cgStat.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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 v-for="(item, index) in profile" :key="index">
  18. <t-tr>
  19. <t-td><view>{{item.ghsName}}</view></t-td>
  20. <t-td><view>{{parseFloat(item.num)}}</view></t-td>
  21. <t-td><view>{{parseFloat(item.amount)}}</view></t-td>
  22. <t-td></t-td>
  23. </t-tr>
  24. </view>
  25. </t-table>
  26. </block>
  27. </view>
  28. </view>
  29. </view>
  30. <view style="font-size:30upx;margin-top:30upx;margin-left:30upx;">以上数据有略微误差,仅供参考</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: { ...mapGetters(["getDictionariesInfo","getLoginInfo"]) },
  46. data() {
  47. return {
  48. isShow:false,
  49. customizationTime:[],
  50. shopId:'',
  51. itemId:'',
  52. nowTime: "",
  53. showTimeDropdown: false,
  54. nowShop: "",
  55. showShopDropdown: false,
  56. columns: [
  57. { name: "姓名", dataIndex: "name", color: "info" },
  58. { name: "开单额", dataIndex: "amount", color: "info", width: 120, align: "center" },
  59. { name: "开单数", dataIndex: "num", color: "info", align: "center" }
  60. ],
  61. dataList: [],
  62. params:{ itemId: '', searchTime:'', startTime: "", endTime: "", shopId: "", },
  63. profile:[],
  64. storageData:[],
  65. searchContent:'',
  66. };
  67. },
  68. onPullDownRefresh() {
  69. this.resetList();
  70. this.getList().then(res => {
  71. uni.stopPullDownRefresh();
  72. });
  73. },
  74. onLoad(e) {
  75. this.itemId = e.id;
  76. this.params.itemId = e.id;
  77. this.shopId = this.getLoginInfo.shopId;
  78. },
  79. methods: {
  80. ...mapActions(['setUserShopAll']),
  81. searchFn(e){
  82. this.searchContent = e;
  83. this.filterStat()
  84. },
  85. filterStat(){
  86. let that = this
  87. if(this.searchContent.length > 0){
  88. that.profile = [];
  89. that.storageData.forEach(obj => {
  90. let hasName = obj.name && obj.name.indexOf(this.searchContent) >= 0;
  91. let elePy = (obj.py && obj.py.toLocaleUpperCase()) || "";
  92. let hasPy = elePy.indexOf(this.searchContent.toLocaleUpperCase()) >= 0;
  93. if (hasName || hasPy) {
  94. that.profile.push(obj)
  95. }
  96. })
  97. }else{
  98. that.profile = that.storageData
  99. }
  100. },
  101. //选择分店
  102. selectShopFn(val){
  103. this.params.shopId = val.id;
  104. this.init();
  105. },
  106. //选择时间
  107. selectDateFn(val) {
  108. this.params = {...this.params,...val}
  109. this.init();
  110. },
  111. async init() {
  112. this.getList();
  113. },
  114. getList() {
  115. let that = this
  116. uni.showLoading()
  117. getStatCgGhsProfile(this.params).then(res => {
  118. uni.hideLoading()
  119. if (!this.$util.isEmpty(res.data.list)) {
  120. that.storageData = res.data.list
  121. that.filterStat()
  122. }else{
  123. that.storageData=[]
  124. }
  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. top:130upx;
  141. display: flex;
  142. width: 100%;
  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: 90upx;
  155. flex: 1;
  156. background-color: #f9fbfc;
  157. .space-view {
  158. background-color: #fff;
  159. .change-level{
  160. font-size:22upx;
  161. padding:10upx 15upx;
  162. }
  163. }
  164. .ex-info {
  165. padding: 30upx;
  166. .info-cell {
  167. display: flex;
  168. align-items: center;
  169. font-size: 28upx;
  170. &:not(:first-child) {
  171. margin-top: 20upx;
  172. }
  173. .cell-label {
  174. width: 110upx;
  175. color: #666666;
  176. }
  177. .cell-value {
  178. margin-left: 40upx;
  179. color: #333;
  180. &.warning {
  181. color: #ffaf1d;
  182. }
  183. &.success {
  184. color: #27c325;
  185. }
  186. }
  187. }
  188. }
  189. .ex-table {
  190. ::v-deep.icon-info {
  191. color: #333333;
  192. }
  193. }
  194. }
  195. .bar-view {
  196. display: flex;
  197. justify-content: space-between;
  198. align-items: center;
  199. padding: 0 30upx;
  200. width: 100%;
  201. height: 100upx;
  202. box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
  203. .info-view {
  204. font-size: 26upx;
  205. }
  206. .btn-view {
  207. display: flex;
  208. .admin-button-com {
  209. margin: 0 10upx;
  210. }
  211. }
  212. }
  213. }
  214. </style>