Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

PatientForm.vue 63KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879
  1. <template>
  2. <div class="main-contain">
  3. <el-dialog
  4. title="新增传染病检查"
  5. :visible.sync="dialogFormVisible"
  6. width="1000px"
  7. id="user-inspection-form"
  8. v-loading="formLoading"
  9. >
  10. <el-form :model="form" ref="form" label-position="top">
  11. <el-row>
  12. <el-col :span="1">&nbsp;</el-col>
  13. <template v-for="(item, index) in form.formItem">
  14. <el-col :span="7" :key="index">
  15. <el-form-item
  16. :label="item.item_name"
  17. v-if="item.range_type == 1"
  18. :key="item.item_id"
  19. :prop="'formItem.' + index + '.value'"
  20. >
  21. <el-input
  22. placeholder="请填入"
  23. v-model="item.value"
  24. style="width:95%"
  25. type="number"
  26. >
  27. <template slot="append">{{ item.unit }}</template>
  28. </el-input>
  29. </el-form-item>
  30. <el-form-item
  31. :label="item.item_name"
  32. v-else
  33. :key="item.item_id"
  34. :prop="'formItem.' + index + '.value'"
  35. >
  36. <el-select
  37. v-model="item.value"
  38. placeholder="请选择"
  39. style="width:95%"
  40. >
  41. <el-option
  42. v-for="(optionItem, oidex) in item.select_options"
  43. :key="oidex"
  44. :label="optionItem"
  45. :value="optionItem"
  46. ></el-option>
  47. </el-select>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="1" :key="'form-col' + index">&nbsp;</el-col>
  51. </template>
  52. </el-row>
  53. </el-form>
  54. <div slot="footer" class="dialog-footer">
  55. <el-button @click="dialogFormVisible = false">取 消</el-button>
  56. <el-button type="primary" @click="submitNew('form')">保 存</el-button>
  57. </div>
  58. </el-dialog>
  59. <div v-if="!isEdit" class="position">
  60. <bread-crumb :crumbs="crumbs"></bread-crumb>
  61. <div class style="float:right;color: white">
  62. <el-button
  63. :disabled="
  64. $store.getters.xt_user.subscibe.state == 3 || !subscibeFlag
  65. ? true
  66. : false
  67. "
  68. type="primary"
  69. v-if="this.isEdit == false"
  70. @click="resetForm('form')"
  71. icon="el-icon-circle-plus-outline"
  72. size="small"
  73. >新增</el-button
  74. >
  75. </div>
  76. </div>
  77. <div
  78. v-if="isEdit"
  79. class
  80. style="float:right;margin-right: 35px;margin-top: 10px"
  81. >
  82. <!-- <el-button @click="$router.back(-1)" icon="el-icon-refresh" size="small">取消</el-button>
  83. <el-button :disabled="$store.getters.xt_user.subscibe.state==3||!subscibeFlag?true:false" type="primary" v-if="this.isEdit==false" @click="resetForm('form')" icon="el-icon-circle-plus-outline" size="small">新增</el-button>
  84. <el-button :disabled="$store.getters.xt_user.subscibe.state==3||!subscibeFlag?true:false" @click="onSubmit('form')" size="small" type="success" icon="el-icon-setting" >保存</el-button>
  85. <el-button v-if="isEdit==false" @click="onReSubmit('form')" :disabled="$store.getters.xt_user.subscibe.state==3||!subscibeFlag?true:false" icon="el-icon-document-add" size="small" type="warning" >保存并继续新增</el-button>-->
  86. </div>
  87. <div class="app-container" v-loading="pageLoad">
  88. <el-form
  89. ref="form"
  90. :rules="rules"
  91. :model="form"
  92. label-width="124px"
  93. class="clearfix"
  94. popper-append-to-body="false"
  95. >
  96. <div class="dataTitle">一般资料</div>
  97. <el-row>
  98. <el-col :span="20" class="form-table">
  99. <el-row :span="20">
  100. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  101. <el-form-item label="姓名 : " class="is-required" prop="name">
  102. <el-input v-model="form.name"></el-input>
  103. </el-form-item>
  104. </el-col>
  105. <el-col
  106. :span="8"
  107. :style="isEdit ? 'width:360px' : ''"
  108. style="height:59px;"
  109. >
  110. <el-form-item label="性别 : " class="is-required" prop="gender">
  111. <el-radio-group v-model="form.gender" @change="changeGender">
  112. <el-radio
  113. v-for="item in sexOptions"
  114. :key="item.value"
  115. :label="item.value"
  116. :value="item.value"
  117. >{{ item.label }}</el-radio
  118. >
  119. </el-radio-group>
  120. </el-form-item>
  121. </el-col>
  122. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  123. <el-form-item
  124. label="身份证号 : "
  125. class="is-required"
  126. prop="idCardNo"
  127. >
  128. <el-input
  129. v-model="form.idCardNo"
  130. @blur="checkIdCardNo"
  131. ></el-input>
  132. </el-form-item>
  133. </el-col>
  134. <el-col
  135. :span="8"
  136. :style="isEdit ? 'width:360px' : ''"
  137. style="height:59px;"
  138. >
  139. <el-form-item label="年龄 : " class="is-required" prop="age">
  140. <el-input
  141. v-model="form.age"
  142. placeholder="请填写年龄"
  143. ></el-input>
  144. </el-form-item>
  145. </el-col>
  146. <template v-if="isEdit">
  147. <!-- <el-col :span="8" :style="isEdit?'width:360px':''">
  148. <el-form-item label="患者类型 : " class="is-required" >
  149. <el-select v-model="form.patientType" placeholder="请选择患者类型" disabled >
  150. <el-option v-for="item in styleOptions" :key="item.id" :label="item.name" :value="item.id"/>
  151. </el-select>
  152. </el-form-item>
  153. </el-col>-->
  154. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  155. <el-form-item label="透析号 : " class="is-required">
  156. <el-input
  157. v-model="form.dialysisNo"
  158. placeholder="填写或自动生成"
  159. style="width:62%;float:left;margin-right: 2%;"
  160. ></el-input>
  161. <!-- <el-button style="width:36%;padding:10px 0;" disabled type="primary">自动生成</el-button> -->
  162. </el-form-item>
  163. </el-col>
  164. </template>
  165. <template v-else>
  166. <!-- <el-col :span="8" >
  167. <el-form-item label="患者类型 : " class="is-required" prop="patientType">
  168. <el-select v-model="form.patientType" placeholder="请选择患者类型" >
  169. <el-option v-for="item in styleOptions" :key="item.id" :label="item.name" :value="item.id"/>
  170. </el-select>
  171. </el-form-item>
  172. </el-col>-->
  173. <el-col :span="8">
  174. <el-form-item
  175. label="透析号 : "
  176. class="is-required"
  177. prop="dialysisNo"
  178. >
  179. <el-input
  180. v-model="form.dialysisNo"
  181. placeholder="填写或自动生成"
  182. style="width:62%;float:left;margin-right: 2%;"
  183. ></el-input>
  184. <el-button
  185. style="width:35%;padding:10px 0;"
  186. :disabled="
  187. $store.getters.xt_user.subscibe.state == 3 ||
  188. !subscibeFlag
  189. ? true
  190. : false
  191. "
  192. type="primary"
  193. @click="generatedialysisno"
  194. >自动生成</el-button
  195. >
  196. </el-form-item>
  197. </el-col>
  198. </template>
  199. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  200. <el-form-item
  201. label="出生日期 : "
  202. class="is-required"
  203. prop="birth"
  204. >
  205. <el-date-picker
  206. v-model="form.birth"
  207. type="date"
  208. placeholder="选择日期"
  209. :suffix-icon="'el-icon-menu'"
  210. @change="hadSelectBirth"
  211. format="yyyy-MM-dd"
  212. value-format="yyyy-MM-dd"
  213. ></el-date-picker>
  214. </el-form-item>
  215. </el-col>
  216. <el-col :span="6" :style="isEdit ? 'width:380px' : ''">
  217. <el-form-item
  218. label="首次肾脏治疗时间:"
  219. prop="firstDialysisDate"
  220. label-width="150px"
  221. >
  222. <el-date-picker
  223. v-model="form.firstDialysisDate"
  224. type="date"
  225. format="yyyy-MM-dd"
  226. value-format="yyyy-MM-dd"
  227. ></el-date-picker>
  228. </el-form-item>
  229. </el-col>
  230. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  231. <el-form-item
  232. label="本人电话 : "
  233. class="is-required"
  234. prop="phone"
  235. >
  236. <el-input v-model="form.phone" maxlength="20"></el-input>
  237. </el-form-item>
  238. </el-col>
  239. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  240. <el-form-item label="家属姓名 : ">
  241. <el-input
  242. v-model="form.contact_name"
  243. maxlength="20"
  244. ></el-input>
  245. </el-form-item>
  246. </el-col>
  247. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  248. <el-form-item label="家属电话 : " prop="homeTelephone">
  249. <el-input
  250. v-model="form.homeTelephone"
  251. maxlength="20"
  252. ></el-input>
  253. </el-form-item>
  254. </el-col>
  255. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  256. <el-form-item
  257. label="患者来源 : "
  258. class="is-required"
  259. prop="source"
  260. >
  261. <el-radio-group v-model="form.source">
  262. <el-radio
  263. v-for="item in sourceOptions"
  264. :key="item.value"
  265. :label="item.value"
  266. :value="item.value"
  267. >{{ item.label }}</el-radio
  268. >
  269. </el-radio-group>
  270. </el-form-item>
  271. </el-col>
  272. <el-col :span="8">
  273. <el-form-item
  274. label="备注 : "
  275. prop="sch_remark">
  276. <el-input
  277. type="textarea"
  278. :rows="3"
  279. v-model="form.sch_remark"
  280. resize="none"
  281. placeholder
  282. ></el-input>
  283. </el-form-item>
  284. </el-col>
  285. <el-col :span="24" :style="isEdit ? 'width:360px' : ''" v-show="showLapseto">
  286. <el-form-item
  287. label="治疗状态(转归) : "
  288. class="is-required"
  289. prop="lapseto"
  290. >
  291. <el-radio-group v-model="form.lapseto">
  292. <el-radio
  293. v-for="item in lapsetoOptions"
  294. :key="item.value"
  295. :label="item.value"
  296. :value="item.value"
  297. >{{ item.label }}</el-radio
  298. >
  299. </el-radio-group>
  300. </el-form-item>
  301. </el-col>
  302. <el-col :span="8">
  303. <el-form-item label="传染病 : " prop="contagions">
  304. <el-radio-group v-model="form.is_infectious" @change="changeInfectious">
  305. <el-radio :label="1">阴性</el-radio>
  306. <el-radio :label="2">阳性</el-radio>
  307. </el-radio-group>
  308. <el-checkbox-group
  309. v-model="form.contagions"
  310. v-if="form.is_infectious == '2'"
  311. >
  312. <el-checkbox
  313. v-for="item in contagionList"
  314. v-if="item.type == 2"
  315. :label="item.id"
  316. :key="item.id"
  317. name="contagions"
  318. :value="item.id"
  319. >{{ item.name }}</el-checkbox
  320. >
  321. </el-checkbox-group>
  322. </el-form-item>
  323. </el-col>
  324. <el-col :span="8">
  325. <el-form-item label="疑难内瘘 : " prop="contagions">
  326. <el-radio-group v-model="form.troble_shoot">
  327. <el-radio :label="1">是</el-radio>
  328. <el-radio :label="2">否</el-radio>
  329. </el-radio-group>
  330. </el-form-item>
  331. </el-col>
  332. <el-col :span="16" v-if="!isEdit">
  333. <el-form-item label="检查结果日期 : ">
  334. <!--<el-date-picker v-model="form.record_date" type="date" placeholder="选择日期" :suffix-icon="'el-icon-menu'"-->
  335. <!--format="yyyy-MM-dd"-->
  336. <!--style="width: 200px;"-->
  337. <!--disabled-->
  338. <!--value-format="yyyy-MM-dd" v-if="isEdit"></el-date-picker>-->
  339. <el-date-picker
  340. v-model="form.record_date"
  341. type="date"
  342. placeholder="选择日期"
  343. :suffix-icon="'el-icon-menu'"
  344. format="yyyy-MM-dd"
  345. style="width: 200px;"
  346. value-format="yyyy-MM-dd"
  347. v-if="!isEdit"
  348. ></el-date-picker>
  349. <el-button
  350. type="primary"
  351. @click="recordCheck()"
  352. v-if="!isEdit"
  353. >录入检验检查</el-button
  354. >
  355. <!--<el-button type="primary" v-if="isEdit">查看检验检查</el-button>-->
  356. </el-form-item>
  357. </el-col>
  358. <el-col :span="24">
  359. <el-form-item label="传染病周期提醒:">
  360. <el-radio-group
  361. v-model="form.remind_cycle"
  362. @change="changeCycle()"
  363. >
  364. <el-radio :label="1">一月一次</el-radio>
  365. <el-radio :label="2">两月一次</el-radio>
  366. <el-radio :label="3">三月一次</el-radio>
  367. <el-radio :label="4">半年一次</el-radio>
  368. <el-radio :label="5">一年一次</el-radio>
  369. </el-radio-group>
  370. </el-form-item>
  371. </el-col>
  372. <el-col :span="24">
  373. <el-form-item label="诊断 : " prop="diagnose">
  374. <el-input
  375. type="textarea"
  376. :rows="3"
  377. v-model="form.diagnose"
  378. resize="none"
  379. placeholder
  380. ></el-input>
  381. </el-form-item>
  382. </el-col>
  383. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  384. <el-form-item label="民族 : " prop="nation">
  385. <el-input v-model="form.nation" maxlength="30"></el-input>
  386. </el-form-item>
  387. </el-col>
  388. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  389. <el-form-item label="籍贯 : " prop="native_place">
  390. <el-input
  391. v-model="form.native_place"
  392. maxlength="30"
  393. ></el-input>
  394. </el-form-item>
  395. </el-col>
  396. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  397. <el-form-item label="家庭住址 : " prop="homeAddress">
  398. <el-input v-model="form.homeAddress"></el-input>
  399. </el-form-item>
  400. </el-col>
  401. <div v-show="!generic_info_fold">
  402. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  403. <el-form-item label="别名 : " prop="alias">
  404. <el-input v-model="form.alias"></el-input>
  405. </el-form-item>
  406. </el-col>
  407. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  408. <el-form-item label="身高(cm) : " prop="height">
  409. <el-input
  410. maxlength="5"
  411. v-model="form.height"
  412. @change="checkHeight"
  413. ></el-input>
  414. </el-form-item>
  415. </el-col>
  416. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  417. <el-form-item label="婚姻状况 : " prop="maritalStatus">
  418. <el-select
  419. v-model="form.maritalStatus"
  420. placeholder="请选择婚姻状况"
  421. >
  422. <el-option
  423. v-for="item in maritalOptions"
  424. :key="item.id"
  425. :label="item.name"
  426. :value="item.id"
  427. />
  428. </el-select>
  429. </el-form-item>
  430. </el-col>
  431. <el-col
  432. :span="8"
  433. style="clearfix"
  434. :style="isEdit ? 'width:360px' : ''"
  435. >
  436. <el-form-item label="子女情况(个) : " prop="children">
  437. <el-input maxlength="5" v-model="form.children"></el-input>
  438. </el-form-item>
  439. <!-- <el-form-item label=" " style="float:left;" label-width="30px">
  440. </el-form-item>-->
  441. </el-col>
  442. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  443. <el-form-item label="住院(门诊)号 : ">
  444. <el-input v-model="form.admissionNumber"></el-input>
  445. </el-form-item>
  446. </el-col>
  447. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  448. <el-form-item label="医保类型 : " prop="reimbursementWayID">
  449. <el-select v-model="form.reimbursementWayID">
  450. <el-option
  451. v-for="item in wayOptions"
  452. :key="item.id"
  453. :label="item.name"
  454. :value="item.id"
  455. />
  456. </el-select>
  457. </el-form-item>
  458. </el-col>
  459. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  460. <el-form-item label="医保号 : " prop="healthCareNo">
  461. <el-input v-model="form.healthCareNo"></el-input>
  462. </el-form-item>
  463. </el-col>
  464. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  465. <el-form-item label="教育程度 : " prop="educationOptions">
  466. <el-select v-model="form.education">
  467. <el-option
  468. v-for="item in educationOptions"
  469. :key="item.id"
  470. :label="item.name"
  471. :value="item.id"
  472. />
  473. </el-select>
  474. </el-form-item>
  475. </el-col>
  476. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  477. <el-form-item label="固定电话 : ">
  478. <el-input
  479. v-model="form.tell_phone"
  480. maxlength="20"
  481. ></el-input>
  482. </el-form-item>
  483. </el-col>
  484. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  485. <el-form-item label="费别 : ">
  486. <el-select v-model="form.expense_kind">
  487. <el-option
  488. v-for="item in expenseOptions"
  489. :key="item.id"
  490. :label="item.name"
  491. :value="item.id"
  492. />
  493. </el-select>
  494. </el-form-item>
  495. </el-col>
  496. <el-col
  497. :span="8"
  498. :style="isEdit ? 'width:360px' : ''"
  499. style="height:59px;"
  500. >
  501. <el-form-item label="透析龄(月): ">
  502. <el-input v-model="form.dialysis_age"></el-input>
  503. </el-form-item>
  504. </el-col>
  505. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  506. <el-form-item label="亲友电话 : " prop="relative_phone">
  507. <el-input
  508. v-model="form.relative_phone"
  509. maxlength="20"
  510. ></el-input>
  511. </el-form-item>
  512. </el-col>
  513. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  514. <el-form-item label="亲友关系 : " prop="relative_relations">
  515. <el-input
  516. v-model="form.relative_relations"
  517. maxlength="20"
  518. ></el-input>
  519. </el-form-item>
  520. </el-col>
  521. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  522. <el-form-item label="职业 : " prop="profession">
  523. <el-select v-model="form.profession">
  524. <el-option
  525. v-for="item in professionOptions"
  526. :key="item.id"
  527. :label="item.name"
  528. :value="item.id"
  529. />
  530. </el-select>
  531. </el-form-item>
  532. </el-col>
  533. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  534. <el-form-item label="工作单位 : " prop="work">
  535. <el-input v-model="form.work"></el-input>
  536. </el-form-item>
  537. </el-col>
  538. <el-col :span="8" :style="isEdit ? 'width:360px' : ''">
  539. <el-form-item label="单位地址 : " prop="unit_address">
  540. <el-input v-model="form.unit_address"></el-input>
  541. </el-form-item>
  542. </el-col>
  543. </div>
  544. <el-col :span="24">
  545. <el-form-item>
  546. <el-button
  547. type="text"
  548. @click="generic_info_fold = !generic_info_fold"
  549. >
  550. {{ generic_info_fold ? "更多资料" : "收起" }}
  551. <i class="el-icon--right" :class="generic_fold_icon"></i>
  552. </el-button>
  553. </el-form-item>
  554. </el-col>
  555. </el-row>
  556. </el-col>
  557. <el-col :span="4" align="center">
  558. <el-upload
  559. style="width:100%;"
  560. :disabled="
  561. $store.getters.xt_user.subscibe.state == 3 || !subscibeFlag
  562. ? true
  563. : false
  564. "
  565. :data="uploadData"
  566. class="uploadHead"
  567. :multiple="false"
  568. action="https://upload.qiniup.com"
  569. :show-file-list="false"
  570. :on-error="handleAvatarError"
  571. :on-success="handleAvatarSuccess"
  572. list-type="picture-card"
  573. :before-upload="beforeAvatarUpload"
  574. >
  575. <img
  576. width="100%"
  577. height="100%"
  578. v-if="form.avatar"
  579. :src="form.avatar"
  580. class="avatar"
  581. />
  582. <i class="el-icon-plus" v-else></i>
  583. </el-upload>
  584. <el-dialog :visible.sync="dialogVisible">
  585. <img width="100%" :src="dialogImageUrl" alt />
  586. </el-dialog>
  587. <el-upload
  588. :disabled="
  589. $store.getters.xt_user.subscibe.state == 3 || !subscibeFlag
  590. ? true
  591. : false
  592. "
  593. :data="uploadData"
  594. :multiple="false"
  595. action="https://upload.qiniup.com"
  596. :show-file-list="false"
  597. :on-error="handleAvatarError"
  598. :on-success="handleAvatarSuccess"
  599. :before-upload="beforeAvatarUpload"
  600. >
  601. <el-button
  602. :disabled="
  603. $store.getters.xt_user.subscibe.state == 3 || !subscibeFlag
  604. ? true
  605. : false
  606. "
  607. class="uploadHeadBtn"
  608. type="primary"
  609. >上传头像</el-button
  610. >
  611. </el-upload>
  612. <el-form-item>
  613. <el-input
  614. v-model="form.avatar"
  615. type="hidden"
  616. placeholder
  617. ></el-input>
  618. </el-form-item>
  619. </el-col>
  620. </el-row>
  621. <div class="dataTitle">治疗信息</div>
  622. <el-row :span="24">
  623. <el-col :span="12">
  624. <el-form-item label="主诉 : " prop="patient_complains">
  625. <el-input
  626. type="textarea"
  627. :rows="3"
  628. v-model="form.patient_complains"
  629. resize="none"
  630. placeholder
  631. ></el-input>
  632. </el-form-item>
  633. </el-col>
  634. <el-col :span="12">
  635. <el-form-item label="现病史 : " prop="present_history">
  636. <el-input
  637. type="textarea"
  638. :rows="3"
  639. v-model="form.present_history"
  640. resize="none"
  641. placeholder
  642. ></el-input>
  643. </el-form-item>
  644. </el-col>
  645. <el-col :span="12">
  646. <el-form-item label="既往史 : " prop="past_history">
  647. <el-input
  648. type="textarea"
  649. :rows="3"
  650. v-model="form.past_history"
  651. resize="none"
  652. placeholder
  653. ></el-input>
  654. </el-form-item>
  655. </el-col>
  656. </el-row>
  657. <el-row :span="24">
  658. <el-col>
  659. <el-form-item label="体格检查">
  660. <el-input v-model="form.temperature" style="width: 200px;">
  661. <template slot="prepend"
  662. >体温:</template
  663. >
  664. <template slot="append"
  665. >℃</template
  666. >
  667. </el-input>
  668. <el-input v-model="form.pulse" style="width: 220px;">
  669. <template slot="prepend"
  670. >脉搏:</template
  671. >
  672. <template slot="append"
  673. >次/分</template
  674. >
  675. </el-input>
  676. <el-input v-model="form.respiratory" style="width: 220px;">
  677. <template slot="prepend"
  678. >呼吸:</template
  679. >
  680. <template slot="append"
  681. >次/分</template
  682. >
  683. </el-input>
  684. <!-- </el-form-item>
  685. <el-form-item>-->
  686. <el-input v-model="form.sbp" style="width: 240px;">
  687. <template slot="prepend"
  688. >收缩压:</template
  689. >
  690. <template slot="append"
  691. >mmHg</template
  692. >
  693. </el-input>
  694. <el-input v-model="form.dbp" style="width: 240px;">
  695. <template slot="prepend"
  696. >舒张压:</template
  697. >
  698. <template slot="append"
  699. >mmHg</template
  700. >
  701. </el-input>
  702. </el-form-item>
  703. </el-col>
  704. <el-col></el-col>
  705. <el-col :span="24">
  706. <el-form-item label prop="remark">
  707. <el-input
  708. type="textarea"
  709. :rows="3"
  710. v-model="form.remark"
  711. resize="none"
  712. placeholder
  713. ></el-input>
  714. </el-form-item>
  715. </el-col>
  716. <!--<el-col :span="24">-->
  717. <!--<el-form-item label="传染病 : " prop="checkContagions">-->
  718. <!--<el-checkbox-group v-model="form.contagions">-->
  719. <!--<el-checkbox v-for="item in contagionList" v-if="item.type==2" :label="item.id" :key="item.id"-->
  720. <!--:value="item.id">{{item.name}}-->
  721. <!--</el-checkbox>-->
  722. <!--</el-checkbox-group>-->
  723. <!--</el-form-item>-->
  724. <!--</el-col>-->
  725. <el-col :span="24">
  726. <el-form-item label="慢性病 : " prop="diseases">
  727. <el-checkbox-group v-model="form.diseases">
  728. <el-checkbox
  729. v-for="item in checkDisease"
  730. :label="item.id"
  731. :key="item.id"
  732. :value="item.id"
  733. >{{ item.name }}</el-checkbox
  734. >
  735. </el-checkbox-group>
  736. </el-form-item>
  737. </el-col>
  738. <div v-show="!treat_info_fold">
  739. <el-col :span="6" :style="isEdit ? 'width:360px' : ''">
  740. <el-form-item
  741. label="本院首次透析 : "
  742. prop="is_hospital_first_dialysis"
  743. >
  744. <el-radio-group v-model="form.is_hospital_first_dialysis">
  745. <el-radio
  746. v-for="item in isHospitalFirstDialysisOptions"
  747. :key="item.value"
  748. :label="item.value"
  749. :value="item.value"
  750. >{{ item.label }}</el-radio
  751. >
  752. </el-radio-group>
  753. </el-form-item>
  754. </el-col>
  755. <el-col :span="6" :style="isEdit ? 'width:360px' : ''">
  756. <el-form-item
  757. label="系统前透析次数 : "
  758. prop="user_sys_before_count"
  759. >
  760. <el-input v-model="form.user_sys_before_count"></el-input>
  761. </el-form-item>
  762. </el-col>
  763. <el-col :span="6" :style="isEdit ? 'width:360px' : ''">
  764. <el-form-item label="首次透析时间 : ">
  765. <el-date-picker
  766. v-model="form.first_treatment_date"
  767. type="date"
  768. format="yyyy-MM-dd"
  769. value-format="yyyy-MM-dd"
  770. ></el-date-picker>
  771. </el-form-item>
  772. </el-col>
  773. <el-col :span="6" :style="isEdit ? 'width:360px' : ''">
  774. <el-form-item
  775. label="首次透析医院 : "
  776. prop="first_dialysis_hospital"
  777. >
  778. <el-input v-model="form.first_dialysis_hospital"></el-input>
  779. </el-form-item>
  780. </el-col>
  781. <el-col :span="24">
  782. <el-form-item
  783. label="透析之前情况 : "
  784. prop="predialysis_condition"
  785. >
  786. <el-checkbox-group v-model="form.predialysis_condition">
  787. <el-checkbox
  788. v-for="item in predialysisConditionOptions"
  789. :label="item.label"
  790. :key="item.value"
  791. :value="item.label"
  792. >{{ item.label }}</el-checkbox
  793. >
  794. </el-checkbox-group>
  795. </el-form-item>
  796. </el-col>
  797. <el-col :span="6" :style="isEdit ? 'width:360px' : ''">
  798. <el-form-item
  799. label="本院前透析频率 : "
  800. prop="pre_hospital_dialysis_frequency"
  801. >
  802. <el-input
  803. v-model="form.pre_hospital_dialysis_frequency"
  804. ></el-input>
  805. </el-form-item>
  806. </el-col>
  807. <el-col :span="6" :style="isEdit ? 'width:360px' : ''">
  808. <el-form-item
  809. label="本院前透析次数 : "
  810. prop="pre_hospital_dialysis_times"
  811. >
  812. <el-input v-model="form.pre_hospital_dialysis_times"></el-input>
  813. </el-form-item>
  814. </el-col>
  815. <el-col :span="6" :style="isEdit ? 'width:360px' : ''">
  816. <el-form-item
  817. label="本院首次透析 : "
  818. prop="hospital_first_dialysis_date"
  819. >
  820. <el-date-picker
  821. v-model="form.hospital_first_dialysis_date"
  822. type="date"
  823. format="yyyy-MM-dd"
  824. value-format="yyyy-MM-dd"
  825. ></el-date-picker>
  826. </el-form-item>
  827. </el-col>
  828. </div>
  829. <el-col :span="24">
  830. <el-form-item>
  831. <el-button
  832. type="text"
  833. @click="treat_info_fold = !treat_info_fold"
  834. >
  835. {{ treat_info_fold ? "更多治疗信息" : "收起" }}
  836. <i class="el-icon--right" :class="treat_fold_icon"></i>
  837. </el-button>
  838. </el-form-item>
  839. </el-col>
  840. <el-col :span="24">
  841. <el-form-item label="登记人员 : ">
  842. <span>{{ adminusername }}</span>
  843. </el-form-item>
  844. </el-col>
  845. <el-col :span="24" align="right" class="newCol">
  846. <el-form-item>
  847. <el-button
  848. @click="$router.back(-1)"
  849. icon="el-icon-refresh"
  850. size="small"
  851. >取消</el-button
  852. >
  853. <el-button
  854. :disabled="
  855. $store.getters.xt_user.subscibe.state == 3 || !subscibeFlag
  856. ? true
  857. : false
  858. "
  859. @click="onSubmit('form')"
  860. size="small"
  861. type="primary"
  862. icon="el-icon-setting"
  863. >保存</el-button
  864. >
  865. <el-button
  866. v-if="isEdit == false"
  867. @click="onReSubmit('form')"
  868. :disabled="
  869. $store.getters.xt_user.subscibe.state == 3 || !subscibeFlag
  870. ? true
  871. : false
  872. "
  873. icon="el-icon-document-add"
  874. size="small"
  875. type="success"
  876. >保存并继续新增</el-button
  877. >
  878. </el-form-item>
  879. </el-col>
  880. </el-row>
  881. </el-form>
  882. </div>
  883. </div>
  884. </template>
  885. <script>
  886. import { getToken } from "@/api/qiniu";
  887. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  888. import {
  889. dialysisAge,
  890. getFileExtension,
  891. isCardNo,
  892. isPositiveInteger,
  893. jsGetAge,
  894. uParseTime
  895. } from "@/utils/tools";
  896. import {
  897. createPatient,
  898. editPatient,
  899. fetchPatient,
  900. generateDialysisNo,
  901. GetPatientTotal
  902. } from "@/api/patient";
  903. // import { fetchAllDoctorAndNurse } from "@/api/doctor";
  904. import { getDataConfig } from "@/utils/data";
  905. const defaultForm = {
  906. avatar: "https://images.shengws.com/201809182128111.png",
  907. name: "",
  908. alias: "",
  909. idCardNo: "",
  910. dialysisNo: "",
  911. gender: "",
  912. birth: "",
  913. nation: "",
  914. native_place: "",
  915. height: "",
  916. maritalStatus: "",
  917. children: "",
  918. admissionNumber: "",
  919. reimbursementWayID: "",
  920. healthCareNo: "",
  921. phone: "",
  922. homeTelephone: "",
  923. relative_phone: "",
  924. relative_relations: "",
  925. lapseto: "",
  926. homeAddress: "",
  927. work: "",
  928. unit_address: "",
  929. profession: "",
  930. education: "",
  931. source: "",
  932. is_hospital_first_dialysis: "",
  933. firstDialysisDate: "",
  934. first_dialysis_hospital: "",
  935. predialysis_condition: [],
  936. pre_hospital_dialysis_frequency: "",
  937. pre_hospital_dialysis_times: "",
  938. hospital_first_dialysis_date: "",
  939. contagions: [],
  940. diseases: [],
  941. remark: "",
  942. sch_remark:"",
  943. diagnose: "",
  944. is_infectious: 1,
  945. age: "",
  946. response_result: "",
  947. remind_cycle: 0,
  948. record_date: "",
  949. tell_phone: "",
  950. first_treatment_date: "",
  951. dialysis_age: "",
  952. expense_kind: "",
  953. contact_name: "",
  954. user_sys_before_count: "",
  955. troble_shoot:2,
  956. formItem: [
  957. {
  958. id: 0,
  959. item: "",
  960. item_id: 60,
  961. item_name: "丙型肝炎病毒核心抗体(AntiHCV)",
  962. project_id: 14,
  963. project_name: "传染病检查",
  964. range_type: 2,
  965. select_options: ["阴性", "阳性", "弱阳性"],
  966. unit: "",
  967. value: ""
  968. },
  969. {
  970. id: 0,
  971. item: "",
  972. item_id: 62,
  973. item_name: "乙型肝炎病毒表面抗原(HBsAg)",
  974. project_id: 14,
  975. project_name: "传染病检查",
  976. range_type: 2,
  977. select_options: ["阴性", "阳性", "弱阳性"],
  978. unit: "",
  979. value: ""
  980. },
  981. {
  982. id: 0,
  983. item: "",
  984. item_id: 63,
  985. item_name: "乙型肝炎病毒表面抗体(AntiHBs)",
  986. project_id: 14,
  987. project_name: "传染病检查",
  988. range_type: 2,
  989. select_options: ["阴性", "阳性", "弱阳性"],
  990. unit: "",
  991. value: ""
  992. },
  993. {
  994. id: 0,
  995. item: "",
  996. item_id: 64,
  997. item_name: "乙型肝炎病毒E抗原(HBeAg)",
  998. project_id: 14,
  999. project_name: "传染病检查",
  1000. range_type: 2,
  1001. select_options: ["阴性", "阳性", "弱阳性"],
  1002. unit: "",
  1003. value: ""
  1004. },
  1005. {
  1006. id: 0,
  1007. item: "",
  1008. item_id: 65,
  1009. item_name: "乙型肝炎病毒E抗体(AntiHBe)",
  1010. project_id: 14,
  1011. project_name: "传染病检查",
  1012. range_type: 2,
  1013. select_options: ["阴性", "阳性", "弱阳性"],
  1014. unit: "",
  1015. value: ""
  1016. },
  1017. {
  1018. id: 0,
  1019. item: "",
  1020. item_id: 66,
  1021. item_name: "乙型肝炎病毒核心抗体(AntiHBc)",
  1022. project_id: 14,
  1023. project_name: "传染病检查",
  1024. range_type: 2,
  1025. select_options: ["阴性", "阳性", "弱阳性"],
  1026. unit: "",
  1027. value: ""
  1028. },
  1029. {
  1030. id: 0,
  1031. item: "",
  1032. item_id: 111,
  1033. item_name: "HIV抗体",
  1034. project_id: 14,
  1035. project_name: "传染病检查",
  1036. range_type: 2,
  1037. select_options: ["阴性", "阳性", "弱阳性"],
  1038. unit: "",
  1039. value: ""
  1040. },
  1041. {
  1042. id: 0,
  1043. item: "",
  1044. item_id: 112,
  1045. item_name: "梅毒",
  1046. project_id: 14,
  1047. project_name: "传染病检查",
  1048. range_type: 2,
  1049. select_options: ["阴性", "阳性", "弱阳性"],
  1050. unit: "",
  1051. value: ""
  1052. },
  1053. {
  1054. id: 0,
  1055. item: "",
  1056. item_id: 178,
  1057. item_name: "乙型病毒DNA测定(HBVDNH)",
  1058. project_id: 14,
  1059. project_name: "传染病检查",
  1060. range_type: 1,
  1061. select_options: 0,
  1062. unit: "",
  1063. value: ""
  1064. },
  1065. {
  1066. id: 0,
  1067. item: "",
  1068. item_id: 179,
  1069. item_name: "丙型病毒DNA测定(HCVDNH",
  1070. project_id: 14,
  1071. project_name: "传染病检查",
  1072. range_type: 1,
  1073. select_options: 0,
  1074. unit: "",
  1075. value: ""
  1076. }
  1077. ],
  1078. // patientType: "",
  1079. // partition: "",
  1080. // bed: "",
  1081. // age: "",
  1082. // healthCareDueDate: "",
  1083. // blood: "",
  1084. // rh: "",
  1085. // healthCareDueAlertDate: "",
  1086. // receivingDate: "",
  1087. // dialysisAge: "",
  1088. // induction: "",
  1089. // initial: "",
  1090. // dialysisTotal: "",
  1091. // doctor: "",
  1092. // nurse: "",
  1093. // assessment: "",
  1094. patient_complains: "",
  1095. present_history: "",
  1096. past_history: "",
  1097. temperature: "",
  1098. pulse: "",
  1099. respiratory: "",
  1100. sbp: "",
  1101. dbp: "",
  1102. showOne:true,
  1103. };
  1104. export default {
  1105. name: "patientForm",
  1106. props: {
  1107. isEdit: {
  1108. type: Boolean,
  1109. default: false
  1110. }
  1111. },
  1112. data() {
  1113. var checkContagions = (rule, value, callback) => {
  1114. if (this.form.is_infectious == 0) {
  1115. return callback(new Error("至少选择一项传染病"));
  1116. }
  1117. if (this.form.is_infectious == "2" && value.length == 0) {
  1118. return callback(new Error("至少选择一项传染病"));
  1119. }
  1120. callback();
  1121. };
  1122. var checkPhone = (rule, value, callback) => {
  1123. if (value.length == 0) {
  1124. return callback(new Error("本人电话不能为空"));
  1125. }
  1126. if (
  1127. !value.match(
  1128. /^1\d{10}$/
  1129. )
  1130. ) {
  1131. return callback(new Error("请填写正确的电话(手机号码)"));
  1132. }
  1133. callback();
  1134. };
  1135. var checkFamilyPhone = (rule, value, callback) => {
  1136. if (value.length == 0) {
  1137. return callback(new Error("家属电话不能为空"));
  1138. }
  1139. if (
  1140. !value.match(
  1141. /^1\d{10}$/
  1142. )
  1143. ) {
  1144. return callback(new Error("请填写正确的电话(手机号码)"));
  1145. }
  1146. callback();
  1147. };
  1148. return {
  1149. crumbs: [
  1150. { path: false, name: "病人管理" },
  1151. { path: false, name: "新增病人" }
  1152. ],
  1153. generic_info_fold: true,
  1154. treat_info_fold: true,
  1155. patientTotal: 0,
  1156. pageLoad: true,
  1157. avatarFlag: false,
  1158. subscibeFlag: false,
  1159. orgname: "",
  1160. adminusername: "",
  1161. form: Object.assign({}, defaultForm),
  1162. formSubmit: true,
  1163. submitMethod: "",
  1164. uploadData: { token: "", key: "" },
  1165. dialogImageUrl: "",
  1166. qiniuDomain: "https://images.shengws.com/",
  1167. dialogVisible: false,
  1168. // typeOptions: null,
  1169. // styleOptions: null,
  1170. sourceOptions: [{ value: 1, label: "门诊" }, { value: 2, label: "住院" }],
  1171. lapsetoOptions: [
  1172. { value: 1, label: "留治" },
  1173. { value: 2, label: "转出" }
  1174. ],
  1175. // partitionOptions: null,
  1176. sexOptions: [{ value: 1, label: "男" }, { value: 2, label: "女" }],
  1177. isHospitalFirstDialysisOptions: [
  1178. { value: 1, label: "是" },
  1179. { value: 2, label: "否" }
  1180. ],
  1181. predialysisConditionOptions: [
  1182. { value: 1, label: "腹膜透析" },
  1183. { value: 2, label: "肾移植" }
  1184. ],
  1185. maritalOptions: null,
  1186. wayOptions: null,
  1187. educationOptions: null,
  1188. professionOptions: null,
  1189. // inductionOptions: null,
  1190. // doctorOptions: null,
  1191. // nurseOptions: null,
  1192. // rhOptions: null,
  1193. checkDisease: null,
  1194. contagionList: null,
  1195. dialogFormVisible: false,
  1196. loading: null,
  1197. submitMsg: "",
  1198. patientID: 0,
  1199. formLoading: false,
  1200. expenseOptions: [
  1201. { id: 1, name: "基本医保" },
  1202. { id: 2, name: "新农合" },
  1203. { id: 3, name: "自费医疗" },
  1204. { id: 4, name: "公费医疗" },
  1205. { id: 5, name: "商业保险" },
  1206. { id: 6, name: "军队医疗" },
  1207. { id: 7, name: "其他" }
  1208. ],
  1209. subscibe: {},
  1210. showLapseto:true,
  1211. rules: {
  1212. contagions: [
  1213. {
  1214. type: "array",
  1215. required: true,
  1216. trigger: "change",
  1217. validator: checkContagions
  1218. }
  1219. ],
  1220. patientType: [
  1221. { required: true, message: "请选择患者类型", trigger: "blur" }
  1222. ],
  1223. dialysisNo: [
  1224. { required: true, message: "请填写透析号", trigger: "blur" }
  1225. ],
  1226. phone: [{ validator: checkPhone, trigger: "blur" }],
  1227. source: [
  1228. { required: true, message: "请选择患者来源", trigger: "blur" }
  1229. ],
  1230. lapseto: [
  1231. { required: true, message: "请选择治疗状态", trigger: "blur" }
  1232. ],
  1233. name: [{ required: true, message: "请填写姓名", trigger: "blur" }],
  1234. gender: [{ required: true, message: "请选择性别", trigger: "blur" }],
  1235. idCardNo: [
  1236. { required: true, message: "请填写身份证号", trigger: "blur" }
  1237. ],
  1238. birth: [{ required: true, message: "请填写生日", trigger: "blur" }],
  1239. age: [{ required: true, message: "请填写年龄", trigger: "blur" }],
  1240. firstDialysisDate: [
  1241. { required: true, message: "请选择日期", trigger: "blur" }
  1242. ]
  1243. // homeTelephone: [{ validator: checkFamilyPhone, trigger: "blur" }],
  1244. // homeAddress: [{ required: true, message: "请填写住址", trigger: "blur" }],
  1245. }
  1246. };
  1247. },
  1248. components: {
  1249. BreadCrumb
  1250. },
  1251. computed: {
  1252. generic_fold_icon: function() {
  1253. return this.generic_info_fold ? "el-icon-arrow-down" : "el-icon-arrow-up";
  1254. },
  1255. treat_fold_icon: function() {
  1256. return this.treat_info_fold ? "el-icon-arrow-down" : "el-icon-arrow-up";
  1257. }
  1258. },
  1259. created() {
  1260. if(this.isEdit == true){
  1261. this.showLapseto = false
  1262. }
  1263. // this.styleOptions = this.$store.getters.patient_types;
  1264. // this.partitionOptions = this.$store.getters.partitions;
  1265. this.maritalOptions = getDataConfig("patient", "marital_options");
  1266. this.wayOptions = getDataConfig("patient", "reimbursement_ways");
  1267. // this.typeOptions = this.$store.getters.blood_types;
  1268. // this.rhOptions = this.$store.getters.rh;
  1269. this.educationOptions = getDataConfig("patient", "education_types");
  1270. this.professionOptions = getDataConfig("patient", "profession_options");
  1271. // this.inductionOptions = this.$store.getters.induction_options;
  1272. this.contagionList = this.$store.getters.contagions;
  1273. this.checkDisease = this.$store.getters.disease;
  1274. this.subscibe = this.$store.getters.xt_user.subscibe;
  1275. this.GetPatientTotal();
  1276. // this.fetchAllDoctorAndNurse();
  1277. this.pageLoad = false;
  1278. var xtuser = this.$store.getters.xt_user;
  1279. this.orgname = xtuser.org.org_name;
  1280. this.adminusername = xtuser.user.user_name;
  1281. if (this.isEdit) {
  1282. this.submitMsg = "修改患者信息成功";
  1283. const id = this.$route.params && this.$route.params.id;
  1284. this.patientID = parseInt(id);
  1285. if (isNaN(this.patientID) || this.patientID <= 0) {
  1286. this.$notify.error({
  1287. title: "错误",
  1288. message: "无效的id"
  1289. });
  1290. this.$router.back(-1);
  1291. }
  1292. this.fetchPatient(id);
  1293. this.avatarFlag = true;
  1294. } else {
  1295. this.submitMsg = "新增患者成功";
  1296. this.form = Object.assign({}, defaultForm);
  1297. this.form.lapseto = 1
  1298. }
  1299. },
  1300. watch: {
  1301. "form.record_date": function(val) {
  1302. console.log(val);
  1303. if (val == null || val == "") {
  1304. console.log("111111");
  1305. this.form.remind_cycle = "";
  1306. }
  1307. }
  1308. },
  1309. methods: {
  1310. recordCheck() {
  1311. if (this.form.record_date == "") {
  1312. this.$message.error("请先选择检验检查日期");
  1313. return;
  1314. } else {
  1315. this.dialogFormVisible = true;
  1316. }
  1317. },
  1318. GetPatientTotal() {
  1319. GetPatientTotal()
  1320. .then(response => {
  1321. if (response.data.state == 1) {
  1322. this.patientTotal = response.data.data.total;
  1323. this.subscibeFlag = true;
  1324. // if ((this.subscibe.state == 2 && this.patientTotal >= 100) || (this.subscibe.state == 1 && this.patientTotal >= 200)) {
  1325. // this.$alert('患者数已达到当前服务版本病人数,需要升级到更高的版本', '提示', {
  1326. // confirmButtonText: '确定',
  1327. // showClose: false,
  1328. // callback: action => {
  1329. // this.$router.push('/service/buy')
  1330. // }
  1331. // })
  1332. // } else {
  1333. // this.subscibeFlag = true
  1334. // }
  1335. } else {
  1336. this.$message.error(response.data.msg);
  1337. }
  1338. })
  1339. .catch(e => {});
  1340. },
  1341. changeGender(value) {
  1342. if (this.avatarFlag) {
  1343. return false;
  1344. }
  1345. if (value == 1) {
  1346. this.form.avatar = "https://images.shengws.com/201809182128111.png";
  1347. } else if (value == 2) {
  1348. this.form.avatar = "https://images.shengws.com/201809182128222.png";
  1349. } else {
  1350. }
  1351. },
  1352. resetForm(formName) {
  1353. this.$refs[formName].resetFields();
  1354. },
  1355. onReSubmit(formName) {
  1356. this.submitForm(formName, "renew");
  1357. },
  1358. onSubmit(formName) {
  1359. console.log("2222",this.form)
  1360. this.submitForm(formName, "redict");
  1361. },
  1362. submitForm(formName, action) {
  1363. if (!this.formSubmit) {
  1364. return false;
  1365. }
  1366. this.form.user_sys_before_count = this.form.user_sys_before_count.toString()
  1367. this.$refs[formName].validate(valid => {
  1368. if (valid) {
  1369. this.formSubmit = false;
  1370. if (this.isEdit) {
  1371. this.form.age = parseInt(this.form.age);
  1372. this.form.user_sys_before_count = this.form.user_sys_before_count.toString();
  1373. this.form.troble_shoot = parseInt(this.form.troble_shoot)
  1374. if(this.form.avatar.indexOf('?imageView2/2/w/500/h/500/q/90')!=-1){
  1375. this.form.avatar = this.form.avatar
  1376. }else{
  1377. this.form.avatar = this.form.avatar + "?imageView2/2/w/500/h/500/q/90"
  1378. }
  1379. console.log("form---",this.form)
  1380. editPatient(this.patientID, this.form)
  1381. .then(response => {
  1382. if (response.data.state == 0) {
  1383. this.$message.error(response.data.msg);
  1384. this.formSubmit = true;
  1385. return false;
  1386. } else {
  1387. this.formSubmit = false;
  1388. this.$notify({
  1389. title: "成功",
  1390. message: this.submitMsg,
  1391. type: "success",
  1392. duration: 2000
  1393. });
  1394. this.$refs[formName].resetFields();
  1395. if (action !== "renew") {
  1396. this.$router.back(-1);
  1397. }
  1398. this.formSubmit = true;
  1399. return false;
  1400. }
  1401. })
  1402. .catch(err => {
  1403. this.$message.error("网络异常");
  1404. this.formSubmit = true;
  1405. return false;
  1406. });
  1407. } else {
  1408. this.form.age = parseInt(this.form.age);
  1409. this.form.troble_shoot = parseInt(this.form.troble_shoot)
  1410. createPatient(this.form)
  1411. .then(response => {
  1412. if (response.data.state == 0) {
  1413. this.$message.error(response.data.msg);
  1414. this.formSubmit = true;
  1415. return false;
  1416. } else {
  1417. this.formSubmit = true;
  1418. this.$notify({
  1419. title: "成功",
  1420. message: this.submitMsg,
  1421. type: "success",
  1422. duration: 2000
  1423. });
  1424. this.$refs[formName].resetFields();
  1425. this.$store.dispatch("SetSubscibePatients");
  1426. var sub = this.$store.getters.xt_user.subscibe;
  1427. if (action !== "renew") {
  1428. this.$router.back(-1);
  1429. }
  1430. return false;
  1431. }
  1432. })
  1433. .catch(err => {
  1434. this.$message.error("网络异常");
  1435. this.formSubmit = true;
  1436. return false;
  1437. });
  1438. }
  1439. } else {
  1440. this.formSubmit = true;
  1441. return false;
  1442. }
  1443. });
  1444. },
  1445. handlePictureCardPreview(file) {
  1446. this.dialogImageUrl = file.url;
  1447. this.dialogVisible = true;
  1448. },
  1449. handleAvatarError(err, file, fileList) {
  1450. this.$message.error(err);
  1451. this.loading.close();
  1452. return false;
  1453. },
  1454. handleAvatarSuccess(res, file) {
  1455. // this.imageUrl = URL.createObjectURL(file.raw);
  1456. this.form.avatar = this.qiniuDomain + res.url +"?imageView2/2/w/500/h/500/q/90";
  1457. console.log("上传成功地址",this.form.avatar)
  1458. this.avatarFlag = true;
  1459. this.loading.close();
  1460. },
  1461. beforeAvatarUpload(file) {
  1462. // const isJPG = file.type === "image/jpeg";
  1463. var fileType = file.type;
  1464. const isJPG = fileType.indexOf("image") > -1;
  1465. const isLt2M = file.size / 1024 / 1024 < 6;
  1466. if (!isJPG) {
  1467. this.$message.error("只能上传图片");
  1468. return false;
  1469. }
  1470. if (!isLt2M) {
  1471. this.$message.error("上传头像图片大小不能超过 6MB!");
  1472. return false;
  1473. }
  1474. var date = new Date();
  1475. var ext = getFileExtension(file.name);
  1476. var key =
  1477. date.getFullYear() +
  1478. "/" +
  1479. (date.getMonth() + 1) +
  1480. "/" +
  1481. date.getDate() +
  1482. "/" +
  1483. date.getHours() +
  1484. "/" +
  1485. date.getMinutes() +
  1486. "/" +
  1487. date.getSeconds() +
  1488. "/" +
  1489. "_s_" +
  1490. file.uid +
  1491. "." +
  1492. ext;
  1493. this.loading = this.$loading({
  1494. lock: true,
  1495. text: "上传中...",
  1496. spinner: "el-icon-loading",
  1497. background: "rgba(0, 0, 0, 0.7)"
  1498. });
  1499. const _self = this;
  1500. return new Promise((resolve, reject) => {
  1501. getToken()
  1502. .then(response => {
  1503. const token = response.data.data.uptoken;
  1504. _self._data.uploadData.token = token;
  1505. _self._data.uploadData.key = key;
  1506. resolve(true);
  1507. })
  1508. .catch(err => {
  1509. console.log(err);
  1510. reject(false);
  1511. this.loading.close();
  1512. });
  1513. });
  1514. },
  1515. generatedialysisno() {
  1516. generateDialysisNo().then(response => {
  1517. this.form.dialysisNo = response.data.data.no + "";
  1518. });
  1519. },
  1520. checkIdCardNo() {
  1521. console.log(this.form.idCardNo);
  1522. if (!isCardNo(this.form.idCardNo)) {
  1523. this.$message.error("身份证号码信息有误!");
  1524. this.form.birth = "";
  1525. return false;
  1526. }
  1527. var thisLen = this.form.idCardNo.length;
  1528. var birth = "";
  1529. if (thisLen == 15) {
  1530. birth = "19" + this.form.idCardNo.substr(6, 6);
  1531. } else {
  1532. birth = this.form.idCardNo.substr(6, 8);
  1533. }
  1534. this.form.birth =
  1535. birth.substr(0, 4) +
  1536. "-" +
  1537. birth.substr(4, 2) +
  1538. "-" +
  1539. birth.substr(6, 2);
  1540. this.form.age = jsGetAge(this.form.birth, "-");
  1541. },
  1542. hadSelectBirth() {
  1543. this.form.age = jsGetAge(this.form.birth, "-");
  1544. },
  1545. checkHeight() {
  1546. if (!isPositiveInteger(this.form.height)) {
  1547. this.$message.error("身高请填写正整数!");
  1548. return false;
  1549. }
  1550. },
  1551. selectFirstDialysisDate() {
  1552. this.form.dialysisAge = dialysisAge(this.form.firstDialysisDate);
  1553. },
  1554. fetchPatient(id) {
  1555. fetchPatient(id)
  1556. .then(response => {
  1557. if (response.data.state == 1) {
  1558. this.$emit("tran-patient-info", response.data.data.patient);
  1559. var patietInfo = response.data.data.patient;
  1560. console.log("9999999",response.data.data.patient)
  1561. this.form.avatar = patietInfo.avatar;
  1562. this.form.name = patietInfo.name;
  1563. this.form.alias = patietInfo.alias;
  1564. this.form.idCardNo = patietInfo.id_card_no;
  1565. this.form.dialysisNo = patietInfo.dialysis_no;
  1566. this.form.gender = patietInfo.gender;
  1567. if (patietInfo.gender == 1 || patietInfo.gender == 2) {
  1568. this.form.gender = patietInfo.gender;
  1569. }
  1570. this.form.birth = uParseTime(patietInfo.birthday, "{y}-{m}-{d}");
  1571. this.form.nation = patietInfo.nation;
  1572. this.form.native_place = patietInfo.native_place;
  1573. this.form.height = patietInfo.height + "";
  1574. console.log(this.form.birth);
  1575. if (patietInfo.marital_status > 0) {
  1576. this.form.maritalStatus = patietInfo.marital_status;
  1577. }
  1578. this.form.children = patietInfo.children;
  1579. this.form.admissionNumber = patietInfo.admission_number;
  1580. if (patietInfo.reimbursement_way_id > 0) {
  1581. this.form.reimbursementWayID = patietInfo.reimbursement_way_id;
  1582. }
  1583. this.form.healthCareNo = patietInfo.health_care_no;
  1584. this.form.phone = patietInfo.phone;
  1585. this.form.homeTelephone = patietInfo.home_telephone;
  1586. this.form.relative_phone = patietInfo.relative_phone;
  1587. this.form.relative_relations = patietInfo.relative_relations;
  1588. this.form.homeAddress = patietInfo.home_address;
  1589. this.form.work = patietInfo.work_unit;
  1590. this.form.unit_address = patietInfo.unit_address;
  1591. this.form.user_sys_before_count = patietInfo.user_sys_before_count;
  1592. if (patietInfo.profession > 0) {
  1593. this.form.profession = patietInfo.profession;
  1594. }
  1595. if (patietInfo.education_level > 0) {
  1596. this.form.education = patietInfo.education_level;
  1597. }
  1598. if (patietInfo.source == 1 || patietInfo.source == 2) {
  1599. this.form.source = patietInfo.source;
  1600. }
  1601. if (patietInfo.lapseto == 1 || patietInfo.lapseto == 2 || patietInfo.lapseto == 3) {
  1602. this.form.lapseto = patietInfo.lapseto;
  1603. }
  1604. if (
  1605. patietInfo.is_hospital_first_dialysis == 1 ||
  1606. patietInfo.is_hospital_first_dialysis == 2
  1607. ) {
  1608. this.form.is_hospital_first_dialysis =
  1609. patietInfo.is_hospital_first_dialysis;
  1610. }
  1611. if (patietInfo.first_dialysis_date != 0) {
  1612. this.form.firstDialysisDate = uParseTime(
  1613. patietInfo.first_dialysis_date,
  1614. "{y}-{m}-{d}"
  1615. );
  1616. }
  1617. this.form.first_dialysis_hospital =
  1618. patietInfo.first_dialysis_hospital;
  1619. if (patietInfo.predialysis_condition.length > 0) {
  1620. this.form.predialysis_condition = patietInfo.predialysis_condition.split(
  1621. ","
  1622. );
  1623. }
  1624. this.form.pre_hospital_dialysis_frequency =
  1625. patietInfo.pre_hospital_dialysis_frequency;
  1626. this.form.pre_hospital_dialysis_times =
  1627. patietInfo.pre_hospital_dialysis_times;
  1628. if (patietInfo.hospital_first_dialysis_date != 0) {
  1629. this.form.hospital_first_dialysis_date = uParseTime(
  1630. patietInfo.hospital_first_dialysis_date,
  1631. "{y}-{m}-{d}"
  1632. );
  1633. }
  1634. this.form.contagions = response.data.data.contagions;
  1635. this.form.diseases = response.data.data.diseases;
  1636. this.form.remark = patietInfo.remark;
  1637. this.form.sch_remark = patietInfo.sch_remark;
  1638. this.form.diagnose = patietInfo.diagnose;
  1639. this.form.patient_complains = patietInfo.patient_complains;
  1640. this.form.present_history = patietInfo.present_history;
  1641. this.form.past_history = patietInfo.past_history;
  1642. this.form.temperature = patietInfo.temperature;
  1643. this.form.pulse = patietInfo.pulse;
  1644. this.form.respiratory = patietInfo.respiratory;
  1645. this.form.sbp = patietInfo.sbp;
  1646. this.form.dbp = patietInfo.dbp;
  1647. this.form.response_result = patietInfo.response_result;
  1648. this.form.remind_cycle = patietInfo.remind_cycle;
  1649. this.form.is_infectious = patietInfo.is_infectious;
  1650. if(this.form.is_infectious == 1){
  1651. this.form.remind_cycle = 0
  1652. }
  1653. this.form.tell_phone = patietInfo.tell_phone;
  1654. this.form.dialysis_age = patietInfo.dialysis_age;
  1655. this.form.contact_name = patietInfo.contact_name;
  1656. if (patietInfo.expense_kind == 0) {
  1657. this.form.expense_kind = "";
  1658. } else {
  1659. this.form.expense_kind = patietInfo.expense_kind;
  1660. }
  1661. this.form.first_treatment_date = uParseTime(
  1662. patietInfo.first_treatment_date,
  1663. "{y}-{m}-{d}"
  1664. );
  1665. if (patietInfo.age == 0) {
  1666. this.form.age = jsGetAge(this.form.birth, "-");
  1667. } else {
  1668. this.form.age = patietInfo.age;
  1669. }
  1670. // this.form.initial = patietInfo.initial_dialysis + "";
  1671. // this.form.dialysisTotal = patietInfo.total_dialysis + "";
  1672. // this.form.assessment = patietInfo.evaluate;
  1673. // if (patietInfo.patient_type > 0) {
  1674. // this.form.patientType = patietInfo.patient_type;
  1675. // }
  1676. // if (patietInfo.partition_id > 0) {
  1677. // this.form.partition = patietInfo.partition_id;
  1678. // }
  1679. // if (patietInfo.bed_id > 0) {
  1680. // this.form.bed = patietInfo.bed_id;
  1681. // }
  1682. // this.form.healthCareDueDate = uParseTime(
  1683. // patietInfo.health_care_due_date,
  1684. // "{y}-{m}-{d}"
  1685. // );
  1686. // if (patietInfo.blood_type > 0) {
  1687. // this.form.blood = patietInfo.blood_type;
  1688. // }
  1689. // if (patietInfo.rh > 0) {
  1690. // this.form.rh = patietInfo.rh;
  1691. // }
  1692. // this.form.healthCareDueAlertDate = uParseTime(
  1693. // patietInfo.health_care_due_alert_date,
  1694. // "{y}-{m}-{d}"
  1695. // );
  1696. // this.form.receivingDate = uParseTime(
  1697. // patietInfo.receiving_date,
  1698. // "{y}-{m}-{d}"
  1699. // );
  1700. // this.form.dialysisAge = dialysisAge(
  1701. // this.form.firstDialysisDate,
  1702. // "-"
  1703. // );
  1704. // if (patietInfo.induction_period > 0) {
  1705. // this.form.induction = patietInfo.induction_period;
  1706. // }
  1707. // if (patietInfo.attending_doctor_id > 0) {
  1708. // this.form.doctor = patietInfo.attending_doctor_id;
  1709. // }
  1710. // if (patietInfo.head_nurse_id > 0) {
  1711. // this.form.nurse = patietInfo.head_nurse_id;
  1712. // }
  1713. // if (patietInfo.registrars_id > 0) {
  1714. // this.form.registrars = patietInfo.registrars_id;
  1715. // }
  1716. this.checkIdCardNo();
  1717. } else {
  1718. this.$notify.error({
  1719. title: "错误",
  1720. message: "网络异常"
  1721. });
  1722. this.$router.back(-1);
  1723. }
  1724. // this.postForm = response.data
  1725. // // Just for test
  1726. // this.postForm.title += ` Article Id:${this.postForm.id}`
  1727. // this.postForm.content_short += ` Article Id:${this.postForm.id}`
  1728. })
  1729. .catch(err => {
  1730. this.$notify.error({
  1731. title: "错误",
  1732. message: "网络异常"
  1733. });
  1734. this.$router.back(-1);
  1735. });
  1736. },
  1737. submitNew(formName) {
  1738. this.dialogFormVisible = false;
  1739. },
  1740. changeCycle(val) {
  1741. if (!this.isEdit) {
  1742. if (this.form.record_date == "" || this.form.record_date == null) {
  1743. this.$message.error("请先选择检查结果日期");
  1744. this.form.remind_cycle = "";
  1745. return;
  1746. }
  1747. }
  1748. },
  1749. changeInfectious(val){
  1750. if(val == 1){
  1751. this.showOne = false
  1752. }
  1753. if(val == 2){
  1754. this.showOne = true
  1755. }
  1756. }
  1757. // fetchAllDoctorAndNurse() {
  1758. // fetchAllDoctorAndNurse().then(response => {
  1759. // if (response.data.state == 1) {
  1760. // this.doctorOptions = response.data.data.doctors;
  1761. // this.nurseOptions = response.data.data.nursers;
  1762. // }
  1763. // });
  1764. // }
  1765. }
  1766. };
  1767. </script>
  1768. <style rel="stylesheet/scss" lang="scss" scoped>
  1769. .uploadHeadBtn {
  1770. width: 148px;
  1771. margin-top: 10px;
  1772. }
  1773. .el-form {
  1774. .el-col-6,
  1775. .el-col-8 {
  1776. width: 430px;
  1777. height: 59px !important;
  1778. }
  1779. .el-form-item {
  1780. .el-select {
  1781. width: 100%;
  1782. }
  1783. .el-date-editor.el-input {
  1784. width: 100%;
  1785. }
  1786. .textarea {
  1787. width: 100%;
  1788. height: 70px;
  1789. border-color: #dcdfe6;
  1790. padding: 5px;
  1791. }
  1792. }
  1793. }
  1794. .el-select-dropdown {
  1795. z-index: 998 !important;
  1796. }
  1797. .newCol {
  1798. position: fixed;
  1799. bottom: 0;
  1800. right: 50px;
  1801. }
  1802. </style>