waste.vue 4.2 KB

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