index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <div class="storage">
  3. <div class="com-mobile-header mobile-center-header">
  4. <a @click="goLastPage"><i class="iconfont icon-fanhui"></i></a>
  5. <p>产品出入库</p>
  6. <p class="en-name"><img :src="`/images/mobile/center/${user.data.enterprise.uu ? 'en' : 'self'}.png`" alt="">{{currentEnName}}</p>
  7. </div>
  8. <div class="mobile-fix-content mobile-centerfix-content" id="mobile-storage-center">
  9. <!--入库记录-->
  10. <div>
  11. <div class="storage-head">
  12. <span class="inline-block" :class="{'active': switchType === 'inBound'}" @click="setSwitchType('inBound')">入库</span>
  13. <span class="inline-block" :class="{'active': switchType === 'outBound'}" @click="setSwitchType('outBound')">出库</span>
  14. </div>
  15. <div class="storage-record">
  16. <div class="search-content clearfix">
  17. <div class="search">
  18. <input type="text" placeholder="卖家/发货单" class="staff-search">
  19. <span><i class="iconfont icon-sousuo"></i></span>
  20. </div>
  21. </div>
  22. <div class="tab-content">
  23. <span :class="{'active': handleItem === 0}" @click="handleItem = 0">{{switchType === 'inBound' ? '查看入库记录' : '查看出库记录'}}</span>
  24. <span :class="{'active': handleItem === 1}" @click="handleItem = 1">{{switchType === 'inBound' ? '其它入库' : '其它出库'}}</span>
  25. <span v-if="switchType === 'outBound'" :class="{'active': handleItem === 2}" @click="handleItem = 2">{{switchType === 'inBound' ? '采购入库' : '销售出库'}}</span>
  26. </div>
  27. <div class="filters-wrap">
  28. <base-filter
  29. v-for="filterOption in filterOptions"
  30. :key="filterOption.selectOption"
  31. :selectItems="filterOption.selectItems"
  32. :defaultVal="filterOption.defaultVal"
  33. :selectOption="filterOption.selectOption"
  34. @selectAction="onSelectAction"
  35. :title="filterOption.title">
  36. </base-filter>
  37. </div>
  38. <div class="list-content">
  39. <storage-list :listData="listData" v-if="handleItem === 0"></storage-list>
  40. <!--<detail-storage></detail-storage>-->
  41. <other-storage v-if="handleItem === 1"></other-storage>
  42. <purchase-storage v-if="handleItem === 2"></purchase-storage>
  43. </div>
  44. <!--<empty-status :type="'collect'" :showLink="true" :text="'抱歉,没有相关信息'" v-else></empty-status>-->
  45. <!--<pull-up :fixId="'mobile-storage-center'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>-->
  46. </div>
  47. </div>
  48. </div>
  49. <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
  50. </div>
  51. </template>
  52. <script>
  53. import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
  54. import { ModalWrapper, BaseFilter } from '~components/mobile/base'
  55. import { StorageList, DetailStorage, OtherStorage, PurchaseStorage } from '~components/mobile/center/outOfStorage'
  56. export default {
  57. middleware: 'authenticated',
  58. layout: 'mobile',
  59. fetch({route, store}) {
  60. return Promise.all([store.dispatch('product/getLoadStorageData', {})])
  61. },
  62. data () {
  63. return {
  64. remindText: '',
  65. timeoutCount: 0,
  66. switchType: 'inBound',
  67. handleItem:0,
  68. filterOptions: [
  69. {
  70. title: '交易时间',
  71. selectOption: 'date',
  72. selectItems: [{
  73. key: '30天',
  74. val: 1
  75. }, {
  76. key: '90天',
  77. val: 2
  78. }, {
  79. key: '180天',
  80. val: 3
  81. }, {
  82. key: '自定义',
  83. val: 4
  84. }],
  85. defaultVal: 1
  86. }
  87. ]
  88. }
  89. },
  90. components: {
  91. RemindBox,
  92. PullUp,
  93. EmptyStatus,
  94. BaseFilter,
  95. StorageList,
  96. DetailStorage,
  97. OtherStorage,
  98. PurchaseStorage
  99. },
  100. methods: {
  101. onRemind: function (str) {
  102. this.remindText = str
  103. this.timeoutCount++
  104. },
  105. setSwitchType (type) {
  106. this.switchType = type
  107. },
  108. setSelect (type, val) {
  109. if (type === 'date') {
  110. if (val) {
  111. this.filterParams.fromDate = val.fromDate
  112. this.filterParams.toDate = val.toDate
  113. } else {
  114. this.filterParams.fromDate = null
  115. this.filterParams.toDate = null
  116. }
  117. } else {
  118. this.filterParams[type] = val
  119. }
  120. this.filterRecord()
  121. },
  122. initFilterParams () {
  123. this.filterParams = {
  124. keyword: '',
  125. fromDate: '',
  126. toDate: '',
  127. currencyName: '',
  128. method: ''
  129. }
  130. },
  131. onSelectAction (selectObj) {
  132. this.setSelect(selectObj.key, selectObj.value)
  133. },
  134. filterRecord () {
  135. this.page = 1
  136. this.isChange = true
  137. this.reloadList()
  138. },
  139. reloadList () {
  140. if (this.switchType === 'account') {
  141. this.$store.dispatch('payCenter/loadBuyerAccount', {
  142. count: this.count,
  143. page: this.page,
  144. sorting: {num: 'ASC'},
  145. type: 'buyer'
  146. })
  147. } else {
  148. this.$store.dispatch('payCenter/loadBuyerRecord', {
  149. count: this.count,
  150. page: this.page,
  151. sorting: {'paytime': 'DESC'},
  152. currencyName: this.filterParams.currencyName || null,
  153. fromDate: this.filterParams.fromDate || null,
  154. toDate: this.filterParams.toDate || null,
  155. remitteeType: this.filterParams.remitteeType || null,
  156. keyword: this.filterParams.keyword || null
  157. })
  158. }
  159. },
  160. }
  161. }
  162. </script>
  163. <style lang="scss">
  164. $base-color: #3f84f6;
  165. #mobile-storage-center {
  166. padding-bottom: .5rem;
  167. margin: 0 auto;
  168. .storage-head {
  169. height: .82rem;
  170. line-height: .82rem;
  171. text-align: center;
  172. background: #fff;
  173. span {
  174. font-size: .29rem;
  175. &:last-child {
  176. margin-left: 2.6rem;
  177. }
  178. &.active {
  179. color: $base-color;
  180. border-bottom: 1px solid $base-color;
  181. }
  182. }
  183. }
  184. .storage-record {
  185. .search-content {
  186. padding: .20rem 0;
  187. text-align: center;
  188. input {
  189. margin: 0;
  190. width: 7.1rem;
  191. border: 1px solid $base-color;
  192. }
  193. }
  194. .tab-content{
  195. margin: 0 auto .13rem;
  196. width: 7.1rem;
  197. overflow: hidden;
  198. text-align: center;
  199. span{
  200. float: left;
  201. display: inline-block;
  202. width: 2.36rem;
  203. height: .62rem;
  204. line-height: .62rem;
  205. text-align: center;
  206. color: #999999;
  207. font-size: .26rem;
  208. background-color: #ffffff;
  209. border: solid 1px #d7d7d7;
  210. -webkit-box-sizing: border-box;
  211. box-sizing: border-box;
  212. &.active{
  213. background-color: #3f84f6;
  214. border: none;
  215. color: #fff;
  216. }
  217. &:first-child{
  218. border-top-left-radius: .05rem;
  219. border-bottom-left-radius: .05rem;
  220. }
  221. &:nth-child(2){
  222. border-left: none;
  223. border-right: none;
  224. }
  225. &:last-child{
  226. border-top-right-radius: .05rem;
  227. border-bottom-right-radius: .05rem;
  228. }
  229. }
  230. }
  231. .filters-wrap{
  232. background: #fff;
  233. margin: 0 auto .13rem;
  234. width: 7.1rem;
  235. overflow: hidden;
  236. padding: .1rem;
  237. }
  238. .list-content{
  239. margin: 0 auto;
  240. padding: 0 .20rem;
  241. margin-bottom:1.2rem;
  242. }
  243. }
  244. }
  245. </style>