血透系统pad前端

MonitDialog.vue 43KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  1. <template>
  2. <div>
  3. <div v-loading="loading">
  4. <div class="Dialog" v-show="listPanel">
  5. <div class="DialogTit">
  6. <span class="iconfont" @click="close()">&#xe6e9;</span>
  7. <h1 class="name">透析监测</h1>
  8. <span class="success">&nbsp;</span>
  9. </div>
  10. <div style="width:100%;background: #fff;">
  11. <div class="yzNav" style="width:80%">
  12. <span @click="openForm()">新增监测</span>
  13. <span @click="openEidtForm()">修改监测</span>
  14. <span @click="deleteForm()">删除监测</span>
  15. </div>
  16. </div>
  17. <div class="DialogContent choose" id="dialogTop">
  18. <div style="width:100%;overflow:hildden;">
  19. <table class="table" style="">
  20. <tr @click="selectRow(-1, null)">
  21. <th v-if="isShow('监测时间')" width="124px">时间</th>
  22. <th v-if="isShow('血压')" width="72px">血压(mmHg)</th>
  23. <th v-if="isShow('脉搏')" width="80px">脉搏(次/分)</th>
  24. <th v-if="isShow('体温')" width="80px">体温(℃)</th>
  25. <th v-if="isShow('呼吸频率')" width="110px">呼吸频率(次/分)</th>
  26. <th v-if="isShow('血流量')" width="92px">血流量(ml/min)</th>
  27. <th width="76px">静脉压/动脉压(mmHg)</th>
  28. <th v-if="isShow('跨膜压')" width="76px">跨膜压(mmHg)</th>
  29. <th v-if="isShow('超滤量') && template_id ==6" width="76px">超滤量(ml)</th>
  30. <th v-if="isShow('超滤量') && template_id !=6" width="76px">超滤量(L)</th>
  31. <th v-if="isShow('钠浓度')" width="92px">钠浓度(mmol/L)</th>
  32. <th v-if="isShow('透析液温度')" width="82px">透析液温度(℃)</th>
  33. <th v-if="isShow('置换率')" width="92px">置换率(L/h)</th>
  34. <th v-if="isShow('置换量')" width="50px">置换量(L)</th>
  35. <th v-if="isShow('电导度')" width="50px">电导度(mS/m)</th>
  36. <th v-if="isShow('置换液流量')" width="50px">置换液流量(ml/h)</th>
  37. <th v-if="isShow('病情变化')" width="92px">病情变化</th>
  38. <th v-if="isShow('处理')" width="92px">处理</th>
  39. <th v-if="isShow('结果')" width="92px">结果</th>
  40. </tr>
  41. <tr v-for="(item,index) in monitorRecords" :key="index" :value="item.value"
  42. @click="selectRow(index, item)" :class="index==currentIndex?rowClass:''">
  43. <td v-if="isShow('监测时间')">{{parseTime(item.operate_time, '{y}-{m}-{d} {h}:{i}')}}</td>
  44. <td v-if="isShow('血压')">
  45. {{item.systolic_blood_pressure?item.systolic_blood_pressure:''}}/{{item.diastolic_blood_pressure?item.diastolic_blood_pressure:''}}
  46. </td>
  47. <td v-if="isShow('脉搏')">{{item.pulse_frequency?item.pulse_frequency:''}}</td>
  48. <td v-if="isShow('体温')">{{item.temperature?item.temperature:''}}</td>
  49. <td v-if="isShow('呼吸频率')">{{item.breathing_rate?item.breathing_rate:''}}</td>
  50. <td v-if="isShow('血流量')">{{item.blood_flow_volume?item.blood_flow_volume:''}}</td>
  51. <td>
  52. {{item.venous_pressure?item.venous_pressure:''}}/{{item.arterial_pressure?item.arterial_pressure:''}}
  53. </td>
  54. <td v-if="isShow('跨膜压')">{{item.transmembrane_pressure?item.transmembrane_pressure:''}}</td>
  55. <td v-if="isShow('超滤量')">{{item.ultrafiltration_volume?item.ultrafiltration_volume:''}}</td>
  56. <td v-if="isShow('钠浓度')">{{item.sodium_concentration?item.sodium_concentration:''}}</td>
  57. <td v-if="isShow('透析液温度')">{{item.dialysate_temperature?item.dialysate_temperature:''}}</td>
  58. <td v-if="isShow('置换率')">{{item.replacement_rate?item.replacement_rate:''}}</td>
  59. <td v-if="isShow('置换量')">{{item.displacement_quantity?item.displacement_quantity:''}}</td>
  60. <td v-if="isShow('电导度')">{{item.conductivity?item.conductivity:''}}</td>
  61. <td v-if="isShow('置换液流量')">{{item.displacement_flow_quantity?item.displacement_flow_quantity:''}}</td>
  62. <td v-if="isShow('病情变化')">{{item.symptom}}</td>
  63. <td v-if="isShow('处理')">{{item.dispose}}</td>
  64. <td v-if="isShow('结果')">{{item.result}}</td>
  65. </tr>
  66. </table>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="Dialog" v-show="formPanel">
  71. <div class="DialogTit">
  72. <div class="back" @click="formPanel=false;listPanel=true;"><span class="iconfont">&#xe720; </span>返回</div>
  73. <h1 class="name">{{formTitle}}</h1>
  74. <span class="success" v-if="form.id>0" @click="submitEditAction()">完成</span>
  75. <span class="success" v-else @click="submitAction()">完成</span>
  76. </div>
  77. <div class="DialogContent choose">
  78. <div class="content">
  79. <div class="cell" v-if="isShow('监测时间')">
  80. <label>监测时间</label>
  81. <input type="text" class="inputBox" @click="chooseTime()"
  82. :value="parseTime(this.form.operate_time, '{y}-{m}-{d} {h}:{i}')" readonly>
  83. </div>
  84. <div class="cell" v-if="isShow('收缩压')">
  85. <label>收缩压(mmHg)</label>
  86. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  87. v-model="form.systolic_bp">
  88. </div>
  89. <div class="cell" v-if="isShow('舒张压')">
  90. <label>舒张压(mmHg)</label>
  91. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  92. v-model="form.diastolic_bp">
  93. </div>
  94. <div class="cell" v-if="isShow('脉搏')">
  95. <label>脉搏(次/分)</label>
  96. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  97. v-model="form.pulse_frequency">
  98. </div>
  99. <div class="cell" v-if="isShow('体温')">
  100. <label>体温(℃)</label>
  101. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  102. v-model="form.temperature">
  103. </div>
  104. <div class="cell" v-if="isShow('呼吸频率')">
  105. <label>呼吸频率(次/分)</label>
  106. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  107. v-model="form.breathing_rated">
  108. </div>
  109. <div class="cell" v-if="isShow('血流量')">
  110. <label>血流量(ml/min)</label>
  111. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  112. v-model="form.blood_flow_volume">
  113. </div>
  114. <div class="cell">
  115. <label>静脉压(mmHg)</label>
  116. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox" v-model="form.venous_pressure" style="width:60%">
  117. <button style="width:30%;padding: 0.18rem 0; color: #fff; background: #409eff;" @click="venousPressureChange(1)" >转换</button>
  118. </div>
  119. <div class="cell" v-if="isShow('跨膜压')">
  120. <label>跨膜压(mmHg)</label>
  121. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox" v-model="form.transmembrane_pressure" style="width:60%">
  122. <button style="width:30%;padding: 0.18rem 0; color: #fff; background: #409eff;" @click="venousPressureChange(2)" >转换</button>
  123. </div>
  124. <div class="cell" v-if="isShow('超滤量')">
  125. <label v-if="template_id == 6">超滤量(ml)</label>
  126. <label v-else>超滤量(L)</label>
  127. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  128. v-model="form.ultrafiltration_volume">
  129. </div>
  130. <div class="cell" v-if="isShow('超滤率')">
  131. <label>超滤率(ml/h)</label>
  132. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  133. v-model="form.ultrafiltration_rate">
  134. </div>
  135. <div class="cell">
  136. <label>动脉压(mmHg)</label>
  137. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox" v-model="form.arterial_pressure" style="width:60%">
  138. <button style="width:30%;padding: 0.18rem 0; color: #fff; background: #409eff;" @click="venousPressureChange(3)" >转换</button>
  139. </div>
  140. <div class="cell" v-if="isShow('钠浓度')">
  141. <label>钠浓度(mmol/L)</label>
  142. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  143. v-model="form.sodium_concentration">
  144. </div>
  145. <div class="cell" v-if="isShow('透析液温度')">
  146. <label>透析液温度(℃)</label>
  147. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  148. v-model="form.dialysate_temperature">
  149. </div>
  150. <div class="cell" v-if="isShow('置换率')">
  151. <label>置换率(L/h)</label>
  152. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  153. v-model="form.replacement_rate">
  154. </div>
  155. <div class="cell" v-if="isShow('置换量')">
  156. <label>置换量(L)</label>
  157. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  158. v-model="form.displacement_quantity">
  159. </div>
  160. <div class="cell" v-if="isShow('电导度')">
  161. <label>电导度(mS/m)</label>
  162. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  163. v-model="form.conductivity">
  164. </div>
  165. <div class="cell" v-if="isShow('置换液流量')">
  166. <label>置换液流量(ml/h)</label>
  167. <input type="number" @focus="inputFocus" onclick="this.select();" class="inputBox"
  168. v-model="form.displacement_flow_quantity">
  169. </div>
  170. <div class="cell width" v-if="isShow('KT/V')">
  171. <label>KT/V(在线)</label>
  172. <!-- <input type="text" class="inputBox" v-model="form.ktv"> -->
  173. <textarea @focus="inputFocus" class="inputBox" style="width: 100%;" :rows="4"
  174. v-model="form.ktv"></textarea>
  175. </div>
  176. <div class="cell width" v-if="isShow('病情变化')">
  177. <label>病情变化</label>
  178. <input type="text" class="inputBox" style="width: 100%;margin-bottom:5px;" v-model="form.symptom" readonly
  179. placeholder="选择 " @click="showSubMenu('symptom')">
  180. <textarea @focus="inputFocus" class="inputBox" style="width: 100%;" :rows="4"
  181. v-model="form.symptom"></textarea>
  182. </div>
  183. <div class="cell width" v-if="isShow('处理')">
  184. <label>处理</label>
  185. <!-- <input type="text" class="inputBox" v-model="form.dispose"> -->
  186. <input type="text" class="inputBox" style="width: 100%;margin-bottom:5px;" v-model="form.dispose" readonly
  187. placeholder="选择" @click="showSubMenu('dispose')">
  188. <textarea @focus="inputFocus" class="inputBox" style="width: 100%;" :rows="4"
  189. v-model="form.dispose"></textarea>
  190. </div>
  191. <div class="cell width" v-if="isShow('结果')">
  192. <label>结果</label>
  193. <!-- <input type="text" class="inputBox" v-model="form.result"> -->
  194. <input type="text" class="inputBox" style="width: 100%;margin-bottom:5px;" v-model="form.result" readonly
  195. placeholder="选择" @click="showSubMenu('result')">
  196. <textarea @focus="lastInputFocus" @blur="lastInputBlur" class="inputBox" style="width: 100%;" :rows="4"
  197. v-model="form.result"></textarea>
  198. </div>
  199. <div class="cell width">
  200. <label>监测人:</label>
  201. <span>{{doctor}}</span>
  202. </div>
  203. </div>
  204. </div>
  205. </div>
  206. </div>
  207. <mt-datetime-picker
  208. ref="picker"
  209. type="datetime"
  210. @confirm="handleConfirm"
  211. v-model="pickertime">
  212. </mt-datetime-picker>
  213. <check-box-sub-menu :visibility="visibility" v-on:menu-cancle="menuCancle" v-on:menu-comfirm="menuComfirm"
  214. :propsForm="propForm"></check-box-sub-menu>
  215. </div>
  216. </template>
  217. <script>
  218. import {addMonitorRecord, deleteMonitorRecord, editMonitorRecord, GetMonitor,GetMonitorToday} from '@/api/dialysis'
  219. import {parseTime} from '@/utils'
  220. import {Dialog, Toast} from 'vant'
  221. import CheckBoxSubMenu from './subMenu/checkBoxSubMenu'
  222. import {getDataConfig} from '@/utils/data'
  223. export default {
  224. name: 'MonitDialog',
  225. props: {
  226. monitor_records: {
  227. type: Array
  228. },
  229. patient: {
  230. type: Object
  231. },
  232. order: {
  233. type: Object
  234. },
  235. last_monitor_record: {
  236. type: Object
  237. }
  238. },
  239. data () {
  240. return {
  241. loading: false,
  242. formTitle: '新增监测',
  243. formPanel: false,
  244. listPanel: true,
  245. tableDate: [],
  246. monitorRecords: this.monitor_records,
  247. pickertime: new Date(),
  248. monitor_time_str: '',
  249. // monitor_date_str: "",
  250. currentIndex: -1,
  251. currentRow: null,
  252. rowClass: 'row-class-active',
  253. template_id: 0,
  254. visibility: false,
  255. today_last_monitor_record : {},
  256. propForm: {
  257. title: '',
  258. list: [],
  259. optionList: [],
  260. isMultiple: 2,
  261. result: [], //选中的值
  262. type: 1, //用来区分不同子菜单,方便对返回值进行赋值
  263. selectId: 0
  264. },
  265. form: {
  266. // patient_id: 0,
  267. // order_id: 0,
  268. monitor_date: 0,
  269. // monitor_time: "00:00",
  270. operate_time: 0,
  271. pulse_frequency: '', // 脉率
  272. breathing_rated: '', // 呼吸频率
  273. systolic_bp: '', // 收缩压
  274. diastolic_bp: '', // 舒张压
  275. blood_flow_volume: '', // 血流量
  276. venous_pressure: '', // 静脉压
  277. arterial_pressure: '', // 动脉压
  278. transmembrane_pressure: '', // 跨膜压
  279. ultrafiltration_rate: '', // 超滤率
  280. ultrafiltration_volume: '', // 超滤量
  281. sodium_concentration: '', // 钠浓度
  282. dialysate_temperature: '', // 透析液温度
  283. temperature: '', // 体温
  284. replacement_rate: '', // 置换率
  285. displacement_quantity: '', // 置换量
  286. conductivity:'',
  287. displacement_flow_quantity:'',
  288. ktv: '', // KT/V(在线)
  289. symptom: '', // 症状
  290. dispose: '', // 处理
  291. result: '', // 结果
  292. monitoring_nurse: this.$store.getters.user.user.id // 监测人
  293. },
  294. doctor: this.$store.getters.user.user.user_name
  295. }
  296. },
  297. created () {
  298. var date = this.$route.query && this.$route.query.date
  299. this.template_id = this.$store.getters.user.template_info.template_id;
  300. // date *= 1000;
  301. // var newDate = new Date(date);
  302. // var cDate = new Date();
  303. // var y = newDate.getFullYear();
  304. // var m = newDate.getMonth() + 1;
  305. // var d = newDate.getDate();
  306. // if (isNaN(y) || isNaN(m) || isNaN(d)) {
  307. // // newDate = new Date();
  308. // y = cDate.getFullYear();
  309. // m = cDate.getMonth() + 1;
  310. // d = cDate.getDate();
  311. // }
  312. // var h = cDate.getHours();
  313. // var mi = cDate.getMinutes();
  314. // var pickertime = (h < 10 ? "0" + h : h) + ":" + (mi < 10 ? "0" + mi : mi);
  315. // var monitor_date_str =
  316. // y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d);
  317. // this.form.monitor_date = Math.round(
  318. // new Date(monitor_date_str + " 00:00:00").getTime() / 1000
  319. // );
  320. // this.form.monitor_date = parseInt((new Date(date.getFullYear, date.getMonth, date.getDate, 0, 0, 0, 0)).getTime()) //parseTime(date, "{y}-{m}-{d}") + " 00:00:00"
  321. this.form.monitor_date = date
  322. this.form.operate_time = this.pickertime.getTime()
  323. },
  324. methods: {
  325. venousPressureChange(type){
  326. if (type == 1) {
  327. this.form.venous_pressure = this.form.venous_pressure * 7.5
  328. } else if(type == 2) {
  329. this.form.transmembrane_pressure = this.form.transmembrane_pressure * 7.5
  330. } else {
  331. this.form.arterial_pressure = this.form.arterial_pressure * 7.5
  332. }
  333. },
  334. isShow (name) {
  335. var filedList = this.$store.getters.user.fileds
  336. for (let i = 0; i < filedList.length; i++) {
  337. if (filedList[i].module == 4 && filedList[i].filed_name_cn == name && filedList[i].is_show == 1) {
  338. return true
  339. }
  340. }
  341. return false
  342. },
  343. getLastRecordTody(){
  344. let params = {
  345. patient_id: this.patient.id
  346. }
  347. GetMonitorToday(params).then(rs => {
  348. var resp =rs.data.data
  349. this.today_last_monitor_record = resp.monitor
  350. // this.form.operate_time = Date.parse(new Date())
  351. this.form.operate_time = resp.monitor.operate_time ? (resp.monitor.operate_time+3600)* 1000 : Date.parse(new Date())
  352. this.form.pulse_frequency = '' //this.last_monitor_record.pulse_frequency;
  353. this.form.breathing_rated = resp.monitor.breathing_rate?resp.monitor.breathing_rate:'';
  354. this.form.systolic_bp = '' //this.last_monitor_record.systolic_blood_pressure;
  355. this.form.diastolic_bp = '' //this.last_monitor_record.diastolic_blood_pressure;
  356. this.form.blood_flow_volume = resp.monitor.blood_flow_volume?resp.monitor.blood_flow_volume:'';
  357. this.form.venous_pressure = ''//this.last_monitor_record.venous_pressure;
  358. this.form.arterial_pressure = '' //this.last_monitor_record.arterial_pressure;
  359. this.form.transmembrane_pressure = '' // this.last_monitor_record.transmembrane_pressure;
  360. this.form.ultrafiltration_rate = resp.monitor.ultrafiltration_rate?resp.monitor.ultrafiltration_rate:'';
  361. this.form.ultrafiltration_volume = resp.monitor.ultrafiltration_volume?resp.monitor.ultrafiltration_volume:'';
  362. this.form.sodium_concentration = resp.monitor.sodium_concentration?resp.monitor.sodium_concentration:'';
  363. this.form.dialysate_temperature = resp.monitor.dialysate_temperature?resp.monitor.dialysate_temperature:'';
  364. this.form.temperature = resp.monitor.temperature?resp.monitor.temperature:'';
  365. this.form.replacement_rate = resp.monitor.replacement_rate?resp.monitor.replacement_rate:'';
  366. this.form.displacement_quantity = '' // this.last_monitor_record.displacement_quantity;
  367. this.form.conductivity = ''
  368. this.form.displacement_flow_quantity = ''
  369. this.form.ktv = '' //this.last_monitor_record.ktv;
  370. this.form.symptom = ''// this.last_monitor_record.symptom;
  371. this.form.dispose = '' // this.last_monitor_record.dispose;
  372. this.form.result = '' //this.last_monitor_record.result;
  373. this.form.id = -1
  374. console.log(this.form)
  375. })
  376. },
  377. getLastRecord () {
  378. let params = {
  379. patient_id: this.patient.id
  380. }
  381. GetMonitor(params).then(rs => {
  382. var resp = rs.data
  383. if (resp.state == 1) {
  384. var monitor = resp.data.monitor
  385. if (monitor.systolic_blood_pressure == 0) {
  386. this.form.systolic_bp = ''
  387. } else {
  388. this.form.systolic_bp = monitor.systolic_blood_pressure
  389. }
  390. if (monitor.diastolic_blood_pressure == 0) {
  391. this.form.diastolic_bp = ''
  392. } else {
  393. this.form.diastolic_bp = monitor.diastolic_blood_pressure
  394. }
  395. if (monitor.pulse_frequency == 0) {
  396. this.form.pulse_frequency = ''
  397. } else {
  398. this.form.pulse_frequency = monitor.pulse_frequency
  399. }
  400. if (monitor.breathing_rate == 0) {
  401. this.form.breathing_rated = ''
  402. } else {
  403. this.form.breathing_rated = monitor.breathing_rate
  404. }
  405. if (monitor.blood_flow_volume == 0) {
  406. this.form.blood_flow_volume = ''
  407. } else {
  408. this.form.blood_flow_volume = monitor.blood_flow_volume
  409. }
  410. if (monitor.venous_pressure == 0) {
  411. this.form.venous_pressure = ''
  412. } else {
  413. this.form.venous_pressure = monitor.venous_pressure
  414. }
  415. if (monitor.arterial_pressure == 0) {
  416. this.form.arterial_pressure = ''
  417. } else {
  418. this.form.arterial_pressure = monitor.arterial_pressure
  419. }
  420. if (monitor.transmembrane_pressure == 0) {
  421. this.form.transmembrane_pressure = ''
  422. } else {
  423. this.form.transmembrane_pressure = monitor.transmembrane_pressure
  424. }
  425. if (monitor.ultrafiltration_rate == 0) {
  426. this.form.ultrafiltration_rate = ''
  427. } else {
  428. this.form.ultrafiltration_rate = monitor.ultrafiltration_rate
  429. }
  430. if (monitor.ultrafiltration_volume == 0) {
  431. this.form.ultrafiltration_volume = ''
  432. } else {
  433. this.form.ultrafiltration_volume = monitor.ultrafiltration_volume
  434. }
  435. if (monitor.sodium_concentration == 0) {
  436. this.form.sodium_concentration = ''
  437. } else {
  438. this.form.sodium_concentration = monitor.sodium_concentration
  439. }
  440. if (monitor.dialysate_temperature == 0) {
  441. this.form.dialysate_temperature = ''
  442. } else {
  443. this.form.dialysate_temperature = monitor.dialysate_temperature
  444. }
  445. if (monitor.temperature == 0) {
  446. this.form.temperature = ''
  447. } else {
  448. this.form.temperature = monitor.temperature
  449. }
  450. if (monitor.replacement_rate == 0) {
  451. this.form.replacement_rate = ''
  452. } else {
  453. this.form.replacement_rate = monitor.replacement_rate
  454. }
  455. if (monitor.displacement_quantity == 0) {
  456. this.form.displacement_quantity = ''
  457. } else {
  458. this.form.displacement_quantity = monitor.displacement_quantity
  459. }
  460. if (monitor.conductivity == 0) {
  461. this.form.conductivity = ''
  462. } else {
  463. this.form.conductivity = monitor.conductivity
  464. }
  465. if (monitor.displacement_flow_quantity == 0) {
  466. this.form.displacement_flow_quantity = ''
  467. } else {
  468. this.form.displacement_flow_quantity = monitor.displacement_flow_quantity
  469. }
  470. this.form.ktv = monitor.ktv
  471. this.form.symptom = monitor.symptom
  472. this.form.dispose = monitor.dispose
  473. this.form.result = monitor.result
  474. this.form.operate_time = new Date(
  475. monitor.operate_time * 1000
  476. ).getTime()
  477. this.form.id = -1
  478. }
  479. })
  480. },
  481. selectRow (index, row) {
  482. this.currentIndex = index
  483. this.currentRow = row
  484. },
  485. inputFocus: function (event) {
  486. var input = event.target
  487. setTimeout(function () {
  488. input.parentNode.scrollIntoView()
  489. }, 0)
  490. // if (input.setSelectionRange) {
  491. // setTimeout(function () {
  492. // input.setSelectionRange(0, input.value.length);
  493. // }, 0);
  494. // } else if (input.createTextRange) {
  495. // var rng = input.createTextRange();
  496. // rng.move('character', input.value.length);
  497. // rng.select();
  498. // }
  499. },
  500. lastInputFocus: function (event) {
  501. var input = event.target
  502. setTimeout(function () {
  503. input.style.marginBottom = '2rem'
  504. input.parentNode.scrollIntoView()
  505. }, 0)
  506. },
  507. lastInputBlur: function (event) {
  508. var input = event.target
  509. setTimeout(function () {
  510. input.style.marginBottom = ''
  511. }, 0)
  512. },
  513. close: function () {
  514. this.$emit('close')
  515. },
  516. setRecords (records) {
  517. if (records == null) {
  518. records = []
  519. }
  520. this.tableDate.splice(0, this.tableDate.length)
  521. this.tableDate.push(...records)
  522. },
  523. parseTime (time, layout) {
  524. return parseTime(time, layout)
  525. },
  526. addRecords (records) {
  527. this.tableDate.push(...records)
  528. },
  529. deleteForm () {
  530. if (this.currentIndex < 0 || this.currentRow == null) {
  531. Toast.fail('请先选择要删除的记录')
  532. return false
  533. }
  534. Dialog.confirm({
  535. title: '删除监测记录',
  536. message: '是否删除该监测记录'
  537. })
  538. .then(() => {
  539. let params = {
  540. record_id: this.currentRow.id,
  541. patient_id: this.patient.id
  542. }
  543. deleteMonitorRecord(params).then(rs => {
  544. var resp = rs.data
  545. if (resp.state == 1) {
  546. var recordId = resp.data.record_id
  547. this.$emit('did_delete_monitor', recordId)
  548. Toast.success('删除成功')
  549. } else {
  550. Toast.fail(resp.msg)
  551. }
  552. })
  553. })
  554. .catch(() => {
  555. })
  556. },
  557. handleConfirm (time) {
  558. this.form.operate_time = time.getTime()
  559. // var timeMap = time.split(":");
  560. // this.form.monitor_time = time;
  561. // this.monitor_time_str =
  562. // parseTime(this.form.monitor_date, "{y}-{m}-{d}") +
  563. // " " +
  564. // this.form.monitor_time;
  565. // this.monitor_time_str = this.handleTime(time);
  566. // this.form.monitor_time = parseTime(time, "{h}:{i}")
  567. // this.form.monitor_date = Math.round(new Date(parseTime(time, "{y}-{m}-{d}") + " 00:00:00").getTime()/1000);
  568. },
  569. handleTime (time) {
  570. var year = time.getFullYear()
  571. var month = time.getMonth() + 1
  572. var day = time.getDate()
  573. var hour = time.getHours()
  574. var minute = time.getMinutes()
  575. if (month < 10) {
  576. month = '0' + month
  577. }
  578. if (day < 10) {
  579. day = '0' + day
  580. }
  581. if (hour < 10) {
  582. hour = '0' + hour
  583. }
  584. if (minute < 10) {
  585. minute = '0' + minute
  586. }
  587. return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':00'
  588. },
  589. chooseTime () {
  590. this.$refs.picker.open()
  591. },
  592. openEidtForm () {
  593. if (this.currentIndex < 0 || this.currentRow == null) {
  594. Toast.fail('请先选择要修改的记录')
  595. return false
  596. }
  597. this.formTitle = '修改监测'
  598. this.formPanel = true
  599. this.listPanel = false
  600. // console.log("this.currentRow", this.currentRow);
  601. if (this.currentRow.systolic_blood_pressure == 0) {
  602. this.form.systolic_bp = ''
  603. } else {
  604. this.form.systolic_bp = this.currentRow.systolic_blood_pressure
  605. }
  606. if (this.currentRow.diastolic_blood_pressure == 0) {
  607. this.form.diastolic_bp = ''
  608. } else {
  609. this.form.diastolic_bp = this.currentRow.diastolic_blood_pressure
  610. }
  611. if (this.currentRow.pulse_frequency == 0) {
  612. this.form.pulse_frequency = ''
  613. } else {
  614. this.form.pulse_frequency = this.currentRow.pulse_frequency
  615. }
  616. if (this.currentRow.breathing_rate == 0) {
  617. this.form.breathing_rated = ''
  618. } else {
  619. this.form.breathing_rated = this.currentRow.breathing_rate
  620. }
  621. if (this.currentRow.blood_flow_volume == 0) {
  622. this.form.blood_flow_volume = ''
  623. } else {
  624. this.form.blood_flow_volume = this.currentRow.blood_flow_volume
  625. }
  626. if (this.currentRow.venous_pressure == 0) {
  627. this.form.venous_pressure = ''
  628. } else {
  629. this.form.venous_pressure = this.currentRow.venous_pressure
  630. }
  631. if (this.currentRow.arterial_pressure == 0) {
  632. this.form.arterial_pressure = ''
  633. } else {
  634. this.form.arterial_pressure = this.currentRow.arterial_pressure
  635. }
  636. if (this.currentRow.transmembrane_pressure == 0) {
  637. this.form.transmembrane_pressure = ''
  638. } else {
  639. this.form.transmembrane_pressure = this.currentRow.transmembrane_pressure
  640. }
  641. if (this.currentRow.ultrafiltration_rate == 0) {
  642. this.form.ultrafiltration_rate = ''
  643. } else {
  644. this.form.ultrafiltration_rate = this.currentRow.ultrafiltration_rate
  645. }
  646. if (this.currentRow.ultrafiltration_volume == 0) {
  647. this.form.ultrafiltration_volume = ''
  648. } else {
  649. this.form.ultrafiltration_volume = this.currentRow.ultrafiltration_volume
  650. }
  651. if (this.currentRow.sodium_concentration == 0) {
  652. this.form.sodium_concentration = ''
  653. } else {
  654. this.form.sodium_concentration = this.currentRow.sodium_concentration
  655. }
  656. if (this.currentRow.dialysate_temperature == 0) {
  657. this.form.dialysate_temperature = ''
  658. } else {
  659. this.form.dialysate_temperature = this.currentRow.dialysate_temperature
  660. }
  661. if (this.currentRow.temperature == 0) {
  662. this.form.temperature = ''
  663. } else {
  664. this.form.temperature = this.currentRow.temperature
  665. }
  666. if (this.currentRow.replacement_rate == 0) {
  667. this.form.replacement_rate = ''
  668. } else {
  669. this.form.replacement_rate = this.currentRow.replacement_rate
  670. }
  671. if (this.currentRow.displacement_quantity == 0) {
  672. this.form.displacement_quantity = ''
  673. } else {
  674. this.form.displacement_quantity = this.currentRow.displacement_quantity
  675. }
  676. if (this.currentRow.conductivity == 0) {
  677. this.form.conductivity = ''
  678. } else {
  679. this.form.conductivity = this.currentRow.conductivity
  680. }
  681. if (this.currentRow.displacement_flow_quantity == 0) {
  682. this.form.displacement_flow_quantity = ''
  683. } else {
  684. this.form.displacement_flow_quantity = this.currentRow.displacement_flow_quantity
  685. }
  686. if (this.currentRow.ktv == 0) {
  687. this.form.ktv = ''
  688. } else {
  689. this.form.ktv = this.currentRow.ktv
  690. }
  691. this.form.symptom = this.currentRow.symptom
  692. this.form.dispose = this.currentRow.dispose
  693. this.form.result = this.currentRow.result
  694. this.form.id = this.currentRow.id
  695. this.form.operate_time = this.currentRow.operate_time * 1000
  696. // this.monitor_time_str =
  697. // parseTime(this.form.monitor_date, "{y}-{m}-{d}") +
  698. // " " +
  699. // this.form.monitor_time;
  700. },
  701. openForm () {
  702. this.formTitle = '新增监测'
  703. this.formPanel = true
  704. this.listPanel = false
  705. // if(this.monitor_time_str == "") {
  706. var date = this.$route.query && this.$route.query.date
  707. date *= 1000
  708. var newDate = new Date(date)
  709. var y = newDate.getFullYear()
  710. var m = newDate.getMonth() + 1
  711. var d = newDate.getDate()
  712. var record_date =
  713. y + '/' + (m < 10 ? '0' + m : m) + '/' + (d < 10 ? '0' + d : d)
  714. this.form.monitor_date = new Date(record_date + ' 00:00:00').getTime() / 1000
  715. var nowTime = new Date()
  716. // this.form.monitor_time = parseTime(nowTime, "{h}:{i}");
  717. // this.monitor_time_str = this.handleTime(nowTime);
  718. // this.monitor_time_str = record_date + " " + this.form.monitor_time;
  719. this.getLastRecordTody()
  720. // }
  721. },
  722. submitEditAction: function () {
  723. this.loading = true
  724. Toast.loading({forbidClick: true, duration: 0})
  725. var params = {}
  726. params.patient_id = this.patient.id
  727. params.order_id = this.order == null ? 0 : this.order.id
  728. params.date = this.form.monitor_date
  729. // params.time = this.form.monitor_time;
  730. params.operate_time = parseInt(this.form.operate_time / 1000)
  731. params.pulse_frequency = this.form.pulse_frequency
  732. params.breathing_rated = this.form.breathing_rated
  733. params.systolic_bp = this.form.systolic_bp
  734. params.diastolic_bp = this.form.diastolic_bp
  735. params.blood_flow_volume = this.form.blood_flow_volume
  736. params.venous_pressure = this.form.venous_pressure
  737. params.arterial_pressure = this.form.arterial_pressure
  738. params.transmembrane_pressure = this.form.transmembrane_pressure
  739. params.ultrafiltration_rate = this.form.ultrafiltration_rate
  740. params.ultrafiltration_volume = this.form.ultrafiltration_volume
  741. params.sodium_concentration = this.form.sodium_concentration
  742. params.dialysate_temperature = this.form.dialysate_temperature
  743. params.temperature = this.form.temperature
  744. params.replacement_rate = this.form.replacement_rate
  745. params.displacement_quantity = this.form.displacement_quantity
  746. params.ktv = this.form.ktv
  747. params.conductivity = this.form.conductivity
  748. params.symptom = this.form.symptom
  749. params.dispose = this.form.dispose
  750. params.result = this.form.result
  751. params.monitoring_nurse = this.form.monitoring_nurse
  752. params.displacement_flow_quantity = this.form.displacement_flow_quantity
  753. params.id = this.form.id
  754. editMonitorRecord(params).then(rs => {
  755. var resp = rs.data
  756. if (resp.state == 1) {
  757. this.loading = false
  758. var monitor = resp.data.monitor
  759. this.$emit('did_edit_monitor', monitor)
  760. this.selectRow(-1, null)
  761. this.form.pulse_frequency = ''
  762. this.form.breathing_rated = ''
  763. this.form.systolic_bp = ''
  764. this.form.diastolic_bp = ''
  765. this.form.blood_flow_volume = ''
  766. this.form.venous_pressure = ''
  767. this.form.arterial_pressure = ''
  768. this.form.transmembrane_pressure = ''
  769. this.form.ultrafiltration_rate = ''
  770. this.form.ultrafiltration_volume = ''
  771. this.form.sodium_concentration = ''
  772. this.form.dialysate_temperature = ''
  773. this.form.temperature = ''
  774. this.form.replacement_rate = ''
  775. this.form.displacement_quantity = ''
  776. this.form.ktv = ''
  777. this.form.symptom = ''
  778. this.form.dispose = ''
  779. this.form.result = ''
  780. this.form.conductivity = ''
  781. this.form.displacement_flow_quantity = ''
  782. this.form.id = -1
  783. Toast.success('修改成功')
  784. this.formPanel = false
  785. this.listPanel = true
  786. } else {
  787. this.loading = false
  788. Toast.fail(resp.msg)
  789. }
  790. })
  791. },
  792. submitAction: function () {
  793. this.loading = true
  794. Toast.loading({forbidClick: true, duration: 0})
  795. var params = {}
  796. params.patient_id = this.patient.id
  797. params.order_id = this.order == null ? 0 : this.order.id
  798. params.date = this.form.monitor_date
  799. params.operate_time = parseInt(this.form.operate_time / 1000)
  800. params.pulse_frequency = this.form.pulse_frequency
  801. params.breathing_rated = this.form.breathing_rated
  802. params.systolic_bp = this.form.systolic_bp
  803. params.diastolic_bp = this.form.diastolic_bp
  804. params.blood_flow_volume = this.form.blood_flow_volume
  805. params.venous_pressure = this.form.venous_pressure
  806. params.arterial_pressure = this.form.arterial_pressure
  807. params.transmembrane_pressure = this.form.transmembrane_pressure
  808. params.ultrafiltration_rate = this.form.ultrafiltration_rate
  809. params.ultrafiltration_volume = this.form.ultrafiltration_volume
  810. params.sodium_concentration = this.form.sodium_concentration
  811. params.dialysate_temperature = this.form.dialysate_temperature
  812. params.temperature = this.form.temperature
  813. params.replacement_rate = this.form.replacement_rate
  814. params.displacement_quantity = this.form.displacement_quantity
  815. params.conductivity = this.form.conductivity
  816. params.displacement_flow_quantity = this.form.displacement_flow_quantity
  817. params.ktv = this.form.ktv
  818. params.symptom = this.form.symptom
  819. params.dispose = this.form.dispose
  820. params.result = this.form.result
  821. params.monitoring_nurse = this.form.monitoring_nurse
  822. addMonitorRecord(params)
  823. .then(rs => {
  824. var resp = rs.data
  825. if (resp.state == 1) {
  826. this.loading = false
  827. var monitor = resp.data.monitor
  828. this.$emit('did_add_monitor', monitor)
  829. // this.monitor_records.unshift(monitor)
  830. // this.monitor_records= this.quickSort(this.monitor_records,"operate_time",false)
  831. this.form.pulse_frequency = ''
  832. this.form.breathing_rated = ''
  833. this.form.systolic_bp = ''
  834. this.form.diastolic_bp = ''
  835. this.form.blood_flow_volume = ''
  836. this.form.venous_pressure = ''
  837. this.form.arterial_pressure = ''
  838. this.form.transmembrane_pressure = ''
  839. this.form.ultrafiltration_rate = ''
  840. this.form.ultrafiltration_volume = ''
  841. this.form.sodium_concentration = ''
  842. this.form.dialysate_temperature = ''
  843. this.form.temperature = ''
  844. this.form.replacement_rate = ''
  845. this.form.displacement_quantity = ''
  846. this.form.ktv = ''
  847. this.form.symptom = ''
  848. this.form.dispose = ''
  849. this.form.result = ''
  850. this.form.conductivity = ''
  851. this.form.displacement_flow_quantity = ''
  852. // this.last_monitor_record.sodium_concentration =
  853. // monitor.sodium_concentration
  854. // this.last_monitor_record.dialysate_temperature =
  855. // monitor.dialysate_temperature
  856. Toast.success('新增成功')
  857. this.formPanel = false
  858. this.listPanel = true
  859. } else {
  860. this.loading = false
  861. Toast.fail(resp.msg)
  862. }
  863. })
  864. .catch(err => {
  865. this.loading = false
  866. Toast.fail(err)
  867. })
  868. },
  869. showSubMenu: function (val) {
  870. switch (val) {
  871. case 'symptom':
  872. this.propForm.type = 1
  873. this.formPanel = false
  874. this.propForm.title = '病情变化'
  875. this.visibility = true
  876. this.propForm.list = getDataConfig('hemodialysis', 'symptoms')
  877. this.propForm.optionList = []
  878. this.propForm.isMultiple = 2
  879. if (this.form.symptom.length > 0) {
  880. this.propForm.result = this.form.symptom.split(',')
  881. } else {
  882. this.propForm.result = []
  883. }
  884. break
  885. case 'dispose':
  886. this.propForm.type = 2
  887. this.formPanel = false
  888. this.propForm.title = '处理'
  889. this.visibility = true
  890. this.propForm.list = getDataConfig('hemodialysis', 'deals')
  891. this.propForm.optionList = []
  892. this.propForm.isMultiple = 2
  893. if (this.form.dispose.length > 0) {
  894. this.propForm.result = this.form.dispose.split(',')
  895. } else {
  896. this.propForm.result = []
  897. }
  898. break
  899. case 'result':
  900. this.propForm.type = 3
  901. this.formPanel = false
  902. this.propForm.title = '结果'
  903. this.visibility = true
  904. this.propForm.list = getDataConfig('hemodialysis', 'results')
  905. this.propForm.optionList = []
  906. this.propForm.isMultiple = 2
  907. if (this.form.result.length > 0) {
  908. this.propForm.result = this.form.result.split(',')
  909. } else {
  910. this.propForm.result = []
  911. }
  912. break
  913. }
  914. },
  915. menuCancle: function () {
  916. this.visibility = false
  917. this.formPanel = true
  918. },
  919. menuComfirm: function (val) {
  920. this.visibility = false
  921. this.formPanel = true
  922. switch (val.type) {
  923. case 1:
  924. this.form.symptom = val.result.join(',')
  925. break
  926. case 2:
  927. this.form.dispose = val.result.join(',')
  928. break
  929. case 3:
  930. this.form.result = val.result.join(',')
  931. break
  932. }
  933. },
  934. open: function () {
  935. this.listPanel = true
  936. this.formPanel = false
  937. this.visibility = false
  938. this.$refs.picker.close()
  939. var dialogTop = document.querySelector('#dialogTop')
  940. if (dialogTop != null) {
  941. this.$nextTick(() => {
  942. dialogTop.scrollTop = 0
  943. })
  944. }
  945. },
  946. parseTime: function (time, format) {
  947. return parseTime(time, format)
  948. },
  949. quickSort (arr, name, snum) {
  950. //如果数组<=1,则直接返回
  951. if (arr.length <= 1) {
  952. return arr
  953. }
  954. var pivotIndex = Math.floor(arr.length / 2)
  955. //找基准,并把基准从原数组删除
  956. var pivot = arr.splice(pivotIndex, 1)[0]
  957. var middleNum = pivot[name]
  958. // 定义左右数组
  959. var left = []
  960. var right = []
  961. //比基准小的放在left,比基准大的放在right
  962. if (snum) {
  963. for (var i = 0; i < arr.length; i++) {
  964. if (arr[i][name] <= middleNum) {
  965. left.push(arr[i])
  966. } else {
  967. right.push(arr[i])
  968. }
  969. }
  970. } else {
  971. for (var i = 0; i < arr.length; i++) {
  972. if (arr[i][name] <= middleNum) {
  973. left.push(arr[i])
  974. } else {
  975. right.push(arr[i])
  976. }
  977. }
  978. }
  979. //递归,返回所需数组
  980. return this.quickSort(left, name, snum).concat(
  981. [pivot],
  982. this.quickSort(right, name, snum)
  983. )
  984. }
  985. },
  986. components: {
  987. CheckBoxSubMenu
  988. }
  989. }
  990. </script>
  991. <style style="stylesheet/scss" lang="scss" scoped>
  992. .DialogContent {
  993. .content {
  994. .cell {
  995. float: left;
  996. width: 4.93rem;
  997. margin: 0.35rem 0 0 0.5rem !important;
  998. label {
  999. display: block;
  1000. height: 0.55rem;
  1001. line-height: 0.55rem;
  1002. color: $pgh-color;
  1003. }
  1004. select {
  1005. width: 100%;
  1006. padding: 0.2rem 0;
  1007. border: 1px $border-color solid;
  1008. border-radius: 2px;
  1009. padding-left: 5px;
  1010. }
  1011. .inputBox {
  1012. border: 1px $border-color solid;
  1013. border-radius: 2px;
  1014. padding: 0.18rem 0;
  1015. padding-left: 5px;
  1016. width: 100%;
  1017. }
  1018. .input_focus {
  1019. margin-bottom: 2rem;
  1020. }
  1021. .textarea {
  1022. width: 100%;
  1023. height: 1.22rem;
  1024. border: 1px $border-color solid;
  1025. border-radius: 2px;
  1026. padding-left: 5px;
  1027. }
  1028. }
  1029. .width {
  1030. width: 95%;
  1031. @include box-sizing;
  1032. label {
  1033. display: inline-block;
  1034. }
  1035. button {
  1036. background: $main-color;
  1037. color: #fff;
  1038. border-radius: 6px;
  1039. width: 3.1rem;
  1040. height: 0.9rem;
  1041. line-height: 0.9rem;
  1042. text-align: center;
  1043. margin: 0 0 0.9rem 0;
  1044. }
  1045. }
  1046. .center {
  1047. text-align: center;
  1048. }
  1049. }
  1050. }
  1051. .row-class-active > td {
  1052. background: #badcff !important;
  1053. }
  1054. </style>