血透系统pad前端

MonitDialog.vue 38KB

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