血透系统pad前端

MsgTip.vue 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <template>
  2. <div v-if="visibility" class="Dialog">
  3. <div class="DialogTit">
  4. <div class="back" @click="cancle()">
  5. <span class="iconfont">&#xe720; </span>返回
  6. </div>
  7. <h1 class="name">
  8. {{ patient_prop.name }} [透析号 {{ patient_prop.dialysis_no }} ]
  9. </h1>
  10. <span @click="comfirm" class="success" style="visibility: hidden;"
  11. >确定</span>
  12. </div>
  13. <div class="DialogContent">
  14. <div class="item">
  15. <label class="name" for="txms">本次透析日期</label>
  16. <div class="content">
  17. <span class="text" id="txms"> {{ dialysis_date }}</span>
  18. </div>
  19. </div>
  20. <div class="item" style="display:block;">
  21. <div class="name" style="width:100%;text-align:left;line-height:1.5rem;font-size:0.7rem;" for="txms">透前称重(kg)<span style="text-align:right;float: right;color:#ec6618;">{{ getBeforeWeight(predialysis)}}</span></div>
  22. <div class="content" style="margin-top:5px;margin-left:0;">
  23. <span class="text" style="text-align:left;display:block;height:0.4rem;" id="txms">透前称重:<span style="color:#ec6618;display:inline-block;text-align:center;margin:0 2px;">{{ getBeforeWeight(predialysis)}}</span>kg=
  24. 透前总重:<span style="color:#ec6618;display:inline-block;text-align:center;center;margin:0 2px;">{{predialysis.weight_before}}</span>kg-
  25. 衣服重:<span style="color:#ec6618;display:inline-block;text-align:center;center;margin:0 2px;">{{predialysis.additional_weight}}</span>kg
  26. </span>
  27. </div>
  28. <br>
  29. </div>
  30. <div class="item">
  31. <label class="name" for="txms">干体重(kg)</label>
  32. <div class="content">
  33. <span class="text" id="txms">{{ getDryWeight() }}</span>
  34. </div>
  35. </div>
  36. <!-- <div class="item">
  37. <label class="name" for="txms">衣物重(kg)</label>
  38. <div class="content">
  39. <span class="text" id="txms">{{
  40. predialysis.additional_weight
  41. }}</span>
  42. </div>
  43. </div> -->
  44. <div class="item" style="display:block;">
  45. <div class="name" style="width:100%;text-align:left;line-height:1.5rem;font-size:0.7rem;" for="txms">体重增加(kg)<span style="text-align:right;float: right;color:#ec6618;">{{add_weight}}</span></div>
  46. <div class="content" style="margin-top:5px;margin-left:0;">
  47. <span class="text" style="text-align:left;display:block;height:0.8rem;line-height:0.6rem;" id="txms">体重增加:<span style="color:#ec6618;display:inline-block;text-align:center;margin:0 2px;">{{add_weight}}</span>kg=
  48. 透前称重:<span style="color:#ec6618;display:inline-block;text-align:center;center;margin:0 2px;">{{getBeforeWeight(predialysis)}}</span>kg -
  49. 上次透后称重:<span style="color:#ec6618;display:inline-block;text-align:center;center;margin:0 2px;">{{getLastAfterWeight(last_record)}}</span>kg
  50. </span>
  51. </div>
  52. <br>
  53. </div>
  54. <!-- <div class="item">
  55. <label class="name" for="txms">体重增加(kg)</label>
  56. <div class="content">
  57. <span class="text" id="txms">{{ add_weight }}</span>
  58. </div>
  59. </div> -->
  60. <div class="item" style="display:block;">
  61. <div class="name" style="width:100%;text-align:left;line-height:1.5rem;font-size:0.7rem;" for="txms">透后称重(kg)<span style="text-align:right;float: right;color:#ec6618;">{{getAfterWeight(record)}}</span></div>
  62. <div class="content" style="margin-top:5px;margin-left:0;">
  63. <span class="text" style="text-align:left;display:block;height:0.4rem;" id="txms">透后称重:<span style="color:#ec6618;display:inline-block;text-align:center;margin:0 2px;">{{getAfterWeight(record)}}</span>kg=
  64. 透后总重:<span style="color:#ec6618;display:inline-block;text-align:center;center;margin:0 2px;">{{record.weight_after}}</span>kg-
  65. 衣服重:<span style="color:#ec6618;display:inline-block;text-align:center;center;margin:0 2px;">{{predialysis.additional_weight}}</span>kg
  66. </span>
  67. </div>
  68. <br>
  69. </div>
  70. <!-- <div class="item">
  71. <label class="name" for="txms">透后体重(kg)</label>
  72. <div class="content">
  73. <span class="text" id="txms">{{ getAfterWeight(record)}}</span>
  74. </div>
  75. </div> -->
  76. <div class="item">
  77. <label class="name" for="txms">体重减少(kg)</label>
  78. <div class="content">
  79. <span class="text" id="txms">{{ weight_loss }}</span>
  80. </div>
  81. </div>
  82. <div class="item" style="display:block;">
  83. <div class="name" style="width:100%;text-align:left;line-height:1.5rem;font-size:0.7rem;" for="txms">上次透后称重(kg)<span style="text-align:right;float: right;color:#ec6618;">{{getLastAfterWeight(last_record)}}</span></div>
  84. <div class="content" style="margin-top:5px;margin-left:0;">
  85. <span class="text" style="text-align:left;display:block;height:0.4rem;" id="txms">上次透后称重:<span style="color:#ec6618;display:inline-block;text-align:center;margin:0 2px;">{{getLastAfterWeight(last_record)}}</span>kg=
  86. 上次透后总重:<span style="color:#ec6618;display:inline-block;text-align:center;center;margin:0 2px;">{{last_record.weight_after}}</span>kg-
  87. 上次衣服重:<span style="color:#ec6618;display:inline-block;text-align:center;center;margin:0 2px;">{{last_predialysis.additional_weight}}</span>kg
  88. </span>
  89. </div>
  90. <br>
  91. </div>
  92. <!-- <div class="item">
  93. <label class="name" for="txms">上次透后体重(kg)</label>
  94. <div class="content">
  95. <span class="text" id="txms">{{
  96. getLastAfterWeight(last_record)
  97. }}</span>
  98. </div>
  99. </div> -->
  100. </div>
  101. </div>
  102. </template>
  103. <script>
  104. import { parseTime } from '@/utils'
  105. export default {
  106. name: 'LongAdviceSubMenu',
  107. created () {
  108. if (this.predialysis.weight_before > 0 && this.last_record.weight_after > 0) {
  109. this.add_weight = parseFloat(
  110. (this.predialysis.weight_before - this.predialysis.additional_weight) - (this.last_record.weight_after - this.last_predialysis.additional_weight)
  111. ).toFixed(2)
  112. }
  113. let loss = ''
  114. if (this.predialysis.weight_before > 0 && this.record.weight_after > 0) {
  115. loss = parseFloat(this.predialysis.weight_before - this.record.weight_after).toFixed(2)
  116. loss = loss > 0 ? loss : ''
  117. }
  118. this.weight_loss = this.record.weight_loss ? this.record.weight_loss : loss
  119. },
  120. data () {
  121. return {
  122. result: [],
  123. id: 0,
  124. selectName: '',
  125. add_weight: 0,
  126. weight_loss: ''
  127. }
  128. },
  129. props: {
  130. predialysis: {
  131. type: Object,
  132. default: null
  133. },
  134. visibility: {
  135. type: Boolean,
  136. default: false
  137. },
  138. last_predialysis: {
  139. type: Object
  140. },
  141. record: {
  142. type: Object
  143. },
  144. last_record: {
  145. type: Object
  146. },
  147. patient_prop: {
  148. type: Object
  149. },
  150. prescription_prop: {
  151. type: Object
  152. },
  153. dry_weight: {
  154. type: Object
  155. }
  156. },
  157. computed: {
  158. dialysis_date: function () {
  159. return parseTime(this.$route.query.date, '{y}/{m}/{d}')
  160. }
  161. },
  162. methods: {
  163. getDryWeight () {
  164. if (this.dry_weight != null && this.dry_weight.id > 0) {
  165. return this.dry_weight.dry_weight
  166. } else {
  167. if (this.last_predialysis != null && this.last_predialysis.id > 0) {
  168. return this.last_predialysis.dry_weight
  169. } else {
  170. return ''
  171. }
  172. }
  173. },
  174. getBeforeWeight (predialysis) {
  175. if (predialysis.id > 0) {
  176. if (predialysis.weight_before > 0) {
  177. return parseFloat(predialysis.weight_before - predialysis.additional_weight).toFixed(1)
  178. } else {
  179. return ''
  180. }
  181. }
  182. },
  183. getAfterWeight (record) {
  184. if (record.id > 0) {
  185. if (record.weight_after > 0) {
  186. return parseFloat(record.weight_after - this.predialysis.additional_weight).toFixed(1)
  187. } else {
  188. return ''
  189. }
  190. }
  191. },
  192. getLastAfterWeight (last_record) {
  193. if (last_record.id > 0) {
  194. if (last_record.weight_after > 0) {
  195. let additional_weight = 0
  196. if (this.last_predialysis.additional_weight != undefined) {
  197. additional_weight = this.last_predialysis.additional_weight
  198. }
  199. return parseFloat(last_record.weight_after - additional_weight).toFixed(1)
  200. } else {
  201. return ''
  202. }
  203. }
  204. },
  205. cancle: function () {
  206. this.$emit('menu-msg-tip')
  207. },
  208. comfirm: function () {
  209. this.$emit('menu-msg-tip')
  210. },
  211. getValue: function () {
  212. let form = {}
  213. let results = []
  214. for (let i = 0; i < this.propsForm.list.length; i++) {
  215. for (let a = 0; a < this.propsForm.result.length; a++) {
  216. if (this.propsForm.list[i].id == this.propsForm.result[a]) {
  217. results.push(this.propsForm.list[i])
  218. }
  219. }
  220. }
  221. var obj5 = {}
  222. results = results.reduce((cur, next) => {
  223. obj5[next.id] ? '' : (obj5[next.id] = true && cur.push(next))
  224. return cur
  225. }, [])
  226. results
  227. return results
  228. }
  229. },
  230. watch: {
  231. visibility (val) {
  232. // 初始化数据操作
  233. }
  234. }
  235. }
  236. </script>
  237. <style style="stylesheet/scss" lang="scss" scoped>
  238. .optionsBox {
  239. background: #fff;
  240. max-height: 10rem;
  241. min-height: 5rem;
  242. @media only screen and (max-width: 812px) {
  243. min-height: 8rem !important;
  244. }
  245. ul {
  246. overflow-y: scroll;
  247. max-height: 9rem;
  248. li {
  249. height: 1.1rem;
  250. line-height: 1.1rem;
  251. border-bottom: 1px #e5e5e5 solid;
  252. padding: 0 0.38rem;
  253. font-size: 0.36rem;
  254. color: $title-color;
  255. }
  256. .tick {
  257. position: relative;
  258. &::before {
  259. content: "";
  260. display: inline-block;
  261. border: 2px solid $main-color;
  262. border-top-width: 0;
  263. border-right-width: 0;
  264. width: 0.3rem;
  265. height: 0.15rem;
  266. -webkit-transform: rotate(-50deg);
  267. position: absolute;
  268. top: 0.38rem;
  269. right: 0.44rem;
  270. }
  271. }
  272. }
  273. }
  274. .CheckBox {
  275. background: #fff;
  276. max-height: 6.8rem;
  277. min-height: 5rem;
  278. overflow-y: scroll;
  279. @media only screen and (max-width: 812px) {
  280. max-height: 8rem !important;
  281. min-height: 8rem !important;
  282. }
  283. ul {
  284. li {
  285. line-height: 1rem;
  286. }
  287. }
  288. }
  289. </style>