add.vue 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754
  1. <template>
  2. <div class="p-2">
  3. <el-card>
  4. <!-- 新增顶部操作栏 -->
  5. <el-row>
  6. <el-col :span="4">
  7. <el-button type="primary" plain @click="close"
  8. style="margin-right: 20px;margin-left: 30px;">返回</el-button>
  9. <span style="font-size: 14px; vertical-align: middle;">{{ screeningName }}</span>
  10. </el-col>
  11. </el-row>
  12. </el-card>
  13. <el-card>
  14. <!-- 基本信息 -->
  15. <template v-if="form.baseInfo">
  16. <div style="margin-bottom: 10px; padding-top: 20px;" class="zebra-row">
  17. <el-row>
  18. <el-col :span="24">
  19. <span style="color: #f56c6c; margin-right: 4px;">*</span>
  20. <span style="font-weight: bold;">{{'1. '+ form.baseInfo.title }}</span>
  21. </el-col>
  22. </el-row>
  23. <el-row style="margin-bottom: 20px;margin-top: 8px;">
  24. <el-col :span="24">
  25. <el-form :inline="true" label-width="100px">
  26. <template v-for="ctl,n in form.baseInfo.contentList">
  27. <el-form-item :label="ctl.label">
  28. <template v-if="ctl.nameEn=='birthDate'||ctl.nameEn=='admissionDate'">
  29. <el-date-picker v-model="ctl.value" type="date" placeholder="请选择" :disabled="isView"/>
  30. </template>
  31. <template v-else-if="ctl.nameEn=='gender'">
  32. <el-select v-model="ctl.value" placeholder="请选择" :disabled="isView">
  33. <el-option v-for="dict in sys_user_sex" :key="dict.value"
  34. :label="dict.label" :value="dict.value"></el-option>
  35. </el-select>
  36. </template>
  37. <template v-else>
  38. <el-input clearable v-model="ctl.value" :disabled="isView" />
  39. </template>
  40. </el-form-item>
  41. </template>
  42. </el-form>
  43. </el-col>
  44. </el-row>
  45. </div>
  46. </template>
  47. <!-- 基本信息 -->
  48. <template v-for="item,idx in form.otherInfo">
  49. <template v-if="item.questionChildType == 'singleChoice'">
  50. <template v-if="item.arrangement == '2'">
  51. <div style="margin-bottom: 20px;padding-top: 20px;"
  52. :style="{'border-top':idx==0?'none':'1px dashed #e5e7eb'}" class="zebra-row">
  53. <el-row>
  54. <el-col :span="24">
  55. <span style="color: #f56c6c; margin-right: 4px;" v-show="item.required">*</span>
  56. <span style="font-weight: bold;">{{idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+ item.title }}</span>
  57. </el-col>
  58. </el-row>
  59. <el-row style="margin-bottom: 20px;">
  60. <el-col :span="24">
  61. <div class="radio-card">
  62. <el-radio-group v-model="item.value" style="margin-top: 8px;">
  63. <template v-for="ctl,i in item.contentList">
  64. <el-radio :label="ctl.label" :value="i" :disabled="isView">
  65. <span class="option-content">
  66. <span v-if="ctl.img" class="option-img">
  67. <miniImageUpload :limit="1" v-model="ctl.img"
  68. :disabled="true" />
  69. </span>
  70. <span>{{ ctl.label }}</span>
  71. <span v-if="ctl.allowFillBlank" style="margin-left: 10px;">
  72. <el-input v-model="ctl.value" clearable
  73. :disabled="isView" />
  74. </span>
  75. </span>
  76. </el-radio>
  77. </template>
  78. </el-radio-group>
  79. </div>
  80. </el-col>
  81. </el-row>
  82. </div>
  83. </template>
  84. <template v-else>
  85. <div style="margin-bottom: 10px; padding-top: 20px;"
  86. :style="{'border-top':idx==0?'none':'1px dashed #e5e7eb'}" class="zebra-row">
  87. <el-row>
  88. <el-col :span="24">
  89. <span style="color: #f56c6c; margin-right: 4px;" v-show="item.required">*</span>
  90. <span style="font-weight: bold;">{{idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+ item.title }}</span>
  91. <el-radio-group v-model="item.value" class="horizontal-radio-group"
  92. style="margin-top: 8px;">
  93. <template v-for="ctl,i in item.contentList">
  94. <el-radio :label="ctl.label" :value="i" :disabled="isView">
  95. <span class="option-content">
  96. <span v-if="ctl.img" class="option-img">
  97. <miniImageUpload :limit="1" v-model="ctl.img"
  98. :disabled="true" />
  99. </span>
  100. <span>{{ ctl.label }}</span>
  101. <span v-if="ctl.allowFillBlank" style="margin-left: 10px;">
  102. <el-input v-model="ctl.value" clearable :disabled="isView" />
  103. </span>
  104. </span>
  105. </el-radio>
  106. </template>
  107. </el-radio-group>
  108. </el-col>
  109. </el-row>
  110. </div>
  111. </template>
  112. </template>
  113. <template v-if="item.questionChildType == 'multipleChoice'">
  114. <template v-if="item.arrangement == '2'">
  115. <div style="margin-bottom: 10px; padding-top: 20px;"
  116. :style="{'border-top':idx==0?'none':'1px dashed #e5e7eb'}" class="zebra-row">
  117. <el-row>
  118. <el-col :span="24">
  119. <span style="color: #f56c6c; margin-right: 4px;" v-show="item.required">*</span>
  120. <span style="font-weight: bold;">{{ idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+item.title }}</span>
  121. </el-col>
  122. </el-row>
  123. <el-row style="margin-bottom: 20px;">
  124. <el-col :span="24">
  125. <div class="checkbox-vertical-card">
  126. <el-checkbox-group v-model="item.value" style="margin-top: 8px;">
  127. <template v-for="ctl,i in item.contentList">
  128. <el-checkbox :label="ctl.label" :value="i" :disabled="isView">
  129. <span class="option-content">
  130. <span v-if="ctl.img" class="option-img">
  131. <miniImageUpload :limit="1" v-model="ctl.img"
  132. :disabled="true" />
  133. </span>
  134. <span>{{ ctl.label }}</span>
  135. <span v-if="ctl.allowFillBlank" style="margin-left: 10px;">
  136. <el-input v-model="ctl.value" clearable
  137. :disabled="isView" />
  138. </span>
  139. </span>
  140. </el-checkbox>
  141. </template>
  142. </el-checkbox-group>
  143. </div>
  144. </el-col>
  145. </el-row>
  146. </div>
  147. </template>
  148. <template v-else>
  149. <div style="margin-bottom: 10px; padding-top: 20px;"
  150. :style="{'border-top':idx==0?'none':'1px dashed #e5e7eb'}" class="zebra-row">
  151. <el-row>
  152. <el-col :span="24">
  153. <span style="color: #f56c6c; margin-right: 4px;" v-show="item.required">*</span>
  154. <span style="font-weight: bold;">{{ idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+item.title }}</span>
  155. <el-checkbox-group v-model="item.value" class="horizontal-checkbox-group"
  156. style="margin-top: 8px;">
  157. <template v-for="ctl,i in item.contentList">
  158. <el-checkbox :label="ctl.label" :value="i" :disabled="isView">
  159. <span class="option-content">
  160. <span v-if="ctl.img" class="option-img">
  161. <miniImageUpload :limit="1" v-model="ctl.img"
  162. :disabled="true" />
  163. </span>
  164. <span>{{ ctl.label }}</span>
  165. <span v-if="ctl.allowFillBlank" style="margin-left: 10px;">
  166. <el-input v-model="ctl.value" clearable :disabled="isView" />
  167. </span>
  168. </span>
  169. </el-checkbox>
  170. </template>
  171. </el-checkbox-group>
  172. </el-col>
  173. </el-row>
  174. </div>
  175. </template>
  176. </template>
  177. <template v-if="item.questionChildType == 'fillBlanks'">
  178. <template v-if="item.arrangement == '2'">
  179. <div style="margin-bottom: 10px; padding-top: 20px;"
  180. :style="{'border-top':idx==0?'none':'1px dashed #e5e7eb'}" class="zebra-row">
  181. <el-row>
  182. <el-col :span="24">
  183. <span style="color: #f56c6c; margin-right: 4px;" v-show="item.required">*</span>
  184. <span style="font-weight: bold;">{{idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+ item.title }}</span>
  185. </el-col>
  186. </el-row>
  187. <el-row style="margin-bottom: 20px;margin-top: 8px;">
  188. <el-col :span="8">
  189. <el-form label-width="100px">
  190. <template v-for="ctl,n in item.contentList">
  191. <el-form-item :label="ctl.label">
  192. <el-input clearable v-model="ctl.value" :disabled="isView" />
  193. <miniImageUpload :limit="1" v-model="ctl.img" :disabled="true"
  194. v-if="ctl.img" />
  195. </el-form-item>
  196. </template>
  197. </el-form>
  198. </el-col>
  199. </el-row>
  200. </div>
  201. </template>
  202. <template v-else>
  203. <div style="margin-bottom: 10px; padding-top: 20px;"
  204. :style="{ 'border-top': idx == 0 ? 'none' : '1px dashed #e5e7eb' }" class="zebra-row">
  205. <el-row>
  206. <el-col :span="24">
  207. <span style="color: #f56c6c; margin-right: 4px;" v-show="item.required">*</span>
  208. <span style="font-weight: bold;">{{idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+ item.title }}</span>
  209. </el-col>
  210. </el-row>
  211. <el-row style="margin-bottom: 20px;margin-top: 8px;">
  212. <el-col :span="24">
  213. <el-form :inline="true" label-width="100px">
  214. <template v-for="ctl,n in item.contentList">
  215. <el-form-item :label="ctl.label">
  216. <el-input clearable v-model="ctl.value" :disabled="isView" />
  217. <miniImageUpload :limit="1" v-model="ctl.img" :disabled="true"
  218. v-if="ctl.img" />
  219. </el-form-item>
  220. </template>
  221. </el-form>
  222. </el-col>
  223. </el-row>
  224. </div>
  225. </template>
  226. </template>
  227. <template v-if="item.questionChildType == 'scaleQuestions'">
  228. <div style="margin-bottom: 10px; padding-top: 20px;"
  229. :style="{ 'border-top': idx == 0 ? 'none' : '1px dashed #e5e7eb' }" class="zebra-row">
  230. <el-row>
  231. <el-col :span="24">
  232. <span style="color: #f56c6c; margin-right: 4px;" v-show="item.required">*</span>
  233. <span style="font-weight: bold;">{{idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+ item.title }}</span>
  234. <div style="overflow-x: scroll;margin-top: 8px;margin-left: 30px;">
  235. <div class="custom-radio-grid">
  236. <div v-for="ctl,n in item.contentList" :key="n"
  237. @click="selectScaleQuestions(idx,n)"
  238. :class="['custom-radio-cell', {'my-selected':ctl.value!=null,'cell': item.contentList.length === n+1, 'is-last': n+1 > 1 }]">
  239. {{ n+1 }}
  240. </div>
  241. </div>
  242. <div class="custom-radio-grid">
  243. <div v-for="ctl, n in item.contentList" :key="ctl.nameEn" style="border: none;"
  244. :class="['custom-radio-cell']">
  245. {{ ctl.label }}
  246. </div>
  247. </div>
  248. </div>
  249. </el-col>
  250. </el-row>
  251. </div>
  252. </template>
  253. <template v-if="item.questionChildType == 'matrixScale'">
  254. <div style="margin-bottom: 10px; padding-top: 20px;"
  255. :style="{ 'border-top': idx == 0 ? 'none' : '1px dashed #e5e7eb' }" class="zebra-row">
  256. <el-row>
  257. <el-col :span="24">
  258. <span style="color: #f56c6c; margin-right: 4px;" v-show="item.required">*</span>
  259. <span style="font-weight: bold;">{{idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+ item.title }}</span>
  260. <div style="border-bottom: 1px solid #e5e7eb;width: 98%;margin-left: 30px;">
  261. <el-row :gutter="10" class="mb8">
  262. <el-col :span="3" style="margin-top: 30px;">
  263. </el-col>
  264. <template v-for="clt in item.contentList">
  265. <template v-if="clt.optionFlag">
  266. <el-col :span="1" align="center"
  267. style="margin-top: 30px;margin-left: 15px;">
  268. {{ clt.optionContent }}
  269. </el-col>
  270. </template>
  271. </template>
  272. </el-row>
  273. <template v-for="clt, i1 in item.contentList">
  274. <el-row :gutter="10" class="mb8">
  275. <el-col :span="3" style="margin-top: 10px;">
  276. <template v-if="clt.labelFlag">
  277. 标题{{ i1 + 1 }}:{{ clt.label }}
  278. </template>
  279. </el-col>
  280. <template v-for="clt2, i2 in item.contentList">
  281. <el-col :span="1" align="center" style="margin-left: 15px;"
  282. v-if="clt2.optionFlag && clt.labelFlag">
  283. <el-radio-group v-model="clt.value" :disabled="isView">
  284. <el-radio :value="(i1 + 1) * 1000 + i2" size="large" />
  285. </el-radio-group>
  286. </el-col>
  287. </template>
  288. <el-col :span="3" style="margin-top: 10px;">
  289. <span v-if="clt.allowFillBlank">
  290. <el-input v-model="clt.matrixFillBlank" clearable :disabled="isView" />
  291. </span>
  292. </el-col>
  293. </el-row>
  294. </template>
  295. </div>
  296. </el-col>
  297. </el-row>
  298. </div>
  299. </template>
  300. <!-- 其他:人体测量、膳食状况、营养生化检查 -->
  301. <template v-if="item.questionChildType == 'anthropometry'">
  302. <template v-if="item.lastType == '1'||item.lastType == '3'">
  303. <div style="margin-bottom: 10px; padding-top: 20px;"
  304. :style="{ 'border-top': idx == 0 ? 'none' : '1px dashed #e5e7eb' }" class="zebra-row">
  305. <el-row>
  306. <el-col :span="24">
  307. <span style="color: #f56c6c; margin-right: 4px;">*</span>
  308. <span style="font-weight: bold;">{{idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+ item.title }}</span>
  309. </el-col>
  310. </el-row>
  311. <el-row style="margin-bottom: 20px;margin-top: 8px;">
  312. <el-col :span="24">
  313. <el-form :inline="true" label-width="120px">
  314. <template v-for="ctl,n in item.contentList">
  315. <el-form-item :label="ctl.label">
  316. <el-input clearable v-model="ctl.value" :disabled="isView" />
  317. </el-form-item>
  318. </template>
  319. </el-form>
  320. </el-col>
  321. </el-row>
  322. </div>
  323. </template>
  324. <template v-else>
  325. <div style="margin-bottom: 10px; padding-top: 20px;"
  326. :style="{'border-top':idx==0?'none':'1px dashed #e5e7eb'}" class="zebra-row">
  327. <el-row>
  328. <el-col :span="24">
  329. <span style="color: #f56c6c; margin-right: 4px;">*</span>
  330. <span style="font-weight: bold;">{{idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+ item.title }}</span>
  331. <el-radio-group v-model="item.value" class="horizontal-radio-group"
  332. style="margin-top: 8px;">
  333. <template v-for="ctl,i in item.contentList">
  334. <el-radio :label="ctl.label" :value="i" :disabled="isView">
  335. <span class="option-content">
  336. <span v-if="ctl.img" class="option-img">
  337. <miniImageUpload :limit="1" v-model="ctl.img"
  338. :disabled="true" />
  339. </span>
  340. <span>{{ ctl.label }}</span>
  341. <span v-if="ctl.allowFillBlank" style="margin-left: 10px;">
  342. <el-input v-model="ctl.value" clearable :disabled="isView" />
  343. </span>
  344. </span>
  345. </el-radio>
  346. </template>
  347. </el-radio-group>
  348. </el-col>
  349. </el-row>
  350. </div>
  351. </template>
  352. </template>
  353. <template v-if="item.questionChildType == 'dietaryStatus'">
  354. <template v-if="item.lastType != '2'">
  355. <div style="margin-bottom: 10px; padding-top: 20px;"
  356. :style="{ 'border-top': idx == 0 ? 'none' : '1px dashed #e5e7eb' }" class="zebra-row">
  357. <el-row>
  358. <el-col :span="24">
  359. <span style="color: #f56c6c; margin-right: 4px;">*</span>
  360. <span style="font-weight: bold;">{{idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+ item.title }}</span>
  361. </el-col>
  362. </el-row>
  363. <el-row style="margin-bottom: 20px;margin-top: 8px;">
  364. <el-col :span="24">
  365. <el-form :inline="true" label-width="120px">
  366. <template v-for="ctl,n in item.contentList">
  367. <el-form-item :label="ctl.label">
  368. <el-input clearable v-model="ctl.value" :disabled="isView" />
  369. </el-form-item>
  370. </template>
  371. </el-form>
  372. </el-col>
  373. </el-row>
  374. </div>
  375. </template>
  376. <template v-else>
  377. <div style="margin-bottom: 10px; padding-top: 20px;"
  378. :style="{'border-top':idx==0?'none':'1px dashed #e5e7eb'}" class="zebra-row">
  379. <el-row>
  380. <el-col :span="24">
  381. <span style="color: #f56c6c; margin-right: 4px;">*</span>
  382. <span style="font-weight: bold;">{{idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+ item.title }}</span>
  383. <el-radio-group v-model="item.value" class="horizontal-radio-group"
  384. style="margin-top: 8px;">
  385. <template v-for="ctl,i in item.contentList">
  386. <el-radio :label="ctl.label" :value="i" :disabled="isView">
  387. <span class="option-content">
  388. <span v-if="ctl.img" class="option-img">
  389. <miniImageUpload :limit="1" v-model="ctl.img"
  390. :disabled="true" />
  391. </span>
  392. <span>{{ ctl.label }}</span>
  393. <span v-if="ctl.allowFillBlank" style="margin-left: 10px;">
  394. <el-input v-model="ctl.value" clearable :disabled="isView" />
  395. </span>
  396. </span>
  397. </el-radio>
  398. </template>
  399. </el-radio-group>
  400. </el-col>
  401. </el-row>
  402. </div>
  403. </template>
  404. </template>
  405. <template v-if="item.questionChildType == 'nutritionalBiochemical'">
  406. <div style="margin-bottom: 10px; padding-top: 20px;"
  407. :style="{ 'border-top': idx == 0 ? 'none' : '1px dashed #e5e7eb' }" class="zebra-row">
  408. <el-row>
  409. <el-col :span="24">
  410. <span style="color: #f56c6c; margin-right: 4px;">*</span>
  411. <span style="font-weight: bold;">{{idx + 1 + (form.baseInfo&&form.baseInfo.contentList&&form.baseInfo.contentList.length>0?1:0) +'. '+ item.title }}</span>
  412. </el-col>
  413. </el-row>
  414. <el-row style="margin-bottom: 20px;margin-top: 8px;">
  415. <el-col :span="24">
  416. <el-form :inline="true" label-width="120px">
  417. <el-form-item :label="item.title">
  418. <el-input clearable v-model="item.value" :disabled="isView" />
  419. </el-form-item>
  420. </el-form>
  421. </el-col>
  422. </el-row>
  423. </div>
  424. </template>
  425. <!-- 其他:人体测量、膳食状况、营养生化检查 -->
  426. </template>
  427. </el-card>
  428. <el-card shadow="always" class="card-footer" v-if="!isView">
  429. <div>
  430. <el-button type="primary" size="large" @click="submitForm" :loading="buttonLoading"
  431. v-hasPermi="['system:hospital:add']">
  432. &nbsp;&nbsp;&nbsp;提交&nbsp;&nbsp;&nbsp;
  433. </el-button>
  434. </div>
  435. </el-card>
  436. </div>
  437. </template>
  438. <script setup name="Screening" lang="ts">
  439. import { listScreening, getScreening, delScreening, addScreening, updateScreening } from '@/api/patients/screening';
  440. import { ScreeningVO, ScreeningQuery, ScreeningForm } from '@/api/patients/screening/types';
  441. import { getScreeningAssessmentConfig } from '@/api/system/screeningAssessmentConfig';
  442. import {ScreeningAssessmentConfigForm} from '@/api/system/screeningAssessmentConfig/types';
  443. import { ref } from 'vue'
  444. let paramForm = ref<ScreeningForm>({});
  445. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  446. const { sys_user_sex } = toRefs<any>(proxy?.useDict('sys_user_sex'));
  447. const screeningName = ref('');
  448. const { patientInfo } = defineProps<{ patientInfo: any }>()
  449. const emit = defineEmits(['change'])
  450. let form=ref<ScreeningAssessmentConfigForm>({});
  451. const buttonLoading = ref(false);
  452. let isView=ref(false);
  453. /** 查询营养筛查列表 */
  454. const getList = async () => {
  455. let id = patientInfo.other;
  456. let reg=/^[0-9]*$/;
  457. if (!reg.test(id.toString())) {
  458. id = window.atob(id);
  459. isView.value = true;
  460. const res =await getScreening(id as string);
  461. const content =JSON.parse(res.data.content);
  462. screeningName.value = content.name;
  463. Object.assign(form.value, content);
  464. } else {
  465. isView.value = false;
  466. const res = await getScreeningAssessmentConfig(id as string);
  467. screeningName.value = res.data.name;
  468. Object.assign(form.value, res.data);
  469. }
  470. }
  471. const close = async () => {
  472. emit('change', 'nutritionScreening');
  473. };
  474. /** 提交按钮 */
  475. const submitForm = async () => {
  476. if (form.value.baseInfo) {
  477. for (let i = 0, len = form.value.baseInfo.contentList.length; i < len; i++) {
  478. let item = form.value.baseInfo.contentList[i];
  479. if (item.value == null || item.value == undefined) {
  480. proxy?.$modal.msgError(item.label + "不为空");
  481. return;
  482. }
  483. }
  484. }
  485. if (form.value.otherInfo) {
  486. for (let i = 0, len = form.value.otherInfo.length; i < len; i++) {
  487. let item = form.value.otherInfo[i];
  488. if (item.questionType == 'otherInfo') {
  489. if (item.questionChildType == 'anthropometry') {
  490. if (item.lastType == '1' || item.lastType == '3') {
  491. for (let k = 0, len = item.contentList.length; k < len; k++) {
  492. if (item.contentList[k].value == null || item.contentList[k].value == undefined) {
  493. proxy?.$modal.msgError("请确保必填项(第" + (i + 1 + (form.value.baseInfo ? 1 : 0)) + "题)[" + item.contentList[k].label + "]不为空");
  494. return;
  495. }
  496. }
  497. } else if (item.value == null || item.value == undefined) {
  498. proxy?.$modal.msgError("请确保必填项(第" + (i + 1 + (form.value.baseInfo ? 1 : 0)) + "题)不为空");
  499. return;
  500. }
  501. } else if (item.questionChildType == 'dietaryStatus') {
  502. if (item.lastType != '2') {
  503. for (let k = 0, len = item.contentList.length; k < len; k++) {
  504. if (item.contentList[k].value == null || item.contentList[k].value == undefined) {
  505. proxy?.$modal.msgError("请确保必填项(第" + (i + 1 + (form.value.baseInfo ? 1 : 0)) + "题)[" + item.contentList[k].label + "]不为空");
  506. return;
  507. }
  508. }
  509. } else if (item.value == null || item.value == undefined) {
  510. proxy?.$modal.msgError("请确保必填项(第" + (i + 1 + (form.value.baseInfo ? 1 : 0)) + "题)不为空");
  511. return;
  512. }
  513. } else {
  514. if (item.value == null || item.value == undefined) {
  515. proxy?.$modal.msgError("请确保必填项(第" + (i + 1 + (form.value.baseInfo ? 1 : 0)) + "题)不为空");
  516. return;
  517. }
  518. }
  519. } else {
  520. if (item.required && (item.value == null || item.value == undefined)) {
  521. proxy?.$modal.msgError("请确保必填项(第" + (i + 1 + (form.value.baseInfo ? 1 : 0)) + "题)不为空");
  522. return;
  523. }
  524. }
  525. }
  526. }
  527. buttonLoading.value = true;
  528. paramForm.value.content = JSON.stringify(form.value);
  529. if (paramForm.value.id) {
  530. await updateScreening(paramForm.value).finally(() => buttonLoading.value = false);
  531. } else {
  532. await addScreening(paramForm.value).finally(() => buttonLoading.value = false);
  533. }
  534. proxy?.$modal.msgSuccess("操作成功");
  535. close();
  536. }
  537. const selectScaleQuestions = async (idx:number, n:number) => {
  538. if(isView.value){
  539. return;
  540. }
  541. let other = form.value.otherInfo[idx];
  542. if (!other.value) {
  543. other.value = [];
  544. }
  545. let ctl = other.contentList[n];
  546. if (ctl.value!=null) {
  547. ctl.value = null;
  548. let newList=[];
  549. for (let i = 0, len = other.value.length; i < len; i++) {
  550. if (other.value[i] != n) {
  551. newList.push(other.value[i]);
  552. }
  553. }
  554. other.value=newList;
  555. } else {
  556. ctl.value = n;
  557. other.value.push(n);
  558. }
  559. }
  560. onMounted(() => {
  561. paramForm.value.patientId=patientInfo.id;
  562. paramForm.value.patientNo=patientInfo.outpatientNo;
  563. paramForm.value.visitType=patientInfo.type;
  564. paramForm.value.configId=patientInfo.other;
  565. getList();
  566. });
  567. </script>
  568. <style scoped>
  569. .screening-type-grid {
  570. display: flex;
  571. flex-wrap: wrap;
  572. gap: 8px;
  573. }
  574. .screening-type-btn {
  575. font-weight: bold;
  576. font-size: 16px;
  577. height: 48px;
  578. border-radius: 8px;
  579. }
  580. .radio-card {
  581. display: inline-block;
  582. }
  583. .radio-card .el-radio-group {
  584. display: flex;
  585. flex-direction: column;
  586. align-items: flex-start;
  587. }
  588. .radio-card .el-radio {
  589. margin-bottom: 3px;
  590. margin-left: 30px;
  591. }
  592. .radio-card el-radio:last-child {
  593. margin-bottom: 0;
  594. }
  595. .horizontal-radio-group {
  596. display: flex;
  597. flex-direction: row;
  598. align-items: center;
  599. margin-left: 16px;
  600. }
  601. .horizontal-radio-group .el-radio {
  602. margin-right: 32px;
  603. margin-bottom: 0;
  604. margin-left: 14px;
  605. }
  606. .horizontal-checkbox-group {
  607. display: flex;
  608. flex-wrap: wrap;
  609. align-items: center;
  610. margin-left: 30px;
  611. }
  612. .horizontal-checkbox-group .el-checkbox {
  613. margin-right: 32px;
  614. margin-bottom: 8px;
  615. }
  616. .checkbox-vertical-card .el-checkbox-group {
  617. display: flex;
  618. flex-direction: column;
  619. align-items: flex-start;
  620. }
  621. .checkbox-vertical-card .el-checkbox {
  622. margin-bottom: 10px;
  623. margin-left: 30px;
  624. }
  625. .checkbox-vertical-card .el-checkbox:last-child {
  626. margin-bottom: 0;
  627. }
  628. /* 斑马色:偶数题背景色 */
  629. .zebra-row:nth-child(even) {
  630. background: #fafafa;
  631. }
  632. /* 斑马色:奇数题背景色 */
  633. .zebra-row:nth-child(odd) {
  634. background: #fff;
  635. }
  636. .card-footer{
  637. z-index: 99;
  638. bottom: 0px;
  639. left: calc(var(--left-menu-max-width) + var(--app-content-padding));
  640. right: 0px;
  641. height: 90px;
  642. display: flex;
  643. justify-content: center;
  644. align-items: center;
  645. }
  646. .custom-radio-grid {
  647. display: flex;
  648. /* border: 1px solid #bfc4cc; */
  649. border-radius: 4px;
  650. background: #fff;
  651. margin-bottom: 16px;
  652. }
  653. .custom-radio-cell {
  654. width: 100px;
  655. flex: none;
  656. text-align: center;
  657. border: 1px solid #bfc4cc;
  658. margin: 0 !important;
  659. height: 40px;
  660. line-height: 20px;
  661. font-size: 18px;
  662. font-weight: normal;
  663. background: #fff;
  664. border-radius: 0 !important;
  665. cursor: pointer;
  666. user-select: none;
  667. transition: background 0.2s;
  668. word-break: break-all;
  669. white-space: normal;
  670. overflow-wrap: break-word;
  671. display: flex;
  672. align-items: center;
  673. justify-content: center;
  674. padding: 0 5px;
  675. }
  676. .custom-radio-cell:last-child {
  677. border-right: none;
  678. }
  679. .custom-radio-cell .el-radio__input {
  680. display: none !important;
  681. }
  682. .custom-radio-cell .el-radio__label {
  683. padding: 0;
  684. width: 100%;
  685. display: block;
  686. text-align: center;
  687. cursor: pointer;
  688. }
  689. .custom-radio-cell .cell {
  690. border-right: 1px solid #bfc4cc;
  691. }
  692. .my-selected{
  693. background-color: #ccf0a4; /* Element Plus 主色 */
  694. color: #fff;
  695. border-radius: 6px;
  696. box-shadow: 0 2px 8px rgba(64,158,255,0.08);
  697. transition: background 0.2s, color 0.2s, border 0.2s;
  698. }
  699. .custom-radio-cell.is-last {
  700. border-right: 1px solid #bfc4cc;
  701. border-left: none;
  702. }
  703. </style>