cgStat.vue 4.7 KB

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