AddForm.vue 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513
  1. <template>
  2. <el-drawer
  3. v-model="dialogVisible"
  4. :title="title"
  5. resizable
  6. :close-on-click-modal="false"
  7. :close-on-press-escape="false"
  8. :destroy-on-close="true"
  9. size="70%"
  10. :before-close="handleClosed"
  11. >
  12. <div class="mmse-form">
  13. <h1 class="form-title">简易精神状态评价量表</h1>
  14. <!-- 基本信息 -->
  15. <el-row :gutter="40">
  16. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12" class="row">
  17. <text>长者姓名</text>
  18. <search-the-elderly ref="selectElderRef" :disabled="isDetail" @update_elder="elderUp" v-model="dataForm.elderName" :tId="dataForm.tenantId"/>
  19. </el-col>
  20. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12" class="row">
  21. <text>档案号</text>
  22. <el-input v-if="!isDetail" v-model="dataForm.contractNumber" disabled />
  23. <el-text v-else disabled="">{{dataForm.contractNumber}}</el-text>
  24. </el-col>
  25. </el-row>
  26. <el-row :gutter="40">
  27. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12" class="row">
  28. <text>入院日期</text>
  29. <el-input v-if="!isDetail" :model-value="dayjs(dataForm.checkInTime).format('YYYY-MM-DD')=='Invalid Date'?'':dayjs(dataForm.checkInTime).format('YYYY-MM-DD')" disabled />
  30. <el-text v-else disabled="">{{dayjs(dataForm.checkInTime).format('YYYY-MM-DD')}}</el-text>
  31. </el-col>
  32. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12" class="row">
  33. <text>床位号</text>
  34. <el-input v-if="!isDetail" v-model="dataForm.bedName" disabled />
  35. <el-text v-else disabled="">{{dataForm.bedName}}</el-text>
  36. </el-col>
  37. </el-row>
  38. <el-row :gutter="40">
  39. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12" class="row">
  40. <text>评估人</text>
  41. <el-input :disabled="isDetail" v-model="form.assessor" />
  42. </el-col>
  43. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12" class="row">
  44. <text>评估日期</text>
  45. <el-date-picker :disabled="isDetail" v-model="form.assessDate" type="date" style="width: 100%;"/>
  46. </el-col>
  47. </el-row>
  48. <!-- 表单内容区域 -->
  49. <div class="form-body">
  50. <!-- 总分显示 -->
  51. <div class="total-score-section">
  52. <div class="total-score">
  53. <span class="score-label">总分:</span>
  54. <span class="score-value">{{ totalScore }}</span>
  55. <span class="score-max">/ 30分</span>
  56. </div>
  57. </div>
  58. <!-- 一、定向力 (10分) -->
  59. <div class="section">
  60. <div class="section-title">一、定向力(10分)</div>
  61. <div class="form-item">
  62. <span class="item-number">1.</span>
  63. <span class="item-label">时间定向(5分):</span>
  64. <div class="score-group">
  65. <div class="score-row">
  66. <span>今年是哪一年?</span>
  67. <el-radio-group :disabled="isDetail" v-model="form.orientation.year" size="small">
  68. <el-radio :value="1">正确(1分)</el-radio>
  69. <el-radio :value="0">错误(0分)</el-radio>
  70. </el-radio-group>
  71. </div>
  72. <div class="score-row">
  73. <span>现在是什么季节?</span>
  74. <el-radio-group :disabled="isDetail" v-model="form.orientation.season" size="small">
  75. <el-radio :value="1">正确(1分)</el-radio>
  76. <el-radio :value="0">错误(0分)</el-radio>
  77. </el-radio-group>
  78. </div>
  79. <div class="score-row">
  80. <span>现在是几月份?</span>
  81. <el-radio-group :disabled="isDetail" v-model="form.orientation.month" size="small">
  82. <el-radio :value="1">正确(1分)</el-radio>
  83. <el-radio :value="0">错误(0分)</el-radio>
  84. </el-radio-group>
  85. </div>
  86. <div class="score-row">
  87. <span>今天是几号?</span>
  88. <el-radio-group :disabled="isDetail" v-model="form.orientation.day" size="small">
  89. <el-radio :value="1">正确(1分)</el-radio>
  90. <el-radio :value="0">错误(0分)</el-radio>
  91. </el-radio-group>
  92. </div>
  93. <div class="score-row">
  94. <span>今天是星期几?</span>
  95. <el-radio-group :disabled="isDetail" v-model="form.orientation.weekDay" size="small">
  96. <el-radio :value="1">正确(1分)</el-radio>
  97. <el-radio :value="0">错误(0分)</el-radio>
  98. </el-radio-group>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="form-item">
  103. <span class="item-number">2.</span>
  104. <span class="item-label">地点定向(5分):</span>
  105. <div class="score-group">
  106. <div class="score-row">
  107. <span>你住在那个省?</span>
  108. <el-radio-group :disabled="isDetail" v-model="form.orientation.province" size="small">
  109. <el-radio :value="1">正确(1分)</el-radio>
  110. <el-radio :value="0">错误(0分)</el-radio>
  111. </el-radio-group>
  112. </div>
  113. <div class="score-row">
  114. <span>你住在那个县(区)?</span>
  115. <el-radio-group :disabled="isDetail" v-model="form.orientation.county" size="small">
  116. <el-radio :value="1">正确(1分)</el-radio>
  117. <el-radio :value="0">错误(0分)</el-radio>
  118. </el-radio-group>
  119. </div>
  120. <div class="score-row">
  121. <span>你住在那个乡(街道)?</span>
  122. <el-radio-group :disabled="isDetail" v-model="form.orientation.town" size="small">
  123. <el-radio :value="1">正确(1分)</el-radio>
  124. <el-radio :value="0">错误(0分)</el-radio>
  125. </el-radio-group>
  126. </div>
  127. <div class="score-row">
  128. <span>咱们现在在哪个养老院?</span>
  129. <el-radio-group :disabled="isDetail" v-model="form.orientation.nursingHome" size="small">
  130. <el-radio :value="1">正确(1分)</el-radio>
  131. <el-radio :value="0">错误(0分)</el-radio>
  132. </el-radio-group>
  133. </div>
  134. <div class="score-row">
  135. <span>咱们现在在第几层楼?</span>
  136. <el-radio-group :disabled="isDetail" v-model="form.orientation.floor" size="small">
  137. <el-radio :value="1">正确(1分)</el-radio>
  138. <el-radio :value="0">错误(0分)</el-radio>
  139. </el-radio-group>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <!-- 二、记忆力 (3分) -->
  145. <div class="section">
  146. <div class="section-title">二、记忆力(3分)</div>
  147. <div class="form-item">
  148. <span class="item-number">3.</span>
  149. <span class="item-label">告诉你三种东西,我说完后,请你重复一遍并记住,待会还会问你(各1分,共3分):</span>
  150. <el-radio-group :disabled="isDetail" v-model="form.memory.score" size="small">
  151. <el-radio :value="3">3分</el-radio>
  152. <el-radio :value="2">2分</el-radio>
  153. <el-radio :value="1">1分</el-radio>
  154. <el-radio :value="0">0分</el-radio>
  155. </el-radio-group>
  156. </div>
  157. </div>
  158. <!-- 三、注意力和计算力 (5分) -->
  159. <div class="section">
  160. <div class="section-title">三、注意力和计算力(5分)</div>
  161. <div class="form-item">
  162. <span class="item-number">4.</span>
  163. <span class="item-label">100-7=?连续减5次(93、86、79、72、65。各1分,共5分。若错了,但下一个答案正确,只记一次错误):</span>
  164. <el-radio-group :disabled="isDetail" v-model="form.attention.score" size="small">
  165. <el-radio :value="5">5分</el-radio>
  166. <el-radio :value="4">4分</el-radio>
  167. <el-radio :value="3">3分</el-radio>
  168. <el-radio :value="2">2分</el-radio>
  169. <el-radio :value="1">1分</el-radio>
  170. <el-radio :value="0">0分</el-radio>
  171. </el-radio-group>
  172. </div>
  173. </div>
  174. <!-- 四、回忆能力 (3分) -->
  175. <div class="section">
  176. <div class="section-title">四、回忆能力(3分)</div>
  177. <div class="form-item">
  178. <span class="item-number">5.</span>
  179. <span class="item-label">现在请你说出我刚才告诉你让你记住的那些东西?</span>
  180. <el-radio-group :disabled="isDetail" v-model="form.recall.score" size="small">
  181. <el-radio :value="3">3分</el-radio>
  182. <el-radio :value="2">2分</el-radio>
  183. <el-radio :value="1">1分</el-radio>
  184. <el-radio :value="0">0分</el-radio>
  185. </el-radio-group>
  186. </div>
  187. </div>
  188. <!-- 五、命名能力 (2分) -->
  189. <div class="section">
  190. <div class="section-title">五、命名能力(2分)</div>
  191. <div class="form-item">
  192. <span class="item-number">6.</span>
  193. <span class="item-label">命名能力:</span>
  194. <div class="score-group">
  195. <div class="score-row">
  196. <span>出示手表,问这个是什么东西?</span>
  197. <el-radio-group :disabled="isDetail" v-model="form.naming.watch" size="small">
  198. <el-radio :value="1">正确(1分)</el-radio>
  199. <el-radio :value="0">错误(0分)</el-radio>
  200. </el-radio-group>
  201. </div>
  202. <div class="score-row">
  203. <span>出示钢笔,问这个是什么东西?</span>
  204. <el-radio-group :disabled="isDetail" v-model="form.naming.pen" size="small">
  205. <el-radio :value="1">正确(1分)</el-radio>
  206. <el-radio :value="0">错误(0分)</el-radio>
  207. </el-radio-group>
  208. </div>
  209. </div>
  210. </div>
  211. </div>
  212. <!-- 六、复述能力 (1分) -->
  213. <div class="section">
  214. <div class="section-title">六、复述能力(1分)</div>
  215. <div class="form-item">
  216. <span class="item-number">7.</span>
  217. <span class="item-label">我现在说一句话,请跟我清楚的重复一遍(四十四只石狮子)!</span>
  218. <el-radio-group :disabled="isDetail" v-model="form.repetition.score" size="small">
  219. <el-radio :value="1">正确(1分)</el-radio>
  220. <el-radio :value="0">错误(0分)</el-radio>
  221. </el-radio-group>
  222. </div>
  223. </div>
  224. <!-- 七、阅读能力 (1分) -->
  225. <div class="section">
  226. <div class="section-title">七、阅读能力(1分)</div>
  227. <div class="form-item">
  228. <span class="item-number">8.</span>
  229. <span class="item-label">(闭上你的眼睛)请你念念这句话,并按上面意思去做!</span>
  230. <el-radio-group :disabled="isDetail" v-model="form.reading.score" size="small">
  231. <el-radio :value="1">正确(1分)</el-radio>
  232. <el-radio :value="0">错误(0分)</el-radio>
  233. </el-radio-group>
  234. </div>
  235. </div>
  236. <!-- 八、三步命令 (3分) -->
  237. <div class="section">
  238. <div class="section-title">八、三步命令(3分)</div>
  239. <div class="form-item">
  240. <span class="item-number">9.</span>
  241. <span class="item-label">我给您一张纸请您按我说的去做,现在开始:"用右手拿着这张纸,用两只手将它对折起来,放在您的左腿上。"(每个动作1分,共3分):</span>
  242. <el-radio-group :disabled="isDetail" v-model="form.threeStepCommand.score" size="small">
  243. <el-radio :value="3">3分</el-radio>
  244. <el-radio :value="2">2分</el-radio>
  245. <el-radio :value="1">1分</el-radio>
  246. <el-radio :value="0">0分</el-radio>
  247. </el-radio-group>
  248. </div>
  249. </div>
  250. <!-- 九、书写能力 (1分) -->
  251. <div class="section">
  252. <div class="section-title">九、书写能力(1分)</div>
  253. <div class="form-item">
  254. <span class="item-number">10.</span>
  255. <span class="item-label">书写能力要求受试者自己写一句完整的句子:</span>
  256. <el-radio-group :disabled="isDetail" v-model="form.writing.score" size="small">
  257. <el-radio :value="1">正确(1分)</el-radio>
  258. <el-radio :value="0">错误(0分)</el-radio>
  259. </el-radio-group>
  260. </div>
  261. </div>
  262. <!-- 十、结构能力 (1分) -->
  263. <div class="section">
  264. <div class="section-title">十、结构能力(1分)</div>
  265. <div class="form-item">
  266. <span class="item-number">11.</span>
  267. <span class="item-label">(出示图案)请你照上面图案画下来!</span>
  268. <div class="structure-content">
  269. <div class="structure-image">
  270. <!-- 两个重叠的五边形图案 -->
  271. <svg viewBox="0 0 200 120" class="pentagon-svg">
  272. <!-- 左侧五边形 -->
  273. <polygon points="50,10 90,30 90,80 50,100 10,80 10,30" fill="none" stroke="#333" stroke-width="2"/>
  274. <!-- 右侧五边形 -->
  275. <polygon points="110,10 150,30 150,80 110,100 70,80 70,30" fill="none" stroke="#333" stroke-width="2"/>
  276. </svg>
  277. </div>
  278. <el-radio-group :disabled="isDetail" v-model="form.structure.score" size="small">
  279. <el-radio :value="1">正确(1分)</el-radio>
  280. <el-radio :value="0">错误(0分)</el-radio>
  281. </el-radio-group>
  282. </div>
  283. </div>
  284. </div>
  285. <!-- 风险程度判断 -->
  286. <div class="section risk-section">
  287. <div class="section-title">风险程度判断</div>
  288. <div class="risk-judgment">
  289. <el-radio-group :disabled="isDetail" v-model="form.riskLevel" >
  290. <el-radio value="none" style="margin-right: 10px">无风险:MMSE ≥27分</el-radio>
  291. <el-radio value="low" style="margin-right: 10px">低风险:MMSE 26-21分</el-radio>
  292. <el-radio value="medium" style="margin-right: 10px">中风险:MMSE 10-20分</el-radio>
  293. <el-radio value="high" style="margin-right: 10px">高风险:MMSE ≤9分</el-radio>
  294. </el-radio-group>
  295. </div>
  296. </div>
  297. <!-- 预防措施 -->
  298. <div class="section">
  299. <div class="section-title">预防措施</div>
  300. <div class="form-item">
  301. <el-checkbox-group :disabled="isDetail" v-model="form.preventiveMeasures" class="preventive-measures">
  302. <el-checkbox value="diet">饮食与生活习惯管理</el-checkbox>
  303. <el-checkbox value="environment">环境优化与安全保障</el-checkbox>
  304. <el-checkbox value="emotion">情绪与行为干预</el-checkbox>
  305. <el-checkbox value="monitoring">健康监测</el-checkbox>
  306. <el-checkbox value="personalized">个性化活动(计算能力训练、方向感知觉训练、记忆力训练等)</el-checkbox>
  307. <el-checkbox value="other">其他</el-checkbox>
  308. </el-checkbox-group>
  309. <template v-if="form.preventiveMeasures.includes('other')">
  310. <el-input v-model="form.preventiveMeasuresOther" class="other-input" placeholder="请输入其他预防措施" />
  311. </template>
  312. </div>
  313. </div>
  314. </div>
  315. </div>
  316. <template #footer>
  317. <el-button @click="handleClosed">关闭</el-button>
  318. <el-button style="margin-left: 22px;margin-right: 30px" v-loading="formLoading" type="primary" v-show="!isDetail" @click="submitForm">确定</el-button>
  319. <el-button v-if="isDetail" type="success" @click="handleExport">打印</el-button>
  320. </template>
  321. </el-drawer>
  322. </template>
  323. <script lang="ts" setup>
  324. import { computed, ref } from 'vue'
  325. import dayjs from 'dayjs'
  326. import {mmseCreate, mmseGetById, mmseUpdate} from "@/api/social-work";
  327. const message = useMessage() // 消息弹窗
  328. const { t } = useI18n() // 国际化
  329. const title = ref('')
  330. const dialogVisible = ref(false) // 弹窗
  331. const formRef = ref() // 表单 Ref
  332. const selectElderRef = ref() // 表单 Ref
  333. const isDetail = ref(false) // 是否详情打开
  334. const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
  335. let dataForm = ref({
  336. // 表单字段
  337. id: undefined,
  338. idCard: '',
  339. contractNumber: '', //档案号
  340. elderName: '',//长者姓名
  341. bedName: '', //床位号
  342. elderAge: '', //年龄
  343. elderSex: '', //性别
  344. checkInTime: '', //入院日期
  345. elderId: '',
  346. tenantId: undefined
  347. })
  348. const elderUp = (e) => {
  349. dataForm.value.elderName = e.elderName
  350. dataForm.value.elderId = e.id
  351. dataForm.value.elderSex = e.elderSex === 1 ? '男' : '女'
  352. dataForm.value.bedName = e.bedName || ''
  353. dataForm.value.checkInTime = e.checkInTime
  354. dataForm.value.contractNumber = e.contractNumber
  355. dataForm.value.elderAge = e.elderAge
  356. }
  357. // ========== MMSE 表单序列化方法 ==========
  358. /** 计算总分 */
  359. const totalScore = computed(() => {
  360. const orientationScore =
  361. (form.orientation.year || 0) +
  362. (form.orientation.season || 0) +
  363. (form.orientation.month || 0) +
  364. (form.orientation.day || 0) +
  365. (form.orientation.weekDay || 0) +
  366. (form.orientation.province || 0) +
  367. (form.orientation.county || 0) +
  368. (form.orientation.town || 0) +
  369. (form.orientation.nursingHome || 0) +
  370. (form.orientation.floor || 0)
  371. const namingScore = (form.naming.watch || 0) + (form.naming.pen || 0)
  372. return orientationScore +
  373. (form.memory.score || 0) +
  374. (form.attention.score || 0) +
  375. (form.recall.score || 0) +
  376. namingScore +
  377. (form.repetition.score || 0) +
  378. (form.reading.score || 0) +
  379. (form.threeStepCommand.score || 0) +
  380. (form.writing.score || 0) +
  381. (form.structure.score || 0)
  382. })
  383. /** 风险程度文本 */
  384. const riskLevelText = computed(() => {
  385. const score = totalScore.value
  386. if (score >= 27) return '无风险'
  387. if (score >= 21) return '低风险'
  388. if (score >= 10) return '中风险'
  389. return '高风险'
  390. })
  391. /** 风险程度样式类 */
  392. const riskLevelClass = computed(() => {
  393. const score = totalScore.value
  394. if (score >= 27) return 'risk-none'
  395. if (score >= 21) return 'risk-low'
  396. if (score >= 10) return 'risk-medium'
  397. return 'risk-high'
  398. })
  399. /** 将表单数据序列化为 JSON 对象 */
  400. const serializeFormData = () => {
  401. return {
  402. // 基本信息
  403. assessor: form.assessor || '',
  404. assessDate: form.assessDate ? dayjs(form.assessDate).format('YYYY-MM-DD') : '',
  405. // 各项评分
  406. orientation: { ...form.orientation },
  407. memory: { ...form.memory },
  408. attention: { ...form.attention },
  409. recall: { ...form.recall },
  410. naming: { ...form.naming },
  411. repetition: { ...form.repetition },
  412. reading: { ...form.reading },
  413. threeStepCommand: { ...form.threeStepCommand },
  414. writing: { ...form.writing },
  415. structure: { ...form.structure },
  416. // 总分
  417. totalScore: totalScore.value,
  418. // 风险程度
  419. riskLevel: form.riskLevel || '',
  420. // 预防措施
  421. preventiveMeasures: form.preventiveMeasures || [],
  422. preventiveMeasuresOther: form.preventiveMeasuresOther || ''
  423. }
  424. }
  425. /** 将 JSON 对象反序列化为表单数据 */
  426. const deserializeFormData = (formData: Record<string, any>) => {
  427. if (!formData) return
  428. // 基本信息
  429. form.assessor = formData.assessor || ''
  430. form.assessDate = formData.assessDate ? dayjs(formData.assessDate).toDate() : ''
  431. // 各项评分
  432. form.orientation = {
  433. year: formData.orientation?.year ?? 0,
  434. season: formData.orientation?.season ?? 0,
  435. month: formData.orientation?.month ?? 0,
  436. day: formData.orientation?.day ?? 0,
  437. weekDay: formData.orientation?.weekDay ?? 0,
  438. province: formData.orientation?.province ?? 0,
  439. county: formData.orientation?.county ?? 0,
  440. town: formData.orientation?.town ?? 0,
  441. nursingHome: formData.orientation?.nursingHome ?? 0,
  442. floor: formData.orientation?.floor ?? 0
  443. }
  444. form.memory = { score: formData.memory?.score ?? 0 }
  445. form.attention = { score: formData.attention?.score ?? 0 }
  446. form.recall = { score: formData.recall?.score ?? 0 }
  447. form.naming = {
  448. watch: formData.naming?.watch ?? 0,
  449. pen: formData.naming?.pen ?? 0
  450. }
  451. form.repetition = { score: formData.repetition?.score ?? 0 }
  452. form.reading = { score: formData.reading?.score ?? 0 }
  453. form.threeStepCommand = { score: formData.threeStepCommand?.score ?? 0 }
  454. form.writing = { score: formData.writing?.score ?? 0 }
  455. form.structure = { score: formData.structure?.score ?? 0 }
  456. // 风险程度
  457. form.riskLevel = formData.riskLevel || ''
  458. // 预防措施
  459. form.preventiveMeasures = formData.preventiveMeasures || []
  460. form.preventiveMeasuresOther = formData.preventiveMeasuresOther || ''
  461. }
  462. /** 重置 MMSE 表单数据 */
  463. const resetMMSEForm = () => {
  464. form.assessor = ''
  465. form.assessDate = ''
  466. // 定向力
  467. form.orientation = {
  468. year: 0,
  469. season: 0,
  470. month: 0,
  471. day: 0,
  472. weekDay: 0,
  473. province: 0,
  474. county: 0,
  475. town: 0,
  476. nursingHome: 0,
  477. floor: 0
  478. }
  479. // 其他评分
  480. form.memory = { score: 0 }
  481. form.attention = { score: 0 }
  482. form.recall = { score: 0 }
  483. form.naming = { watch: 0, pen: 0 }
  484. form.repetition = { score: 0 }
  485. form.reading = { score: 0 }
  486. form.threeStepCommand = { score: 0 }
  487. form.writing = { score: 0 }
  488. form.structure = { score: 0 }
  489. // 风险程度
  490. form.riskLevel = ''
  491. // 预防措施
  492. form.preventiveMeasures = []
  493. form.preventiveMeasuresOther = ''
  494. }
  495. /** 加载评估数据 */
  496. const loadAttackRiskData = async (id: number) => {
  497. try {
  498. const res = await mmseGetById(id)
  499. if (res) {
  500. // 填充长者基本信息
  501. dataForm.value.elderName = res.elderName || ''
  502. dataForm.value.elderId = res.elderId || ''
  503. dataForm.value.elderSex = res.elderSex || ''
  504. dataForm.value.bedName = res.bedName || ''
  505. dataForm.value.checkInTime = res.checkInTime || ''
  506. dataForm.value.contractNumber = res.fileNumber || ''
  507. dataForm.value.elderAge = res.elderAge || ''
  508. await selectElderRef.value.upData(res.elderName, res.elderId)
  509. // 解析 assessmentData
  510. if (res.assessData) {
  511. const formData = JSON.parse(res.assessData)
  512. deserializeFormData(formData)
  513. }
  514. }
  515. } catch (error) {
  516. message.error('加载评估数据失败')
  517. }
  518. }
  519. /** 打开弹窗 */
  520. const open = async (tenantId, id?: any, detail: boolean = false) => {
  521. resetForm()
  522. dialogVisible.value = true
  523. dataForm.value.id = id || undefined
  524. dataForm.value.tenantId = tenantId
  525. isDetail.value = detail
  526. if (id) {
  527. title.value = "编辑-MMSE评估"
  528. // 加载 MMSE 数据
  529. await loadAttackRiskData(id)
  530. } else {
  531. title.value = "新增-MMSE评估"
  532. }
  533. }
  534. const form = reactive({
  535. // 基本信息
  536. assessor: '',
  537. assessDate: '',
  538. // 定向力 (10分)
  539. orientation: {
  540. year: 0,
  541. season: 0,
  542. month: 0,
  543. day: 0,
  544. weekDay: 0,
  545. province: 0,
  546. county: 0,
  547. town: 0,
  548. nursingHome: 0,
  549. floor: 0
  550. },
  551. // 记忆力 (3分)
  552. memory: { score: 0 },
  553. // 注意力和计算力 (5分)
  554. attention: { score: 0 },
  555. // 回忆能力 (3分)
  556. recall: { score: 0 },
  557. // 命名能力 (2分)
  558. naming: { watch: 0, pen: 0 },
  559. // 复述能力 (1分)
  560. repetition: { score: 0 },
  561. // 阅读能力 (1分)
  562. reading: { score: 0 },
  563. // 三步命令 (3分)
  564. threeStepCommand: { score: 0 },
  565. // 书写能力 (1分)
  566. writing: { score: 0 },
  567. // 结构能力 (1分)
  568. structure: { score: 0 },
  569. // 风险程度
  570. riskLevel: '',
  571. // 预防措施
  572. preventiveMeasures: [],
  573. preventiveMeasuresOther: ''
  574. })
  575. // MMSE 不需要下拉选项,使用 radio 和 checkbox 直接评分
  576. defineExpose({ open }) // 提供 open 方法,用于打开弹窗
  577. /** 提交表单 */
  578. const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
  579. const submitForm = async () => {
  580. if (formLoading.value) {
  581. return
  582. }
  583. formLoading.value = true
  584. // 提交请求
  585. try {
  586. const assessData = serializeFormData()
  587. const tempParams = {
  588. ...dataForm.value,
  589. assessData: JSON.stringify(assessData),
  590. totalScore: totalScore.value,
  591. assessor: form.assessor,
  592. assessDate: form.assessDate ? dayjs(form.assessDate).format('YYYY-MM-DD') : ''
  593. }
  594. if (dataForm.value.id) {
  595. const res = await mmseUpdate(tempParams)
  596. if (res) {
  597. message.success(t('common.updateSuccess'))
  598. dialogVisible.value = false
  599. // 发送操作成功的事件
  600. emit('success')
  601. }
  602. } else {
  603. const res = await mmseCreate(tempParams)
  604. if (res) {
  605. message.success(t('common.createSuccess'))
  606. dialogVisible.value = false
  607. // 发送操作成功的事件
  608. emit('success')
  609. }
  610. }
  611. } finally {
  612. setTimeout(() => {
  613. formLoading.value = false
  614. }, 500)
  615. }
  616. }
  617. /** 重置表单 */
  618. const resetForm = () => {
  619. dataForm.value = {
  620. id: undefined,
  621. idCard: '',
  622. contractNumber: '', //档案号
  623. elderName: '',//长者姓名
  624. bedName: '', //床位号
  625. elderAge: '', //年龄
  626. elderSex: '', //性别
  627. checkInTime: '', //入院日期
  628. elderId: '',
  629. tenantId: undefined
  630. }
  631. formRef.value?.resetFields()
  632. // 重置 MMSE 表单
  633. resetMMSEForm()
  634. }
  635. // 关闭表单
  636. const handleClosed = () => {
  637. dialogVisible.value = false
  638. resetForm()
  639. }
  640. /** 导出PDF */
  641. const handleExport = () => {
  642. // 创建打印窗口
  643. const printWindow = window.open('', '_blank')
  644. if (!printWindow) {
  645. message.error('请允许弹出窗口')
  646. return
  647. }
  648. // 辅助函数:获取评分状态
  649. const getScoreMark = (score) => score === 1 ? '☑ 正确 (1分)' : '☐ 错误 (0分)'
  650. const getMemoryMark = (score) => {
  651. const marks = ['☐ 0分', '☐ 1分', '☐ 2分', '☐ 3分']
  652. if (score >= 0 && score <= 3) marks[score] = marks[score].replace('☐', '☑')
  653. return marks.join(' ')
  654. }
  655. const getAttentionMark = (score) => {
  656. const marks = ['☐ 0分', '☐ 1分', '☐ 2分', '☐ 3分', '☐ 4分', '☐ 5分']
  657. if (score >= 0 && score <= 5) marks[score] = marks[score].replace('☐', '☑')
  658. return marks.join(' ')
  659. }
  660. const getRecallMark = (score) => {
  661. const marks = ['☐ 0分', '☐ 1分', '☐ 2分', '☐ 3分']
  662. if (score >= 0 && score <= 3) marks[score] = marks[score].replace('☐', '☑')
  663. return marks.join(' ')
  664. }
  665. const getThreeStepMark = (score) => {
  666. const marks = ['☐ 0分', '☐ 1分', '☐ 2分', '☐ 3分']
  667. if (score >= 0 && score <= 3) marks[score] = marks[score].replace('☐', '☑')
  668. return marks.join(' ')
  669. }
  670. const getNamingMark = (score) => score === 1 ? '☑ 正确 (1分)' : '☐ 错误 (0分)'
  671. // 构建打印内容
  672. const printContent = `
  673. <!DOCTYPE html>
  674. <html>
  675. <head>
  676. <meta charset="UTF-8">
  677. <title>MMSE评估表 - ${dataForm.value.elderName || ''}</title>
  678. <style>
  679. @media print {
  680. @page { size: A4 portrait; margin: 15mm; }
  681. }
  682. body {
  683. font-family: 'SimSun', 'Microsoft YaHei', serif;
  684. font-size: 11pt;
  685. line-height: 1.5;
  686. color: #333;
  687. }
  688. .header {
  689. text-align: center;
  690. margin-bottom: 20px;
  691. border-bottom: 2px solid #333;
  692. padding-bottom: 10px;
  693. }
  694. .header h1 {
  695. font-size: 18pt;
  696. margin: 0;
  697. letter-spacing: 2px;
  698. }
  699. .header .sub-title {
  700. font-size: 12pt;
  701. color: #666;
  702. margin-top: 5px;
  703. }
  704. .info-section {
  705. margin-bottom: 15px;
  706. padding: 10px;
  707. border: 1px solid #999;
  708. background: #fafafa;
  709. }
  710. .info-row {
  711. display: flex;
  712. flex-wrap: wrap;
  713. gap: 20px;
  714. }
  715. .info-item {
  716. display: flex;
  717. align-items: center;
  718. }
  719. .info-item .label {
  720. font-weight: bold;
  721. margin-right: 8px;
  722. color: #555;
  723. }
  724. .info-item .value {
  725. border-bottom: 1px solid #333;
  726. min-width: 80px;
  727. padding: 0 5px;
  728. text-align: center;
  729. }
  730. .score-summary {
  731. display: flex;
  732. justify-content: space-between;
  733. align-items: center;
  734. padding: 10px 15px;
  735. background: #f0f0f0;
  736. border: 2px solid #333;
  737. margin-bottom: 15px;
  738. }
  739. .total-score {
  740. font-size: 14pt;
  741. font-weight: bold;
  742. }
  743. .total-score .score-value {
  744. color: #d9534f;
  745. font-size: 18pt;
  746. }
  747. .risk-level {
  748. font-size: 12pt;
  749. font-weight: bold;
  750. padding: 5px 15px;
  751. }
  752. .risk-none { color: #5cb85c; }
  753. .risk-low { color: #f0ad4e; }
  754. .risk-medium { color: #d9534f; }
  755. .risk-high { color: #d9534f; background: #ffe6e6; padding: 5px 10px; border-radius: 3px; }
  756. .section {
  757. margin-bottom: 12px;
  758. border: 1px solid #999;
  759. }
  760. .section-header {
  761. font-weight: bold;
  762. background: #e8e8e8;
  763. padding: 8px 12px;
  764. border-bottom: 1px solid #999;
  765. display: flex;
  766. justify-content: space-between;
  767. align-items: center;
  768. }
  769. .section-title {
  770. font-size: 12pt;
  771. }
  772. .section-score {
  773. font-size: 11pt;
  774. color: #666;
  775. }
  776. .question {
  777. padding: 8px 12px;
  778. border-bottom: 1px dashed #ccc;
  779. display: flex;
  780. justify-content: space-between;
  781. align-items: flex-start;
  782. }
  783. .question:last-child {
  784. border-bottom: none;
  785. }
  786. .question-text {
  787. flex: 1;
  788. padding-right: 15px;
  789. }
  790. .question-number {
  791. font-weight: bold;
  792. margin-right: 8px;
  793. color: #555;
  794. }
  795. .question-desc {
  796. font-size: 10pt;
  797. color: #666;
  798. margin-top: 3px;
  799. }
  800. .answer-options {
  801. white-space: nowrap;
  802. font-size: 10pt;
  803. color: #555;
  804. }
  805. .structure-image {
  806. text-align: center;
  807. padding: 10px;
  808. background: #fafafa;
  809. margin: 10px 0;
  810. }
  811. .structure-image svg {
  812. width: 200px;
  813. height: 120px;
  814. }
  815. .measures-section {
  816. margin-top: 15px;
  817. border: 1px solid #999;
  818. }
  819. .measures-title {
  820. font-weight: bold;
  821. background: #e8e8e8;
  822. padding: 8px 12px;
  823. border-bottom: 1px solid #999;
  824. }
  825. .measures-content {
  826. padding: 10px 12px;
  827. }
  828. .measure-item {
  829. margin-bottom: 5px;
  830. font-size: 10pt;
  831. }
  832. .measure-other {
  833. margin-left: 20px;
  834. margin-top: 5px;
  835. border-bottom: 1px solid #333;
  836. min-width: 200px;
  837. display: inline-block;
  838. }
  839. .signature-section {
  840. margin-top: 30px;
  841. display: flex;
  842. justify-content: space-between;
  843. }
  844. .signature-item {
  845. width: 45%;
  846. }
  847. .signature-label {
  848. margin-bottom: 5px;
  849. }
  850. .signature-line {
  851. border-bottom: 1px solid #333;
  852. height: 30px;
  853. }
  854. .date-line {
  855. border-bottom: 1px solid #333;
  856. height: 30px;
  857. width: 150px;
  858. }
  859. .footer-note {
  860. margin-top: 20px;
  861. font-size: 9pt;
  862. color: #666;
  863. text-align: center;
  864. border-top: 1px solid #ccc;
  865. padding-top: 10px;
  866. }
  867. </style>
  868. </head>
  869. <body>
  870. <div class="header">
  871. <h1>简易精神状态评价量表(MMSE)</h1>
  872. <div class="sub-title">Mini-Mental State Examination</div>
  873. </div>
  874. <div class="info-section">
  875. <div class="info-row">
  876. <div class="info-item">
  877. <span class="label">长者姓名:</span>
  878. <span class="value">${dataForm.value.elderName || ''}</span>
  879. </div>
  880. <div class="info-item">
  881. <span class="label">档案号:</span>
  882. <span class="value">${dataForm.value.contractNumber || ''}</span>
  883. </div>
  884. <div class="info-item">
  885. <span class="label">床位号:</span>
  886. <span class="value">${dataForm.value.bedName || ''}</span>
  887. </div>
  888. </div>
  889. <div class="info-row" style="margin-top: 10px;">
  890. <div class="info-item">
  891. <span class="label">评估日期:</span>
  892. <span class="value">${form.assessDate ? dayjs(form.assessDate).format('YYYY-MM-DD') : ''}</span>
  893. </div>
  894. <div class="info-item">
  895. <span class="label">评估人:</span>
  896. <span class="value">${form.assessor || ''}</span>
  897. </div>
  898. </div>
  899. </div>
  900. <div class="score-summary">
  901. <div class="total-score">
  902. 总分:<span class="score-value">${totalScore.value}</span> / 30分
  903. </div>
  904. </div>
  905. <!-- 一、定向力 -->
  906. <div class="section">
  907. <div class="section-header">
  908. <span class="section-title">一、定向力(10分)</span>
  909. <span class="section-score">得分:${(form.orientation.year || 0) + (form.orientation.season || 0) + (form.orientation.month || 0) + (form.orientation.day || 0) + (form.orientation.weekDay || 0) + (form.orientation.province || 0) + (form.orientation.county || 0) + (form.orientation.town || 0) + (form.orientation.nursingHome || 0) + (form.orientation.floor || 0)} / 10分</span>
  910. </div>
  911. <div class="question">
  912. <div class="question-text">
  913. <span class="question-number">1.</span>
  914. <div>
  915. <div>时间定向(5分)</div>
  916. <div class="question-desc">今年是哪一年?现在是什么季节?现在是几月份?今天是几号?今天是星期几?</div>
  917. </div>
  918. </div>
  919. <div class="answer-options">
  920. ${getScoreMark(form.orientation.year)}<br>
  921. ${getScoreMark(form.orientation.season)}<br>
  922. ${getScoreMark(form.orientation.month)}<br>
  923. ${getScoreMark(form.orientation.day)}<br>
  924. ${getScoreMark(form.orientation.weekDay)}
  925. </div>
  926. </div>
  927. <div class="question">
  928. <div class="question-text">
  929. <span class="question-number">2.</span>
  930. <div>
  931. <div>地点定向(5分)</div>
  932. <div class="question-desc">你住在那个省?你住在那个县(区)?你住在那个乡(街道)?咱们现在在哪个养老院?咱们现在在第几层楼?</div>
  933. </div>
  934. </div>
  935. <div class="answer-options">
  936. ${getScoreMark(form.orientation.province)}<br>
  937. ${getScoreMark(form.orientation.county)}<br>
  938. ${getScoreMark(form.orientation.town)}<br>
  939. ${getScoreMark(form.orientation.nursingHome)}<br>
  940. ${getScoreMark(form.orientation.floor)}
  941. </div>
  942. </div>
  943. </div>
  944. <!-- 二、记忆力 -->
  945. <div class="section">
  946. <div class="section-header">
  947. <span class="section-title">二、记忆力(3分)</span>
  948. <span class="section-score">得分:${form.memory.score || 0} / 3分</span>
  949. </div>
  950. <div class="question">
  951. <div class="question-text">
  952. <span class="question-number">3.</span>
  953. <div>
  954. <div>告诉你三种东西,我说完后,请你重复一遍并记住,待会还会问你(各1分,共3分)</div>
  955. <div class="question-desc">例如:皮球、国旗、树木</div>
  956. </div>
  957. </div>
  958. <div class="answer-options">
  959. ${getMemoryMark(form.memory.score || 0)}
  960. </div>
  961. </div>
  962. </div>
  963. <!-- 三、注意力和计算力 -->
  964. <div class="section">
  965. <div class="section-header">
  966. <span class="section-title">三、注意力和计算力(5分)</span>
  967. <span class="section-score">得分:${form.attention.score || 0} / 5分</span>
  968. </div>
  969. <div class="question">
  970. <div class="question-text">
  971. <span class="question-number">4.</span>
  972. <div>
  973. <div>100-7=?连续减5次(93、86、79、72、65。各1分,共5分)</div>
  974. <div class="question-desc">若错了,但下一个答案正确,只记一次错误</div>
  975. </div>
  976. </div>
  977. <div class="answer-options">
  978. ${getAttentionMark(form.attention.score || 0)}
  979. </div>
  980. </div>
  981. </div>
  982. <!-- 四、回忆能力 -->
  983. <div class="section">
  984. <div class="section-header">
  985. <span class="section-title">四、回忆能力(3分)</span>
  986. <span class="section-score">得分:${form.recall.score || 0} / 3分</span>
  987. </div>
  988. <div class="question">
  989. <div class="question-text">
  990. <span class="question-number">5.</span>
  991. <div>现在请你说出我刚才告诉你让你记住的那些东西?</div>
  992. </div>
  993. <div class="answer-options">
  994. ${getRecallMark(form.recall.score || 0)}
  995. </div>
  996. </div>
  997. </div>
  998. <!-- 五、命名能力 -->
  999. <div class="section">
  1000. <div class="section-header">
  1001. <span class="section-title">五、命名能力(2分)</span>
  1002. <span class="section-score">得分:${(form.naming.watch || 0) + (form.naming.pen || 0)} / 2分</span>
  1003. </div>
  1004. <div class="question">
  1005. <div class="question-text">
  1006. <span class="question-number">6.</span>
  1007. <div>出示手表,问这个是什么东西?</div>
  1008. </div>
  1009. <div class="answer-options">
  1010. ${getNamingMark(form.naming.watch || 0)}
  1011. </div>
  1012. </div>
  1013. <div class="question">
  1014. <div class="question-text">
  1015. <span class="question-number"></span>
  1016. <div>出示钢笔,问这个是什么东西?</div>
  1017. </div>
  1018. <div class="answer-options">
  1019. ${getNamingMark(form.naming.pen || 0)}
  1020. </div>
  1021. </div>
  1022. </div>
  1023. <!-- 六、复述能力 -->
  1024. <div class="section">
  1025. <div class="section-header">
  1026. <span class="section-title">六、复述能力(1分)</span>
  1027. <span class="section-score">得分:${form.repetition.score || 0} / 1分</span>
  1028. </div>
  1029. <div class="question">
  1030. <div class="question-text">
  1031. <span class="question-number">7.</span>
  1032. <div>我现在说一句话,请跟我清楚的重复一遍(四十四只石狮子)!</div>
  1033. </div>
  1034. <div class="answer-options">
  1035. ${getScoreMark(form.repetition.score || 0)}
  1036. </div>
  1037. </div>
  1038. </div>
  1039. <!-- 七、阅读能力 -->
  1040. <div class="section">
  1041. <div class="section-header">
  1042. <span class="section-title">七、阅读能力(1分)</span>
  1043. <span class="section-score">得分:${form.reading.score || 0} / 1分</span>
  1044. </div>
  1045. <div class="question">
  1046. <div class="question-text">
  1047. <span class="question-number">8.</span>
  1048. <div>(闭上你的眼睛)请你念念这句话,并按上面意思去做!</div>
  1049. </div>
  1050. <div class="answer-options">
  1051. ${getScoreMark(form.reading.score || 0)}
  1052. </div>
  1053. </div>
  1054. </div>
  1055. <!-- 八、三步命令 -->
  1056. <div class="section">
  1057. <div class="section-header">
  1058. <span class="section-title">八、三步命令(3分)</span>
  1059. <span class="section-score">得分:${form.threeStepCommand.score || 0} / 3分</span>
  1060. </div>
  1061. <div class="question">
  1062. <div class="question-text">
  1063. <span class="question-number">9.</span>
  1064. <div>
  1065. <div>我给您一张纸请您按我说的去做,现在开始:</div>
  1066. <div class="question-desc">"用右手拿着这张纸,用两只手将它对折起来,放在您的左腿上。"(每个动作1分,共3分)</div>
  1067. </div>
  1068. </div>
  1069. <div class="answer-options">
  1070. ${getThreeStepMark(form.threeStepCommand.score || 0)}
  1071. </div>
  1072. </div>
  1073. </div>
  1074. <!-- 九、书写能力 -->
  1075. <div class="section">
  1076. <div class="section-header">
  1077. <span class="section-title">九、书写能力(1分)</span>
  1078. <span class="section-score">得分:${form.writing.score || 0} / 1分</span>
  1079. </div>
  1080. <div class="question">
  1081. <div class="question-text">
  1082. <span class="question-number">10.</span>
  1083. <div>书写能力要求受试者自己写一句完整的句子</div>
  1084. </div>
  1085. <div class="answer-options">
  1086. ${getScoreMark(form.writing.score || 0)}
  1087. </div>
  1088. </div>
  1089. </div>
  1090. <!-- 十、结构能力 -->
  1091. <div class="section">
  1092. <div class="section-header">
  1093. <span class="section-title">十、结构能力(1分)</span>
  1094. <span class="section-score">得分:${form.structure.score || 0} / 1分</span>
  1095. </div>
  1096. <div class="question">
  1097. <div class="question-text">
  1098. <span class="question-number">11.</span>
  1099. <div>(出示图案)请你照上面图案画下来!</div>
  1100. </div>
  1101. <div class="answer-options">
  1102. ${getScoreMark(form.structure.score || 0)}
  1103. </div>
  1104. </div>
  1105. <div class="structure-image">
  1106. <svg viewBox="0 0 200 120">
  1107. <polygon points="50,10 90,30 90,80 50,100 10,80 10,30" fill="none" stroke="#333" stroke-width="2"/>
  1108. <polygon points="110,10 150,30 150,80 110,100 70,80 70,30" fill="none" stroke="#333" stroke-width="2"/>
  1109. </svg>
  1110. </div>
  1111. </div>
  1112. <!-- 风险程度判断 -->
  1113. <div class="section">
  1114. <div class="section-header">
  1115. <span class="section-title">风险程度判断</span>
  1116. </div>
  1117. <div class="question">
  1118. <div class="question-text">
  1119. <div style="display: flex; gap: 30px; flex-wrap: wrap;">
  1120. <span>${form.riskLevel === 'none' ? '☑' : '☐'} 无风险:MMSE ≥27分</span>
  1121. <span>${form.riskLevel === 'low' ? '☑' : '☐'} 低风险:MMSE 26-21分</span>
  1122. <span>${form.riskLevel === 'medium' ? '☑' : '☐'} 中风险:MMSE 10-20分</span>
  1123. <span>${form.riskLevel === 'high' ? '☑' : '☐'} 高风险:MMSE ≤9分</span>
  1124. </div>
  1125. </div>
  1126. </div>
  1127. </div>
  1128. <!-- 预防措施 -->
  1129. <div class="measures-section">
  1130. <div class="measures-title">预防措施</div>
  1131. <div class="measures-content">
  1132. <div class="measure-item">${form.preventiveMeasures?.includes('diet') ? '☑' : '☐'} 饮食与生活习惯管理</div>
  1133. <div class="measure-item">${form.preventiveMeasures?.includes('environment') ? '☑' : '☐'} 环境优化与安全保障</div>
  1134. <div class="measure-item">${form.preventiveMeasures?.includes('emotion') ? '☑' : '☐'} 情绪与行为干预</div>
  1135. <div class="measure-item">${form.preventiveMeasures?.includes('monitoring') ? '☑' : '☐'} 健康监测</div>
  1136. <div class="measure-item">${form.preventiveMeasures?.includes('personalized') ? '☑' : '☐'} 个性化活动(计算能力训练、方向感知觉训练、记忆力训练等)</div>
  1137. <div class="measure-item">
  1138. ${form.preventiveMeasures?.includes('other') ? '☑' : '☐'} 其他
  1139. ${form.preventiveMeasures?.includes('other') ? '<span class="measure-other">' + (form.preventiveMeasuresOther || '') + '</span>' : ''}
  1140. </div>
  1141. </div>
  1142. </div>
  1143. <div class="footer-note">
  1144. 注:MMSE总分30分,≥27分为认知功能正常,26-21分为轻度认知障碍,10-20分为中度认知障碍,≤9分为重度认知障碍
  1145. </div>
  1146. </body>
  1147. </html>
  1148. `
  1149. // 写入内容并打印
  1150. printWindow.document.write(printContent)
  1151. printWindow.document.close()
  1152. // 延迟打印,确保样式加载完成
  1153. setTimeout(() => {
  1154. printWindow.print()
  1155. }, 500)
  1156. }
  1157. </script>
  1158. <style scoped lang="scss">
  1159. .mmse-form {
  1160. max-width: 1200px;
  1161. margin: 0 auto;
  1162. background: #fff;
  1163. .form-title {
  1164. text-align: center;
  1165. font-size: 24px;
  1166. font-weight: bold;
  1167. margin-bottom: 20px;
  1168. }
  1169. .info-row {
  1170. display: flex;
  1171. gap: 40px;
  1172. width: 100%;
  1173. flex-direction: row;
  1174. align-items: center;
  1175. margin-bottom: 10px;
  1176. .info-item {
  1177. display: flex;
  1178. align-items: center;
  1179. gap: 8px;
  1180. .label {
  1181. width: 82px;
  1182. text-align: right;
  1183. margin-right: 4px;
  1184. white-space: nowrap;
  1185. }
  1186. }
  1187. }
  1188. .form-body {
  1189. border: 1px solid #333;
  1190. padding: 15px;
  1191. }
  1192. .section {
  1193. margin-bottom: 20px;
  1194. &:last-child {
  1195. margin-bottom: 0;
  1196. }
  1197. .section-title {
  1198. font-weight: bold;
  1199. margin-bottom: 10px;
  1200. }
  1201. }
  1202. .form-item {
  1203. display: flex;
  1204. align-items: center;
  1205. margin-bottom: 12px;
  1206. flex-wrap: wrap;
  1207. gap: 8px;
  1208. .item-number {
  1209. font-weight: bold;
  1210. min-width: 25px;
  1211. }
  1212. .item-label {
  1213. white-space: nowrap;
  1214. min-width: fit-content;
  1215. }
  1216. }
  1217. .other-input {
  1218. width: 200px;
  1219. margin-left: 10px;
  1220. }
  1221. // 调整 Element Plus 组件样式
  1222. :deep(.el-input__inner) {
  1223. height: 28px;
  1224. line-height: 28px;
  1225. border-top: none;
  1226. border-left: none;
  1227. border-right: none;
  1228. border-radius: 0;
  1229. padding: 0 4px;
  1230. &:focus {
  1231. border-color: #409eff;
  1232. }
  1233. }
  1234. :deep(.el-checkbox__label),
  1235. :deep(.el-radio__label) {
  1236. padding-left: 4px;
  1237. }
  1238. }
  1239. .row{
  1240. margin-bottom: 12px;
  1241. display: flex;
  1242. flex-direction: row;
  1243. align-items: center;
  1244. text{
  1245. text-align: right;
  1246. margin-right: 4px;
  1247. width: 82px;
  1248. }
  1249. }
  1250. // MMSE 特有样式
  1251. .total-score-section {
  1252. display: flex;
  1253. justify-content: space-between;
  1254. align-items: center;
  1255. padding: 15px;
  1256. background: #f5f7fa;
  1257. border-radius: 4px;
  1258. margin-bottom: 20px;
  1259. .total-score {
  1260. display: flex;
  1261. align-items: baseline;
  1262. gap: 4px;
  1263. .score-label {
  1264. font-size: 16px;
  1265. font-weight: bold;
  1266. }
  1267. .score-value {
  1268. font-size: 28px;
  1269. font-weight: bold;
  1270. color: #409eff;
  1271. }
  1272. .score-max {
  1273. font-size: 14px;
  1274. color: #909399;
  1275. }
  1276. }
  1277. .risk-level {
  1278. font-size: 16px;
  1279. font-weight: bold;
  1280. padding: 8px 16px;
  1281. border-radius: 4px;
  1282. &.risk-none {
  1283. color: #67c23a;
  1284. background: #f0f9eb;
  1285. }
  1286. &.risk-low {
  1287. color: #e6a23c;
  1288. background: #fdf6ec;
  1289. }
  1290. &.risk-medium {
  1291. color: #f56c6c;
  1292. background: #fef0f0;
  1293. }
  1294. &.risk-high {
  1295. color: #f56c6c;
  1296. background: #fef0f0;
  1297. border: 1px solid #f56c6c;
  1298. }
  1299. }
  1300. }
  1301. .score-group {
  1302. display: flex;
  1303. flex-direction: column;
  1304. gap: 10px;
  1305. margin-left: 35px;
  1306. margin-top: 8px;
  1307. width: 100%;
  1308. .score-row {
  1309. display: flex;
  1310. align-items: center;
  1311. justify-content: space-between;
  1312. padding: 8px 12px;
  1313. background: #fafafa;
  1314. border-radius: 4px;
  1315. span {
  1316. flex: 1;
  1317. }
  1318. }
  1319. }
  1320. .structure-content {
  1321. display: flex;
  1322. align-items: center;
  1323. gap: 20px;
  1324. margin-left: 35px;
  1325. margin-top: 8px;
  1326. .structure-image {
  1327. .pentagon-svg {
  1328. width: 200px;
  1329. height: 120px;
  1330. border: 1px solid #dcdfe6;
  1331. border-radius: 4px;
  1332. padding: 10px;
  1333. }
  1334. }
  1335. }
  1336. .risk-section {
  1337. background: #f5f7fa;
  1338. padding: 15px;
  1339. border-radius: 4px;
  1340. .risk-judgment {
  1341. margin-left: 35px;
  1342. margin-top: 10px;
  1343. :deep(.el-radio) {
  1344. display: block;
  1345. margin-bottom: 8px;
  1346. margin-right: 0;
  1347. }
  1348. }
  1349. }
  1350. .preventive-measures {
  1351. display: flex;
  1352. flex-direction: column;
  1353. gap: 8px;
  1354. margin-left: 35px;
  1355. margin-top: 8px;
  1356. :deep(.el-checkbox) {
  1357. margin-right: 0;
  1358. height: auto;
  1359. align-items: flex-start;
  1360. .el-checkbox__label {
  1361. white-space: normal;
  1362. line-height: 1.5;
  1363. }
  1364. }
  1365. }
  1366. </style>