kdIncome.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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 SelectList from "@/components/plugin/selectList";
  95. import { getStatKdProfile } from "@/api/stat/index";
  96. import { list } from "@/mixins";
  97. import ShopSelect from "@/components/module/shopSelect";
  98. import DateSelect from "@/components/module/dateSelect";
  99. import {mapActions, mapGetters} from "vuex";
  100. import ModalModule from "@/components/plugin/modal";
  101. export default {
  102. components: { SelectList, AppWrapperEmpty,ShopSelect,DateSelect,ModalModule},
  103. mixins: [list],
  104. computed: { ...mapGetters(["getDictionariesInfo","getLoginInfo"]) },
  105. data() {
  106. return {
  107. isShow:false,
  108. customizationTime:'',
  109. menuTimeObj:'',
  110. menuShopObj:'',
  111. shopId:'',
  112. itemId:'',
  113. nowTime: "",
  114. showTimeDropdown: false,
  115. nowShop: "",
  116. payCodeIncome:0,
  117. showShopDropdown: false,
  118. dataList: [],
  119. params:{
  120. itemId: '',
  121. searchTime:'',
  122. startTime: "",
  123. endTime: "",
  124. shopId: "",
  125. contain:0
  126. },
  127. profile:[],
  128. totalIncome:0,
  129. showDetailPop:false,
  130. detailItem:[],
  131. staffAmountList:[]
  132. };
  133. },
  134. onPullDownRefresh() {
  135. this.resetList();
  136. this.getIncomeList().then(res => {
  137. uni.stopPullDownRefresh();
  138. });
  139. },
  140. onLoad(e) {
  141. this.itemId = e.id;
  142. this.params.itemId = e.id;
  143. this.shopId = this.getLoginInfo.shopId;
  144. },
  145. methods: {
  146. ...mapActions(['setUserShopAll']),
  147. confirmDetail(val){
  148. if (val.index === 0) {
  149. this.cancelShowDetail();
  150. } else {
  151. this.cancelShowDetail();
  152. }
  153. },
  154. cancelShowDetail(){
  155. this.showDetailPop = false
  156. },
  157. selectShopFn(val){
  158. this.params.shopId = val.id;
  159. this.init();
  160. },
  161. getDetail(item){
  162. this.detailItem = item
  163. this.showDetailPop = true
  164. },
  165. selectDateFn(val) {
  166. this.params = {...this.params,...val}
  167. this.init();
  168. },
  169. async init() {
  170. this.getIncomeList();
  171. },
  172. getIncomeList() {
  173. let that = this
  174. uni.showLoading()
  175. getStatKdProfile(this.params).then(res => {
  176. uni.hideLoading()
  177. that.profile = res.data.list
  178. that.payCodeIncome = res.data.payCodeIncome ? parseFloat(res.data.payCodeIncome) : 0
  179. that.totalIncome = res.data.totalIncome
  180. that.staffAmountList = res.data.staffAmountList
  181. });
  182. }
  183. }
  184. };
  185. </script>
  186. <style lang="scss" scoped>
  187. .ex-page {
  188. background: white;
  189. padding-top:20upx;
  190. height: 100%;
  191. display: flex;
  192. flex-direction: column;
  193. .top-bar {
  194. position: absolute;
  195. left: 0;
  196. display: flex;
  197. width: 100%;
  198. top:20upx;
  199. z-index: 20;
  200. .bar{
  201. width: 50%;
  202. height: 100%;
  203. text-align: center;
  204. &:nth-child(1){
  205. border-right: 1upx solid #eeeeec;
  206. }
  207. }
  208. }
  209. .main-view {
  210. margin-top: 60upx;
  211. flex: 1;
  212. background-color: #f9fbfc;
  213. .space-view {
  214. background-color: #fff;
  215. }
  216. .act-income{
  217. margin-left:60upx;
  218. margin-top:30upx;
  219. font-size:30upx;
  220. color:rgb(92, 91, 91);
  221. }
  222. .ex-info {
  223. padding: 30upx;
  224. .info-cell {
  225. display: flex;
  226. align-items: center;
  227. font-size: 28upx;
  228. &:not(:first-child) {
  229. margin-top: 20upx;
  230. }
  231. .cell-label {
  232. width: 110upx;
  233. color: #666666;
  234. }
  235. .cell-value {
  236. margin-left: 40upx;
  237. color: #333;
  238. &.warning {
  239. color: #ffaf1d;
  240. }
  241. &.success {
  242. color: #27c325;
  243. }
  244. }
  245. }
  246. }
  247. .ex-table {
  248. ::v-deep.icon-info {
  249. color: #333333;
  250. }
  251. }
  252. }
  253. .bar-view {
  254. display: flex;
  255. justify-content: space-between;
  256. align-items: center;
  257. padding: 0 30upx;
  258. width: 100%;
  259. height: 100upx;
  260. box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
  261. .info-view {
  262. font-size: 26upx;
  263. }
  264. .btn-view {
  265. display: flex;
  266. .admin-button-com {
  267. margin: 0 10upx;
  268. }
  269. }
  270. }
  271. }
  272. </style>