kdIncome.vue 7.1 KB

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