血透系统PC前端

index.vue 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. </div>
  6. <div class="app-container sign-and-weigh-box">
  7. <el-row :gutter="20">
  8. <el-col :span="7">
  9. <div class="dataTitle">患者列表</div>
  10. <div style="margin-bottom: 10px;">
  11. <el-input v-model="queryParams.keywords" placeholder="姓名/透析号" style="width: 180px;" @change="changeSearch"></el-input>
  12. <el-select v-model="queryParams.schedule_type" style="width: 100px;" @change="changeSearch">
  13. <el-option v-for="item in shiftOptions" :label="item.label" :value="item.value" :key="item.value"></el-option>
  14. </el-select>
  15. </div>
  16. <el-table :data="patients" :class="signAndWeighBoxPatients" style="width: 100%" border highlight-current-row :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" max-height="300" @current-change="handleCurrentChange">
  17. <el-table-column type="index" label="序号" min-width="30" align="center"></el-table-column>
  18. <el-table-column prop="name" label="姓名" min-width="30" align="center">
  19. <template slot-scope="scope">
  20. {{scope.row.name}}({{scope.row.dialysis_no}})
  21. </template>
  22. </el-table-column>
  23. <el-table-column prop="state" label="状态" min-width="30" align="center">
  24. <template slot-scope="scope">
  25. <span v-if="scope.row.id==0">未签到</span>
  26. <span v-else-if="scope.row.dialysis_order.stage==2">已经下机</span>
  27. <span v-else>已签到</span>
  28. </template>
  29. </el-table-column>
  30. </el-table>
  31. <el-table :data="schedules" :class="signAndWeighBoxPatients" style="width: 100%; margin:15px 0 0 0;" border highlight-current-row :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}">
  32. <el-table-column prop="shift" label="班次" min-width="30" align="center"></el-table-column>
  33. <el-table-column prop="arrange" label="排班" min-width="30" align="center" ></el-table-column>
  34. <el-table-column prop="sign" label="签到" min-width="30" align="center" ></el-table-column>
  35. <el-table-column prop="weight" label="称重(透前/透后)" min-width="50" align="center">
  36. <template slot-scope="scope">
  37. {{scope.row.before}} / {{scope.row.after}}
  38. </template>
  39. </el-table-column>
  40. </el-table>
  41. </el-col>
  42. <el-col :span="17">
  43. <div class="dataTitle">患者信息</div>
  44. <el-form class="information" label-position="left">
  45. <div class="span"><span class="span">姓名:{{weigh_form.name}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;透析号:{{weigh_form.dialysis_no}} &nbsp;&nbsp;</span></div>
  46. <div class="patient-app-container">
  47. <span class="button"><el-button @click="change()">修改</el-button></span>
  48. </div>
  49. <div class="border"></div>
  50. <el-row :gutter="20">
  51. <el-col :span="8">
  52. <el-form-item label="透前称重(kg):" label-width="100px">
  53. <el-input v-model="weigh_list.weight_before" :disabled="disa" ></el-input>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :span="8">
  57. <el-form-item label="干体重(kg):" label-width="100px">
  58. <el-input v-model="weigh_list.dry_weight" :disabled="disa"></el-input>
  59. </el-form-item>
  60. </el-col>
  61. </el-row>
  62. <el-row :gutter="20">
  63. <el-col :span="4">
  64. <el-form-item label="体温(℃):" label-width="80px">
  65. <el-input v-model="weigh_list.temperature" :disabled="disa" style="width:70px"></el-input>
  66. </el-form-item>
  67. </el-col>
  68. <el-col :span="5">
  69. <el-form-item label="脉搏(次/分):" label-width="90px">
  70. <el-input v-model="weigh_list.pulse_frequency" :disabled="disa" style="width:70px"></el-input>
  71. </el-form-item>
  72. </el-col>
  73. <el-col :span="5">
  74. <el-form-item label="呼吸(次/分):" label-width="100px">
  75. <el-input v-model="weigh_list.breathing_rate" :disabled="disa" style="width:70px"></el-input>
  76. </el-form-item>
  77. </el-col>
  78. <el-col :span="9">
  79. <el-form-item label="血压(mmHg):" label-width="100px">
  80. <el-input v-model="weigh_list.systolic_blood_pressure" style="width: 70px" :disabled="disa"></el-input>
  81. <span> / </span>
  82. <el-input v-model="weigh_list.diastolic_blood_pressure" style="width: 70px" :disabled="disa"></el-input>
  83. </el-form-item>
  84. </el-col>
  85. </el-row>
  86. <div class="border"></div>
  87. <el-row :gutter="20">
  88. <el-col :span="8">
  89. <el-form-item label="透后称重(kg):" label-width="100px">
  90. <el-input v-model="weigh_infor.weight_after" :disabled="disa"></el-input>
  91. </el-form-item>
  92. </el-col>
  93. <el-col :span="8">
  94. <el-form-item label="干体重(kg):" label-width="100px">
  95. <el-input v-model="weigh_list.dry_weight" :disabled="disa"></el-input>
  96. </el-form-item>
  97. </el-col>
  98. </el-row>
  99. <el-row :gutter="20">
  100. <el-col :span="4">
  101. <el-form-item label="体温(℃):" label-width="80px">
  102. <el-input v-model="weigh_infor.temperature" :disabled="disa" style="width:70px"></el-input>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="5">
  106. <el-form-item label="脉搏(次/分):" label-width="90px">
  107. <el-input v-model="weigh_infor.pulse_frequency" :disabled="disa" style="width:70px"></el-input>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="5">
  111. <el-form-item label="呼吸(次/分):" label-width="100px">
  112. <el-input v-model="weigh_infor.breathing_rate" :disabled="disa" style="width:70px"></el-input>
  113. </el-form-item>
  114. </el-col>
  115. <el-col :span="9">
  116. <el-form-item label="血压(mmHg):" label-width="100px">
  117. <el-input v-model="weigh_infor.systolic_blood_pressure" style="width: 70px" :disabled="disa"></el-input>
  118. <span> / </span>
  119. <el-input v-model="weigh_infor.diastolic_blood_pressure" style="width: 70px" :disabled="disa"></el-input>
  120. </el-form-item>
  121. </el-col>
  122. </el-row>
  123. <div class="border"></div>
  124. <div v-if="show">
  125. <el-row :gutter="20">
  126. <el-col :span="23" align="right" class="button">
  127. <el-button @click="hide()">取消</el-button>
  128. <el-button @click="savedata();updatedata();sighdata()" type="primary">保存</el-button>
  129. </el-col>
  130. </el-row>
  131. </div>
  132. </el-form>
  133. </el-col>
  134. </el-row>
  135. </div>
  136. </div>
  137. </template>
  138. <script>
  139. import { fetchSignPatients, getPatientSign, SignWeigh, getDialysisInforInfomation, getDialysisAfterInfomation, createdata, editdata,sighdata} from '@/api/signandweigh'
  140. import BreadCrumb from '../components/bread-crumb'
  141. export default {
  142. name: 'sign',
  143. components: { BreadCrumb },
  144. data() {
  145. return {
  146. crumbs: [
  147. { path: '/sign/index', name: '签到称重' }
  148. ],
  149. patientlist: [],
  150. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  151. queryParams: {
  152. keywords: '',
  153. schedule_type: '',
  154. need_schedule_type: 0
  155. },
  156. querySignParams: {
  157. patient_id: 0,
  158. date_time: ''
  159. },
  160. weigh_form: {
  161. choose: false,
  162. name: '',
  163. dry_weight: '',
  164. clothes_weight: '',
  165. // 透前
  166. weigh_before: '',
  167. dehydrated_weight: '',
  168. dehydrated_percent: '',
  169. weight_before: '',
  170. temperature_before: '',
  171. pulse_rate_before: '', // P 脉率
  172. respiratory_rate_before: '', // R 呼吸频率
  173. DBP_before: '', // 舒张压
  174. SBP_before: '', // 收缩压
  175. // 透后
  176. weigh_after: '',
  177. weight_reduce_after: '',
  178. weight_after: '',
  179. temperature_after: '',
  180. pulse_rate_after: '', // P 脉率
  181. respiratory_rate_after: '', // R 呼吸频率
  182. DBP_after: '', // 舒张压
  183. SBP_after: '', // 收缩压
  184. dialysis_no: ''
  185. },
  186. weigh_list: {
  187. weight_before: '', // 透前体重
  188. temperature: '', // 体温
  189. pulse_frequency: '', // 脉搏
  190. breathing_rate: '', // 呼吸频率
  191. dry_weight: '', // 干体重
  192. systolic_blood_pressure: '', // 收缩压
  193. diastolic_blood_pressure: ''// 舒张压
  194. },
  195. weigh_infor: {
  196. weight_after: '', // 透后体重
  197. temperature: '',
  198. pulse_frequency: '',
  199. breathing_rate: '',
  200. dry_weight: '',
  201. systolic_blood_pressure: '',
  202. diastolic_blood_pressure: ''
  203. },
  204. shiftOptions: [
  205. { value: 0, label: '班次' },
  206. { value: 1, label: '上午' },
  207. { value: 2, label: '下午' },
  208. { value: 3, label: '晚上' }
  209. ],
  210. schedules: [{
  211. type: 1,
  212. shift: '上午',
  213. arrange: 0,
  214. sign: 0,
  215. before: 0,
  216. after: 0
  217. }, {
  218. type: 2,
  219. shift: '下午',
  220. arrange: 0,
  221. sign: 0,
  222. before: 0,
  223. after: 0
  224. }, {
  225. type: 3,
  226. shift: '晚上',
  227. arrange: 0,
  228. sign: 0,
  229. before: 0,
  230. after: 0
  231. }],
  232. patients: [],
  233. dialysis_stege: 0,
  234. show: false,
  235. disa:true,
  236. }
  237. },
  238. methods: {
  239. fetchSignPatients() {
  240. fetchSignPatients(this.queryParams).then(response => {
  241. this.patients = []
  242. if (response.data.state === 1) {
  243. this.patients = response.data.data.patients
  244. this.queryParams.schedule_type = response.data.data.schedule_type
  245. this.querySignParams.date_time = response.data.data.today
  246. if (this.queryParams.need_schedule_type === 1) {
  247. var sl = this.schedules.length
  248. for (let index = 0; index < sl; index++) {
  249. if (this.schedules[index].type in response.data.data.panel) {
  250. this.schedules[index].arrange = response.data.data.panel[this.schedules[index].type].schedule
  251. this.schedules[index].sign = response.data.data.panel[this.schedules[index].type].sign
  252. this.schedules[index].before = response.data.data.panel[this.schedules[index].type].before
  253. this.schedules[index].after = response.data.data.panel[this.schedules[index].type].after
  254. }
  255. }
  256. }
  257. }
  258. })
  259. },
  260. // getPatientSign(){
  261. // getPatientSign(this.querySignParams).then(response=>{
  262. // if (response.data.state==1) {
  263. // if (response.data.data.sign != null) {
  264. // var sign = response.data.data.sign;
  265. // this.weigh_form.dry_weight = sign.dry_weight;
  266. // this.weigh_form.clothes_weight = sign.clothes_weight;
  267. // // 透前
  268. // this.weigh_form.weigh_before = sign.weigh_before;
  269. // this.weigh_form.dehydrated_weight = sign.dehydrated_weight;
  270. // this.weigh_form.dehydrated_percent = sign.dehydrated_percent;
  271. // this.weigh_form.weight_before = sign.weight_before;
  272. // this.weigh_form.temperature_before = sign.temperature_before;
  273. // this.weigh_form.pulse_rate_before = sign.pulse_rate_before; // P 脉率
  274. // this.weigh_form.respiratory_rate_before = sign.respiratory_rate_before; // R 呼吸频率
  275. // this.weigh_form.DBP_before = sign.DBP_before; // 舒张压
  276. // this.weigh_form.SBP_before = sign.SBP_before // 收缩压
  277. // // 透后
  278. // this.weigh_form.weigh_after = sign.weigh_after;
  279. // this.weigh_form.weight_reduce_after = sign.weight_reduce_after;
  280. // this.weigh_form.weight_after = sign.weight_after
  281. // this.weigh_form.temperature_after = sign.temperature_after;
  282. // this.weigh_form.pulse_rate_after = sign.pulse_rate_after; // P 脉率
  283. // this.weigh_form.respiratory_rate_after = sign.respiratory_rate_after; // R 呼吸频率
  284. // this.weigh_form.DBP_after = sign.DBP_after; // 舒张压
  285. // this.weigh_form.SBP_after = sign.SBP_after; // 收缩压
  286. // this.weigh_form.id=sign.id;
  287. // }
  288. // }
  289. // });
  290. // },
  291. changeSearch() {
  292. this.queryParams.need_schedule_type = 0
  293. this.fetchSignPatients()
  294. },
  295. handleCurrentChange(row, old) {
  296. // this.weigh_form = {
  297. // id:0,
  298. // choose:false,
  299. // name: '',
  300. // dry_weight: '',
  301. // clothes_weight: '',
  302. // // 透前
  303. // weigh_before: '',
  304. // dehydrated_weight: '',
  305. // dehydrated_percent: '',
  306. // weight_before: '',
  307. // temperature_before: '',
  308. // pulse_rate_before: '', // P 脉率
  309. // respiratory_rate_before: '', // R 呼吸频率
  310. // DBP_before: '', // 舒张压
  311. // SBP_before: '', // 收缩压
  312. // // 透后
  313. // weigh_after: '',
  314. // weight_reduce_after: '',
  315. // weight_after: '',
  316. // temperature_after: '',
  317. // pulse_rate_after: '', // P 脉率
  318. // respiratory_rate_after: '', // R 呼吸频率
  319. // DBP_after: '', // 舒张压
  320. // SBP_after: '', // 收缩压
  321. // patient_id: 0,
  322. // dialysis_no:'',
  323. // };
  324. this.disa = true
  325. this.weigh_form.choose = true
  326. this.weigh_form.name = row.name
  327. this.weigh_form.dialysis_no = row.dialysis_no
  328. // if (row.alias.length>0) {
  329. // this.weigh_form.name += "("+row.alias+")";
  330. // }
  331. this.weigh_form.patient_id = row.id
  332. this.querySignParams.patient_id = row.id
  333. this.dialysis_stege = row.dialysis_order.stage
  334. this.getDialysisInforInfomation(row.id)
  335. this.getDialysisAfterInfomation(row.id)
  336. if (row.signin != null) {
  337. this.weigh_form.dry_weight = '' + row.signin.dry_weight;
  338. this.weigh_form.clothes_weight = '' + row.signin.clothing_weight;
  339. // 透前
  340. this.weigh_form.weigh_before = '' + row.signin.weighing_before;
  341. this.weigh_form.dehydrated_weight = '' + row.signin.target_dewatering;
  342. if (this.weigh_form.dry_weight == 0) {
  343. this.weigh_form.dehydrated_percent = '';
  344. }else {
  345. var dehydrated_percent = ((this.weigh_form.dehydrated_weight/this.weigh_form.dry_weight) * 100).toFixed(2);
  346. if (isNaN(dehydrated_percent)) {
  347. this.weigh_form.dehydrated_percent = '';
  348. }else {
  349. this.weigh_form.dehydrated_percent = dehydrated_percent + "%";
  350. }
  351. }
  352. this.weigh_form.weight_before = '' + row.signin.weight_before;
  353. this.weigh_form.temperature_before = '' + row.signin.temperature_before;
  354. this.weigh_form.pulse_rate_before = '' + row.signin.pulse_frequency_before;
  355. this.weigh_form.respiratory_rate_before = '' + row.signin.breathing_rate_before;
  356. this.weigh_form.DBP_before = '' + row.signin.diastolic_blood_pressure_before;
  357. this.weigh_form.SBP_before = '' + row.signin.systolic_blood_pressure_before;
  358. this.weigh_form.weigh_after = '' + row.signin.weighing_after;
  359. this.weigh_form.weight_reduce_after = '' + row.signin.weight_loss;
  360. this.weigh_form.weight_after = '' + row.signin.weight_after;
  361. this.weigh_form.temperature_after = '' + row.signin.temperature_after;
  362. this.weigh_form.pulse_rate_after = '' + row.signin.pulse_frequency_after;
  363. this.weigh_form.respiratory_rate_after = '' + row.signin.breathing_rate_after;
  364. this.weigh_form.DBP_after = '' + row.signin.diastolic_blood_pressure_after;
  365. this.weigh_form.SBP_after = '' + row.signin.systolic_blood_pressure_after;
  366. this.weigh_form.id = row.id;
  367. console.log("好难哦")
  368. console.log(this.weigh_form.id)
  369. }
  370. },
  371. submitSign() {
  372. SignWeigh(this.querySignParams, this.weigh_form).then(response => {
  373. if (response.data.state === 1) {
  374. this.$message({
  375. type: 'success',
  376. message: '成功!'
  377. })
  378. var tlen = this.patients.length
  379. for (let index = 0; index < tlen; index++) {
  380. if (this.patients[index].id === this.querySignParams.patient_id) {
  381. var signin = this.patients[index].signin
  382. this.patients[index].signin = response.data.data.sign
  383. if (this.patients[index].schedule.id > 0 && (this.patients[index].schedule.schedule_type >= 1 || this.patients[index].schedule.schedule_type <= 3)) {
  384. var sl = this.schedules.length
  385. for (let j = 0; j < sl; j++) {
  386. if (this.schedules[j].type === this.patients[index].schedule.schedule_type) {
  387. if (this.weigh_form.id <= 0) {
  388. this.schedules[j].sign++
  389. }
  390. if (signin.weigh_before_time === 0 && response.data.data.sign.weigh_before_time > 0) {
  391. this.schedules[j].before++
  392. }
  393. if (signin.weigh_time === 0 && response.data.data.sign.weigh_time > 0) {
  394. this.schedules[j].after++
  395. }
  396. }
  397. }
  398. }
  399. break
  400. }
  401. }
  402. this.weigh_form.id = response.data.data.sign.id
  403. } else {
  404. this.$message.error(response.data.msg)
  405. return false
  406. }
  407. })
  408. },
  409. getDialysisInforInfomation(id) {
  410. getDialysisInforInfomation(id).then(response => {
  411. if (response.data.data.patientlist != null) {
  412. var patientlist = response.data.data.patientlist
  413. this.weigh_list.dry_weight = patientlist.dry_weight
  414. this.weigh_list.weight_before = patientlist.weight_before
  415. this.weigh_list.temperature = patientlist.temperature
  416. this.weigh_list.pulse_frequency = patientlist.pulse_frequency
  417. this.weigh_list.breathing_rate = patientlist.breathing_rate
  418. this.weigh_list.systolic_blood_pressure = patientlist.systolic_blood_pressure
  419. this.weigh_list.diastolic_blood_pressure = patientlist.diastolic_blood_pressure
  420. }
  421. })
  422. },
  423. getDialysisAfterInfomation(id) {
  424. getDialysisAfterInfomation(id).then(response => {
  425. if (response.data.data.patientinfor != null) {
  426. var patientinfor = response.data.data.patientinfor
  427. console.log(patientinfor)
  428. this.weigh_infor.dry_weight = patientinfor.dry_weight
  429. this.weigh_infor.weight_after = patientinfor.weight_after
  430. console.log(patientinfor.weight_after)
  431. this.weigh_infor.temperature = patientinfor.temperature
  432. this.weigh_infor.pulse_frequency = patientinfor.pulse_frequency
  433. this.weigh_infor.breathing_rate = patientinfor.breathing_rate
  434. this.weigh_infor.systolic_blood_pressure = patientinfor.systolic_blood_pressure
  435. this.weigh_infor.diastolic_blood_pressure = patientinfor.diastolic_blood_pressure
  436. }
  437. })
  438. },
  439. change() {
  440. this.show = true
  441. this.disa = false
  442. },
  443. savedata() {
  444. var params = new Object()
  445. params.patient_id = this.weigh_form.patient_id
  446. params.dry_weight = this.weigh_list.dry_weight
  447. params.weight_before = this.weigh_list.weight_before
  448. params.temperature = this.weigh_list.temperature
  449. params.pulse_frequency = this.weigh_list.pulse_frequency
  450. params.breathing_rate = this.weigh_list.breathing_rate
  451. params.systolic_blood_pressure = this.weigh_list.systolic_blood_pressure
  452. params.diastolic_blood_pressure = this.weigh_list.diastolic_blood_pressure
  453. createdata(params).then(response => {
  454. if (response.data.state === 1) {
  455. this.$message({
  456. type: 'success',
  457. message: '成功!'
  458. })
  459. }
  460. })
  461. },
  462. hide() {
  463. this.show = false
  464. },
  465. updatedata() {
  466. var params = new Object()
  467. params.patient_id = this.weigh_form.patient_id
  468. params.dry_weight = this.weigh_infor.dry_weight
  469. params.weight_after = this.weigh_infor.weight_after
  470. params.temperature = this.weigh_infor.temperature
  471. params.pulse_frequency = this.weigh_infor.pulse_frequency
  472. params.breathing_rate = this.weigh_infor.breathing_rate
  473. params.systolic_blood_pressure = this.weigh_infor.systolic_blood_pressure
  474. params.diastolic_blood_pressure = this.weigh_infor.diastolic_blood_pressure
  475. editdata(params).then(response => {
  476. if (response.data.state === 1) {
  477. this.$message({
  478. type: 'success',
  479. message: '成功!'
  480. })
  481. }
  482. })
  483. console.log('hahahahah')
  484. console.log(params)
  485. },
  486. sighdata() {
  487. //透前数据
  488. var params = new Object()
  489. var data_time = this.querySignParams.date_time
  490. params.date_time = data_time
  491. params.patient_id = this.weigh_form.patient_id
  492. params.dry_weight = this.weigh_list.dry_weight
  493. params.weight_before = this.weigh_list.weight_before
  494. params.temperature = this.weigh_list.temperature
  495. params.pulse_frequency = this.weigh_list.pulse_frequency
  496. params.breathing_rate = this.weigh_list.breathing_rate
  497. params.systolic_blood_pressure = this.weigh_list.systolic_blood_pressure
  498. params.diastolic_blood_pressure = this.weigh_list.diastolic_blood_pressure
  499. //透后数据
  500. params.weight_after = this.weigh_infor.weight_after
  501. params.temperatureafter = this.weigh_infor.temperature
  502. params.pulse_frequencyafter = this.weigh_infor.pulse_frequency
  503. params.breathing_rateafter = this.weigh_infor.breathing_rate
  504. params.systolic_blood_pressureafter = this.weigh_infor.systolic_blood_pressure
  505. params.diastolic_blood_pressureafter = this.weigh_infor.diastolic_blood_pressure
  506. console.log("params数据",params)
  507. sighdata(params).then(response => {
  508. var signs = response.data.data.signs
  509. console.log(signs)
  510. if (response.data.state === 1) {
  511. this.$message({
  512. type: 'success',
  513. message: '成功!'
  514. })
  515. var tlen = this.patients.length
  516. for(let index=0;index<tlen;index++ ){
  517. if(this.patients[index].id ==params.patient_id){
  518. var signin = this.patients[index].signin
  519. this.patients[index].signin = response.data.data.signs
  520. if(this.patients[index].schedule.id > 0 && (this.patients[index].schedule.schedule_type >= 1 || this.patients[index].schedule.schedule_type <= 3)){
  521. var sl = this.schedules.length
  522. for(let j = 0; j < sl; j++){
  523. if(this.schedules[j].type === this.patients[index].schedule.schedule_type){
  524. if(this.weigh_form.id > 0){
  525. this.schedules[j].sign++
  526. }
  527. if(signin.weigh_before_time === 0 && response.data.data.signs.weigh_before_time > 0){
  528. this.schedules[j].before++
  529. }
  530. if(signin.weigh_time === 0 && response.data.data.signs.weigh_time > 0){
  531. this.schedules[j].after++
  532. }
  533. }
  534. }
  535. }
  536. break
  537. }
  538. }
  539. this.weigh_form.id = response.data.data.signs.id
  540. }else{
  541. this.$message.error(response.data.msg)
  542. return false
  543. }
  544. })
  545. }
  546. },
  547. watch: {
  548. 'weigh_form.weigh_before': function() {
  549. this.weigh_form.weight_before = this.weigh_form.weigh_before - this.weigh_form.clothes_weight
  550. this.weigh_form.dehydrated_weight = this.weigh_form.weigh_before - this.weigh_form.dry_weight - this.weigh_form.clothes_weight
  551. this.weigh_form.weight_before += ''
  552. this.weigh_form.dehydrated_weight += ''
  553. if (this.dialysis_stege === 2) {
  554. this.weigh_form.weight_reduce_after = this.weigh_form.weigh_before - this.weigh_form.weigh_after
  555. this.weigh_form.weight_reduce_after += ''
  556. }
  557. },
  558. 'weigh_form.weigh_after': function() {
  559. if (this.dialysis_stege === 2) {
  560. this.weigh_form.weight_reduce_after = this.weigh_form.weigh_before - this.weigh_form.weigh_after
  561. this.weigh_form.weight_reduce_after += ''
  562. this.weigh_form.weight_after = this.weigh_form.weigh_after - this.weigh_form.clothes_weight
  563. this.weigh_form.weight_after += ''
  564. }
  565. },
  566. 'weigh_form.clothes_weight': function() {
  567. this.weigh_form.weight_before = this.weigh_form.weigh_before - this.weigh_form.clothes_weight
  568. this.weigh_form.dehydrated_weight = this.weigh_form.weigh_before - this.weigh_form.dry_weight - this.weigh_form.clothes_weight
  569. this.weigh_form.weight_before += ''
  570. this.weigh_form.dehydrated_weight += ''
  571. if (this.dialysis_stege === 2) {
  572. this.weigh_form.weight_after = this.weigh_form.weigh_after - this.weigh_form.clothes_weight
  573. this.weigh_form.weight_after += ''
  574. }
  575. },
  576. 'weigh_form.dry_weight': function() {
  577. this.weigh_form.dehydrated_weight = this.weigh_form.weigh_before - this.weigh_form.dry_weight - this.weigh_form.clothes_weight
  578. this.weigh_form.dehydrated_weight += ''
  579. },
  580. 'weigh_form.dehydrated_weight': function() {
  581. if (this.weigh_form.dry_weight === 0) {
  582. this.weigh_form.dehydrated_percent = ''
  583. } else {
  584. var dehydrated_percent = ((this.weigh_form.dehydrated_weight / this.weigh_form.dry_weight) * 100).toFixed(2)
  585. if (isNaN(dehydrated_percent)) {
  586. this.weigh_form.dehydrated_percent = ''
  587. } else {
  588. this.weigh_form.dehydrated_percent = dehydrated_percent + '%'
  589. }
  590. }
  591. }
  592. },
  593. created() {
  594. this.queryParams.schedule_type = -1
  595. this.queryParams.need_schedule_type = 1
  596. this.fetchSignPatients()
  597. }
  598. }
  599. </script>
  600. <style rel="stylesheet/css" lang="scss" scoped>
  601. .information {
  602. border: 1px #dcdfe6 solid;
  603. padding: 30px 20px 30px 20px;
  604. .border {
  605. border-bottom: 1px #dcdfe6 solid;
  606. margin: 0px 0 20px 0;
  607. }
  608. }
  609. .title {
  610. background:#409eff;
  611. height: 44px;
  612. line-height: 44px;
  613. padding: 0 0 0 10px;
  614. color: #fff;
  615. margin: 0 0 10px 0;
  616. // border-radius: 4px 4px 0 0;
  617. }
  618. .edit_separater {
  619. border-top: 1px solid rgb(233, 233, 233);
  620. margin-top: 15px;
  621. margin-bottom: 15px;
  622. }
  623. </style>
  624. <style>
  625. .sign-and-weigh-box .sign-and-weigh-box-patients .cell{
  626. font-size: 12px;
  627. }
  628. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row>td{
  629. background: #6fb5fa;
  630. }
  631. .button{
  632. float: right;
  633. margin-bottom:0px
  634. }
  635. .patient-app-container{
  636. line-height: 20px;
  637. height: 50px;
  638. }
  639. .span{
  640. height:1px;
  641. }
  642. </style>