kdIncome.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="app-content">
  3. <view class="ex-page">
  4. <!-- <view class="top-bar"><DateSelect class="bar" top="0" @selectDateFn="selectDateFn" /></view> -->
  5. <view class="top-bar" style="margin-left:100upx;">今天</view>
  6. <view class="main-view">
  7. <view class="space-view ex-table">
  8. <block>
  9. <t-table :headerBackgroundColor="'#F0F2F6'">
  10. <t-tr header><t-th>渠道</t-th><t-th>笔数</t-th><t-th>金额</t-th><t-th>操作</t-th></t-tr>
  11. <view v-for="(item, index) in profile" :key="index">
  12. <t-tr>
  13. <t-td><view>{{item.name}}</view></t-td>
  14. <t-td><view>{{item.num}}</view></t-td>
  15. <t-td><view>{{item.amount}}</view></t-td>
  16. <t-td>
  17. <view>
  18. <button class="admin-button-com middel blue" @click="getDetail(item)">明细</button>
  19. </view>
  20. </t-td>
  21. </t-tr>
  22. </view>
  23. </t-table>
  24. </block>
  25. </view>
  26. <view class="act-income"></view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import AppWrapperEmpty from "@/components/app-wrapper-empty";
  33. import SelectList from "@/components/plugin/selectList";
  34. import { getStatKdProfile } from "@/api/stat/index";
  35. import { list } from "@/mixins";
  36. import ShopSelect from "@/components/module/shopSelect";
  37. import DateSelect from "@/components/module/dateSelect";
  38. import {mapActions, mapGetters} from "vuex";
  39. export default {
  40. components: { SelectList, AppWrapperEmpty,ShopSelect,DateSelect},
  41. mixins: [list],
  42. computed: {
  43. ...mapGetters(["getDictionariesInfo","getLoginInfo"])
  44. },
  45. data() {
  46. return {
  47. isShow:false,
  48. customizationTime:'',
  49. menuTimeObj:'',
  50. menuShopObj:'',
  51. shopId:'',
  52. itemId:'',
  53. nowTime: "",
  54. showTimeDropdown: false,
  55. nowShop: "",
  56. showShopDropdown: false,
  57. dataList: [],
  58. params:{
  59. itemId: '',
  60. searchTime:'',
  61. startTime: "",
  62. endTime: "",
  63. shopId: "",
  64. },
  65. profile:[],
  66. income:0
  67. };
  68. },
  69. onPullDownRefresh() {
  70. this.resetList();
  71. this._list().then(res => {
  72. uni.stopPullDownRefresh();
  73. });
  74. },
  75. onLoad(e) {
  76. this.itemId = e.id;
  77. this.params.itemId = e.id;
  78. this.shopId = this.getLoginInfo.shopId;
  79. },
  80. methods: {
  81. getDetail(item){
  82. let str = ''
  83. if(item.class && !this.$util.isEmpty(item.class)){
  84. let cl = Object.values(item.class)
  85. cl.forEach((it,idx,arr) => {
  86. let num = it.num
  87. let name = it.name
  88. let amount = it.amount
  89. str += name+' '+num+'笔'+' ¥'+amount+', '
  90. })
  91. str += ' || '
  92. }
  93. if(item.category && !this.$util.isEmpty(item.category)){
  94. let cat = Object.values(item.category)
  95. cat.forEach((it,idx,arr) => {
  96. let num = it.num
  97. let name = it.name
  98. let amount = it.amount
  99. str += name+' '+num+'笔'+' ¥'+amount+', '
  100. })
  101. }
  102. this.$util.confirmModal({title:'明细',content:str},() => { })
  103. },
  104. ...mapActions(['setUserShopAll']),
  105. //选择分店
  106. selectShopFn(val){
  107. this.params.shopId = val.id;
  108. this.init();
  109. },
  110. //选择时间
  111. selectDateFn(val) {
  112. this.params = {...this.params,...val}
  113. this.init();
  114. },
  115. async init() {
  116. this._list();
  117. },
  118. _list() {
  119. let that = this
  120. uni.showLoading()
  121. getStatKdProfile(this.params).then(res => {
  122. uni.hideLoading()
  123. that.profile = res.data.list
  124. that.income = res.data.income
  125. });
  126. }
  127. }
  128. };
  129. </script>
  130. <style lang="scss" scoped>
  131. .ex-page {
  132. background: white;
  133. padding-top:20upx;
  134. height: 100%;
  135. display: flex;
  136. flex-direction: column;
  137. .top-bar {
  138. position: absolute;
  139. left: 0;
  140. display: flex;
  141. width: 100%;
  142. top:20upx;
  143. z-index: 20;
  144. .bar{
  145. width: 50%;
  146. height: 100%;
  147. text-align: center;
  148. &:nth-child(1){
  149. border-right: 1upx solid #eeeeec;
  150. }
  151. }
  152. }
  153. .main-view {
  154. margin-top: 60upx;
  155. flex: 1;
  156. background-color: #f9fbfc;
  157. .space-view {
  158. background-color: #fff;
  159. }
  160. .act-income{
  161. margin-top:30upx;
  162. margin-bottom:30upx;
  163. font-size:25upx;
  164. color:rgb(92, 91, 91);
  165. text-align:center;
  166. font-weight:bold;
  167. }
  168. .ex-info {
  169. padding: 30upx;
  170. .info-cell {
  171. display: flex;
  172. align-items: center;
  173. font-size: 28upx;
  174. &:not(:first-child) {
  175. margin-top: 20upx;
  176. }
  177. .cell-label {
  178. width: 110upx;
  179. color: #666666;
  180. }
  181. .cell-value {
  182. margin-left: 40upx;
  183. color: #333;
  184. &.warning {
  185. color: #ffaf1d;
  186. }
  187. &.success {
  188. color: #27c325;
  189. }
  190. }
  191. }
  192. }
  193. .ex-table {
  194. /deep/.icon-info {
  195. color: #333333;
  196. }
  197. }
  198. }
  199. .bar-view {
  200. display: flex;
  201. justify-content: space-between;
  202. align-items: center;
  203. padding: 0 30upx;
  204. width: 100%;
  205. height: 100upx;
  206. box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
  207. .info-view {
  208. font-size: 26upx;
  209. }
  210. .btn-view {
  211. display: flex;
  212. .admin-button-com {
  213. margin: 0 10upx;
  214. }
  215. }
  216. }
  217. }
  218. </style>