archivesEdit.html 74 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3. <head>
  4. <th:block th:include="include :: header('档案明细')" />
  5. </head>
  6. <style>
  7. .select2-dropdown {
  8. z-index: 9999 !important;
  9. }
  10. .tabs-container {
  11. position: relative;
  12. }
  13. </style>
  14. <script>
  15. </script>
  16. <body>
  17. <div class="ui-layout-center">
  18. <h4 class="form-header h4">档案详情</h4>
  19. <div class="col-sm-12">
  20. <div class="tabs-container">
  21. <ul class="nav nav-tabs" id="myTabs3">
  22. <li class="active"><a data-toggle="tab" href="#tab-2" aria-expanded="false">首患建档</a>
  23. </li>
  24. <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false" > 用药购药</a>
  25. </li>
  26. <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">随访计划</a>
  27. </li>
  28. <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">任务跟进</a>
  29. </li>
  30. </ul>
  31. <div class="tab-content">
  32. <div id="tab-2" class="tab-pane active">
  33. <form class="form-horizontal" id="form-server-edit">
  34. <input type="hidden" id="id2" name="id" th:value="${id}">
  35. <input type="hidden" id="basicInformation" name="basicInformation" value="true">
  36. <div class="panel-body">
  37. <ul class="nav nav-tabs" id="myTabs">
  38. <li class="active"><a data-toggle="tab" href="#tab-20" aria-expanded="true">快速建档信息</a>
  39. </li>
  40. <li class="active"><a data-toggle="tab" href="#tab-21" aria-expanded="true">一般信息、家族史和既往史</a>
  41. </li>
  42. <li class=""><a data-toggle="tab" href="#tab-22" aria-expanded="false">特重/罕见疾病情况</a>
  43. </li>
  44. <li class=""><a data-toggle="tab" href="#tab-23" aria-expanded="false">慢性疾病情况</a>
  45. </li>
  46. </ul>
  47. </div>
  48. <div id="tab-20" class="tab-pane fade in active">
  49. <div class="panel-body">
  50. <strong>快速建档信息</strong>
  51. <div class="customize-search-form">
  52. <input type="hidden" id="id" name="id" th:value="${id}">
  53. <div class="customize-form-group edit">
  54. <label class="control-label is-required">姓名:</label>
  55. <input name="name" id="name" placeholder="请输入姓名" class="styled-input edit_inputs" type="text" maxlength="30" th:value="${name}" disabled="true">
  56. &nbsp; <i class="fa" th:class="${realNameStatus == 1 ? 'fa fa-check' : 'fa fa-close'}" id="checkName" ></i>
  57. &nbsp;
  58. <input name="realNameStatus" id="realNameStatus" class="status" type="text" th:value="${realNameStatus == 1 ? '已实名' : (realNameStatus == 0 ? '未实名' : '')}" readonly>
  59. </div>
  60. <div class="customize-form-group edit">
  61. <label>性别:</label>
  62. <select name="gender" class="styled-input edit_inputs" th:with="type=${@dict.getType('sys_user_sex')}" disabled="true">
  63. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
  64. th:selected="${dict.dictValue} == ${gender}" ></option>
  65. </select>
  66. <span class="span_line" readonly></span>
  67. </div>
  68. <div class="customize-form-group edit">
  69. <label>出生年月:</label>
  70. <input name="dateBirth" id="dateBirth" placeholder="出生年月" class="styled-input edit_inputs" type="text" th:value="${dateBirth}" disabled="true">
  71. <span class="status" style="width: 66px">
  72. <input name="age" type="text" id="age" th:value="${age}" style="text-align: center;width: 30px;border: none;" readonly>
  73. </span>
  74. </div>
  75. <div class="customize-form-group edit">
  76. <label class="control-label is-required">手机号:</label>
  77. <input name="phoneNumber" id="phoneNumber" placeholder="请输入手机号" class="styled-input edit_inputs" type="text" maxlength="30" th:value="${phoneNumber}" required>
  78. <span class="span_line" readonly></span>
  79. </div>
  80. <div class="customize-form-group edit">
  81. <label >证件号码:</label>
  82. <input name="documentType" placeholder="证件类型" class="styled-input short" type="text" th:value="${documentType}" disabled="true">
  83. <input name="documentNumber" placeholder="请输入证件号码" class="styled-input edit_inputs1" type="text" maxlength="30" th:value="${documentNumber}" disabled="true">
  84. <span class="span_line" readonly></span>
  85. </div>
  86. <div class="customize-form-group edit select-time">
  87. <label >首次确诊时间:</label>
  88. <input name="timeFirstDiagnosis" placeholder="首次确诊时间" class="time-input styled-input edit_inputs" type="text" th:value="${timeFirstDiagnosis}">
  89. <span class="span_line" readonly></span>
  90. </div>
  91. <div class="customize-form-group">
  92. <label class="control-label">配送地址:</label>
  93. <input name="addr" placeholder="配送地址" id="addr" class="styled-input edit_inputs" type="text" th:value="${addr}">
  94. <span class="span_line" readonly></span>
  95. </div>
  96. <div class="customize-form-group">
  97. <label class="control-label">联系人手机号:</label>
  98. <input name="contactPhone" placeholder="联系人手机号" id="contactPhone" class="styled-input edit_inputs" type="text" th:value="${contactPhone}">
  99. <span class="span_line" readonly></span>
  100. </div>
  101. <div class="customize-form-group">
  102. <label class="control-label">联系人姓名:</label>
  103. <input name="contactName" placeholder="联系人姓名" id="contactName" class="styled-input edit_inputs" type="text" th:value="${contactName}">
  104. <span class="span_line" readonly></span>
  105. </div>
  106. </div>
  107. <div class="customize-search-form">
  108. <div class="customize-form-group">
  109. <label class="control-label">肿瘤发病部位疾病:</label>
  110. <select id="category-select1" class="styled-input edit_inputs select2-multiple" multiple placeholder="请选择或输入搜索">
  111. </select>
  112. <span class="span_line" readonly></span>
  113. </div>
  114. <div class="customize-form-group">
  115. <label class="control-label">肿瘤治疗并发症与合并症:</label>
  116. <select id="category-select2" class="styled-input edit_inputs select2-multiple" multiple placeholder="请选择或输入搜索">
  117. </select>
  118. <span class="span_line" readonly></span>
  119. </div>
  120. <div class="customize-form-group">
  121. <label class="control-label">风湿免疫疾病名称:</label>
  122. <select id="category-select3" class="styled-input edit_inputs select2-multiple" multiple placeholder="请选择或输入搜索">
  123. </select>
  124. <span class="span_line" readonly></span>
  125. </div>
  126. <div class="customize-form-group">
  127. <label class="control-label">罕见病疾病:</label>
  128. <select id="category-select4" class="styled-input edit_inputs select2-multiple" multiple placeholder="请选择或输入搜索">
  129. </select>
  130. <span class="span_line" readonly></span>
  131. </div>
  132. <div class="customize-form-group">
  133. <label class="control-label">感染类疾病:</label>
  134. <select id="category-select5" class="styled-input edit_inputs select2-multiple" multiple placeholder="请选择或输入搜索">
  135. </select>
  136. <span class="span_line" readonly></span>
  137. </div>
  138. <div class="customize-form-group">
  139. <label class="control-label">临时慢病:</label>
  140. <select id="category-select6" class="styled-input edit_inputs select2-multiple" multiple placeholder="请选择或输入搜索">
  141. </select>
  142. <span class="span_line" readonly></span>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. <div id="tab-21" class="tab-pane fade in active">
  148. <div class="panel-body">
  149. <strong>一般信息、家族史和既往史</strong>
  150. <div class="customize-search-form">
  151. <div class="customize-form-group edit">
  152. <label>身高:</label>
  153. <input name="height" id="heighth" placeholder="请输入身高" class="styled-input edit_inputs" type="number" th:value="${height}">
  154. <span class="status">
  155. cm
  156. </span>
  157. </div>
  158. <div class="customize-form-group edit">
  159. <label>体重:</label>
  160. <input name="weight" id="weightw" placeholder="请输入体重" class="styled-input edit_inputs" type="number" th:value="${weight}">
  161. <span class="status">
  162. kg
  163. </span>
  164. </div>
  165. <div class="customize-form-group edit">
  166. <label>BMI:</label>
  167. <input name="BMI" id="BMI2" placeholder="" class="styled-input edit_inputs" type="text" th:value="${BMI}" readonly>
  168. <span class="status">
  169. kg/m²
  170. </span>
  171. </div>
  172. <div class="customize-form-group edit">
  173. <label>腰围:</label>
  174. <input name="waist" id="waist" placeholder="请输入腰围" class="styled-input edit_inputs" type="number" th:value="${waist}">
  175. <span class="status">
  176. cm
  177. </span>
  178. </div>
  179. <div class="customize-form-group edit">
  180. <label>臀围:</label>
  181. <input name="hip" id="hip" placeholder="请输入臀围" class="styled-input edit_inputs" type="number" th:value="${hip}">
  182. <span class="status">
  183. cm
  184. </span>
  185. </div>
  186. <div class="customize-form-group edit">
  187. <label>血压:</label>
  188. <input name="bloodPressure" id="bloodPressure" placeholder="请输入血压" class="styled-input edit_inputs" type="number" th:value="${bloodPressure}">
  189. <span class="status">
  190. mmHg
  191. </span>
  192. </div>
  193. <div class="customize-form-group edit">
  194. <label>血糖:</label>
  195. <input name="bloodSugar" id="bloodSugar" placeholder="请输入血糖" class="styled-input edit_inputs" type="number" th:value="${bloodSugar}">
  196. <span class="status">
  197. mmol/L
  198. </span>
  199. </div>
  200. <div class="customize-search-form">
  201. <div class="customize-form-group edit">
  202. <label>既往史:</label>
  203. <select name="medicalHistory" class="styled-input edit_inputs" th:with="type=${@dict.getType('sys_select_dtp_ysfw_jibinshi')}">
  204. <option value="">请选择</option>
  205. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
  206. th:selected="${dict.dictLabel}==${medicalHistory}"></option>
  207. </select>
  208. <span class="status"></span>
  209. </div>
  210. <div class="customize-form-group edit">
  211. <label>是外伤手术史:</label>
  212. <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
  213. <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:checked="${dict.dictLabel}==${hasSurgicalTraumaHistory}" name="hasSurgicalTraumaHistory" id="hasSurgicalTraumaHistory">
  214. </div>
  215. <span class="status"></span>
  216. </div>
  217. <div class="customize-form-group edit">
  218. <label>家族史:</label>
  219. <select name="infectiousDiseaseHistory" class="styled-input edit_inputs" th:with="type=${@dict.getType('sys_select_dtp_ysfw_crbs')}" >
  220. <option value="">请选择</option>
  221. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
  222. th:selected="${dict.dictLabel}==${infectiousDiseaseHistory}"></option>
  223. </select>
  224. <span class="status"></span>
  225. </div>
  226. </div>
  227. <div class="customize-search-form">
  228. <div class="customize-search-form">
  229. <div class="customize-form-group edit">
  230. <div class="customize-form-group edit">
  231. <label>过敏史:</label>
  232. <textarea id="allergyHistory" name="allergyHistory" placeholder="这里可以输入过敏史...食物/药物"
  233. class="styled-input edit_inputs textareas"
  234. style="width: auto;height: 35px ;border: 1px solid ;" rows="1.9" cols="112" th:text="${allergyHistory}"></textarea>
  235. </div>
  236. </div>
  237. </div>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. <div id="tab-22" class="tab-pane fade in active">
  243. <div class="panel-body">
  244. <strong>特重/罕见疾病情</strong>
  245. <div class="customize-search-form">
  246. <!--is-required 增加星号 显示为必填-->
  247. <div class="customize-form-group edit">
  248. <label>肿瘤TNM分期:</label>
  249. <select name="businessBelonging" class="styled-input edit_inputs" th:with="type=${@dict.getType('sys_zlfq')}">
  250. <option value="">请选择</option>
  251. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
  252. th:selected="${dict.dictLabel}==${businessBelonging}"></option>
  253. </select>
  254. <span class="status"></span>
  255. </div>
  256. <div class="customize-form-group edit">
  257. <label>肿瘤疾病分期:</label>
  258. <select name="zlfq" class="styled-input edit_inputs" th:with="type=${@dict.getType('sys_select_dtp_ysfw_blfq')}" required>
  259. <option value="">请选择</option>
  260. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
  261. th:selected="${dict.dictLabel}==${zlfq}"></option>
  262. </select>
  263. <span class="status"></span>
  264. </div>
  265. <div class="customize-form-group edit">
  266. <label>基因突变:</label><!-- 需要配置选择的值-->
  267. <select name="jytb" class="styled-input edit_inputs" th:with="type=${@dict.getType('sys_jy_type')}" required>
  268. <option value="">请选择</option>
  269. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
  270. th:selected="${dict.dictLabel}==${jytb}"></option>
  271. </select>
  272. <span class="status"></span>
  273. </div>
  274. <div class="customize-form-group edit">
  275. <label>分子分型监测:</label>
  276. <select name="fzjc" class="styled-input edit_inputs" th:with="type=${@dict.getType('sys_fzjc')}" required>
  277. <option value="">请选择</option>
  278. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
  279. th:selected="${dict.dictLabel}==${fzjc}"></option>
  280. </select>
  281. <span class="status"></span>
  282. </div>
  283. <div class="customize-form-group edit">
  284. <label>PD-L1表达:</label>
  285. <select name="pdl1" class="styled-input edit_inputs" th:with="type=${@dict.getType('sys_pdl1')}" required>
  286. <option value="">请选择</option>
  287. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
  288. th:selected="${dict.dictLabel}==${pdl1}"></option>
  289. </select>
  290. <span class="status"></span>
  291. </div>
  292. <div class="customize-form-group edit">
  293. <label>治疗手段:</label><!-- 值配置到字典-->
  294. <select name="zlsd" class="styled-input edit_inputs" th:with="type=${@dict.getType('sys_zlsd')}" required>
  295. <option value="">请选择</option>
  296. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
  297. th:selected="${dict.dictLabel}==${zlsd}"></option>
  298. </select>
  299. <span class="status"></span>
  300. </div>
  301. <div class="customize-form-group edit">
  302. <label>治疗分期:</label>
  303. <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_zlfq')}">
  304. <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:checked="${dict.dictLabel}==${treatmentStage}" name="treatmentStage" required>
  305. </div>
  306. <span class="status"></span>
  307. </div>
  308. <div class="customize-form-group edit">
  309. <label>治疗线收集:</label>
  310. <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_zlxsj')}">
  311. <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:checked="${dict.dictLabel}==${healingLineCollection}" name="healingLineCollection">
  312. </div>
  313. <span class="status"></span>
  314. </div>
  315. </div>
  316. </div>
  317. </div>
  318. <div id="tab-23" class="tab-pane fade in active">
  319. <div class="panel-body">
  320. <strong>慢性疾病情况</strong>
  321. <div class="customize-search-form">
  322. <div class="customize-form-group edit">
  323. <label>糖尿病:</label>
  324. <input name="tnb" placeholder="临床症状" id="tnb" class="styled-input edit_inputs" type="text" th:value="${tnb}">
  325. <input name="tnbhbz" placeholder="合并症" id="tnbhbz" class="styled-input edit_inputs" type="text" th:value="${tnbhbz}">
  326. <span class="status"></span>
  327. </div>
  328. <div class="customize-form-group edit">
  329. <label>高血压:</label>
  330. <input name="gxy" placeholder="临床症状" id="gxy" class="styled-input edit_inputs" type="text" th:value="${gxy}">
  331. <input name="gxyhbz" placeholder="合并症" id="gxyhbz" class="styled-input edit_inputs" type="text" th:value="${gxyhbz}">
  332. <span class="status"></span>
  333. </div>
  334. <div class="customize-form-group edit">
  335. <label>高血脂症:</label>
  336. <input name="gxz" placeholder="临床症状" id="gxz" class="styled-input edit_inputs" type="text" th:value="${gxz}">
  337. <input name="gxzhbz" placeholder="合并症" id="gxzhbz" class="styled-input edit_inputs" type="text" th:value="${gxzhbz}">
  338. <span class="status"></span>
  339. </div>
  340. </div>
  341. </div>
  342. </div>
  343. <div id="tab-26" class="tab-pane fade in active">
  344. <div class="panel-body">
  345. <strong>用药情况 </strong>
  346. <div class="customize-search-form">
  347. <div class="customize-form-group edit">
  348. <div style="/*display: flex;*/">
  349. <label style="width: auto;">当前用药情况:</label>
  350. <button type="button" data-toggle="modal" data-target="#myModal2" class="btn btn-xs btn-primary">新增</button>
  351. <table id="yyqkTable" style="width: 340px;">
  352. <thead>
  353. <tr>
  354. <th>序号</th>
  355. <th>用药情况</th>
  356. <th>用药类型</th>
  357. <th>操作</th>
  358. </tr>
  359. </thead>
  360. <tbody id="yyqkTableBody">
  361. <!-- 表格行将在这里动态添加 -->
  362. </tbody>
  363. </table>
  364. </div>
  365. <div class="modal inmodal" id="myModal2" tabindex="-1" role="dialog" aria-hidden="true">
  366. <div class="modal-dialog">
  367. <form class="form-horizontal" id="form-yyqk-add">
  368. <div class="modal-content animated bounceInRight">
  369. <div class="modal-header">
  370. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
  371. </button>
  372. <h4 class="modal-title">用药情况</h4>
  373. </div>
  374. <div class="modal-body">
  375. <div class="form-group">
  376. <label>用药情况</label>
  377. <input type="text" name="medication_description" placeholder="请输入当前慢病用药名称" class="styled-input edit_inputs" style="width: 200px;" id="medication_description">
  378. <div class="customize-search-form">
  379. <div class="customize-form-group edit">
  380. <label>用药类型</label>
  381. <select name="medication_type" class="styled-input edit_inputs" style="width: 200px;" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}" id="medication_type">
  382. <option value="">请选择家庭成员</option>
  383. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
  384. th:selected="${dict.dictLabel}==${medication_type}"></option>
  385. </select>
  386. </div>
  387. </div>
  388. </div>
  389. </div>
  390. <div class="modal-footer">
  391. <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
  392. <button type="button" class="btn btn-primary" onclick="saveRow(2)">保存</button>
  393. </div>
  394. </div>
  395. </form>
  396. </div>
  397. </div>
  398. </div>
  399. </div>
  400. </div>
  401. </div>
  402. </form>
  403. </div>
  404. <div id="tab-3" class="tab-pane">
  405. <div class="panel-body">
  406. <strong>用药购药</strong>
  407. <div class="container-div">
  408. <div class="row">
  409. <div class="col-sm-12 select-table table-striped">
  410. <table id="bootstrap-table-3"></table>
  411. </div>
  412. </div>
  413. </div>
  414. </div>
  415. </div>
  416. <div id="tab-4" class="tab-pane">
  417. <div class="panel-body">
  418. <strong>随访跟进人</strong>
  419. <div class="row">
  420. <div class="col-sm-12">
  421. <label class="col-sm-1 control-label">随访跟进人:</label>
  422. <span>无</span>
  423. <div class="col-sm-2" >
  424. <div class="input-group">
  425. <select name="healingLineCollection" class="styled-input edit_inputs" th:with="type=${@dict.getType('sys_yes_no')}">
  426. <option value="">请选择</option>
  427. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
  428. th:selected="${dict.dictLabel} == ${healingLineCollection}" ></option>
  429. </select>
  430. </div>
  431. </div>
  432. <label class="col-sm-1 control-label">.</label>
  433. <div class="col-sm-2" >
  434. <div class="input-group">
  435. <span>脱落召回</span>
  436. </div>
  437. </div>
  438. <div class="col-sm-2" >
  439. <div class="input-group">
  440. <span>进行中</span>
  441. </div>
  442. </div>
  443. <a>关闭计划</a>
  444. </div>
  445. </div>
  446. <div class="row">
  447. <div class="col-sm-12">
  448. <label class="col-sm-1 control-label">创建人:</label>
  449. <div class="col-sm-1" >
  450. <div class="input-group">
  451. <span>系统订单</span>
  452. </div>
  453. </div>
  454. <label class="col-sm-1 control-label">开启时间:</label>
  455. <div class="col-sm-1" >
  456. <div class="input-group">
  457. <span>2024-09-16</span>
  458. </div>
  459. </div>
  460. <label class="col-sm-1 control-label">跟新人:</label>
  461. <div class="col-sm-1" >
  462. <div class="input-group">
  463. <span>admin</span>
  464. </div>
  465. </div>
  466. <label class="col-sm-1 control-label">更新时间:</label>
  467. <div class="col-sm-1" >
  468. <div class="input-group">
  469. <span>2024-09-16</span>
  470. </div>
  471. </div>
  472. <div class="col-sm-1" >
  473. <a>查看操作记录</a>
  474. </div>
  475. </div>
  476. </div>
  477. <div class="container-div">
  478. <div class="row">
  479. <div class="col-sm-12 select-table table-striped">
  480. <table id="bootstrap-table-4"></table>
  481. </div>
  482. </div>
  483. </div>
  484. </div>
  485. </div>
  486. <div id="tab-5" class="tab-pane">
  487. <ul class="nav nav-tabs">
  488. <div class="panel-body">
  489. <div class="container-div">
  490. <div class="row">
  491. <label class="col-sm-1 control-label">随访跟进人:</label>
  492. <span>无</span>
  493. <div class="col-sm-2" >
  494. <div class="input-group">
  495. <select name="healingLineCollection" class="styled-input edit_inputs" th:with="type=${@dict.getType('sys_yes_no')}">
  496. <option value="">请选择</option>
  497. <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
  498. th:selected="${dict.dictLabel} == ${healingLineCollection}" ></option>
  499. </select>
  500. </div>
  501. </div>
  502. </div>
  503. <div class="row">
  504. <div class="col-sm-12 select-table table-striped">
  505. <table id="bootstrap-table-5"></table>
  506. </div>
  507. </div>
  508. </div>
  509. </div>
  510. </ul>
  511. </div>
  512. </div>
  513. </div>
  514. </div>
  515. <div class="main-content" id="content-main">
  516. <div class="col-sm-offset-5 col-sm-10">
  517. <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
  518. <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
  519. </div>
  520. </div>
  521. </div>
  522. <th:block th:include="include :: footer" />
  523. <th:block th:include="include :: select2-css" />
  524. <th:block th:include="include :: bootstrap-select-css" />
  525. <th:block th:include="include :: select2-js" />
  526. <th:block th:include="include :: bootstrap-select-js" />
  527. </body>
  528. </html>
  529. <script th:inline="javascript">
  530. var prefix = ctx + "dtp/pmService";
  531. var prefix2 = ctx + "demo/table";
  532. var formSubmitted = true;
  533. $(document).ready(function() {
  534. // 初始化 Select2 插件
  535. for (let i = 1; i <= 6; i++) {
  536. $(`#category-select${i}`).select2({
  537. placeholder: "请选择或直接输入搜索",
  538. allowClear: true
  539. });
  540. }
  541. // 获取所有下拉选项的数据
  542. $.ajax({
  543. url: ctx + 'sp/sp/typeDate',
  544. method: 'GET',
  545. dataType: 'json',
  546. success: function(data) {
  547. // 获取所有的 select 元素
  548. var selects = [
  549. $('#category-select1'),
  550. $('#category-select2'),
  551. $('#category-select3'),
  552. $('#category-select4'),
  553. $('#category-select5'),
  554. $('#category-select6')
  555. ];
  556. // 清空已有选项(除了第一个默认选项)
  557. selects.forEach(function(select) {
  558. select.find('option').not(':first').remove();
  559. });
  560. // 添加默认选项到每个下拉列表
  561. selects.forEach(function(select) {
  562. if (!select.find('option:first').length) { // 检查是否已经有默认选项
  563. $('<option>', {
  564. value: '',
  565. text : '请选择疾病'
  566. }).prependTo(select); // 使用 prependTo 确保它成为第一个选项
  567. }
  568. });
  569. // 解析 dl 数据并获取 ID 数组
  570. var dl = /*[[${dl}]]*/ '';
  571. var dlParsed = JSON.parse(dl);
  572. var dlIds = Array.isArray(dlParsed) ? dlParsed.map(item => item.id.toString()) : [];
  573. // 遍历返回的数据并添加选项
  574. $.each(data.value || [], function(index, item) {
  575. var selectIndex = item.dict_key-1; // 假设 dict_key 是从 1 开始的索引
  576. if (selectIndex >= 0 && selectIndex < selects.length) {
  577. $('<option>', {
  578. value: item.id,
  579. text : item.categoryName
  580. }).appendTo(selects[selectIndex]);
  581. // 设置选中的值(仅当 dlIds 包含该项 id 时)
  582. if (dlIds.includes(item.id.toString())) {
  583. selects[selectIndex].val(item.id).trigger('change');
  584. }
  585. }
  586. });
  587. // 如果使用 Select2 插件,则初始化或刷新它们
  588. selects.forEach(function(select) {
  589. select.trigger('change');
  590. });
  591. },
  592. error: function(xhr, status, error) {
  593. console.error("Failed to load disease categories:", error);
  594. }
  595. });
  596. });
  597. function unbound() {
  598. $.modal.confirm("请确认是否解除当前患者档案与患者小程序账号的绑定关系?解绑后无法撤销,请谨慎操作", function() {
  599. var id = $("#id").val();
  600. var data=[];
  601. data.push({name:'id',value:id});
  602. console.log("data==="+data)
  603. $.ajax({
  604. cache: true,
  605. type: "POST",
  606. url: ctx + "dtp/pmService/unbound",
  607. data: data,
  608. async: false,
  609. error: function (data) {
  610. $.modal.alertError(data.msg);
  611. },
  612. success: function (data) {
  613. $.modal.alertSuccess(data.msg);
  614. // 重新加载整个页面
  615. location.reload();
  616. }
  617. });
  618. });
  619. }
  620. var flipStatus = $("#flipStatus").val();
  621. var unboundLink = $("#unboundflipStatus");
  622. if (flipStatus === '已上翻') {
  623. unboundLink.show();
  624. } else {
  625. unboundLink.hide();
  626. }
  627. function submitHandler() {
  628. //表单 基本信息
  629. var data = $("#form-server-edit").serializeArray();
  630. const tableBody2 = document.getElementById('yyqkTableBody');
  631. const rows2 = tableBody2.getElementsByTagName('tr');
  632. if (rows2.length > 0) {
  633. const rowsRcords = [];//用药情况table
  634. $('#yyqkTableBody tr').each(function () {
  635. const row = {
  636. archiveId: $("#id").val(),
  637. medicationDescription: $(this).find('td:eq(1)').text(),
  638. medicationType: $(this).find('td:eq(2)').text(),
  639. };
  640. rowsRcords.push(row);
  641. });
  642. data.push({name:"rowsRcords",value:JSON.stringify(rowsRcords)})
  643. }
  644. // 获取所有选中的选项并处理数据
  645. var selectedDataDL = [];
  646. for (let i = 1; i <= 6; i++) {
  647. var selectedOptionsDL = $(`#category-select${i} option:selected`);
  648. if (selectedOptionsDL.length > 0) {
  649. selectedOptionsDL.each(function() {
  650. selectedDataDL.push({
  651. id: $(this).val(),
  652. name: $(this).text()
  653. });
  654. });
  655. }
  656. }
  657. var hasSelection = false;
  658. if (selectedDataDL.length > 0) {
  659. hasSelection = true;
  660. }
  661. const DL = JSON.stringify(selectedDataDL);
  662. if (!hasSelection) {
  663. alert('请至少选择一个疾病选项!');
  664. return;
  665. }
  666. data.push({name: "dl", value: DL});
  667. $.operate.saveTab(prefix + "/archivesEdit", data);
  668. }
  669. $('#weightw').on('blur', function() {
  670. var inputValuew = $('#weightw').val().trim();
  671. var inputValueh = $('#heighth').val().trim();
  672. var result = calculateBMI(inputValueh,inputValuew); // 身高1.75m 体重70kg,
  673. // 显示输入框的值
  674. $('#BMI2').val(result);
  675. });
  676. $('#heighth').on('blur', function() {
  677. var inputValuew = $('#weightw').val().trim();
  678. var inputValueh = $('#heighth').val().trim();
  679. var result = calculateBMI(inputValueh, inputValuew); // 身高1.75m 体重70kg,
  680. // 显示输入框的值
  681. $('#BMI2').val(result);
  682. });
  683. $(document).ready(function() {
  684. // 监听点击事件,激活指定的选项卡
  685. $('#myTabs3 li a').click(function(e) {
  686. // 阻止默认行为
  687. //e.preventDefault();
  688. // 获取当前点击的选项卡链接
  689. var $this = $(this);
  690. var x = document.getElementById("content-main");
  691. if($this.attr('href') === '#tab-1'){
  692. formSubmitted=true;
  693. }
  694. if($this.attr('href') === '#tab-2'){
  695. formSubmitted=false;
  696. // 添加 active 类到当前点击的选项卡
  697. $(this).addClass('active');
  698. $this.attr('aria-expanded', 'true');
  699. }
  700. // 检查是否为“用药购药”选项卡
  701. if ($this.attr('href') === '#tab-3' || $this.attr('href') === '#tab-4' || $this.attr('href') === '#tab-5') {
  702. // 初始化表格
  703. initializeTables();
  704. x.style.display = "none";
  705. } else {
  706. x.style.display = "block";
  707. }
  708. // 初始化时回显保险已选中的值
  709. function check(insuranceList) {
  710. var insurances = insuranceList.split(',');
  711. $.each(insurances, function(index, value) {
  712. var checkbox = $('input[name="insurance2"][value="'+value.trim()+'"]');
  713. // 选中复选框
  714. checkbox.prop('checked', true);
  715. });
  716. }
  717. /*<![CDATA[*/
  718. var insuranceList = /*[[${insurance}]]*/ '';
  719. /*]]>*/
  720. if(insuranceList){
  721. check(insuranceList);
  722. }
  723. // 初始化时回显陪护人已选中的值
  724. function checkCaregiver(caregiverList) {
  725. var caregiver = caregiverList.split(',');
  726. $.each(caregiver, function(index, value) {
  727. var checkbox = $('input[name="caregiver"][value="'+value.trim()+'"]');
  728. checkbox.prop('checked', true);
  729. });
  730. }
  731. /*<![CDATA[*/
  732. var caregiverList = /*[[${caregiver}]]*/ '';
  733. /*]]>*/
  734. if(caregiverList){
  735. checkCaregiver(caregiverList);
  736. }
  737. // 初始化时回显睡眠状况已选中的值
  738. function checkSleepCondition(sleepConditionList) {
  739. var sleepCondition = sleepConditionList.split(',');
  740. $.each(sleepCondition, function(index, value) {
  741. var trimmedValue = value.trim();
  742. var checkbox = $('input[name="sleepCondition"][value="'+value.trim()+'"]');
  743. checkbox.prop('checked', true);
  744. });
  745. }
  746. /*<![CDATA[*/
  747. var sleepConditionList = /*[[${sleepCondition}]]*/ '';
  748. /*]]>*/
  749. if(sleepConditionList){
  750. checkSleepCondition(sleepConditionList);
  751. }
  752. // 初始化时回显饮食偏好已选中的值
  753. function checkDietaryPreference(dietaryPreferenceList) {
  754. var dietaryPreference = dietaryPreferenceList.split(',');
  755. $.each(dietaryPreference, function(index, value) {
  756. var trimmedValue = value.trim();
  757. var checkbox = $('input[name="dietaryPreference"][value="'+value.trim()+'"]');
  758. checkbox.prop('checked', true);
  759. });
  760. }
  761. /*<![CDATA[*/
  762. var dietaryPreferenceList = /*[[${dietaryPreference}]]*/ '';
  763. /*]]>*/
  764. if(dietaryPreferenceList){
  765. checkDietaryPreference(dietaryPreferenceList);
  766. }
  767. });
  768. });
  769. //初始化加载
  770. if(formSubmitted){
  771. //基本信息页面1
  772. function populateSelections(insuranceList) {
  773. var insurances = insuranceList.split(',');
  774. var selectedValuesDiv = $('#selected-values');
  775. selectedValuesDiv.empty(); // 清空之前的选中值
  776. $.each(insurances, function(index, value) {
  777. $('#insurance option[value="' + value + '"]').prop('selected', true);
  778. selectedValuesDiv.append('<span>' + value + '</span>');
  779. });
  780. }
  781. function updateSelectedValues() {
  782. var selectedValues = $('#insurance').val();
  783. var selectedValuesDiv = $('#selected-values');
  784. selectedValuesDiv.empty(); // 清空之前的选中值
  785. if (selectedValues) {
  786. $.each(selectedValues, function(index, value) {
  787. selectedValuesDiv.append('<span>' + value + '</span>');
  788. });
  789. }
  790. }
  791. /*<![CDATA[*/
  792. var insurance = /*[[${insurance}]]*/ '';
  793. /*]]>*/
  794. if(insurance){
  795. populateSelections(insurance);
  796. }
  797. // 绑定事件监听,当选择发生变化时更新显示的选中值
  798. $('#insurance').on('change', function() {
  799. updateSelectedValues();
  800. });
  801. /*<![CDATA[*/
  802. var contactsData = /*[[${contactsData}]]*/ '';
  803. /*]]>*/
  804. if(contactsData!==null) {
  805. // 遍历数据并动态生成表格行
  806. contactsData.forEach(function (item, index) {
  807. var row = '<tr>' +
  808. '<td>' + (index + 1) + '</td>' +
  809. '<td>' + item.contactPhone + '</td>' +
  810. '<td>' + item.contactName + '</td>' +
  811. '<td>' + item.contactRelationship + '</td>' +
  812. '<td><button class="btn-danger" onclick="deleteRow(this)">删除</button></td>' +
  813. '</tr>';
  814. $('#relationTableBody').append(row);
  815. });
  816. }
  817. /*<![CDATA[*/
  818. var recordsData = /*[[${recordsData}]]*/ '';
  819. /*]]>*/
  820. // 遍历数据并动态生成表格行
  821. if(recordsData!==null) {
  822. recordsData.forEach(function (item, index) {
  823. var row = '<tr>' +
  824. '<td>' + (index + 1) + '</td>' +
  825. '<td>' + item.medicationDescription + '</td>' +
  826. '<td>' + item.medicationType + '</td>' +
  827. '<td><button class="btn-danger" onclick="deleteRow(this)">删除</button></td>' +
  828. '</tr>';
  829. $('#yyqkTableBody').append(row);
  830. });
  831. }
  832. /*<![CDATA[*/
  833. var historyData = /*[[${historyData}]]*/ '';
  834. /*]]>*/
  835. // 遍历数据并动态生成表格行
  836. if(historyData!==null) {
  837. historyData.forEach(function (item, index) {
  838. var row = '<tr>' +
  839. '<td>' + (index + 1) + '</td>' +
  840. '<td>' + item.disease + '</td>' +
  841. '<td>' + item.member + '</td>' +
  842. '<td><button class="btn-danger" onclick="deleteRow(this)">删除</button></td>' +
  843. '</tr>';
  844. $('#familyHistoryTableBody').append(row);
  845. });
  846. }
  847. }
  848. // 绑定事件监听,当复选框状态改变时更新错误提示
  849. $('input[name="insurance2"]').on('change', function() {
  850. if ($('input[name="insurance2"]:checked').length > 0) {
  851. $('#insurance-error').hide();
  852. }
  853. });
  854. // 监听点击事件,激活指定的选项卡
  855. $('#myTabs li a').click(function(e) {
  856. // 阻止默认行为
  857. e.preventDefault();
  858. // 获取当前点击的选项卡链接
  859. var $this = $(this);
  860. // 移除所有选项卡的 active 类
  861. //$('#myTabs li').removeClass('active');
  862. //$('.tab-pane').removeClass('active in');
  863. $('#myTabs li a').addClass('active');
  864. // 添加 active 类到当前点击的选项卡
  865. $this.parent().addClass('active');
  866. // 获取目标选项卡面板的 ID
  867. var target = $this.attr('href');
  868. // 展示对应的选项卡面板,并更新 aria-expanded
  869. $(target).addClass('active in');
  870. $this.attr('aria-expanded', 'true');
  871. // 执行点击链接对应的动作
  872. $this.tab('show');
  873. // 移除所有选项卡的激活类
  874. //$('.active').removeClass('active');
  875. $(this).addClass('active');
  876. // 滚动到目标选项卡位置
  877. // 将目标内容区滚动到视口中央
  878. $('html, body').animate({
  879. scrollTop: $(target).offset().top - ($(window).height() / 2)
  880. }, 500); // 500毫秒动画时间
  881. // scrollToTab($this);
  882. // 重新初始化当前选项卡内的表格
  883. var tableId = target.replace('#', '');
  884. initializeTableForTab(tableId);
  885. });
  886. function initializeTables() {
  887. // 初始化所有表格
  888. //initializeTableForTab('tab-1');
  889. //initializeTableForTab('tab-2');
  890. initializeTableForTab('tab-3');
  891. /*initializeTableForTab('tab-4');
  892. initializeTableForTab('tab-5');*/
  893. }
  894. function initializeTableForTab(tabId) {
  895. var datas=[];
  896. debugger
  897. var tableId = 'bootstrap-table-' + tabId.substring(4);
  898. var tableElement = $('#' + tableId);
  899. var data = {
  900. "patientPhone": $('#phoneNumber').val(),
  901. "patientName": $('#name').val(),
  902. "id": $('#id').val(),
  903. };
  904. console.log("patientPhone="+$('#phoneNumber').val());
  905. // 初始化表格 getDrugPurchaseList
  906. $.ajax({
  907. cache : true,
  908. type : "POST",
  909. url : ctx + "dtp/pmService/getDrugPurchaseList",
  910. data : data,
  911. async : false,
  912. error : function(request) {
  913. $.modal.alertError("系统错误");
  914. },
  915. success : function(data) {
  916. datas=data.rows;
  917. $.operate.successCallback(data);
  918. }
  919. });
  920. tableElement.bootstrapTable({
  921. // 配置表格的相关属性
  922. // 例如数据源、列定义等
  923. // 示例配置
  924. data: datas,
  925. columns : [
  926. [
  927. {field: 'salesOrderNumber', title: '销售' },
  928. { field: 'prescriptionNumber', title: '处方编号' },
  929. { field: 'prescriptionDate', title: '处方日期' },
  930. { field: 'hospital', title: '医院' },
  931. { field: 'prescribingDoctor', title: '处方医生' },
  932. { field: 'department', title: '科室' },
  933. { field: 'attendingDoctor', title: '主管医生' }, // 注意这里使用的是 "attendingDoctor" 而不是 "attendingPhysician"
  934. { field: 'clinicalDiagnosis', title: '临床诊断' },
  935. { field: 'genericName', title: '药品通用名' },
  936. { field: 'productName', title: '商品名' },
  937. { field: 'medicationRoute', title: '用药途径' },
  938. { field: 'dosageFrequency', title: '用药频次' },
  939. { field: 'singleDoseUnit', title: '单次剂量' },
  940. { field: 'registrant', title: '登记人' },
  941. { field: 'registrationDate', title: '登记日期' },
  942. { field: 'saleDate', title: '销售日期' },
  943. { field: 'pharmacyName', title: '购药门店名称' }
  944. ]
  945. ]
  946. });
  947. }
  948. function scrollToTab(tabLink) {
  949. // 获取目标选项卡的位置
  950. var tabPos = tabLink.offset().top;
  951. //使用 scrollIntoView 方法滚动到目标位置
  952. //选项 { behavior: 'smooth' } 使滚动平滑
  953. window.scroll({
  954. top: tabPos,
  955. left: 0,
  956. behavior: 'smooth' // 平滑滚动
  957. });
  958. }
  959. $(function() {
  960. var optionsyygy = {
  961. url: prefix2 + "/list",
  962. showSearch: false,
  963. showRefresh: false,
  964. showToggle: false,
  965. showColumns: false,
  966. pagination: false,
  967. uniqueId: "userId",
  968. height: 400,
  969. columns: [{
  970. checkbox: true
  971. },
  972. {
  973. field : 'userId',
  974. title : '用户ID'
  975. },
  976. {
  977. field : 'userCode',
  978. title : '用户编号'
  979. },
  980. {
  981. field : 'userName',
  982. title : '用户姓名'
  983. },
  984. {
  985. field : 'userPhone',
  986. title : '用户手机'
  987. },
  988. {
  989. field : 'userEmail',
  990. title : '用户邮箱'
  991. },
  992. {
  993. field : 'userBalance',
  994. title : '用户余额'
  995. }]
  996. };
  997. $.table.init(optionsyygy);
  998. var optionssfjh = {
  999. url: prefix2 + "/list",
  1000. showSearch: false,
  1001. showRefresh: false,
  1002. showToggle: false,
  1003. showColumns: false,
  1004. pagination: false,
  1005. uniqueId: "userId",
  1006. height: 400,
  1007. columns: [{
  1008. checkbox: true
  1009. },
  1010. {
  1011. field : 'userId',
  1012. title : '用户ID'
  1013. },
  1014. {
  1015. field : 'userCode',
  1016. title : '用户编号'
  1017. },
  1018. {
  1019. field : 'userName',
  1020. title : '用户姓名'
  1021. },
  1022. {
  1023. field : 'userPhone',
  1024. title : '用户手机'
  1025. },
  1026. {
  1027. field : 'userEmail',
  1028. title : '用户邮箱'
  1029. },
  1030. {
  1031. field : 'userBalance',
  1032. title : '用户余额'
  1033. }]
  1034. };
  1035. $.table.init(optionssfjh);
  1036. var optionsregj = {
  1037. url: prefix2 + "/list",
  1038. showSearch: false,
  1039. showRefresh: false,
  1040. showToggle: false,
  1041. showColumns: false,
  1042. pagination: false,
  1043. uniqueId: "userId",
  1044. height: 400,
  1045. columns: [{
  1046. checkbox: true
  1047. },
  1048. {
  1049. field : 'userId',
  1050. title : '用户ID'
  1051. },
  1052. {
  1053. field : 'userCode',
  1054. title : '用户编号'
  1055. },
  1056. {
  1057. field : 'userName',
  1058. title : '用户姓名'
  1059. },
  1060. {
  1061. field : 'userPhone',
  1062. title : '用户手机'
  1063. },
  1064. {
  1065. field : 'userEmail',
  1066. title : '用户邮箱'
  1067. },
  1068. {
  1069. field : 'userBalance',
  1070. title : '用户余额'
  1071. }]
  1072. };
  1073. $.table.init(optionsregj);
  1074. });
  1075. /* 查询表格所有数据值 */
  1076. function getData(){
  1077. var data = $("#" + table.options.id).bootstrapTable('getData');
  1078. $.modal.alert(JSON.stringify(data))
  1079. }
  1080. /* 查询行ID值为1的数据 */
  1081. function getRowByUniqueId(){
  1082. var data = $("#" + table.options.id).bootstrapTable('getRowByUniqueId', 1);
  1083. $.modal.alert(JSON.stringify(data))
  1084. }
  1085. /* 查询表格选择行数据值 */
  1086. function getSelections(){
  1087. var data = $("#" + table.options.id).bootstrapTable('getSelections');
  1088. $.modal.alert(JSON.stringify(data))
  1089. }
  1090. function saveRow(button) {
  1091. if(button==1){
  1092. // 获取表单数据
  1093. var illness = document.getElementById('disease').value;
  1094. var familyMember = document.getElementById('member').value;
  1095. // 检查数据是否为空
  1096. if (!illness || !familyMember) {
  1097. $.modal.alert('请填写疾病和选择家庭成员!');
  1098. return;
  1099. }
  1100. // 创建新的表格行
  1101. var newRow = document.createElement('tr');
  1102. // 序号列
  1103. var serialNumberCell = document.createElement('td');
  1104. serialNumberCell.textContent = '1'; // 序号可以按需动态生成
  1105. newRow.appendChild(serialNumberCell);
  1106. // 疾病列
  1107. var illnessCell = document.createElement('td');
  1108. illnessCell.textContent = illness;
  1109. newRow.appendChild(illnessCell);
  1110. // 家庭成员列
  1111. var familyMemberCell = document.createElement('td');
  1112. familyMemberCell.textContent = familyMember;
  1113. newRow.appendChild(familyMemberCell);
  1114. // 修改 操作列
  1115. var actionCell = document.createElement('td');
  1116. // var editButton = document.createElement('button');
  1117. // editButton.textContent = '修改';
  1118. // editButton.onclick = function() { editRow(this);/* 复制逻辑 */ };
  1119. // actionCell.appendChild(editButton);
  1120. // var copyButton = document.createElement('button');
  1121. // copyButton.textContent = '复制';
  1122. // copyButton.onclick = function() { /* 复制逻辑 */ };
  1123. // actionCell.appendChild(copyButton);
  1124. var deleteButton = document.createElement('button');
  1125. deleteButton.textContent = '删除';
  1126. deleteButton.onclick = function() { deleteRow(this);/* 复制逻辑 */ };
  1127. actionCell.appendChild(deleteButton);
  1128. newRow.appendChild(actionCell);
  1129. // 将新行添加到表格的tbody中
  1130. var tableBody = document.querySelector('#familyHistoryTable tbody');
  1131. tableBody.appendChild(newRow);
  1132. // 清空表单输入框
  1133. document.getElementById('disease').value = '';
  1134. document.getElementById('member').selectedIndex = 0;
  1135. // 关闭模态框
  1136. $('#myModal').modal('hide');
  1137. }
  1138. if(button==2){
  1139. // 获取表单数据
  1140. var yyqk = document.getElementById('medication_description').value;
  1141. var yylx = document.getElementById('medication_type').value;
  1142. // 检查数据是否为空
  1143. if (!yyqk || !yylx) {
  1144. $.modal.alert('请填写用药情况和选择用药类型!');
  1145. return;
  1146. }
  1147. // 创建新的表格行
  1148. var newRow = document.createElement('tr');
  1149. // 序号列
  1150. var serialNumberCell = document.createElement('td');
  1151. serialNumberCell.textContent = '1'; // 序号可以按需动态生成
  1152. newRow.appendChild(serialNumberCell);
  1153. // 疾病列
  1154. var yyqkCell = document.createElement('td');
  1155. yyqkCell.textContent = yyqk;
  1156. newRow.appendChild(yyqkCell);
  1157. // 家庭成员列
  1158. var yylxCell = document.createElement('td');
  1159. yylxCell.textContent = yylx;
  1160. newRow.appendChild(yylxCell);
  1161. // 修改 操作列
  1162. var actionCell = document.createElement('td');
  1163. // var editButton = document.createElement('button');
  1164. // editButton.textContent = '修改';
  1165. // editButton.onclick = function() { editRow(this);/* 复制逻辑 */ };
  1166. // actionCell.appendChild(editButton);
  1167. //
  1168. // var copyButton = document.createElement('button');
  1169. // copyButton.textContent = '复制';
  1170. // copyButton.onclick = function() { /* 复制逻辑 */ };
  1171. // actionCell.appendChild(copyButton);
  1172. var deleteButton = document.createElement('button');
  1173. deleteButton.textContent = '删除';
  1174. deleteButton.onclick = function() { deleteRow(this);/* 复制逻辑 */ };
  1175. actionCell.appendChild(deleteButton);
  1176. newRow.appendChild(actionCell);
  1177. // 将新行添加到表格的tbody中
  1178. var tableBody = document.querySelector('#yyqkTable tbody');
  1179. tableBody.appendChild(newRow);
  1180. // 清空表单输入框
  1181. document.getElementById('medication_description').value = '';
  1182. document.getElementById('medication_type').selectedIndex = 0;
  1183. // 关闭模态框
  1184. $('#myModal2').modal('hide');
  1185. }
  1186. if(button==3){
  1187. // 获取表单数据 form-relation-add relationTable 联系人电话 lxrdh 联系人姓名 lxrxm 联系人关系 lxrgx
  1188. var lxrdh = document.getElementById('contact_phone').value;
  1189. var lxrxm = document.getElementById('contact_name').value;
  1190. var lxrgx = document.getElementById('contact_relationship').value;
  1191. // 检查数据是否为空
  1192. if (!lxrdh || !lxrxm || !lxrgx) {
  1193. $.modal.alert('请填写联系人姓名,联系人电话和选择家庭成员!');
  1194. return;
  1195. }
  1196. // 创建新的表格行
  1197. var newRow = document.createElement('tr');
  1198. // 序号列
  1199. var serialNumberCell = document.createElement('td');
  1200. serialNumberCell.textContent = '1'; // 序号可以按需动态生成
  1201. newRow.appendChild(serialNumberCell);
  1202. // 联系人电话列
  1203. var lxrdhCell = document.createElement('td');
  1204. lxrdhCell.textContent = lxrdh;
  1205. newRow.appendChild(lxrdhCell);
  1206. //联系人姓名列
  1207. var lxrxmCell = document.createElement('td');
  1208. lxrxmCell.textContent = lxrxm;
  1209. newRow.appendChild(lxrxmCell);
  1210. // 联系人关系列
  1211. var lxrgxCell = document.createElement('td');
  1212. lxrgxCell.textContent = lxrgx;
  1213. newRow.appendChild(lxrgxCell);
  1214. // 修改 操作列
  1215. var actionCell = document.createElement('td');
  1216. // var editButton = document.createElement('button');
  1217. // editButton.textContent = '修改';
  1218. // editButton.onclick = function() { editRow(this);/* 复制逻辑 */ };
  1219. // actionCell.appendChild(editButton);
  1220. //
  1221. // var copyButton = document.createElement('button');
  1222. // copyButton.textContent = '复制';
  1223. // copyButton.onclick = function() { /* 复制逻辑 */ };
  1224. // actionCell.appendChild(copyButton);
  1225. var deleteButton = document.createElement('button');
  1226. deleteButton.textContent = '删除';
  1227. deleteButton.onclick = function() { deleteRow(this);/* 复制逻辑 */ };
  1228. actionCell.appendChild(deleteButton);
  1229. newRow.appendChild(actionCell);
  1230. // 将新行添加到表格的tbody中
  1231. var tableBody = document.querySelector('#relationTable tbody');
  1232. tableBody.appendChild(newRow);
  1233. // 清空表单输入框
  1234. document.getElementById('contact_phone').value = '';
  1235. document.getElementById('contact_name').value = '';
  1236. document.getElementById('contact_relationship').selectedIndex = 0;
  1237. // 关闭模态框
  1238. $('#myModal3').modal('hide');
  1239. }
  1240. }
  1241. // 编辑模式标志
  1242. let isEditMode = false;
  1243. let currentRow = null;
  1244. function deleteRow(button) {
  1245. const row = button.parentNode.parentNode;
  1246. row.remove();
  1247. }
  1248. </script>
  1249. <style>
  1250. /* 添加一些基础样式 */
  1251. body {
  1252. font-family: Arial, sans-serif;
  1253. }
  1254. table {
  1255. width: 100%;
  1256. border-collapse: collapse;
  1257. }
  1258. th, td {
  1259. text-align: left;
  1260. padding: 8px;
  1261. border-bottom: 1px solid #ddd;
  1262. }
  1263. tr:nth-child(even) {
  1264. background-color: #f2f2f2;
  1265. }
  1266. .modal {
  1267. display: none;
  1268. position: fixed;
  1269. z-index: 1;
  1270. left: 0;
  1271. top: 0;
  1272. width: 100%;
  1273. height: 100%;
  1274. overflow: auto;
  1275. background-color: rgba(0,0,0,0.4);
  1276. }
  1277. .modal-content {
  1278. background-color: #fefefe;
  1279. margin: 15% auto;
  1280. padding: 20px;
  1281. border: 1px solid #888;
  1282. width: 80%;
  1283. }
  1284. .close {
  1285. color: #aaa;
  1286. float: right;
  1287. font-size: 28px;
  1288. font-weight: bold;
  1289. }
  1290. .close:hover,
  1291. .close:focus {
  1292. color: black;
  1293. text-decoration: none;
  1294. cursor: pointer;
  1295. }
  1296. .error-message {
  1297. color: red;
  1298. display: none;
  1299. }
  1300. </style>