血透系统PC前端

PatientForm.vue 56KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421
  1. <template>
  2. <div class="main-contain">
  3. <el-dialog title="新增传染病检查" :visible.sync="dialogFormVisible" width="1000px" id="user-inspection-form" v-loading="formLoading">
  4. <el-form :model="form" ref="form" label-position="top">
  5. <el-row >
  6. <el-col :span="1">&nbsp;</el-col>
  7. <template v-for="(item, index) in form.formItem" >
  8. <el-col :span="7" :key="index">
  9. <el-form-item :label="item.item_name" v-if="item.range_type==1" :key="item.item_id" :prop="'formItem.' + index + '.value'"
  10. >
  11. <el-input placeholder="请填入" v-model="item.value" style="width:95%" type="number">
  12. <template slot="append">{{item.unit}}</template>
  13. </el-input>
  14. </el-form-item>
  15. <el-form-item :label="item.item_name" v-else :key="item.item_id" :prop="'formItem.' + index + '.value'"
  16. >
  17. <el-select v-model="item.value" placeholder="请选择" style="width:95%">
  18. <el-option
  19. v-for="(optionItem, oidex) in item.select_options"
  20. :key="oidex"
  21. :label="optionItem"
  22. :value="optionItem">
  23. </el-option>
  24. </el-select>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :span="1" :key="'form-col'+index">&nbsp;</el-col>
  28. </template>
  29. </el-row>
  30. </el-form>
  31. <div slot="footer" class="dialog-footer">
  32. <el-button @click="dialogFormVisible = false">取 消</el-button>
  33. <el-button type="primary" @click="submitNew('form')">保 存</el-button>
  34. </div>
  35. </el-dialog>
  36. <div v-if="!isEdit" class="position">
  37. <bread-crumb :crumbs='crumbs'></bread-crumb>
  38. <div class="" style="float:right;color: white">
  39. <el-button :disabled="$store.getters.xt_user.subscibe.state==3||!subscibeFlag?true:false" type="primary"
  40. v-if="this.isEdit==false" @click="resetForm('form')" icon="el-icon-circle-plus-outline" size="small">
  41. 新增
  42. </el-button>
  43. </div>
  44. </div>
  45. <div v-if="isEdit" class="" style="float:right;margin-right: 35px;margin-top: 10px">
  46. <!-- <el-button @click="$router.back(-1)" icon="el-icon-refresh" size="small">取消</el-button>
  47. <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>
  48. <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>
  49. <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> -->
  50. </div>
  51. <div class="app-container " v-loading="pageLoad">
  52. <el-form ref="form" :rules="rules" :model="form" label-width="124px" class="clearfix"
  53. popper-append-to-body="false">
  54. <div class="dataTitle">一般资料</div>
  55. <el-row>
  56. <el-col :span="20" class="form-table">
  57. <el-row :span="20">
  58. <el-col :span="8" :style="isEdit?'width:360px':''">
  59. <el-form-item label="姓名 : " class="is-required" prop="name">
  60. <el-input v-model="form.name"></el-input>
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="8" :style="isEdit?'width:360px':''" style="height:59px;">
  64. <el-form-item label="性别 : " class="is-required" prop="gender">
  65. <el-radio-group v-model="form.gender" @change="changeGender">
  66. <el-radio v-for="item in sexOptions" :key="item.value" :label="item.value" :value="item.value">
  67. {{item.label}}
  68. </el-radio>
  69. </el-radio-group>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :span="8" :style="isEdit?'width:360px':''">
  73. <el-form-item label="身份证号 : " class="is-required" prop="idCardNo">
  74. <el-input v-model="form.idCardNo" @blur="checkIdCardNo"></el-input>
  75. </el-form-item>
  76. </el-col>
  77. <el-col :span="8" :style="isEdit?'width:360px':''" style="height:59px;">
  78. <el-form-item label="年龄 : " class="is-required" prop="age">
  79. <el-input v-model="form.age" placeholder="请填写年龄"></el-input>
  80. </el-form-item>
  81. </el-col>
  82. <template v-if="isEdit">
  83. <!-- <el-col :span="8" :style="isEdit?'width:360px':''">
  84. <el-form-item label="患者类型 : " class="is-required" >
  85. <el-select v-model="form.patientType" placeholder="请选择患者类型" disabled >
  86. <el-option v-for="item in styleOptions" :key="item.id" :label="item.name" :value="item.id"/>
  87. </el-select>
  88. </el-form-item>
  89. </el-col> -->
  90. <el-col :span="8" :style="isEdit?'width:360px':''">
  91. <el-form-item label="透析号 : " class="is-required">
  92. <el-input v-model="form.dialysisNo" placeholder="填写或自动生成"
  93. style="width:62%;float:left;margin-right: 2%;"></el-input>
  94. <!-- <el-button style="width:36%;padding:10px 0;" disabled type="primary">自动生成</el-button> -->
  95. </el-form-item>
  96. </el-col>
  97. </template>
  98. <template v-else>
  99. <!-- <el-col :span="8" >
  100. <el-form-item label="患者类型 : " class="is-required" prop="patientType">
  101. <el-select v-model="form.patientType" placeholder="请选择患者类型" >
  102. <el-option v-for="item in styleOptions" :key="item.id" :label="item.name" :value="item.id"/>
  103. </el-select>
  104. </el-form-item>
  105. </el-col> -->
  106. <el-col :span="8">
  107. <el-form-item label="透析号 : " class="is-required" prop="dialysisNo">
  108. <el-input v-model="form.dialysisNo" placeholder="填写或自动生成"
  109. style="width:62%;float:left;margin-right: 2%;"></el-input>
  110. <el-button style="width:36%;padding:10px 0;"
  111. :disabled="$store.getters.xt_user.subscibe.state==3||!subscibeFlag?true:false"
  112. type="primary" @click="generatedialysisno">自动生成
  113. </el-button>
  114. </el-form-item>
  115. </el-col>
  116. </template>
  117. <el-col :span="8" :style="isEdit?'width:360px':''">
  118. <el-form-item label="出生日期 : " class="is-required" prop="birth">
  119. <el-date-picker v-model="form.birth" type="date" placeholder="选择日期" :suffix-icon="'el-icon-menu'"
  120. @change="hadSelectBirth" format="yyyy-MM-dd"
  121. value-format="yyyy-MM-dd"></el-date-picker>
  122. </el-form-item>
  123. </el-col>
  124. <el-col :span="6" :style="isEdit?'width:380px':''">
  125. <el-form-item label="首次肾脏治疗时间:" prop="firstDialysisDate" label-width="150px">
  126. <el-date-picker v-model="form.firstDialysisDate" type="date" format="yyyy-MM-dd"
  127. value-format="yyyy-MM-dd"></el-date-picker>
  128. </el-form-item>
  129. </el-col>
  130. <el-col :span="8" :style="isEdit?'width:360px':''">
  131. <el-form-item label="本人电话 : " class="is-required" prop="phone">
  132. <el-input v-model="form.phone" maxlength="20"></el-input>
  133. </el-form-item>
  134. </el-col>
  135. <el-col :span="8" :style="isEdit?'width:360px':''">
  136. <el-form-item label="家属姓名 : ">
  137. <el-input v-model="form.contact_name" maxlength="20"></el-input>
  138. </el-form-item>
  139. </el-col>
  140. <el-col :span="8" :style="isEdit?'width:360px':''">
  141. <el-form-item label="家属电话 : " prop="homeTelephone">
  142. <el-input v-model="form.homeTelephone" maxlength="20"></el-input>
  143. </el-form-item>
  144. </el-col>
  145. <el-col :span="8" :style="isEdit?'width:360px':''">
  146. <el-form-item label="患者来源 : " class="is-required" prop="source">
  147. <el-radio-group v-model="form.source">
  148. <el-radio v-for="item in sourceOptions" :key="item.value" :label="item.value" :value="item.value">
  149. {{item.label}}
  150. </el-radio>
  151. </el-radio-group>
  152. </el-form-item>
  153. </el-col>
  154. <el-col :span="8" :style="isEdit?'width:360px':''">
  155. <el-form-item label="治疗状态(转归) : " class="is-required" prop="lapseto">
  156. <el-radio-group v-model="form.lapseto">
  157. <el-radio v-for="item in lapsetoOptions" :key="item.value" :label="item.value" :value="item.value">
  158. {{item.label}}
  159. </el-radio>
  160. </el-radio-group>
  161. </el-form-item>
  162. </el-col>
  163. <el-col :span="24">
  164. <el-form-item label="传染病 : " prop="contagions">
  165. <el-radio-group v-model="form.is_infectious">
  166. <el-radio :label="1">无</el-radio>
  167. <el-radio :label="2">有</el-radio>
  168. </el-radio-group>
  169. <el-checkbox-group v-model="form.contagions" v-if="form.is_infectious == '2'">
  170. <el-checkbox v-for="item in contagionList" v-if="item.type==2" :label="item.id" :key="item.id" name="contagions"
  171. :value="item.id">{{item.name}}
  172. </el-checkbox>
  173. </el-checkbox-group>
  174. </el-form-item>
  175. </el-col>
  176. <el-col :span="16" v-if="!isEdit">
  177. <el-form-item label="检查结果日期 : " >
  178. <!--<el-date-picker v-model="form.record_date" type="date" placeholder="选择日期" :suffix-icon="'el-icon-menu'"-->
  179. <!--format="yyyy-MM-dd"-->
  180. <!--style="width: 200px;"-->
  181. <!--disabled-->
  182. <!--value-format="yyyy-MM-dd" v-if="isEdit"></el-date-picker>-->
  183. <el-date-picker v-model="form.record_date" type="date" placeholder="选择日期" :suffix-icon="'el-icon-menu'"
  184. format="yyyy-MM-dd"
  185. style="width: 200px;"
  186. value-format="yyyy-MM-dd" v-if="!isEdit"></el-date-picker>
  187. <el-button type="primary" @click="recordCheck()" v-if="!isEdit">录入检验检查</el-button>
  188. <!--<el-button type="primary" v-if="isEdit">查看检验检查</el-button>-->
  189. </el-form-item>
  190. </el-col>
  191. <el-col :span="24">
  192. <el-form-item label="传染病周期提醒: " >
  193. <el-radio-group v-model="form.remind_cycle" @change="changeCycle()">
  194. <el-radio :label="1">一月一次</el-radio>
  195. <el-radio :label="2">两月一次</el-radio>
  196. <el-radio :label="3">三月一次</el-radio>
  197. <el-radio :label="4">半年一次</el-radio>
  198. <el-radio :label="5">一年一次</el-radio>
  199. </el-radio-group>
  200. </el-form-item>
  201. </el-col>
  202. <el-col :span="24">
  203. <el-form-item label="诊断 : " prop="diagnose">
  204. <el-input type="textarea" :rows="3" v-model="form.diagnose" resize="none" placeholder=""></el-input>
  205. </el-form-item>
  206. </el-col>
  207. <el-col :span="8" :style="isEdit?'width:360px':''">
  208. <el-form-item label="民族 : " prop="nation">
  209. <el-input v-model="form.nation" maxlength="30"></el-input>
  210. </el-form-item>
  211. </el-col>
  212. <el-col :span="8" :style="isEdit?'width:360px':''">
  213. <el-form-item label="籍贯 : " prop="native_place">
  214. <el-input v-model="form.native_place" maxlength="30"></el-input>
  215. </el-form-item>
  216. </el-col>
  217. <el-col :span="8" :style="isEdit?'width:360px':''">
  218. <el-form-item label="家庭住址 : " prop="homeAddress">
  219. <el-input v-model="form.homeAddress"></el-input>
  220. </el-form-item>
  221. </el-col>
  222. <div v-show="!generic_info_fold">
  223. <el-col :span="8" :style="isEdit?'width:360px':''">
  224. <el-form-item label="别名 : " prop="alias">
  225. <el-input v-model="form.alias"></el-input>
  226. </el-form-item>
  227. </el-col>
  228. <el-col :span="8" :style="isEdit?'width:360px':''">
  229. <el-form-item label="身高(cm) : " prop="height">
  230. <el-input maxlength="5" v-model="form.height" @change="checkHeight"></el-input>
  231. </el-form-item>
  232. </el-col>
  233. <el-col :span="8" :style="isEdit?'width:360px':''">
  234. <el-form-item label="婚姻状况 : " prop="maritalStatus">
  235. <el-select v-model="form.maritalStatus" placeholder="请选择婚姻状况">
  236. <el-option v-for="item in maritalOptions" :key="item.id" :label="item.name" :value="item.id"/>
  237. </el-select>
  238. </el-form-item>
  239. </el-col>
  240. <el-col :span="8" style="clearfix" :style="isEdit?'width:360px':''">
  241. <el-form-item label="子女情况(个) : " prop="children">
  242. <el-input maxlength="5" v-model="form.children"></el-input>
  243. </el-form-item>
  244. <!-- <el-form-item label=" " style="float:left;" label-width="30px">
  245. </el-form-item> -->
  246. </el-col>
  247. <el-col :span="8" :style="isEdit?'width:360px':''">
  248. <el-form-item label="住院(门诊)号 : ">
  249. <el-input v-model="form.admissionNumber"></el-input>
  250. </el-form-item>
  251. </el-col>
  252. <el-col :span="8" :style="isEdit?'width:360px':''">
  253. <el-form-item label="医保类型 : " prop="reimbursementWayID">
  254. <el-select v-model="form.reimbursementWayID">
  255. <el-option v-for="item in wayOptions" :key="item.id" :label="item.name" :value="item.id"/>
  256. </el-select>
  257. </el-form-item>
  258. </el-col>
  259. <el-col :span="8" :style="isEdit?'width:360px':''">
  260. <el-form-item label="医保号 : " prop="healthCareNo">
  261. <el-input v-model="form.healthCareNo"></el-input>
  262. </el-form-item>
  263. </el-col>
  264. <el-col :span="8" :style="isEdit?'width:360px':''">
  265. <el-form-item label="教育程度 : " prop="educationOptions">
  266. <el-select v-model="form.education">
  267. <el-option v-for="item in educationOptions" :key="item.id" :label="item.name" :value="item.id"/>
  268. </el-select>
  269. </el-form-item>
  270. </el-col>
  271. <el-col :span="8" :style="isEdit?'width:360px':''">
  272. <el-form-item label="固定电话 : ">
  273. <el-input v-model="form.tell_phone" maxlength="20"></el-input>
  274. </el-form-item>
  275. </el-col>
  276. <el-col :span="8" :style="isEdit?'width:360px':''">
  277. <el-form-item label="费别 : ">
  278. <el-select v-model="form.expense_kind">
  279. <el-option v-for="item in expenseOptions" :key="item.id" :label="item.name" :value="item.id"/>
  280. </el-select>
  281. </el-form-item>
  282. </el-col>
  283. <el-col :span="8" :style="isEdit?'width:360px':''" style="height:59px;">
  284. <el-form-item label="透析龄(月): ">
  285. <el-input v-model="form.dialysis_age" ></el-input>
  286. </el-form-item>
  287. </el-col>
  288. <el-col :span="8" :style="isEdit?'width:360px':''">
  289. <el-form-item label="亲友电话 : " prop="relative_phone">
  290. <el-input v-model="form.relative_phone" maxlength="20"></el-input>
  291. </el-form-item>
  292. </el-col>
  293. <el-col :span="8" :style="isEdit?'width:360px':''">
  294. <el-form-item label="亲友关系 : " prop="relative_relations">
  295. <el-input v-model="form.relative_relations" maxlength="20"></el-input>
  296. </el-form-item>
  297. </el-col>
  298. <el-col :span="8" :style="isEdit?'width:360px':''">
  299. <el-form-item label="职业 : " prop="profession">
  300. <el-select v-model="form.profession">
  301. <el-option v-for="item in professionOptions" :key="item.id" :label="item.name" :value="item.id"/>
  302. </el-select>
  303. </el-form-item>
  304. </el-col>
  305. <el-col :span="8" :style="isEdit?'width:360px':''">
  306. <el-form-item label="工作单位 : " prop="work">
  307. <el-input v-model="form.work"></el-input>
  308. </el-form-item>
  309. </el-col>
  310. <el-col :span="8" :style="isEdit?'width:360px':''">
  311. <el-form-item label="单位地址 : " prop="unit_address">
  312. <el-input v-model="form.unit_address"></el-input>
  313. </el-form-item>
  314. </el-col>
  315. </div>
  316. <el-col :span="24">
  317. <el-form-item>
  318. <el-button type="text" @click="generic_info_fold = !generic_info_fold">{{ generic_info_fold ? '更多资料' :
  319. '收起' }}<i class="el-icon--right" :class="generic_fold_icon"></i></el-button>
  320. </el-form-item>
  321. </el-col>
  322. </el-row>
  323. </el-col>
  324. <el-col :span="4" align="center">
  325. <el-upload style="width:100%;"
  326. :disabled="$store.getters.xt_user.subscibe.state==3||!subscibeFlag?true:false"
  327. :data="uploadData"
  328. class="uploadHead"
  329. :multiple="false"
  330. action="https://upload.qiniup.com"
  331. :show-file-list="false"
  332. :on-error="handleAvatarError"
  333. :on-success="handleAvatarSuccess"
  334. list-type="picture-card"
  335. :before-upload="beforeAvatarUpload">
  336. <img width="100%" height="100%" v-if="form.avatar" :src="form.avatar" class="avatar">
  337. <i class="el-icon-plus" v-else></i>
  338. </el-upload>
  339. <el-dialog :visible.sync="dialogVisible">
  340. <img width="100%" :src="dialogImageUrl" alt="">
  341. </el-dialog>
  342. <el-upload
  343. :disabled="$store.getters.xt_user.subscibe.state==3||!subscibeFlag?true:false"
  344. :data="uploadData"
  345. :multiple="false"
  346. action="https://upload.qiniup.com"
  347. :show-file-list="false"
  348. :on-error="handleAvatarError"
  349. :on-success="handleAvatarSuccess"
  350. :before-upload="beforeAvatarUpload">
  351. <el-button :disabled="$store.getters.xt_user.subscibe.state==3||!subscibeFlag?true:false"
  352. class="uploadHeadBtn" type="primary">上传头像
  353. </el-button>
  354. </el-upload>
  355. <el-form-item>
  356. <el-input v-model="form.avatar" type="hidden" placeholder=""></el-input>
  357. </el-form-item>
  358. </el-col>
  359. </el-row>
  360. <div class="dataTitle">治疗信息</div>
  361. <el-row :span="24">
  362. <el-col :span="12">
  363. <el-form-item label="主诉 : " prop="patient_complains">
  364. <el-input type="textarea" :rows="3" v-model="form.patient_complains" resize="none"
  365. placeholder=""></el-input>
  366. </el-form-item>
  367. </el-col>
  368. <el-col :span="12">
  369. <el-form-item label="现病史 : " prop="present_history">
  370. <el-input type="textarea" :rows="3" v-model="form.present_history" resize="none"
  371. placeholder=""></el-input>
  372. </el-form-item>
  373. </el-col>
  374. <el-col :span="12">
  375. <el-form-item label="既往史 : " prop="past_history">
  376. <el-input type="textarea" :rows="3" v-model="form.past_history" resize="none" placeholder=""></el-input>
  377. </el-form-item>
  378. </el-col>
  379. </el-row>
  380. <el-row :span="24">
  381. <el-col>
  382. <el-form-item label="体格检查">
  383. <el-input v-model="form.temperature" style="width: 200px;">
  384. <template slot="prepend">体温:</template>
  385. <template slot="append">℃</template>
  386. </el-input>
  387. <el-input v-model="form.pulse" style="width: 220px;">
  388. <template slot="prepend">脉搏:</template>
  389. <template slot="append">次/分</template>
  390. </el-input>
  391. <el-input v-model="form.respiratory" style="width: 220px;">
  392. <template slot="prepend">呼吸:</template>
  393. <template slot="append">次/分</template>
  394. </el-input>
  395. <!-- </el-form-item>
  396. <el-form-item> -->
  397. <el-input v-model="form.sbp" style="width: 240px;">
  398. <template slot="prepend">收缩压:</template>
  399. <template slot="append">mmHg</template>
  400. </el-input>
  401. <el-input v-model="form.dbp" style="width: 240px;">
  402. <template slot="prepend">舒张压:</template>
  403. <template slot="append">mmHg</template>
  404. </el-input>
  405. </el-form-item>
  406. </el-col>
  407. <el-col>
  408. </el-col>
  409. <el-col :span="24">
  410. <el-form-item label="" prop="remark">
  411. <el-input type="textarea" :rows="3" v-model="form.remark" resize="none" placeholder=""></el-input>
  412. </el-form-item>
  413. </el-col>
  414. <!--<el-col :span="24">-->
  415. <!--<el-form-item label="传染病 : " prop="checkContagions">-->
  416. <!--<el-checkbox-group v-model="form.contagions">-->
  417. <!--<el-checkbox v-for="item in contagionList" v-if="item.type==2" :label="item.id" :key="item.id"-->
  418. <!--:value="item.id">{{item.name}}-->
  419. <!--</el-checkbox>-->
  420. <!--</el-checkbox-group>-->
  421. <!--</el-form-item>-->
  422. <!--</el-col>-->
  423. <el-col :span="24">
  424. <el-form-item label="慢性病 : " prop="diseases">
  425. <el-checkbox-group v-model="form.diseases">
  426. <el-checkbox v-for="item in checkDisease" :label="item.id" :key="item.id" :value="item.id">
  427. {{item.name}}
  428. </el-checkbox>
  429. </el-checkbox-group>
  430. </el-form-item>
  431. </el-col>
  432. <div v-show="!treat_info_fold">
  433. <el-col :span="6" :style="isEdit?'width:360px':''">
  434. <el-form-item label="本院首次透析 : " prop="is_hospital_first_dialysis">
  435. <el-radio-group v-model="form.is_hospital_first_dialysis">
  436. <el-radio v-for="item in isHospitalFirstDialysisOptions" :key="item.value" :label="item.value"
  437. :value="item.value">{{item.label}}
  438. </el-radio>
  439. </el-radio-group>
  440. </el-form-item>
  441. </el-col>
  442. <el-col :span="6" :style="isEdit?'width:360px':''">
  443. <el-form-item label="首次诊治时间 : " >
  444. <el-date-picker v-model="form.first_treatment_date" type="date" format="yyyy-MM-dd"
  445. value-format="yyyy-MM-dd"></el-date-picker>
  446. </el-form-item>
  447. </el-col>
  448. <el-col :span="6" :style="isEdit?'width:360px':''">
  449. <el-form-item label="首次透析医院 : " prop="first_dialysis_hospital">
  450. <el-input v-model="form.first_dialysis_hospital"></el-input>
  451. </el-form-item>
  452. </el-col>
  453. <el-col :span="24">
  454. <el-form-item label="透析之前情况 : " prop="predialysis_condition">
  455. <el-checkbox-group v-model="form.predialysis_condition">
  456. <el-checkbox v-for="item in predialysisConditionOptions" :label="item.label" :key="item.value"
  457. :value="item.label">{{item.label}}
  458. </el-checkbox>
  459. </el-checkbox-group>
  460. </el-form-item>
  461. </el-col>
  462. <el-col :span="6" :style="isEdit?'width:360px':''">
  463. <el-form-item label="本院前透析频率 : " prop="pre_hospital_dialysis_frequency">
  464. <el-input v-model="form.pre_hospital_dialysis_frequency"></el-input>
  465. </el-form-item>
  466. </el-col>
  467. <el-col :span="6" :style="isEdit?'width:360px':''">
  468. <el-form-item label="本院前透析次数 : " prop="pre_hospital_dialysis_times">
  469. <el-input v-model="form.pre_hospital_dialysis_times"></el-input>
  470. </el-form-item>
  471. </el-col>
  472. <el-col :span="6" :style="isEdit?'width:360px':''">
  473. <el-form-item label="本院首次透析 : " prop="hospital_first_dialysis_date">
  474. <el-date-picker v-model="form.hospital_first_dialysis_date" type="date" format="yyyy-MM-dd"
  475. value-format="yyyy-MM-dd"></el-date-picker>
  476. </el-form-item>
  477. </el-col>
  478. </div>
  479. <el-col :span="24">
  480. <el-form-item>
  481. <el-button type="text" @click="treat_info_fold = !treat_info_fold">{{ treat_info_fold ? '更多治疗信息' : '收起' }}<i
  482. class="el-icon--right" :class="treat_fold_icon"></i></el-button>
  483. </el-form-item>
  484. </el-col>
  485. <el-col :span="24">
  486. <el-form-item label="登记人员 : ">
  487. <span>{{adminusername}} </span>
  488. </el-form-item>
  489. </el-col>
  490. <el-col :span="24" align="right">
  491. <el-form-item>
  492. <el-button @click="$router.back(-1)" icon="el-icon-refresh" size="small">取消</el-button>
  493. <el-button :disabled="$store.getters.xt_user.subscibe.state==3||!subscibeFlag?true:false"
  494. @click="onSubmit('form')" size="small" type="primary" icon="el-icon-setting">保存
  495. </el-button>
  496. <el-button v-if="isEdit==false" @click="onReSubmit('form')"
  497. :disabled="$store.getters.xt_user.subscibe.state==3||!subscibeFlag?true:false"
  498. icon="el-icon-document-add" size="small" type="success">保存并继续新增
  499. </el-button>
  500. </el-form-item>
  501. </el-col>
  502. </el-row>
  503. </el-form>
  504. </div>
  505. </div>
  506. </template>
  507. <script>
  508. import { getToken } from '@/api/qiniu'
  509. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  510. import { dialysisAge, getFileExtension, isCardNo, isPositiveInteger, jsGetAge, uParseTime } from '@/utils/tools'
  511. import { createPatient, editPatient, fetchPatient, generateDialysisNo, GetPatientTotal } from '@/api/patient'
  512. // import { fetchAllDoctorAndNurse } from "@/api/doctor";
  513. import { getDataConfig } from '@/utils/data'
  514. const defaultForm = {
  515. avatar: 'https://images.shengws.com/201809182128111.png',
  516. name: '',
  517. alias: '',
  518. idCardNo: '',
  519. dialysisNo: '',
  520. gender: '',
  521. birth: '',
  522. nation: '',
  523. native_place: '',
  524. height: '',
  525. maritalStatus: '',
  526. children: '',
  527. admissionNumber: '',
  528. reimbursementWayID: '',
  529. healthCareNo: '',
  530. phone: '',
  531. homeTelephone: '',
  532. relative_phone: '',
  533. relative_relations: '',
  534. lapseto: '',
  535. homeAddress: '',
  536. work: '',
  537. unit_address: '',
  538. profession: '',
  539. education: '',
  540. source: '',
  541. is_hospital_first_dialysis: '',
  542. firstDialysisDate: '',
  543. first_dialysis_hospital: '',
  544. predialysis_condition: [],
  545. pre_hospital_dialysis_frequency: '',
  546. pre_hospital_dialysis_times: '',
  547. hospital_first_dialysis_date: '',
  548. contagions: [],
  549. diseases: [],
  550. remark: '',
  551. diagnose: '',
  552. is_infectious:1,
  553. age: '',
  554. response_result:'',
  555. remind_cycle:0,
  556. record_date:'',
  557. tell_phone:'',
  558. first_treatment_date:'',
  559. dialysis_age:'',
  560. expense_kind:'',
  561. contact_name:'',
  562. formItem:[
  563. { id: 0,
  564. item: "",
  565. item_id: 104,
  566. item_name: "甲型肝抗体测定(Anti-HAV:各种免疫方法)",
  567. project_id: 14,
  568. project_name: "甲肝乙肝丙肝梅毒HIV",
  569. range_type: 2,
  570. select_options: ["阴性", "阳性", "弱阳性"],
  571. unit: "",
  572. value: ""
  573. },
  574. { id: 0,
  575. item: "",
  576. item_id: 105,
  577. item_name: "乙型肝炎表面抗原测定(HBsAg:酶标法)",
  578. project_id: 14,
  579. project_name: "甲肝乙肝丙肝梅毒HIV",
  580. range_type: 2,
  581. select_options: ["阴性", "阳性", "弱阳性"],
  582. unit: "",
  583. value: ""
  584. },
  585. { id: 0,
  586. item: "",
  587. item_id: 106,
  588. item_name: "乙型肝炎表面抗体测定(Anti-HBs:酶标法)",
  589. project_id: 14,
  590. project_name: "甲肝乙肝丙肝梅毒HIV",
  591. range_type: 2,
  592. select_options: ["阴性", "阳性", "弱阳性"],
  593. unit: "",
  594. value: ""
  595. },
  596. { id: 0,
  597. item: "",
  598. item_id: 107,
  599. item_name: "乙型肝炎e抗原测定(HBeAg:酶标法)",
  600. project_id: 14,
  601. project_name: "甲肝乙肝丙肝梅毒HIV",
  602. range_type: 2,
  603. select_options: ["阴性", "阳性", "弱阳性"],
  604. unit: "",
  605. value: ""
  606. },{ id: 0,
  607. item: "",
  608. item_id: 108,
  609. item_name: "乙型肝炎e抗体测定(Anti-Hbe:酶标法)",
  610. project_id: 14,
  611. project_name: "甲肝乙肝丙肝梅毒HIV",
  612. range_type: 2,
  613. select_options: ["阴性", "阳性", "弱阳性"],
  614. unit: "",
  615. value: ""
  616. }, { id: 0,
  617. item: "",
  618. item_id: 109,
  619. item_name: "乙型肝炎核心抗体测定(Anti-HBc)",
  620. project_id: 14,
  621. project_name: "甲肝乙肝丙肝梅毒HIV",
  622. range_type: 2,
  623. select_options: ["阴性", "阳性", "弱阳性"],
  624. unit: "",
  625. value: ""
  626. },{ id: 0,
  627. item: "",
  628. item_id: 110,
  629. item_name: "丙型肝炎抗体测定(Anti-HCV:定性)",
  630. project_id: 14,
  631. project_name: "甲肝乙肝丙肝梅毒HIV",
  632. range_type: 2,
  633. select_options: ["阴性", "阳性", "弱阳性"],
  634. unit: "",
  635. value: ""
  636. },{ id: 0,
  637. item: "",
  638. item_id: 111,
  639. item_name: "人类免疫缺陷病毒抗体测定(Anti-HIV)",
  640. project_id: 14,
  641. project_name: "甲肝乙肝丙肝梅毒HIV",
  642. range_type: 2,
  643. select_options: ["阴性", "阳性", "弱阳性"],
  644. unit: "",
  645. value: ""
  646. },{ id: 0,
  647. item: "",
  648. item_id: 112,
  649. item_name: "梅毒螺旋体特异抗体测定(凝集,印迹法)",
  650. project_id: 14,
  651. project_name: "甲肝乙肝丙肝梅毒HIV",
  652. range_type: 2,
  653. select_options: ["阴性", "阳性", "弱阳性"],
  654. unit: "",
  655. value: ""
  656. },{ id: 0,
  657. item: "",
  658. item_id: 113,
  659. item_name: "快速血浆反应素试验(RPR)",
  660. project_id: 14,
  661. project_name: "甲肝乙肝丙肝梅毒HIV",
  662. range_type: 2,
  663. select_options: ["阴性", "阳性", "弱阳性"],
  664. unit: "",
  665. value: ""
  666. },
  667. ],
  668. // patientType: "",
  669. // partition: "",
  670. // bed: "",
  671. // age: "",
  672. // healthCareDueDate: "",
  673. // blood: "",
  674. // rh: "",
  675. // healthCareDueAlertDate: "",
  676. // receivingDate: "",
  677. // dialysisAge: "",
  678. // induction: "",
  679. // initial: "",
  680. // dialysisTotal: "",
  681. // doctor: "",
  682. // nurse: "",
  683. // assessment: "",
  684. patient_complains: '',
  685. present_history: '',
  686. past_history: '',
  687. temperature: '',
  688. pulse: '',
  689. respiratory: '',
  690. sbp: '',
  691. dbp: ''
  692. }
  693. export default {
  694. name: 'patientForm',
  695. props: {
  696. isEdit: {
  697. type: Boolean,
  698. default: false
  699. }
  700. },
  701. data() {
  702. var checkContagions = (rule, value, callback) => {
  703. if(this.form.is_infectious == '2'&& value.length == 0){
  704. return callback(new Error('至少选择一项传染病'))
  705. }
  706. callback()
  707. }
  708. var checkPhone = (rule, value, callback) => {
  709. if (value.length == 0) {
  710. return callback(new Error('本人电话不能为空'))
  711. }
  712. if (!value.match(/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/)) {
  713. return callback(new Error('请填写正确的电话(手机号码)'))
  714. }
  715. callback()
  716. }
  717. var checkFamilyPhone = (rule, value, callback) => {
  718. if (value.length == 0) {
  719. return callback(new Error('家属电话不能为空'))
  720. }
  721. if (!value.match(/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/)) {
  722. return callback(new Error('请填写正确的电话(手机号码)'))
  723. }
  724. callback()
  725. }
  726. return {
  727. crumbs: [
  728. { path: false, name: '病人管理' },
  729. { path: false, name: '新增病人' }
  730. ],
  731. generic_info_fold: true,
  732. treat_info_fold: true,
  733. patientTotal: 0,
  734. pageLoad: true,
  735. avatarFlag: false,
  736. subscibeFlag: false,
  737. orgname: '',
  738. adminusername: '',
  739. form: Object.assign({}, defaultForm),
  740. formSubmit: true,
  741. submitMethod: '',
  742. uploadData: { token: '', key: '' },
  743. dialogImageUrl: '',
  744. qiniuDomain: 'https://images.shengws.com/',
  745. dialogVisible: false,
  746. // typeOptions: null,
  747. // styleOptions: null,
  748. sourceOptions: [{ value: 1, label: '门诊' }, { value: 2, label: '住院' }],
  749. lapsetoOptions: [{ value: 1, label: '留治' }, { value: 2, label: '转出' }],
  750. // partitionOptions: null,
  751. sexOptions: [{ value: 1, label: '男' }, { value: 2, label: '女' }],
  752. isHospitalFirstDialysisOptions: [{ value: 1, label: '是' }, { value: 2, label: '否' }],
  753. predialysisConditionOptions: [{ value: 1, label: '腹膜透析' }, { value: 2, label: '肾移植' }],
  754. maritalOptions: null,
  755. wayOptions: null,
  756. educationOptions: null,
  757. professionOptions: null,
  758. // inductionOptions: null,
  759. // doctorOptions: null,
  760. // nurseOptions: null,
  761. // rhOptions: null,
  762. checkDisease: null,
  763. contagionList: null,
  764. dialogFormVisible:false,
  765. loading: null,
  766. submitMsg: '',
  767. patientID: 0,
  768. formLoading:false,
  769. expenseOptions:[
  770. {id:1,name:"基本医保"},
  771. {id:2,name:"新农合"},
  772. {id:3,name:"自费医疗"},
  773. {id:4,name:"公费医疗"},
  774. {id:5,name:"商业保险"},
  775. {id:6,name:"军队医疗"},
  776. {id:7,name:"其他"},
  777. ],
  778. subscibe: {},
  779. rules: {
  780. contagions: [
  781. { type: 'array', required: true, trigger: 'change',validator: checkContagions }
  782. ],
  783. patientType: [{ required: true, message: '请选择患者类型', trigger: 'blur' }],
  784. dialysisNo: [{ required: true, message: '请填写透析号', trigger: 'blur' }],
  785. phone: [{ validator: checkPhone, trigger: 'blur' }],
  786. source: [{ required: true, message: '请选择患者来源', trigger: 'blur' }],
  787. lapseto: [{ required: true, message: '请选择治疗状态', trigger: 'blur' }],
  788. name: [{ required: true, message: '请填写姓名', trigger: 'blur' }],
  789. gender: [{ required: true, message: '请选择性别', trigger: 'blur' }],
  790. idCardNo: [{ required: true, message: '请填写身份证号', trigger: 'blur' }],
  791. birth: [{ required: true, message: '请填写生日', trigger: 'blur' }],
  792. age: [{ required: true, message: '请填写年龄', trigger: 'blur' }],
  793. firstDialysisDate:[{ required: true, message: '请选择日期', trigger: 'blur' }],
  794. // homeTelephone: [{ validator: checkFamilyPhone, trigger: "blur" }],
  795. // homeAddress: [{ required: true, message: "请填写住址", trigger: "blur" }],
  796. }
  797. }
  798. },
  799. components: {
  800. BreadCrumb
  801. },
  802. computed: {
  803. generic_fold_icon: function() {
  804. return this.generic_info_fold ? 'el-icon-arrow-down' : 'el-icon-arrow-up'
  805. },
  806. treat_fold_icon: function() {
  807. return this.treat_info_fold ? 'el-icon-arrow-down' : 'el-icon-arrow-up'
  808. }
  809. },
  810. created() {
  811. // this.styleOptions = this.$store.getters.patient_types;
  812. // this.partitionOptions = this.$store.getters.partitions;
  813. this.maritalOptions = getDataConfig('patient', 'marital_options')
  814. this.wayOptions = getDataConfig('patient', 'reimbursement_ways')
  815. // this.typeOptions = this.$store.getters.blood_types;
  816. // this.rhOptions = this.$store.getters.rh;
  817. this.educationOptions = getDataConfig('patient', 'education_types')
  818. this.professionOptions = getDataConfig('patient', 'profession_options')
  819. // this.inductionOptions = this.$store.getters.induction_options;
  820. this.contagionList = this.$store.getters.contagions
  821. this.checkDisease = this.$store.getters.disease
  822. this.subscibe = this.$store.getters.xt_user.subscibe
  823. this.GetPatientTotal()
  824. // this.fetchAllDoctorAndNurse();
  825. this.pageLoad = false
  826. var xtuser = this.$store.getters.xt_user
  827. this.orgname = xtuser.org.org_name
  828. this.adminusername = xtuser.user.user_name
  829. if (this.isEdit) {
  830. this.submitMsg = '修改患者信息成功'
  831. const id = this.$route.params && this.$route.params.id
  832. this.patientID = parseInt(id)
  833. if (isNaN(this.patientID) || this.patientID <= 0) {
  834. this.$notify.error({
  835. title: '错误',
  836. message: '无效的id'
  837. })
  838. this.$router.back(-1)
  839. }
  840. this.fetchPatient(id)
  841. this.avatarFlag = true
  842. } else {
  843. this.submitMsg = '新增患者成功'
  844. this.form = Object.assign({}, defaultForm)
  845. }
  846. },
  847. watch:{
  848. "form.record_date":function(val) {
  849. console.log(val)
  850. if(val == null || val == ''){
  851. console.log("111111")
  852. this.form.remind_cycle = ""
  853. }
  854. }
  855. },
  856. methods: {
  857. recordCheck(){
  858. if(this.form.record_date == ""){
  859. this.$message.error('请先选择检验检查日期')
  860. return
  861. }else{
  862. this.dialogFormVisible = true
  863. }
  864. },
  865. GetPatientTotal() {
  866. GetPatientTotal().then(response => {
  867. if (response.data.state == 1) {
  868. this.patientTotal = response.data.data.total
  869. this.subscibeFlag = true
  870. // if ((this.subscibe.state == 2 && this.patientTotal >= 100) || (this.subscibe.state == 1 && this.patientTotal >= 200)) {
  871. // this.$alert('患者数已达到当前服务版本病人数,需要升级到更高的版本', '提示', {
  872. // confirmButtonText: '确定',
  873. // showClose: false,
  874. // callback: action => {
  875. // this.$router.push('/service/buy')
  876. // }
  877. // })
  878. // } else {
  879. // this.subscibeFlag = true
  880. // }
  881. } else {
  882. this.$message.error(response.data.msg)
  883. }
  884. }).catch(e => {
  885. })
  886. },
  887. changeGender(value) {
  888. if (this.avatarFlag) {
  889. return false
  890. }
  891. if (value == 1) {
  892. this.form.avatar = 'https://images.shengws.com/201809182128111.png'
  893. } else if (value == 2) {
  894. this.form.avatar = 'https://images.shengws.com/201809182128222.png'
  895. } else {
  896. }
  897. },
  898. resetForm(formName) {
  899. this.$refs[formName].resetFields()
  900. },
  901. onReSubmit(formName) {
  902. this.submitForm(formName, 'renew')
  903. },
  904. onSubmit(formName) {
  905. this.submitForm(formName, 'redict')
  906. },
  907. submitForm(formName, action) {
  908. if (!this.formSubmit) {
  909. return false
  910. }
  911. this.$refs[formName].validate(valid => {
  912. if (valid) {
  913. this.formSubmit = false
  914. if (this.isEdit) {
  915. this.form.age = parseInt(this.form.age)
  916. editPatient(this.patientID, this.form)
  917. .then(response => {
  918. if (response.data.state == 0) {
  919. this.$message.error(response.data.msg)
  920. this.formSubmit = true
  921. return false
  922. } else {
  923. this.formSubmit = false
  924. this.$notify({
  925. title: '成功',
  926. message: this.submitMsg,
  927. type: 'success',
  928. duration: 2000
  929. })
  930. this.$refs[formName].resetFields()
  931. if (action !== 'renew') {
  932. this.$router.back(-1)
  933. }
  934. this.formSubmit = true
  935. return false
  936. }
  937. })
  938. .catch(err => {
  939. this.$message.error('网络异常')
  940. this.formSubmit = true
  941. return false
  942. })
  943. } else {
  944. this.form.age = parseInt(this.form.age)
  945. createPatient(this.form)
  946. .then(response => {
  947. if (response.data.state == 0) {
  948. this.$message.error(response.data.msg)
  949. this.formSubmit = true
  950. return false
  951. } else {
  952. this.formSubmit = true
  953. this.$notify({
  954. title: '成功',
  955. message: this.submitMsg,
  956. type: 'success',
  957. duration: 2000
  958. })
  959. this.$refs[formName].resetFields()
  960. this.$store.dispatch('SetSubscibePatients')
  961. var sub = this.$store.getters.xt_user.subscibe
  962. console.log(sub)
  963. if (action !== 'renew') {
  964. this.$router.back(-1)
  965. }
  966. return false
  967. }
  968. })
  969. .catch(err => {
  970. this.$message.error('网络异常')
  971. this.formSubmit = true
  972. return false
  973. })
  974. }
  975. } else {
  976. this.formSubmit = true
  977. return false
  978. }
  979. })
  980. },
  981. handlePictureCardPreview(file) {
  982. this.dialogImageUrl = file.url
  983. this.dialogVisible = true
  984. },
  985. handleAvatarError(err, file, fileList) {
  986. this.$message.error(err)
  987. this.loading.close()
  988. return false
  989. },
  990. handleAvatarSuccess(res, file) {
  991. // this.imageUrl = URL.createObjectURL(file.raw);
  992. this.form.avatar = this.qiniuDomain + res.url
  993. this.avatarFlag = true
  994. this.loading.close()
  995. },
  996. beforeAvatarUpload(file) {
  997. // const isJPG = file.type === "image/jpeg";
  998. var fileType = file.type
  999. const isJPG = fileType.indexOf('image') > -1
  1000. const isLt2M = file.size / 1024 / 1024 < 2
  1001. if (!isJPG) {
  1002. this.$message.error('只能上传图片')
  1003. return false
  1004. }
  1005. if (!isLt2M) {
  1006. this.$message.error('上传头像图片大小不能超过 2MB!')
  1007. return false
  1008. }
  1009. var date = new Date()
  1010. var ext = getFileExtension(file.name)
  1011. var key =
  1012. date.getFullYear() +
  1013. '/' +
  1014. (date.getMonth() + 1) +
  1015. '/' +
  1016. date.getDate() +
  1017. '/' +
  1018. date.getHours() +
  1019. '/' +
  1020. date.getMinutes() +
  1021. '/' +
  1022. date.getSeconds() +
  1023. '/' +
  1024. '_s_' +
  1025. file.uid +
  1026. '.' +
  1027. ext
  1028. this.loading = this.$loading({
  1029. lock: true,
  1030. text: '上传中...',
  1031. spinner: 'el-icon-loading',
  1032. background: 'rgba(0, 0, 0, 0.7)'
  1033. })
  1034. const _self = this
  1035. return new Promise((resolve, reject) => {
  1036. getToken()
  1037. .then(response => {
  1038. const token = response.data.data.uptoken
  1039. _self._data.uploadData.token = token
  1040. _self._data.uploadData.key = key
  1041. resolve(true)
  1042. })
  1043. .catch(err => {
  1044. console.log(err)
  1045. reject(false)
  1046. this.loading.close()
  1047. })
  1048. })
  1049. },
  1050. generatedialysisno() {
  1051. generateDialysisNo().then(response => {
  1052. this.form.dialysisNo = response.data.data.no + ''
  1053. })
  1054. },
  1055. checkIdCardNo() {
  1056. console.log(this.form.idCardNo)
  1057. if (!isCardNo(this.form.idCardNo)) {
  1058. this.$message.error('身份证号码信息有误!')
  1059. this.form.birth = ''
  1060. return false
  1061. }
  1062. var thisLen = this.form.idCardNo.length
  1063. var birth = ''
  1064. if (thisLen == 15) {
  1065. birth = '19' + this.form.idCardNo.substr(6, 6)
  1066. } else {
  1067. birth = this.form.idCardNo.substr(6, 8)
  1068. }
  1069. this.form.birth =
  1070. birth.substr(0, 4) +
  1071. '-' +
  1072. birth.substr(4, 2) +
  1073. '-' +
  1074. birth.substr(6, 2)
  1075. this.form.age = jsGetAge(this.form.birth, '-')
  1076. },
  1077. hadSelectBirth() {
  1078. this.form.age = jsGetAge(this.form.birth, '-')
  1079. },
  1080. checkHeight() {
  1081. if (!isPositiveInteger(this.form.height)) {
  1082. this.$message.error('身高请填写正整数!')
  1083. return false
  1084. }
  1085. },
  1086. selectFirstDialysisDate() {
  1087. this.form.dialysisAge = dialysisAge(this.form.firstDialysisDate)
  1088. },
  1089. fetchPatient(id) {
  1090. fetchPatient(id)
  1091. .then(response => {
  1092. if (response.data.state == 1) {
  1093. this.$emit('tran-patient-info', response.data.data.patient)
  1094. var patietInfo = response.data.data.patient
  1095. this.form.avatar = patietInfo.avatar
  1096. this.form.name = patietInfo.name
  1097. this.form.alias = patietInfo.alias
  1098. this.form.idCardNo = patietInfo.id_card_no
  1099. this.form.dialysisNo = patietInfo.dialysis_no
  1100. this.form.gender = patietInfo.gender
  1101. if (patietInfo.gender == 1 || patietInfo.gender == 2) {
  1102. this.form.gender = patietInfo.gender
  1103. }
  1104. this.form.birth = uParseTime(patietInfo.birthday, '{y}-{m}-{d}')
  1105. this.form.nation = patietInfo.nation
  1106. this.form.native_place = patietInfo.native_place
  1107. this.form.height = patietInfo.height + ''
  1108. console.log(this.form.birth)
  1109. if (patietInfo.marital_status > 0) {
  1110. this.form.maritalStatus = patietInfo.marital_status
  1111. }
  1112. this.form.children = patietInfo.children
  1113. this.form.admissionNumber = patietInfo.admission_number
  1114. if (patietInfo.reimbursement_way_id > 0) {
  1115. this.form.reimbursementWayID = patietInfo.reimbursement_way_id
  1116. }
  1117. this.form.healthCareNo = patietInfo.health_care_no
  1118. this.form.phone = patietInfo.phone
  1119. this.form.homeTelephone = patietInfo.home_telephone
  1120. this.form.relative_phone = patietInfo.relative_phone
  1121. this.form.relative_relations = patietInfo.relative_relations
  1122. this.form.homeAddress = patietInfo.home_address
  1123. this.form.work = patietInfo.work_unit
  1124. this.form.unit_address = patietInfo.unit_address
  1125. if (patietInfo.profession > 0) {
  1126. this.form.profession = patietInfo.profession
  1127. }
  1128. if (patietInfo.education_level > 0) {
  1129. this.form.education = patietInfo.education_level
  1130. }
  1131. if (patietInfo.source == 1 || patietInfo.source == 2) {
  1132. this.form.source = patietInfo.source
  1133. }
  1134. if (patietInfo.lapseto == 1 || patietInfo.lapseto == 2) {
  1135. this.form.lapseto = patietInfo.lapseto
  1136. }
  1137. if (patietInfo.is_hospital_first_dialysis == 1 || patietInfo.is_hospital_first_dialysis == 2) {
  1138. this.form.is_hospital_first_dialysis = patietInfo.is_hospital_first_dialysis
  1139. }
  1140. if (patietInfo.first_dialysis_date != 0) {
  1141. this.form.firstDialysisDate = uParseTime(
  1142. patietInfo.first_dialysis_date,
  1143. '{y}-{m}-{d}'
  1144. )
  1145. }
  1146. this.form.first_dialysis_hospital = patietInfo.first_dialysis_hospital
  1147. if (patietInfo.predialysis_condition.length > 0) {
  1148. this.form.predialysis_condition = patietInfo.predialysis_condition.split(',')
  1149. }
  1150. this.form.pre_hospital_dialysis_frequency = patietInfo.pre_hospital_dialysis_frequency
  1151. this.form.pre_hospital_dialysis_times = patietInfo.pre_hospital_dialysis_times
  1152. if (patietInfo.hospital_first_dialysis_date != 0) {
  1153. this.form.hospital_first_dialysis_date = uParseTime(
  1154. patietInfo.hospital_first_dialysis_date,
  1155. '{y}-{m}-{d}'
  1156. )
  1157. }
  1158. this.form.contagions = response.data.data.contagions
  1159. this.form.diseases = response.data.data.diseases
  1160. this.form.remark = patietInfo.remark
  1161. this.form.diagnose = patietInfo.diagnose
  1162. this.form.patient_complains = patietInfo.patient_complains
  1163. this.form.present_history = patietInfo.present_history
  1164. this.form.past_history = patietInfo.past_history
  1165. this.form.temperature = patietInfo.temperature
  1166. this.form.pulse = patietInfo.pulse
  1167. this.form.respiratory = patietInfo.respiratory
  1168. this.form.sbp = patietInfo.sbp
  1169. this.form.dbp = patietInfo.dbp
  1170. this.form.response_result = patietInfo.response_result
  1171. this.form.remind_cycle = patietInfo.remind_cycle
  1172. this.form.is_infectious = patietInfo.is_infectious
  1173. this.form.tell_phone = patietInfo.tell_phone
  1174. this.form.dialysis_age = patietInfo.dialysis_age
  1175. this.form.contact_name = patietInfo.contact_name
  1176. if( patietInfo.expense_kind == 0){
  1177. this.form.expense_kind = ""
  1178. }else{
  1179. this.form.expense_kind = patietInfo.expense_kind
  1180. }
  1181. this.form.first_treatment_date = uParseTime(
  1182. patietInfo.first_treatment_date,
  1183. '{y}-{m}-{d}'
  1184. )
  1185. if (patietInfo.age == 0) {
  1186. this.form.age = jsGetAge(this.form.birth, '-')
  1187. } else {
  1188. this.form.age = patietInfo.age
  1189. }
  1190. // this.form.initial = patietInfo.initial_dialysis + "";
  1191. // this.form.dialysisTotal = patietInfo.total_dialysis + "";
  1192. // this.form.assessment = patietInfo.evaluate;
  1193. // if (patietInfo.patient_type > 0) {
  1194. // this.form.patientType = patietInfo.patient_type;
  1195. // }
  1196. // if (patietInfo.partition_id > 0) {
  1197. // this.form.partition = patietInfo.partition_id;
  1198. // }
  1199. // if (patietInfo.bed_id > 0) {
  1200. // this.form.bed = patietInfo.bed_id;
  1201. // }
  1202. // this.form.healthCareDueDate = uParseTime(
  1203. // patietInfo.health_care_due_date,
  1204. // "{y}-{m}-{d}"
  1205. // );
  1206. // if (patietInfo.blood_type > 0) {
  1207. // this.form.blood = patietInfo.blood_type;
  1208. // }
  1209. // if (patietInfo.rh > 0) {
  1210. // this.form.rh = patietInfo.rh;
  1211. // }
  1212. // this.form.healthCareDueAlertDate = uParseTime(
  1213. // patietInfo.health_care_due_alert_date,
  1214. // "{y}-{m}-{d}"
  1215. // );
  1216. // this.form.receivingDate = uParseTime(
  1217. // patietInfo.receiving_date,
  1218. // "{y}-{m}-{d}"
  1219. // );
  1220. // this.form.dialysisAge = dialysisAge(
  1221. // this.form.firstDialysisDate,
  1222. // "-"
  1223. // );
  1224. // if (patietInfo.induction_period > 0) {
  1225. // this.form.induction = patietInfo.induction_period;
  1226. // }
  1227. // if (patietInfo.attending_doctor_id > 0) {
  1228. // this.form.doctor = patietInfo.attending_doctor_id;
  1229. // }
  1230. // if (patietInfo.head_nurse_id > 0) {
  1231. // this.form.nurse = patietInfo.head_nurse_id;
  1232. // }
  1233. // if (patietInfo.registrars_id > 0) {
  1234. // this.form.registrars = patietInfo.registrars_id;
  1235. // }
  1236. this.checkIdCardNo()
  1237. } else {
  1238. this.$notify.error({
  1239. title: '错误',
  1240. message: '网络异常'
  1241. })
  1242. this.$router.back(-1)
  1243. }
  1244. // this.postForm = response.data
  1245. // // Just for test
  1246. // this.postForm.title += ` Article Id:${this.postForm.id}`
  1247. // this.postForm.content_short += ` Article Id:${this.postForm.id}`
  1248. })
  1249. .catch(err => {
  1250. this.$notify.error({
  1251. title: '错误',
  1252. message: '网络异常'
  1253. })
  1254. this.$router.back(-1)
  1255. })
  1256. },submitNew(formName){
  1257. this.dialogFormVisible = false
  1258. },changeCycle(val){
  1259. if(!this.isEdit) {
  1260. if (this.form.record_date == "" || this.form.record_date == null) {
  1261. this.$message.error('请先选择检查结果日期')
  1262. this.form.remind_cycle = ''
  1263. return
  1264. }
  1265. }
  1266. },
  1267. // fetchAllDoctorAndNurse() {
  1268. // fetchAllDoctorAndNurse().then(response => {
  1269. // if (response.data.state == 1) {
  1270. // this.doctorOptions = response.data.data.doctors;
  1271. // this.nurseOptions = response.data.data.nursers;
  1272. // }
  1273. // });
  1274. // }
  1275. }
  1276. }
  1277. </script>
  1278. <style rel="stylesheet/scss" lang="scss" scoped>
  1279. .uploadHeadBtn {
  1280. width: 148px;
  1281. margin-top: 10px;
  1282. }
  1283. .el-form {
  1284. .el-col-6, .el-col-8 {
  1285. width: 430px;
  1286. height: 59px !important;
  1287. }
  1288. .el-form-item {
  1289. .el-select {
  1290. width: 100%;
  1291. }
  1292. .el-date-editor.el-input {
  1293. width: 100%;
  1294. }
  1295. .textarea {
  1296. width: 100%;
  1297. height: 70px;
  1298. border-color: #dcdfe6;
  1299. padding: 5px;
  1300. }
  1301. }
  1302. }
  1303. .el-select-dropdown {
  1304. z-index: 998 !important;
  1305. }
  1306. </style>