tiewk.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view class="cartsList">
  3. <view class="cartsList-all">
  4. <view class="cartsList-name">
  5. 耗材消耗数量排名
  6. </view>
  7. <view class="cartsList-seleven">
  8. <uni-data-select v-model="value" :localdata="CalendarList" @change="change"
  9. :clear="false"></uni-data-select>
  10. </view>
  11. <view class="cartsList-seleven">
  12. <uni-data-select v-model="valueList" :localdata="medicament" @change="changelist"
  13. :clear="false"></uni-data-select>
  14. </view>
  15. </view>
  16. <view class="cartsList-table">
  17. <UniTable>
  18. <UniTr v-for="(item, index) in dataList" :key="index">
  19. <UniTd align="center">
  20. <span v-if="index === 0" style="color: #c13124; font-weight: 800; font-family: sans-serif">
  21. {{ index + 1 }}
  22. </span>
  23. <span v-else-if="index === 1" style="color: #e99d7f; font-weight: 800; font-family: sans-serif">
  24. {{ index + 1 }}
  25. </span>
  26. <span v-else-if="index === 2" style="color: #75f9fd; font-weight: 800; font-family: sans-serif">
  27. {{ index + 1 }}
  28. </span>
  29. <span v-else>{{ index + 1 }}</span>
  30. </UniTd>
  31. <UniTd>{{ item.date }}</UniTd>
  32. <UniTd align="left">
  33. <view class="name">{{ item.prodName }}</view>
  34. </UniTd>
  35. <UniTd align="center">{{ item.mcsCnt }}</UniTd>
  36. </UniTr>
  37. </UniTable>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import {
  43. CalendarList,
  44. medicament
  45. } from '../Pie.js';
  46. import UniTable from '@/subpkg/uni_modules/uni-table/components/uni-table/uni-table.vue';
  47. import UniTr from '@/subpkg/uni_modules/uni-table/components/uni-tr/uni-tr.vue';
  48. import UniTd from '@/subpkg/uni_modules/uni-table/components/uni-td/uni-td.vue';
  49. export default {
  50. components:{
  51. UniTable,
  52. UniTr,
  53. UniTd
  54. },
  55. data() {
  56. return {
  57. value: 'Y',
  58. valueList: "1",
  59. CalendarList: CalendarList,
  60. medicament: medicament,
  61. dataList: []
  62. }
  63. },
  64. methods: {
  65. listData() {
  66. this.$http('homePage.cntCosm', {
  67. mcsType: this.valueList,
  68. timeType: this.value
  69. }, '加载中').then((res) => {
  70. this.dataList = res.data;
  71. });
  72. },
  73. change(e) {
  74. this.value = e;
  75. this.updateListData();
  76. },
  77. changelist(e) {
  78. this.valueList = e;
  79. this.updateListData();
  80. },
  81. updateListData() {
  82. this.listData({
  83. mcsType: this.valueList,
  84. timeType: this.value
  85. });
  86. }
  87. },
  88. created() {
  89. this.listData()
  90. }
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. .cartsList {
  95. padding: 30rpx;
  96. .cartsList-all {
  97. width: 100%;
  98. height: 100rpx;
  99. display: flex;
  100. justify-content: space-between;
  101. background-color: #ffffff;
  102. padding: 20rpx;
  103. box-sizing: border-box;
  104. border-top-left-radius: 20rpx;
  105. border-top-right-radius: 20rpx;
  106. border-width: 4rpx 4rpx 4rpx 4rpx;
  107. border-style: solid;
  108. border-color: #90ffe4;
  109. .cartsList-name {
  110. font-size: 35rpx;
  111. font-weight: bold;
  112. }
  113. }
  114. .cartsList-table {
  115. border-bottom-right-radius: 20rpx;
  116. border-bottom-left-radius: 20rpx;
  117. border-style: solid;
  118. border-color: #90ffe4;
  119. border-width: 0 4rpx 4rpx 4rpx;
  120. }
  121. }
  122. </style>