AddForm.vue 48 KB

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