PatientForm.vue 61KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819
  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' : ''">
  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. /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/
  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. /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/
  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. rules: {
  1187. contagions: [
  1188. {
  1189. type: "array",
  1190. required: true,
  1191. trigger: "change",
  1192. validator: checkContagions
  1193. }
  1194. ],
  1195. patientType: [
  1196. { required: true, message: "请选择患者类型", trigger: "blur" }
  1197. ],
  1198. dialysisNo: [
  1199. { required: true, message: "请填写透析号", trigger: "blur" }
  1200. ],
  1201. phone: [{ validator: checkPhone, trigger: "blur" }],
  1202. source: [
  1203. { required: true, message: "请选择患者来源", trigger: "blur" }
  1204. ],
  1205. lapseto: [
  1206. { required: true, message: "请选择治疗状态", trigger: "blur" }
  1207. ],
  1208. name: [{ required: true, message: "请填写姓名", trigger: "blur" }],
  1209. gender: [{ required: true, message: "请选择性别", trigger: "blur" }],
  1210. idCardNo: [
  1211. { required: true, message: "请填写身份证号", trigger: "blur" }
  1212. ],
  1213. birth: [{ required: true, message: "请填写生日", trigger: "blur" }],
  1214. age: [{ required: true, message: "请填写年龄", trigger: "blur" }],
  1215. firstDialysisDate: [
  1216. { required: true, message: "请选择日期", trigger: "blur" }
  1217. ]
  1218. // homeTelephone: [{ validator: checkFamilyPhone, trigger: "blur" }],
  1219. // homeAddress: [{ required: true, message: "请填写住址", trigger: "blur" }],
  1220. }
  1221. };
  1222. },
  1223. components: {
  1224. BreadCrumb
  1225. },
  1226. computed: {
  1227. generic_fold_icon: function() {
  1228. return this.generic_info_fold ? "el-icon-arrow-down" : "el-icon-arrow-up";
  1229. },
  1230. treat_fold_icon: function() {
  1231. return this.treat_info_fold ? "el-icon-arrow-down" : "el-icon-arrow-up";
  1232. }
  1233. },
  1234. created() {
  1235. // this.styleOptions = this.$store.getters.patient_types;
  1236. // this.partitionOptions = this.$store.getters.partitions;
  1237. this.maritalOptions = getDataConfig("patient", "marital_options");
  1238. this.wayOptions = getDataConfig("patient", "reimbursement_ways");
  1239. // this.typeOptions = this.$store.getters.blood_types;
  1240. // this.rhOptions = this.$store.getters.rh;
  1241. this.educationOptions = getDataConfig("patient", "education_types");
  1242. this.professionOptions = getDataConfig("patient", "profession_options");
  1243. // this.inductionOptions = this.$store.getters.induction_options;
  1244. this.contagionList = this.$store.getters.contagions;
  1245. this.checkDisease = this.$store.getters.disease;
  1246. this.subscibe = this.$store.getters.xt_user.subscibe;
  1247. this.GetPatientTotal();
  1248. // this.fetchAllDoctorAndNurse();
  1249. this.pageLoad = false;
  1250. var xtuser = this.$store.getters.xt_user;
  1251. this.orgname = xtuser.org.org_name;
  1252. this.adminusername = xtuser.user.user_name;
  1253. if (this.isEdit) {
  1254. this.submitMsg = "修改患者信息成功";
  1255. const id = this.$route.params && this.$route.params.id;
  1256. this.patientID = parseInt(id);
  1257. if (isNaN(this.patientID) || this.patientID <= 0) {
  1258. this.$notify.error({
  1259. title: "错误",
  1260. message: "无效的id"
  1261. });
  1262. this.$router.back(-1);
  1263. }
  1264. this.fetchPatient(id);
  1265. this.avatarFlag = true;
  1266. } else {
  1267. this.submitMsg = "新增患者成功";
  1268. this.form = Object.assign({}, defaultForm);
  1269. }
  1270. },
  1271. watch: {
  1272. "form.record_date": function(val) {
  1273. console.log(val);
  1274. if (val == null || val == "") {
  1275. console.log("111111");
  1276. this.form.remind_cycle = "";
  1277. }
  1278. }
  1279. },
  1280. methods: {
  1281. recordCheck() {
  1282. if (this.form.record_date == "") {
  1283. this.$message.error("请先选择检验检查日期");
  1284. return;
  1285. } else {
  1286. this.dialogFormVisible = true;
  1287. }
  1288. },
  1289. GetPatientTotal() {
  1290. GetPatientTotal()
  1291. .then(response => {
  1292. if (response.data.state == 1) {
  1293. this.patientTotal = response.data.data.total;
  1294. this.subscibeFlag = true;
  1295. // if ((this.subscibe.state == 2 && this.patientTotal >= 100) || (this.subscibe.state == 1 && this.patientTotal >= 200)) {
  1296. // this.$alert('患者数已达到当前服务版本病人数,需要升级到更高的版本', '提示', {
  1297. // confirmButtonText: '确定',
  1298. // showClose: false,
  1299. // callback: action => {
  1300. // this.$router.push('/service/buy')
  1301. // }
  1302. // })
  1303. // } else {
  1304. // this.subscibeFlag = true
  1305. // }
  1306. } else {
  1307. this.$message.error(response.data.msg);
  1308. }
  1309. })
  1310. .catch(e => {});
  1311. },
  1312. changeGender(value) {
  1313. if (this.avatarFlag) {
  1314. return false;
  1315. }
  1316. if (value == 1) {
  1317. this.form.avatar = "https://images.shengws.com/201809182128111.png";
  1318. } else if (value == 2) {
  1319. this.form.avatar = "https://images.shengws.com/201809182128222.png";
  1320. } else {
  1321. }
  1322. },
  1323. resetForm(formName) {
  1324. this.$refs[formName].resetFields();
  1325. },
  1326. onReSubmit(formName) {
  1327. this.submitForm(formName, "renew");
  1328. },
  1329. onSubmit(formName) {
  1330. this.submitForm(formName, "redict");
  1331. },
  1332. submitForm(formName, action) {
  1333. if (!this.formSubmit) {
  1334. return false;
  1335. }
  1336. this.form.user_sys_before_count = this.form.user_sys_before_count.toString()
  1337. this.$refs[formName].validate(valid => {
  1338. if (valid) {
  1339. this.formSubmit = false;
  1340. if (this.isEdit) {
  1341. this.form.age = parseInt(this.form.age);
  1342. this.form.user_sys_before_count = this.form.user_sys_before_count.toString();
  1343. editPatient(this.patientID, this.form)
  1344. .then(response => {
  1345. if (response.data.state == 0) {
  1346. this.$message.error(response.data.msg);
  1347. this.formSubmit = true;
  1348. return false;
  1349. } else {
  1350. this.formSubmit = false;
  1351. this.$notify({
  1352. title: "成功",
  1353. message: this.submitMsg,
  1354. type: "success",
  1355. duration: 2000
  1356. });
  1357. this.$refs[formName].resetFields();
  1358. if (action !== "renew") {
  1359. this.$router.back(-1);
  1360. }
  1361. this.formSubmit = true;
  1362. return false;
  1363. }
  1364. })
  1365. .catch(err => {
  1366. this.$message.error("网络异常");
  1367. this.formSubmit = true;
  1368. return false;
  1369. });
  1370. } else {
  1371. this.form.age = parseInt(this.form.age);
  1372. createPatient(this.form)
  1373. .then(response => {
  1374. if (response.data.state == 0) {
  1375. this.$message.error(response.data.msg);
  1376. this.formSubmit = true;
  1377. return false;
  1378. } else {
  1379. this.formSubmit = true;
  1380. this.$notify({
  1381. title: "成功",
  1382. message: this.submitMsg,
  1383. type: "success",
  1384. duration: 2000
  1385. });
  1386. this.$refs[formName].resetFields();
  1387. this.$store.dispatch("SetSubscibePatients");
  1388. var sub = this.$store.getters.xt_user.subscibe;
  1389. if (action !== "renew") {
  1390. this.$router.back(-1);
  1391. }
  1392. return false;
  1393. }
  1394. })
  1395. .catch(err => {
  1396. this.$message.error("网络异常");
  1397. this.formSubmit = true;
  1398. return false;
  1399. });
  1400. }
  1401. } else {
  1402. this.formSubmit = true;
  1403. return false;
  1404. }
  1405. });
  1406. },
  1407. handlePictureCardPreview(file) {
  1408. this.dialogImageUrl = file.url;
  1409. this.dialogVisible = true;
  1410. },
  1411. handleAvatarError(err, file, fileList) {
  1412. this.$message.error(err);
  1413. this.loading.close();
  1414. return false;
  1415. },
  1416. handleAvatarSuccess(res, file) {
  1417. // this.imageUrl = URL.createObjectURL(file.raw);
  1418. this.form.avatar = this.qiniuDomain + res.url;
  1419. this.avatarFlag = true;
  1420. this.loading.close();
  1421. },
  1422. beforeAvatarUpload(file) {
  1423. // const isJPG = file.type === "image/jpeg";
  1424. var fileType = file.type;
  1425. const isJPG = fileType.indexOf("image") > -1;
  1426. const isLt2M = file.size / 1024 / 1024 < 2;
  1427. if (!isJPG) {
  1428. this.$message.error("只能上传图片");
  1429. return false;
  1430. }
  1431. if (!isLt2M) {
  1432. this.$message.error("上传头像图片大小不能超过 2MB!");
  1433. return false;
  1434. }
  1435. var date = new Date();
  1436. var ext = getFileExtension(file.name);
  1437. var key =
  1438. date.getFullYear() +
  1439. "/" +
  1440. (date.getMonth() + 1) +
  1441. "/" +
  1442. date.getDate() +
  1443. "/" +
  1444. date.getHours() +
  1445. "/" +
  1446. date.getMinutes() +
  1447. "/" +
  1448. date.getSeconds() +
  1449. "/" +
  1450. "_s_" +
  1451. file.uid +
  1452. "." +
  1453. ext;
  1454. this.loading = this.$loading({
  1455. lock: true,
  1456. text: "上传中...",
  1457. spinner: "el-icon-loading",
  1458. background: "rgba(0, 0, 0, 0.7)"
  1459. });
  1460. const _self = this;
  1461. return new Promise((resolve, reject) => {
  1462. getToken()
  1463. .then(response => {
  1464. const token = response.data.data.uptoken;
  1465. _self._data.uploadData.token = token;
  1466. _self._data.uploadData.key = key;
  1467. resolve(true);
  1468. })
  1469. .catch(err => {
  1470. console.log(err);
  1471. reject(false);
  1472. this.loading.close();
  1473. });
  1474. });
  1475. },
  1476. generatedialysisno() {
  1477. generateDialysisNo().then(response => {
  1478. this.form.dialysisNo = response.data.data.no + "";
  1479. });
  1480. },
  1481. checkIdCardNo() {
  1482. console.log(this.form.idCardNo);
  1483. if (!isCardNo(this.form.idCardNo)) {
  1484. this.$message.error("身份证号码信息有误!");
  1485. this.form.birth = "";
  1486. return false;
  1487. }
  1488. var thisLen = this.form.idCardNo.length;
  1489. var birth = "";
  1490. if (thisLen == 15) {
  1491. birth = "19" + this.form.idCardNo.substr(6, 6);
  1492. } else {
  1493. birth = this.form.idCardNo.substr(6, 8);
  1494. }
  1495. this.form.birth =
  1496. birth.substr(0, 4) +
  1497. "-" +
  1498. birth.substr(4, 2) +
  1499. "-" +
  1500. birth.substr(6, 2);
  1501. this.form.age = jsGetAge(this.form.birth, "-");
  1502. },
  1503. hadSelectBirth() {
  1504. this.form.age = jsGetAge(this.form.birth, "-");
  1505. },
  1506. checkHeight() {
  1507. if (!isPositiveInteger(this.form.height)) {
  1508. this.$message.error("身高请填写正整数!");
  1509. return false;
  1510. }
  1511. },
  1512. selectFirstDialysisDate() {
  1513. this.form.dialysisAge = dialysisAge(this.form.firstDialysisDate);
  1514. },
  1515. fetchPatient(id) {
  1516. fetchPatient(id)
  1517. .then(response => {
  1518. if (response.data.state == 1) {
  1519. this.$emit("tran-patient-info", response.data.data.patient);
  1520. var patietInfo = response.data.data.patient;
  1521. this.form.avatar = patietInfo.avatar;
  1522. this.form.name = patietInfo.name;
  1523. this.form.alias = patietInfo.alias;
  1524. this.form.idCardNo = patietInfo.id_card_no;
  1525. this.form.dialysisNo = patietInfo.dialysis_no;
  1526. this.form.gender = patietInfo.gender;
  1527. if (patietInfo.gender == 1 || patietInfo.gender == 2) {
  1528. this.form.gender = patietInfo.gender;
  1529. }
  1530. this.form.birth = uParseTime(patietInfo.birthday, "{y}-{m}-{d}");
  1531. this.form.nation = patietInfo.nation;
  1532. this.form.native_place = patietInfo.native_place;
  1533. this.form.height = patietInfo.height + "";
  1534. console.log(this.form.birth);
  1535. if (patietInfo.marital_status > 0) {
  1536. this.form.maritalStatus = patietInfo.marital_status;
  1537. }
  1538. this.form.children = patietInfo.children;
  1539. this.form.admissionNumber = patietInfo.admission_number;
  1540. if (patietInfo.reimbursement_way_id > 0) {
  1541. this.form.reimbursementWayID = patietInfo.reimbursement_way_id;
  1542. }
  1543. this.form.healthCareNo = patietInfo.health_care_no;
  1544. this.form.phone = patietInfo.phone;
  1545. this.form.homeTelephone = patietInfo.home_telephone;
  1546. this.form.relative_phone = patietInfo.relative_phone;
  1547. this.form.relative_relations = patietInfo.relative_relations;
  1548. this.form.homeAddress = patietInfo.home_address;
  1549. this.form.work = patietInfo.work_unit;
  1550. this.form.unit_address = patietInfo.unit_address;
  1551. this.form.user_sys_before_count = patietInfo.user_sys_before_count;
  1552. if (patietInfo.profession > 0) {
  1553. this.form.profession = patietInfo.profession;
  1554. }
  1555. if (patietInfo.education_level > 0) {
  1556. this.form.education = patietInfo.education_level;
  1557. }
  1558. if (patietInfo.source == 1 || patietInfo.source == 2) {
  1559. this.form.source = patietInfo.source;
  1560. }
  1561. if (patietInfo.lapseto == 1 || patietInfo.lapseto == 2) {
  1562. this.form.lapseto = patietInfo.lapseto;
  1563. }
  1564. if (
  1565. patietInfo.is_hospital_first_dialysis == 1 ||
  1566. patietInfo.is_hospital_first_dialysis == 2
  1567. ) {
  1568. this.form.is_hospital_first_dialysis =
  1569. patietInfo.is_hospital_first_dialysis;
  1570. }
  1571. if (patietInfo.first_dialysis_date != 0) {
  1572. this.form.firstDialysisDate = uParseTime(
  1573. patietInfo.first_dialysis_date,
  1574. "{y}-{m}-{d}"
  1575. );
  1576. }
  1577. this.form.first_dialysis_hospital =
  1578. patietInfo.first_dialysis_hospital;
  1579. if (patietInfo.predialysis_condition.length > 0) {
  1580. this.form.predialysis_condition = patietInfo.predialysis_condition.split(
  1581. ","
  1582. );
  1583. }
  1584. this.form.pre_hospital_dialysis_frequency =
  1585. patietInfo.pre_hospital_dialysis_frequency;
  1586. this.form.pre_hospital_dialysis_times =
  1587. patietInfo.pre_hospital_dialysis_times;
  1588. if (patietInfo.hospital_first_dialysis_date != 0) {
  1589. this.form.hospital_first_dialysis_date = uParseTime(
  1590. patietInfo.hospital_first_dialysis_date,
  1591. "{y}-{m}-{d}"
  1592. );
  1593. }
  1594. this.form.contagions = response.data.data.contagions;
  1595. this.form.diseases = response.data.data.diseases;
  1596. this.form.remark = patietInfo.remark;
  1597. this.form.diagnose = patietInfo.diagnose;
  1598. this.form.patient_complains = patietInfo.patient_complains;
  1599. this.form.present_history = patietInfo.present_history;
  1600. this.form.past_history = patietInfo.past_history;
  1601. this.form.temperature = patietInfo.temperature;
  1602. this.form.pulse = patietInfo.pulse;
  1603. this.form.respiratory = patietInfo.respiratory;
  1604. this.form.sbp = patietInfo.sbp;
  1605. this.form.dbp = patietInfo.dbp;
  1606. this.form.response_result = patietInfo.response_result;
  1607. this.form.remind_cycle = patietInfo.remind_cycle;
  1608. this.form.is_infectious = patietInfo.is_infectious;
  1609. this.form.tell_phone = patietInfo.tell_phone;
  1610. this.form.dialysis_age = patietInfo.dialysis_age;
  1611. this.form.contact_name = patietInfo.contact_name;
  1612. if (patietInfo.expense_kind == 0) {
  1613. this.form.expense_kind = "";
  1614. } else {
  1615. this.form.expense_kind = patietInfo.expense_kind;
  1616. }
  1617. this.form.first_treatment_date = uParseTime(
  1618. patietInfo.first_treatment_date,
  1619. "{y}-{m}-{d}"
  1620. );
  1621. if (patietInfo.age == 0) {
  1622. this.form.age = jsGetAge(this.form.birth, "-");
  1623. } else {
  1624. this.form.age = patietInfo.age;
  1625. }
  1626. // this.form.initial = patietInfo.initial_dialysis + "";
  1627. // this.form.dialysisTotal = patietInfo.total_dialysis + "";
  1628. // this.form.assessment = patietInfo.evaluate;
  1629. // if (patietInfo.patient_type > 0) {
  1630. // this.form.patientType = patietInfo.patient_type;
  1631. // }
  1632. // if (patietInfo.partition_id > 0) {
  1633. // this.form.partition = patietInfo.partition_id;
  1634. // }
  1635. // if (patietInfo.bed_id > 0) {
  1636. // this.form.bed = patietInfo.bed_id;
  1637. // }
  1638. // this.form.healthCareDueDate = uParseTime(
  1639. // patietInfo.health_care_due_date,
  1640. // "{y}-{m}-{d}"
  1641. // );
  1642. // if (patietInfo.blood_type > 0) {
  1643. // this.form.blood = patietInfo.blood_type;
  1644. // }
  1645. // if (patietInfo.rh > 0) {
  1646. // this.form.rh = patietInfo.rh;
  1647. // }
  1648. // this.form.healthCareDueAlertDate = uParseTime(
  1649. // patietInfo.health_care_due_alert_date,
  1650. // "{y}-{m}-{d}"
  1651. // );
  1652. // this.form.receivingDate = uParseTime(
  1653. // patietInfo.receiving_date,
  1654. // "{y}-{m}-{d}"
  1655. // );
  1656. // this.form.dialysisAge = dialysisAge(
  1657. // this.form.firstDialysisDate,
  1658. // "-"
  1659. // );
  1660. // if (patietInfo.induction_period > 0) {
  1661. // this.form.induction = patietInfo.induction_period;
  1662. // }
  1663. // if (patietInfo.attending_doctor_id > 0) {
  1664. // this.form.doctor = patietInfo.attending_doctor_id;
  1665. // }
  1666. // if (patietInfo.head_nurse_id > 0) {
  1667. // this.form.nurse = patietInfo.head_nurse_id;
  1668. // }
  1669. // if (patietInfo.registrars_id > 0) {
  1670. // this.form.registrars = patietInfo.registrars_id;
  1671. // }
  1672. this.checkIdCardNo();
  1673. } else {
  1674. this.$notify.error({
  1675. title: "错误",
  1676. message: "网络异常"
  1677. });
  1678. this.$router.back(-1);
  1679. }
  1680. // this.postForm = response.data
  1681. // // Just for test
  1682. // this.postForm.title += ` Article Id:${this.postForm.id}`
  1683. // this.postForm.content_short += ` Article Id:${this.postForm.id}`
  1684. })
  1685. .catch(err => {
  1686. this.$notify.error({
  1687. title: "错误",
  1688. message: "网络异常"
  1689. });
  1690. this.$router.back(-1);
  1691. });
  1692. },
  1693. submitNew(formName) {
  1694. this.dialogFormVisible = false;
  1695. },
  1696. changeCycle(val) {
  1697. if (!this.isEdit) {
  1698. if (this.form.record_date == "" || this.form.record_date == null) {
  1699. this.$message.error("请先选择检查结果日期");
  1700. this.form.remind_cycle = "";
  1701. return;
  1702. }
  1703. }
  1704. }
  1705. // fetchAllDoctorAndNurse() {
  1706. // fetchAllDoctorAndNurse().then(response => {
  1707. // if (response.data.state == 1) {
  1708. // this.doctorOptions = response.data.data.doctors;
  1709. // this.nurseOptions = response.data.data.nursers;
  1710. // }
  1711. // });
  1712. // }
  1713. }
  1714. };
  1715. </script>
  1716. <style rel="stylesheet/scss" lang="scss" scoped>
  1717. .uploadHeadBtn {
  1718. width: 148px;
  1719. margin-top: 10px;
  1720. }
  1721. .el-form {
  1722. .el-col-6,
  1723. .el-col-8 {
  1724. width: 430px;
  1725. height: 59px !important;
  1726. }
  1727. .el-form-item {
  1728. .el-select {
  1729. width: 100%;
  1730. }
  1731. .el-date-editor.el-input {
  1732. width: 100%;
  1733. }
  1734. .textarea {
  1735. width: 100%;
  1736. height: 70px;
  1737. border-color: #dcdfe6;
  1738. padding: 5px;
  1739. }
  1740. }
  1741. }
  1742. .el-select-dropdown {
  1743. z-index: 998 !important;
  1744. }
  1745. .newCol {
  1746. position: fixed;
  1747. bottom: 0;
  1748. right: 50px;
  1749. }
  1750. </style>