血透系统pad前端

ComputerDialog.vue 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <div>
  3. <div class="Dialog" v-show="!selecting">
  4. <div class="DialogTit">
  5. <span @click="close()" class="iconfont">&#xe6e9;</span>
  6. <h1 class="name">透析上机</h1>
  7. <span class="success"></span>
  8. </div>
  9. <div class="DialogContent ">
  10. <div class="item" @click="select_bed">
  11. <h2 class="name">上机床位</h2>
  12. <div class="content">
  13. <span class="text" style="width: 100px">{{ device_number_map[bed_id].number }}</span>
  14. <span class="iconfont">&#xe6f9;</span>
  15. </div>
  16. </div>
  17. <div class="item" @click="select_nurse">
  18. <h2 class="name">上机护士</h2>
  19. <div class="content">
  20. <span class="text" style="width: 100px">{{ admin_map[nurse_id].name }}</span>
  21. <span class="iconfont">&#xe6f9;</span>
  22. </div>
  23. </div>
  24. <div class="perform">
  25. <!-- <p class="crew">上机人员 : <span>黄海燕 护士</span></p> -->
  26. <!-- <button>执行上机</button> -->
  27. <button @click="commitInfo" v-if="(record == null || record.id == '')">执行上机</button>
  28. <button :disabled="true" style="background-color:lightgray;" v-else>已上机</button>
  29. </div>
  30. </div>
  31. </div>
  32. <two-menu ref="selector"></two-menu>
  33. </div>
  34. </template>
  35. <script>
  36. import { startDialysis } from "@/api/dialysis";
  37. import { Toast } from 'vant';
  38. import TwoMenu from './TwoMenu'
  39. export default {
  40. name: "ComputerDialog",
  41. components: {
  42. TwoMenu
  43. },
  44. data() {
  45. return {
  46. selecting: false,
  47. bed_id: 0,
  48. nurse_id: 0,
  49. zone_beds: [], // 该排班的区里的床位
  50. }
  51. },
  52. props:{
  53. schedule: {
  54. type: Object,
  55. },
  56. patient_prop: {
  57. type: Object,
  58. },
  59. record: {
  60. type: Object,
  61. },
  62. admins: {
  63. type: Array,
  64. },
  65. device_numbers: {
  66. type: Array,
  67. },
  68. admin_map: {
  69. type: Object,
  70. },
  71. device_number_map: {
  72. type: Object,
  73. },
  74. },
  75. created(){
  76. var date = this.$route.query && this.$route.query.date;
  77. date *= 1000;
  78. var newDate = new Date(date);
  79. var y = newDate.getFullYear();
  80. var m = newDate.getMonth() + 1;
  81. var d = newDate.getDate();
  82. if (isNaN(y) || isNaN(m) || isNaN(d)) {
  83. newDate = new Date();
  84. y = newDate.getFullYear();
  85. m = newDate.getMonth() + 1;
  86. d = newDate.getDate();
  87. }
  88. this.record_date = y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d);
  89. this.bed_id = (this.record == null || this.record.id == '') ? this.schedule.bed_id : this.record.bed_id
  90. this.nurse_id = (this.record == null || this.record.id == '') ? this.$store.getters.user.user.id : this.record.start_nurse
  91. var beds = []
  92. for (let index = 0; index < this.device_numbers.length; index++) {
  93. const device_number = this.device_numbers[index];
  94. if (device_number.zone_id == this.schedule.partition_id) {
  95. beds.push(device_number)
  96. }
  97. }
  98. this.zone_beds = beds
  99. },
  100. methods: {
  101. commitInfo: function () {
  102. Toast.loading({forbidClick: true, duration: 0})
  103. let ParamsQuery = {}
  104. ParamsQuery['patient_id'] = this.patient_prop.id
  105. ParamsQuery['record_date'] = this.record_date
  106. ParamsQuery["nurse"] = this.nurse_id
  107. ParamsQuery["bed"] = this.bed_id
  108. startDialysis(ParamsQuery).then(response => {
  109. if (response.data.state == 0) {
  110. Toast.fail(response.data.msg);
  111. return false;
  112. } else {
  113. Toast.success("上机成功");
  114. this.$emit('did_start', response.data.data.dialysis_order);
  115. var record = this.record
  116. for (const key in response.data.data.dialysis_order) {
  117. this.$set(record, key, response.data.data.dialysis_order[key])
  118. // this.record[key] = response.data.data.dialysis_order[key]
  119. }
  120. }
  121. });
  122. },
  123. close: function() {
  124. this.$emit('close')
  125. },
  126. select_bed: function() {
  127. if (this.record.id != 0) {
  128. return
  129. }
  130. this.selecting = true
  131. var t = this
  132. this.$refs.selector.showSingleSelect(this.zone_beds, this.bed_id, "选择床位号", "number", "id", function(select_id) {
  133. t.bed_id = select_id
  134. }, function() {
  135. t.selecting = false
  136. })
  137. },
  138. select_nurse: function() {
  139. if (this.record.id != 0) {
  140. return
  141. }
  142. this.selecting = true
  143. var t = this
  144. this.$refs.selector.showSingleSelect(this.admins, this.nurse_id, "选择上机护士", "name", "id", function(select_id) {
  145. console.log("nurse id: ", select_id)
  146. t.nurse_id = select_id
  147. }, function() {
  148. t.selecting = false
  149. })
  150. },
  151. open:function(){
  152. this.selecting = false;
  153. this.$refs.selector.hide();
  154. }
  155. }
  156. };
  157. </script>
  158. <style style="stylesheet/scss" lang="scss" scoped>
  159. .perform{
  160. text-align: center;
  161. font-size: 0.3rem;
  162. padding-top: 2rem;
  163. .crew{
  164. color: $pgh-color;
  165. }
  166. button{
  167. background:$main-color;
  168. color: #fff;
  169. font-size: 0.3rem;
  170. text-align:center;
  171. width: 3rem;
  172. height: 0.7rem;
  173. line-height: 0.7rem;
  174. border-radius:4px;
  175. margin-top:10px;
  176. }
  177. }
  178. </style>