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

PatientForm.vue 63KB

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