flowing.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <view>
  3. <u-navbar :border-bottom="false" :is-back="true" title-color="#fff" title=" " :background="nav_background">
  4. <view class="headline">
  5. <u-search
  6. height="72"
  7. bg-color="#ECF0F7"
  8. :show-action="false"
  9. :clearabled="true"
  10. @search="searchConfirm"
  11. placeholder="商品名称/单据编号"
  12. @clear="searchConfirm"
  13. v-model="search_form.keyword"
  14. ></u-search>
  15. </view>
  16. </u-navbar>
  17. <view class="tabs-view clearfix float_left">
  18. <view class="search-view clearfix float_left" style="width: 50%;">
  19. <view class="title ellipsis" style="width: 47.5%;" @click="timeShow('start_show')">{{ $u.timeFormat(search_form.start, 'yyyy-mm-dd') || '开始时间' }}</view>
  20. <view style="width: 5%;" class="title"><u-icon name="arrow-right"></u-icon></view>
  21. <view class="title ellipsis" style="width: 47.5%;" @click="timeShow('end_show')">{{ $u.timeFormat(search_form.end, 'yyyy-mm-dd') || '结束时间' }}</view>
  22. </view>
  23. <view class="search-view clearfix float_left" style="width: 50%">
  24. <view class="title ellipsis" style="width: 50%;" @click="goPage('/pagesT/werahouse/selWerahouse')">
  25. {{ search_form.warehouseName }}
  26. <u-icon name="arrow-down-fill" class="ico" style="right: 0;"></u-icon>
  27. </view>
  28. <view class="title ellipsis" style="width: 30%;" @click="goPage('/pagesT/staff/selStaff')">
  29. {{ search_form.salesName }}
  30. <u-icon name="arrow-down-fill" class="ico" style="right: 0;"></u-icon>
  31. </view>
  32. <view class="title" style="width: 20%;" @click="clearValue"><u-icon name="reload"></u-icon></view>
  33. </view>
  34. </view>
  35. <view class="rigth-view">
  36. <scroll-view scroll-y="true" class="rigth-scroll" @scrolltolower="moreGoods" :scroll-top="scrollTop">
  37. <view class="explain">
  38. <view class="float_left">合计数据</view>
  39. <view class="float_right">共{{ total }}条</view>
  40. </view>
  41. <view class="goods-li" v-for="(item, index) in customer_list" :key="index">
  42. <view class="title clearfix">
  43. <view class="float_left ellipsis" style="margin-left: 40rpx; width: 350rpx;">{{ item.sourceNo }}</view>
  44. <view class="float_right" style="margin-right: 40rpx;">{{ item.operatorName }}</view>
  45. </view>
  46. <view class="goods-main clearfix">
  47. <image class="goods-img float_left" :src="item.images[0]" mode="aspectFill"></image>
  48. <view class="goods-info float_left">
  49. <view class="goods-name ellipsis">{{ item.materielName }}</view>
  50. <view class="goods-code ellipsis">{{ item.materielCode }}</view>
  51. <view class="goods-code">{{ item.unitName }};{{ item.skuName }}</view>
  52. <view class="goods-code">{{ item.skuValue }}</view>
  53. <view class="goods-code">
  54. <view class="num-ul">
  55. <view class="num-li" v-if="item.actionType === 4">
  56. <view class="label">
  57. 出库
  58. <text style="color: #FF6D74; margin-left: 20rpx;">-{{ $utils.formatNub(item.inventoryNum) }}</text>
  59. </view>
  60. </view>
  61. <view class="num-li" v-if="item.actionType === 5">
  62. <view class="label">
  63. 入库
  64. <text style="color:#00C792; margin-left: 20rpx;">+{{ $utils.formatNub(item.inventoryNum) }}</text>
  65. </view>
  66. </view>
  67. <view class="num-li float_right" style="text-align: center;">
  68. <view class="label">
  69. 剩余量
  70. <text style="margin-left: 20rpx;">{{ $utils.formatNub(item.inventoryChangeNum) }}</text>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="title clearfix" style="border-top: 1rpx rgb(238,238,238) solid; border-bottom: none;">
  78. <view class="float_left ellipsis" style="margin-left: 40rpx; width: 350rpx;">{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  79. <view class="float_right" style="margin-right: 40rpx; color: #2D405E;">{{ item.sourceName }}</view>
  80. </view>
  81. </view>
  82. <u-loadmore v-if="customer_list.length" :status="load_status" />
  83. <view v-if="!customer_list.length" class="empty-view"><u-empty text="暂无数据" mode="order"></u-empty></view>
  84. </scroll-view>
  85. </view>
  86. <u-picker v-model="start_show" mode="time" :params="time_params" @confirm="startconfirm"></u-picker>
  87. <u-picker v-model="end_show" mode="time" :params="time_params" @confirm="endconfirm"></u-picker>
  88. </view>
  89. </template>
  90. <script>
  91. export default {
  92. data() {
  93. return {
  94. load_status: 'nomore',
  95. nav_background: {
  96. backgroundColor: '#fff'
  97. },
  98. start_show: false,
  99. end_show: false,
  100. time_params: {
  101. year: true,
  102. month: true,
  103. day: true,
  104. hour: false,
  105. minute: false,
  106. second: false
  107. },
  108. search_form: {
  109. keyword: '',
  110. start: new Date(this.$utils.showMonthFirstDay()).getTime() / 1000,
  111. end: new Date().getTime(),
  112. warehouseId: '',
  113. warehouseName: '仓库',
  114. salesName: '操作人',
  115. salesManId: ''
  116. },
  117. staffData: {},
  118. werahouseData: {},
  119. customer_list: [],
  120. page: 1,
  121. pageSize: 10,
  122. total: 0
  123. };
  124. },
  125. onLoad() {
  126. this.getAllWarehouse();
  127. },
  128. onReachBottom() {
  129. if (this.total / this.pageSize > this.page) {
  130. this.page += 1;
  131. this.searchAllInventoryDetails();
  132. }
  133. },
  134. watch: {
  135. werahouseData(val) {
  136. if (val) {
  137. this.search_form.warehouseId = val.id;
  138. this.search_form.warehouseName = val.warehouseName;
  139. this.searchAllInventoryDetails();
  140. }
  141. },
  142. staffData(val) {
  143. if (val) {
  144. this.search_form.salesManId = val.id;
  145. this.search_form.salesName = val.staffName;
  146. this.searchAllInventoryDetails();
  147. }
  148. }
  149. },
  150. methods: {
  151. // 滚动到底部,触发上拉加载
  152. moreGoods() {
  153. if (this.total / this.pageSize > this.page) {
  154. this.page += 1;
  155. this.searchAllInventoryDetails();
  156. }
  157. },
  158. searchConfirm() {
  159. this.page = 1;
  160. this.searchAllInventoryDetails();
  161. },
  162. startconfirm(val) {
  163. this.search_form.start = this.$utils.timeByTimestamp(val.year + '-' + val.month + '-' + val.day + ' 00:00:00');
  164. this.page = 1;
  165. },
  166. endconfirm(val) {
  167. this.search_form.end = this.$utils.timeByTimestamp(val.year + '-' + val.month + '-' + val.day + ' 23:59:59') * 1000;
  168. this.page = 1;
  169. this.searchAllInventoryDetails();
  170. },
  171. timeShow(params) {
  172. this[params] = true;
  173. },
  174. getAllWarehouse() {
  175. this.$u.api
  176. .getAllWarehouse({
  177. page: 1,
  178. pageSize: 1
  179. })
  180. .then(res => {
  181. this.search_form.warehouseId = res.data[0].id;
  182. this.search_form.warehouseName = res.data[0].warehouseName;
  183. this.searchAllInventoryDetails();
  184. });
  185. },
  186. clearValue() {
  187. this.search_form = {
  188. keyword: '',
  189. start: new Date(this.$utils.showMonthFirstDay()).getTime() / 1000,
  190. end: new Date().getTime(),
  191. warehouseId: '',
  192. warehouseName: '仓库',
  193. salesName: '操作人',
  194. salesManId: ''
  195. };
  196. this.page = 1;
  197. this.getAllWarehouse();
  198. },
  199. searchAllInventoryDetails() {
  200. this.load_status = 'loading';
  201. this.$u.api
  202. .searchAllInventoryDetails({
  203. merchantId: '',
  204. warehouseId: this.search_form.warehouseId,
  205. skuId: '',
  206. operatorId: this.search_form.salesManId,
  207. start: this.search_form.start,
  208. end: this.search_form.end / 1000,
  209. search: this.search_form.keyword,
  210. page: this.page,
  211. pageSize: this.pageSize
  212. })
  213. .then(res => {
  214. if (this.page === 1) {
  215. this.customer_list = res.data;
  216. } else {
  217. this.customer_list = this.customer_list.concat(res.data);
  218. }
  219. this.total = res.pageTotal;
  220. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, this.total);
  221. });
  222. }
  223. }
  224. };
  225. </script>
  226. <style lang="scss" scoped>
  227. .headline {
  228. margin-left: 30rpx;
  229. margin-bottom: 18rpx;
  230. width: 400rpx;
  231. /* #ifdef APP-PLUS */
  232. width: 600rpx;
  233. /* #endif */
  234. /* #ifdef MP */
  235. width: 400rpx;
  236. /* #endif */
  237. height: 72rpx;
  238. }
  239. .tabs-view {
  240. width: 100%;
  241. .search-view {
  242. width: 100%;
  243. background-color: #fff;
  244. .title {
  245. position: relative;
  246. width: 50%;
  247. height: 84rpx;
  248. float: left;
  249. text-align: center;
  250. font-size: 26rpx;
  251. font-weight: 400;
  252. line-height: 84rpx;
  253. font-family: PingFangSC-Regular, PingFang SC;
  254. color: #62738e;
  255. .text {
  256. width: 12rpx;
  257. height: 10rpx;
  258. margin-left: 8rpx;
  259. vertical-align: middle;
  260. }
  261. .ico {
  262. font-size: 12rpx;
  263. color: #b8c0c8;
  264. position: absolute;
  265. top: 38rpx;
  266. }
  267. }
  268. }
  269. }
  270. .rigth-view {
  271. width: 100%;
  272. background-color: rgb(247, 248, 250);
  273. .rigth-scroll {
  274. width: 100%;
  275. height: calc(90vh - 100rpx);
  276. padding-top: calc(var(--status-bar-height));
  277. .explain {
  278. width: 100%;
  279. height: 81rpx;
  280. line-height: 81rpx;
  281. z-index: 99;
  282. color: #879bba;
  283. font-size: 24rpx;
  284. padding: 0 28rpx 0 32rpx;
  285. }
  286. .goods-li {
  287. margin: 0 20rpx 24rpx;
  288. background-color: #ffffff;
  289. border-radius: 8px;
  290. position: relative;
  291. .title {
  292. line-height: 80rpx;
  293. border-bottom: 1px solid #eeeeee;
  294. font-size: 24rpx;
  295. color: #cad0d7;
  296. font-family: PingFangSC-Regular, PingFang SC;
  297. font-weight: 400;
  298. .float_rigth {
  299. .custom-icon-jinru {
  300. margin-left: 10rpx;
  301. font-size: 28rpx;
  302. }
  303. }
  304. }
  305. .goods-main {
  306. padding: 20rpx 0 20rpx 40rpx;
  307. .goods-img {
  308. border-radius: 10rpx;
  309. width: 156rpx;
  310. height: 156rpx;
  311. margin-right: 20rpx;
  312. }
  313. .goods-info {
  314. width: 490rpx;
  315. .goods-name {
  316. -webkit-line-clamp: 1;
  317. }
  318. .goods-code {
  319. width: 100%;
  320. font-size: 24rpx;
  321. padding-top: 6rpx;
  322. }
  323. }
  324. }
  325. .num-ul {
  326. width: 100%;
  327. display: flex;
  328. .num-li {
  329. font-size: 24rpx;
  330. line-height: 36rpx;
  331. font-weight: bold;
  332. flex: 2;
  333. .label {
  334. font-weight: 400;
  335. color: #999999;
  336. }
  337. }
  338. }
  339. .more-btn {
  340. position: absolute;
  341. right: 20rpx;
  342. bottom: -120rpx;
  343. background-color: #ffffff;
  344. border-radius: 10rpx;
  345. padding: 0 20rpx;
  346. z-index: 9;
  347. box-shadow: 0px 3px 24rpx rgba(0, 0, 0, 0.1);
  348. .more-btn-li {
  349. font-size: 24rpx;
  350. line-height: 60rpx;
  351. text-align: center;
  352. border-bottom: 1px solid #f5f5f5;
  353. &:last-child {
  354. border: 0 none;
  355. }
  356. }
  357. }
  358. }
  359. }
  360. }
  361. </style>