kdIncome.vue 5.8 KB

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