血透系统PC前端

computer_dialog.vue 7.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <div>
  3. <el-dialog title="透析上机" :visible.sync="visible" width="854px" :modal-append-to-body="false">
  4. <el-form :model="form" label-width="100px">
  5. <el-form-item label="上机床位">
  6. <el-select v-model="form.bed_id" placeholder="" :disabled="dialysis_order.id != 0">
  7. <el-option v-for="(bed, index) in zone_beds" :key="index" :value="bed.id" :label="bed.number"></el-option>
  8. </el-select>
  9. </el-form-item>
  10. <el-form-item label="上机护士">
  11. <el-select v-model="form.nurse_id" placeholder="" :disabled="dialysis_order.id != 0">
  12. <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="穿刺护士">
  16. <el-select v-model="form.puncture_nurse_id" placeholder="" :disabled="dialysis_order.id != 0">
  17. <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item label="引血(ml/min)" v-if="template_id == 6" >
  21. <el-input type="number" v-model="form.lood_drawing" style="width:200px;"></el-input>
  22. </el-form-item>
  23. <el-form-item label="上机时间 :" style="width:300px">
  24. <el-date-picker
  25. :disabled="dialysis_order.id != 0"
  26. type="datetime"
  27. format="yyyy-MM-dd HH:mm"
  28. value-format="yyyy-MM-dd HH:mm"
  29. placeholder="选择时间"
  30. v-model="form.start_time"
  31. style="width:100%;"
  32. ></el-date-picker>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button v-if="dialysis_order.id == 0" @click="submit" type="primary" :loading="loading">执行上机</el-button>
  36. <el-button v-else type="info" :disabled="true">已上机</el-button>
  37. </el-form-item>
  38. </el-form>
  39. </el-dialog>
  40. </div>
  41. </template>
  42. <script>
  43. import { startDialysis } from '@/api/dialysis_record'
  44. import { parseTime } from '@/utils'
  45. export default {
  46. name: 'ComputerDialog',
  47. data() {
  48. return {
  49. visible: false,
  50. loading: false,
  51. template_id: 0,
  52. patient_id: 0,
  53. schedule_date: 0,
  54. start_time: 0,
  55. form: {
  56. bed_id: '',
  57. nurse_id: '',
  58. start_time: '',
  59. puncture_nurse_id: ''
  60. lood_drawing:100
  61. }
  62. }
  63. },
  64. props: {
  65. dialysis_order: {
  66. type: Object
  67. },
  68. schedule: {
  69. type: Object
  70. },
  71. admins: {
  72. type: Array
  73. },
  74. device_numbers: {
  75. type: Array
  76. }
  77. },
  78. created() {
  79. <<<<<<< .mine
  80. =======
  81. this.template_id = this.$store.getters.xt_user.template_info.template_id
  82. >>>>>>> .theirs
  83. this.patient_id = this.$route.query.patient_id
  84. this.schedule_date = this.$route.query.date
  85. this.form.bed_id = this.dialysis_order.id == 0 ? this.schedule.bed_id : this.dialysis_order.bed_id
  86. this.form.nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.start_nurse
  87. this.form.puncture_nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.puncture_nurse
  88. this.form.lood_drawing = 0
  89. if (this.form.puncture_nurse_id == 0) {
  90. this.form.puncture_nurse_id = this.$store.getters.xt_user.user.id
  91. }
  92. },
  93. watch: {
  94. 'schedule.id': function() {
  95. this.form.bed_id = this.dialysis_order.id == 0 ? this.schedule.bed_id : this.dialysis_order.bed_id
  96. },
  97. 'dialysis_order.id': function() {
  98. console.log(this.dialysis_order)
  99. this.form.bed_id = this.dialysis_order.id == 0 ? this.schedule.bed_id : this.dialysis_order.bed_id
  100. this.form.nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.start_nurse
  101. this.form.puncture_nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.puncture_nurse
  102. var nowDate = new Date()
  103. var nowYear = nowDate.getFullYear()
  104. var nowMonth = nowDate.getMonth() + 1
  105. var nowDay = nowDate.getDate()
  106. var nowHours = nowDate.getHours()
  107. var nowMinutes = nowDate.getMinutes()
  108. var nowSeconds = nowDate.getSeconds()
  109. var time =
  110. nowYear +
  111. '-' +
  112. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  113. '-' +
  114. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
  115. this.form.start_time = this.dialysis_order.id == 0 ? time : this.getTime(this.dialysis_order.start_time, '{y}-{m}-{d} {h}:{i}')
  116. }
  117. },
  118. computed: {
  119. zone_beds: function() {
  120. var beds = []
  121. for (let index = 0; index < this.device_numbers.length; index++) {
  122. const device_number = this.device_numbers[index]
  123. if (device_number.zone_id == this.schedule.partition_id) {
  124. beds.push(device_number)
  125. }
  126. }
  127. return beds
  128. }
  129. },
  130. methods: {
  131. getTime(value, temp) {
  132. if (value != undefined) {
  133. return parseTime(value, temp)
  134. }
  135. return ''
  136. },
  137. show: function() {
  138. this.visible = true
  139. var nowDate = new Date()
  140. var nowYear = nowDate.getFullYear()
  141. var nowMonth = nowDate.getMonth() + 1
  142. var nowDay = nowDate.getDate()
  143. var nowHours = nowDate.getHours()
  144. var nowMinutes = nowDate.getMinutes()
  145. var nowSeconds = nowDate.getSeconds()
  146. if (this.dialysis_order.id != 0) {
  147. this.form.start_time = this.getTime(this.dialysis_order.start_time, '{y}-{m}-{d} {h}:{i}')
  148. } else {
  149. this.form.start_time =
  150. nowYear +
  151. '-' +
  152. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  153. '-' +
  154. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
  155. }
  156. },
  157. hide: function() {
  158. this.visible = false
  159. },
  160. submit: function() {
  161. this.loading = true
  162. <<<<<<< .mine
  163. startDialysis(this.patient_id, parseTime(this.schedule_date, '{y}-{m}-{d}'), this.form.nurse_id, this.form.bed_id, this.form.puncture_nurse_id, this.form.start_time).then(rs => {
  164. =======
  165. startDialysis(this.patient_id, parseTime(this.schedule_date, '{y}-{m}-{d}'), this.form.nurse_id, this.form.bed_id,this.form.lood_drawing, this.form.puncture_nurse_id,this.form.start_time).then(rs => {
  166. >>>>>>> .theirs
  167. this.loading = false
  168. var resp = rs.data
  169. if (resp.state == 1) {
  170. var resp_dialysis_order = resp.data.dialysis_order
  171. var this_order = this.dialysis_order
  172. for (const key in resp_dialysis_order) {
  173. this.$set(this_order, key, resp_dialysis_order[key])
  174. }
  175. } else {
  176. this.$message.error(resp.msg)
  177. }
  178. })
  179. }
  180. }
  181. }
  182. </script>
  183. <style scoped>
  184. .txsj {
  185. text-align: center;
  186. margin-bottom: 20px;
  187. }
  188. </style>