cgStat.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <view class="app-content">
  3. <view class="ex-page">
  4. <view class="input-wrap_box">
  5. <view>
  6. <AppSearchModule placeholder="输入拼音首字母搜索" @input="searchFn"/>
  7. </view>
  8. </view>
  9. <view class="top-bar">
  10. <DateSelect class="bar" top="0" @selectDateFn="selectDateFn" />
  11. </view>
  12. <view class="main-view">
  13. <view class="space-view ex-table">
  14. <block>
  15. <t-table :headerBackgroundColor="'#F0F2F6'">
  16. <t-tr header><t-th>供货商</t-th><t-th>订单数</t-th><t-th>金额</t-th><t-th>操作</t-th></t-tr>
  17. <view style="font-size:30upx;margin:10upx 0 10upx 10upx;">总金额:{{ totalActPrice }}</view>
  18. <view v-for="(item, index) in storageData" :key="index">
  19. <t-tr>
  20. <t-td><view>{{item.name}}</view></t-td>
  21. <t-td><view>{{parseFloat(item.num)}}</view></t-td>
  22. <t-td><view>{{parseFloat(item.actPrice)}}</view></t-td>
  23. <t-td></t-td>
  24. </t-tr>
  25. </view>
  26. </t-table>
  27. </block>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import AppWrapperEmpty from "@/components/app-wrapper-empty";
  35. import SelectList from "@/components/plugin/selectList";
  36. import { getStatCgGhsProfile } from "@/api/stat/index";
  37. import { list } from "@/mixins";
  38. import ShopSelect from "@/components/module/shopSelect";
  39. import DateSelect from "@/components/module/dateSelect";
  40. import AppSearchModule from "@/components/module/app-search";
  41. import {mapActions, mapGetters} from "vuex";
  42. export default {
  43. components: { SelectList, AppWrapperEmpty,ShopSelect,AppSearchModule,DateSelect },
  44. mixins: [list],
  45. computed: {
  46. ...mapGetters(["getDictionariesInfo","getLoginInfo"])
  47. },
  48. data() {
  49. return {
  50. isShow:false,
  51. customizationTime:[],
  52. shopId:'',
  53. itemId:'',
  54. nowTime: "",
  55. showTimeDropdown: false,
  56. nowShop: "",
  57. showShopDropdown: false,
  58. columns: [
  59. { name: "姓名", dataIndex: "name", color: "info" },
  60. { name: "开单额", dataIndex: "amount", color: "info", width: 120, align: "center" },
  61. { name: "开单数", dataIndex: "num", color: "info", align: "center" }
  62. ],
  63. dataList: [],
  64. params:{ itemId: '', searchTime:'', startTime: "", endTime: "", shopId: "", },
  65. storageData:[],
  66. searchContent:'',
  67. totalActPrice:0
  68. };
  69. },
  70. onPullDownRefresh() {
  71. this.resetList();
  72. this.getList().then(res => {
  73. uni.stopPullDownRefresh();
  74. });
  75. },
  76. onLoad(e) {
  77. this.itemId = e.id;
  78. this.params.itemId = e.id;
  79. this.shopId = this.getLoginInfo.shopId;
  80. },
  81. methods: {
  82. ...mapActions(['setUserShopAll']),
  83. searchFn(e){
  84. this.searchContent = e;
  85. this.filterStat()
  86. },
  87. selectShopFn(val){
  88. this.params.shopId = val.id;
  89. this.init();
  90. },
  91. //选择时间
  92. selectDateFn(val) {
  93. this.params = {...this.params,...val}
  94. this.init();
  95. },
  96. async init() {
  97. this.getList();
  98. },
  99. getList() {
  100. let that = this
  101. uni.showLoading()
  102. getStatCgGhsProfile(this.params).then(res => {
  103. uni.hideLoading()
  104. if (!this.$util.isEmpty(res.data.list)) {
  105. that.storageData = res.data.list
  106. that.totalActPrice = res.data.totalActPrice?parseFloat(res.data.totalActPrice):0
  107. }else{
  108. that.storageData = []
  109. }
  110. })
  111. }
  112. }
  113. };
  114. </script>
  115. <style lang="scss" scoped>
  116. .ex-page {
  117. background: white;
  118. padding-top:20upx;
  119. height: 100%;
  120. display: flex;
  121. flex-direction: column;
  122. .top-bar {
  123. position: absolute;
  124. left: 0;
  125. top:130upx;
  126. display: flex;
  127. width: 100%;
  128. z-index: 20;
  129. .bar{
  130. width: 50%;
  131. height: 100%;
  132. text-align: center;
  133. &:nth-child(1){
  134. border-right: 1upx solid #eeeeec;
  135. }
  136. }
  137. }
  138. .main-view {
  139. margin-top: 90upx;
  140. flex: 1;
  141. background-color: #f9fbfc;
  142. .space-view {
  143. background-color: #fff;
  144. .change-level{
  145. font-size:22upx;
  146. padding:10upx 15upx;
  147. }
  148. }
  149. .ex-info {
  150. padding: 30upx;
  151. .info-cell {
  152. display: flex;
  153. align-items: center;
  154. font-size: 28upx;
  155. &:not(:first-child) {
  156. margin-top: 20upx;
  157. }
  158. .cell-label {
  159. width: 110upx;
  160. color: #666666;
  161. }
  162. .cell-value {
  163. margin-left: 40upx;
  164. color: #333;
  165. &.warning {
  166. color: #ffaf1d;
  167. }
  168. &.success {
  169. color: #27c325;
  170. }
  171. }
  172. }
  173. }
  174. .ex-table {
  175. ::v-deep.icon-info {
  176. color: #333333;
  177. }
  178. }
  179. }
  180. .bar-view {
  181. display: flex;
  182. justify-content: space-between;
  183. align-items: center;
  184. padding: 0 30upx;
  185. width: 100%;
  186. height: 100upx;
  187. box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
  188. .info-view {
  189. font-size: 26upx;
  190. }
  191. .btn-view {
  192. display: flex;
  193. .admin-button-com {
  194. margin: 0 10upx;
  195. }
  196. }
  197. }
  198. }
  199. </style>