血透系统pad前端

MonitDialog.vue 42KB

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