AddForm.vue 49 KB

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