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

PatientForm.vue 62KB

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