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