cgItem.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="app-content">
  3. <view class="ex-page">
  4. <view class="input-wrap_box">
  5. <view>
  6. <AppSearchModule placeholder="输入拼音首字母搜索" @input="searchFn"/>
  7. </view>
  8. </view>
  9. <view class="top-bar">
  10. <DateSelect class="bar" top="0" @selectDateFn="selectDateFn" />
  11. </view>
  12. <scroll-view scroll-y scroll-with-animation class="main-view">
  13. <view class="space-view ex-table">
  14. <block v-if="!$util.isEmpty(profile)">
  15. <t-table :headerBackgroundColor="'#F0F2F6'">
  16. <t-tr header>
  17. <t-th>花材</t-th>
  18. <t-th><view @click="rankByFn('num')">总数量<i class="iconfont iconsanjiao_xia"></i></view></t-th>
  19. <t-th><view @click="rankByFn('amount')">总金额<i class="iconfont iconsanjiao_xia"></i></view></t-th>
  20. </t-tr>
  21. <block v-if="profile.list && !$util.isEmpty(profile.list)">
  22. <view v-for="(item, index) in profile.list" :key="index">
  23. <t-tr>
  24. <t-td><view style="color:black;font-size:26upx;">{{item.name}}</view></t-td>
  25. <t-td><view style="color:black;font-size:28upx;">{{item.num ? parseFloat(item.num) : 0}}</view></t-td>
  26. <t-td><view style="color:black;font-size:28upx;">¥{{item.amount ? parseFloat(item.amount) : 0}}</view></t-td>
  27. </t-tr>
  28. </view>
  29. </block>
  30. </t-table>
  31. </block>
  32. </view>
  33. </scroll-view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import AppWrapperEmpty from "@/components/app-wrapper-empty";
  39. import SelectList from "@/components/plugin/selectList";
  40. import { getStatCgItem } from "@/api/stat";
  41. import { list } from "@/mixins";
  42. import ShopSelect from "@/components/module/shopSelect";
  43. import DateSelect from "@/components/module/dateSelect";
  44. import AppSearchModule from "@/components/module/app-search";
  45. export default {
  46. components: { SelectList, AppWrapperEmpty,ShopSelect,DateSelect,AppSearchModule},
  47. mixins: [list],
  48. computed: {
  49. },
  50. data() {
  51. return {
  52. params:{
  53. searchTime:'',
  54. startTime: "",
  55. endTime: "",
  56. sort:"num"
  57. },
  58. profile:[]
  59. };
  60. },
  61. onPullDownRefresh() {
  62. this.resetList();
  63. this.getStatList().then(res => {
  64. uni.stopPullDownRefresh();
  65. });
  66. },
  67. methods: {
  68. searchFn(e){
  69. },
  70. selectShopFn(val){
  71. this.init();
  72. },
  73. selectDateFn(val) {
  74. this.params = {...this.params,...val}
  75. this.init();
  76. },
  77. rankByFn(rank){
  78. this.getStatList(rank)
  79. },
  80. async init() {
  81. this.getStatList("num");
  82. },
  83. getStatList(rank) {
  84. let that = this
  85. uni.showLoading()
  86. this.params.sort = rank
  87. getStatCgItem(this.params).then(res => {
  88. uni.hideLoading()
  89. that.profile = res.data
  90. })
  91. }
  92. }
  93. };
  94. </script>
  95. <style lang="scss" scoped>
  96. .ex-page {
  97. background: white;
  98. padding-top:20upx;
  99. height: 100%;
  100. display: flex;
  101. flex-direction: column;
  102. .top-bar {
  103. position: absolute;
  104. left: 0;
  105. display: flex;
  106. width: 100%;
  107. top:130upx;
  108. z-index: 20;
  109. .bar{
  110. width: 50%;
  111. height: 100%;
  112. text-align: center;
  113. &:nth-child(1){
  114. border-right: 1upx solid #eeeeec;
  115. }
  116. }
  117. }
  118. .main-view {
  119. margin-top: 90upx;
  120. flex: 1;
  121. background-color: #f9fbfc;
  122. .space-view {
  123. background-color: #fff;
  124. }
  125. .ex-info {
  126. padding: 30upx;
  127. .info-cell {
  128. display: flex;
  129. align-items: center;
  130. font-size: 28upx;
  131. &:not(:first-child) {
  132. margin-top: 20upx;
  133. }
  134. .cell-label {
  135. width: 110upx;
  136. color: #666666;
  137. }
  138. .cell-value {
  139. margin-left: 40upx;
  140. color: #333;
  141. &.warning {
  142. color: #ffaf1d;
  143. }
  144. &.success {
  145. color: #27c325;
  146. }
  147. }
  148. }
  149. }
  150. .ex-table {
  151. ::v-deep.icon-info {
  152. color: #333333;
  153. }
  154. }
  155. }
  156. .bar-view {
  157. display: flex;
  158. justify-content: space-between;
  159. align-items: center;
  160. padding: 0 30upx;
  161. width: 100%;
  162. height: 100upx;
  163. box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
  164. .info-view {
  165. font-size: 26upx;
  166. }
  167. .btn-view {
  168. display: flex;
  169. .admin-button-com {
  170. margin: 0 10upx;
  171. }
  172. }
  173. }
  174. }
  175. </style>