血透系统pad前端

MissionTable.vue 7.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <div>
  3. <div class="choice">
  4. <ul>
  5. <li>日期查询:
  6. <div @click="openStartPicker" class="">{{parseTime(startTime.getTime()/1000, "{y}-{m}-{d}")}}<span class="iconfont">&#xe74a;</span> </div>
  7. <span class="line"> </span>
  8. <div @click="openEndPicker" class="">{{parseTime(endTime.getTime()/1000, "{y}-{m}-{d}")}}<span class="iconfont">&#xe74a;</span> </div>
  9. </li>
  10. </ul>
  11. </div>
  12. <div class="blueBorder"></div>
  13. <van-list
  14. width="100%"
  15. v-model="loading"
  16. :finished="finished"
  17. @load="onLoad"
  18. >
  19. <div class="tableTit " >
  20. <ul>
  21. <li style="width:10%;">序号</li>
  22. <li style="width:15%;">日期</li>
  23. <li style="width:75%;">宣教内容</li>
  24. </ul>
  25. </div>
  26. <div class="tableDate" >
  27. <ul v-for="(item,index) in tableDate" :key="index" :value="item.value">
  28. <li style="width:10%;">{{index+1}}</li>
  29. <li style="width:15%;">{{parseTime(item.assessment_date, "{y}-{m}-{d}")}}</li>
  30. <li style="width:75%;">{{item.mission}}</li>
  31. </ul>
  32. </div>
  33. <!--<div class="NoData" v-show="tableDate.length == 0"><img src="@/assets/login/data.jpg" alt=""></div>-->
  34. <div class="NoData" v-show="tableDate.length == 0"><img style="margin-top: 50px; margin-bottom: 50px" src="@/assets/login/data.jpg" alt=""></div>
  35. </van-list>
  36. <mt-datetime-picker
  37. ref="start_date_picker"
  38. type="date"
  39. @confirm="handleStartDateConfirm"
  40. :endDate="new Date()"
  41. v-model="startTime">
  42. </mt-datetime-picker>
  43. <mt-datetime-picker
  44. ref="end_date_picker"
  45. type="date"
  46. @confirm="handleEndDateConfirm"
  47. :endDate="new Date()"
  48. v-model="endTime">
  49. </mt-datetime-picker>
  50. </div>
  51. </template>
  52. <script>
  53. import {parseTime} from "@/utils"
  54. import {getAllEducationList} from '@/api/patient';
  55. import { Popover } from "vux";
  56. export default {
  57. name: "LongTable",
  58. created(){
  59. this.tableDate=[]
  60. this.queryParams.start_time = this.parseTime(new Date().getTime() / 1000, "{y}-{m}-{d}")
  61. this.queryParams.end_time = this.parseTime(new Date().getTime() / 1000, "{y}-{m}-{d}")
  62. this.queryParams.patient_id = this.$route.query.patient_id
  63. this.queryParams.page = this.queryParams.page + 1
  64. this.queryParams.limit = 15
  65. this.tableDate=[]
  66. getAllEducationList(this.queryParams).then(response =>{
  67. if(response.data.state == 0){
  68. return false;
  69. }else{
  70. if(response.data.data.total == 0){
  71. }else{
  72. for(let i = 0; i < response.data.data.edus.length;i++){
  73. this.tableDate.push(response.data.data.edus[i])
  74. }
  75. }
  76. }
  77. });
  78. },
  79. data() {
  80. return {
  81. tableDate: [],
  82. loading: false,
  83. finished: false,
  84. startTime: new Date(),
  85. endTime: new Date(),
  86. queryParams: {
  87. mode_id: '',
  88. start_time: "",
  89. end_time: "",
  90. page: 0,
  91. patient_id: 0,
  92. limit: 15,
  93. },
  94. };
  95. }, methods: {
  96. parseTime(time, layout) {
  97. return parseTime(time, layout)
  98. },onLoad() {
  99. this.queryParams.start_time = this.parseTime(this.startTime.getTime()/1000, "{y}-{m}-{d}")
  100. this.queryParams.end_time = this.parseTime(this.endTime.getTime()/1000, "{y}-{m}-{d}")
  101. this.queryParams.patient_id = this.$route.query.patient_id
  102. this.queryParams.page = this.queryParams.page + 1
  103. this.queryParams.limit = 15
  104. getAllEducationList(params).then(response =>{
  105. if(response.data.state == 0){
  106. this.finished = true;
  107. this.loading = false;
  108. return false;
  109. }else{
  110. if(response.data.data.edus.length == 0){
  111. this.finished = true;
  112. this.loading = false;
  113. }else{
  114. for(let i = 0; i < response.data.data.edus.length;i++){
  115. this.tableDate.push(response.data.data.edus[i])
  116. }
  117. this.loading = false;
  118. }
  119. }
  120. });
  121. },
  122. handleStartDateConfirm: function (val) {
  123. this.queryParams.start_time = this.parseTime(this.startTime / 1000, "{y}-{m}-{d}")
  124. this.queryParams.end_time = this.parseTime(this.endTime / 1000, "{y}-{m}-{d}")
  125. this.queryParams.page = 1
  126. this.queryParams.limit = 15
  127. this.getRecordList(this.queryParams)
  128. },
  129. handleEndDateConfirm: function (val) {
  130. this.queryParams.start_time = this.parseTime(this.startTime / 1000, "{y}-{m}-{d}")
  131. this.queryParams.end_time = this.parseTime(this.endTime / 1000, "{y}-{m}-{d}")
  132. this.queryParams.page = 1
  133. this.queryParams.limit = 15
  134. this.getRecordList(this.queryParams)
  135. },openStartPicker: function () {
  136. this.$refs.start_date_picker.open();
  137. },
  138. openEndPicker: function () {
  139. this.$refs.end_date_picker.open();
  140. },getRecordList: function (val) {
  141. this.tableDate=[]
  142. getAllEducationList(val).then(response =>{
  143. if(response.data.state == 0){
  144. return false;
  145. }else{
  146. if(response.data.data.edus.length == 0){
  147. }else{
  148. for(let i = 0; i < response.data.data.edus.length;i++){
  149. this.tableDate.push(response.data.data.edus[i])
  150. }
  151. }
  152. }
  153. });
  154. }
  155. },
  156. components: {
  157. Popover
  158. }
  159. };
  160. </script>
  161. <style style="stylesheet/scss" lang="scss" scoped>
  162. .choice {
  163. border-bottom: 1px #e5e5e5 solid;
  164. ul {
  165. @include display-flex;
  166. @include align-items-center;
  167. @include text-align;
  168. @include justify-content-between;
  169. width: 40%;
  170. margin: 0 auto;
  171. font-size: 0.32rem;
  172. color: $pgh-color;
  173. li {
  174. @include display-flex;
  175. @include align-items-center;
  176. @include text-align;
  177. @include justify-content-between;
  178. padding: 0.3rem 0;
  179. .iconfont {
  180. margin: 0 0.1rem;
  181. @media only screen and (max-width: 812px) {
  182. font-size: 12px !important;
  183. }
  184. }
  185. .line{
  186. background: #a8b3ba;
  187. width: 0.2rem;
  188. height: 1px;
  189. margin: 0 0.2rem;
  190. display: inline-block;
  191. }
  192. }
  193. }
  194. }
  195. .tableTit {
  196. background: $main-color;
  197. color: $text-color;
  198. @include box-sizing;
  199. ul {
  200. @include display-flex;
  201. @include align-items-center;
  202. @include text-align;
  203. @include justify-content-center;
  204. li {
  205. border-right: 2px #fff solid;
  206. font-size: 0.3rem;
  207. height: 0.88rem;
  208. line-height: 0.88rem;
  209. }
  210. &:last-child {
  211. border-right: none;
  212. }
  213. }
  214. }
  215. .tableDate {
  216. background: #ecf5ff;
  217. color: $pgh-color;
  218. @include box-sizing;
  219. ul {
  220. @include display-flex;
  221. @include align-items-center;
  222. @include text-align;
  223. @include justify-content-center;
  224. li {
  225. font-size: 0.3rem;
  226. padding:0.16rem 0;
  227. line-height: 0.5rem;
  228. border-right: 2px #fff solid;
  229. span {
  230. @include flex;
  231. border-right: 2px #fff solid;
  232. border-bottom: 2px #fff solid;
  233. background: #ecf5ff;
  234. display: inline-block;
  235. height: 0.88rem;
  236. line-height: 0.88rem;
  237. .iconfont {
  238. color: $main-color;
  239. font-size: 0.3rem;
  240. margin-right: 0.1rem;
  241. }
  242. }
  243. }
  244. &:last-child {
  245. border-right: none;
  246. }
  247. }
  248. }
  249. </style>