血透系统pad前端

MonitDialog.vue 31KB

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