stockPut.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  1. <template>
  2. <view class="digitShelf-pagesCons">
  3. <view class="tab-body">
  4. <view>
  5. <u-tabs-swiper ref="uTabs" :list="tabList" bar-width='100' active-color="#1283d4" name="dispName" :current="current" @change="tabsChange" :is-scroll="false"
  6. swiperWidth="750"></u-tabs-swiper>
  7. </view>
  8. <swiper class="check-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
  9. <swiper-item class="swiper-item" style="height: 100%;width: 100%;overflow: hidden;" v-for="(tabs, indexs) in tabList" :key="indexs">
  10. <scroll-view scroll-y style="height: 100%;width: 100%;overflow: auto;" @scrolltolower="onreachBottom" v-if="swiperCurrent == indexs">
  11. <view style="height: 20rpx;" ></view>
  12. <view
  13. class="check-order-list"
  14. v-for="(item,index) in list"
  15. :key="item.id"
  16. @click="viewRow(item)"
  17. >
  18. <view class="check-row">
  19. <view class="orderNo">{{item.replenishBillNo||'--'}}</view>
  20. <view class="times" v-if="item.billState=='WAIT_CHECK'">{{item.outStockTime}}</view>
  21. <view class="times" v-if="item.billState=='FINISH'">{{item.putStockTime}}</view>
  22. </view>
  23. <view class="check-row flex align-center">
  24. <view>
  25. <view class="carModel">
  26. {{item.dealerName||'--'}}
  27. </view>
  28. <view class="carVin" v-if="item.billState=='WAIT_CHECK'">
  29. 待入库数量:<text>{{item.totalConfirmQty||item.totalConfirmQty==0?item.totalConfirmQty:'--'}}</text>
  30. </view>
  31. <view class="carVin" v-if="item.billState=='FINISH'">
  32. 入库数量:<text>{{item.totalPutQty||item.totalPutQty==0?item.totalPutQty:'--'}}</text>
  33. </view>
  34. </view>
  35. <view>
  36. <button :hover-stop-propagation="true" @click.stop="viewRow(item)" class="action finish" size="mini">查看详情</button>
  37. </view>
  38. </view>
  39. </view>
  40. <view style="padding:0 30upx 30upx;">
  41. <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  42. <u-loadmore v-if="(total>=list.length&&list.length)||status=='loading'" :status="status" />
  43. </view>
  44. </scroll-view>
  45. </swiper-item>
  46. </swiper>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. import { getShelfReplenishBilllList } from '@/api/shelf'
  52. import moment from 'moment'
  53. export default {
  54. components: {},
  55. data() {
  56. return {
  57. theme:'',
  58. status: 'loading',
  59. noDataText: '暂无数据',
  60. tabList: [
  61. {
  62. dispName: '待入库',
  63. typeId: 'WAIT_CHECK'
  64. },
  65. {
  66. dispName: '已入库',
  67. typeId: 'FINISH'
  68. },
  69. ],
  70. current: 0,
  71. swiperCurrent: 0,
  72. // 查询条件
  73. pageNo: 1,
  74. pageSize: 10,
  75. list: [],
  76. total: 0,
  77. billState:'', // 状态
  78. }
  79. },
  80. onLoad() {
  81. let _this = this
  82. _this.pageInit()
  83. _this.theme = getApp().globalData.theme
  84. uni.$on('refreshOrder',function(data){
  85. _this.list = []
  86. _this.status = "loading"
  87. _this.pageInit()
  88. })
  89. },
  90. methods:{
  91. // 复制
  92. copyVin(){
  93. uni.setClipboardData({
  94. data: this.vinNumber||'',
  95. })
  96. },
  97. message(title){
  98. uni.showToast({
  99. icon:'none',
  100. title: title
  101. })
  102. },
  103. pageInit(){
  104. this.total = 0
  105. this.billState = this.tabList[this.current].typeId
  106. this.pageNo = 1
  107. // 待取货
  108. if(this.swiperCurrent == 0){
  109. this.finishFlag = ''
  110. this.orderFlags = []
  111. }
  112. // 已取货
  113. if(this.swiperCurrent == 1){
  114. this.finishFlag = 'SAVE'
  115. this.orderFlags = []
  116. }
  117. // 已取消
  118. if(this.swiperCurrent == 2){
  119. this.finishFlag = 'FINI'
  120. this.orderFlags = ['UNPA','INPA']
  121. }
  122. this.getRow()
  123. },
  124. // tabs通知swiper切换
  125. tabsChange(index) {
  126. this.list = []
  127. this.status = "loading"
  128. this.swiperCurrent = index
  129. },
  130. swiperChange(event){
  131. this.list = []
  132. this.status = "loading"
  133. this.swiperCurrent = event.detail.current
  134. },
  135. // swiper-item左右移动,通知tabs的滑块跟随移动
  136. transition(e) {
  137. let dx = e.detail.dx;
  138. this.$refs.uTabs.setDx(dx);
  139. },
  140. // 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
  141. // swiper滑动结束,分别设置tabs和swiper的状态
  142. animationfinish(e) {
  143. let current = e.detail.current;
  144. if(current != this.current){
  145. this.$refs.uTabs.setFinishCurrent(current);
  146. this.swiperCurrent = current;
  147. this.current = current;
  148. this.pageInit()
  149. }
  150. },
  151. // scroll-view到底部加载更多
  152. onreachBottom() {
  153. console.log(this.list.length, this.total)
  154. if(this.list.length < this.total){
  155. this.pageNo += 1
  156. this.getRow()
  157. }else{
  158. this.status = "nomore"
  159. }
  160. },
  161. checkNums (states, i){
  162. if(states){
  163. let arr = states.split(',')
  164. return arr[i]
  165. }
  166. return 0
  167. },
  168. // 查询列表
  169. getRow (pageNo) {
  170. let _this = this
  171. if (pageNo) {
  172. this.pageNo = pageNo
  173. }
  174. let params = {
  175. pageNo: this.pageNo,
  176. pageSize: this.pageSize,
  177. billState:this.tabList[this.current].typeId
  178. }
  179. this.status = "loading"
  180. getShelfReplenishBilllList(params).then(res => {
  181. if (res.code == 200 || res.status == 204 || res.status == 200) {
  182. if(_this.pageNo>1){
  183. _this.list = _this.list.concat(res.data.list || [])
  184. }else{
  185. _this.list = res.data.list || []
  186. }
  187. _this.total = res.data.count || 0
  188. } else {
  189. _this.list = []
  190. _this.total = 0
  191. _this.noDataText = res.message
  192. }
  193. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  194. })
  195. },
  196. // 详细页
  197. viewRow(item){
  198. uni.navigateTo({
  199. url: "/pagesA/digitalShelf/stockPutDetail?sn="+item.replenishBillSn
  200. })
  201. },
  202. // 立即入库
  203. toPut (params,index) {
  204. let _this = this
  205. uni.showModal({
  206. title: '提示',
  207. content: '确认立即入库?',
  208. success: (ret) => {
  209. if(ret.confirm||ret.index==0){
  210. }
  211. }
  212. })
  213. },
  214. }
  215. }
  216. </script>
  217. <style lang="scss">
  218. page{
  219. height: 100vh;
  220. background-color: #F8F8F8;
  221. }
  222. .digitShelf-pagesCons{
  223. width: 100%;
  224. height: 100vh;
  225. .tab-body{
  226. width: 100%;
  227. height: 100vh;
  228. display: flex;
  229. flex-direction: column;
  230. .check-list{
  231. height: calc(100vh - 44px);
  232. }
  233. .check-order-list{
  234. background: #ffffff;
  235. padding: 10upx 20upx;
  236. margin: 0 25rpx 25rpx 25rpx;
  237. border-radius: 20upx;
  238. box-shadow: 1px 1px 3px #EEEEEE;
  239. .check-row{
  240. display: flex;
  241. align-items: center;
  242. padding: 20upx 10upx;
  243. font-size: 28upx;
  244. &:first-child{
  245. color: #666E75;
  246. font-size: 28upx;
  247. padding-bottom: 10upx;
  248. .orderNo{
  249. font-size: 34upx;
  250. color: #222222;
  251. width: 45%;
  252. }
  253. border-bottom: 2upx solid #f5f5f5;
  254. }
  255. > view{
  256. justify-content: space-between;
  257. &:first-child{
  258. flex-grow: 1;
  259. width: 65%;
  260. }
  261. .carModel{
  262. color: #222222;
  263. font-size: 32upx;
  264. font-weight: bold;
  265. line-height: normal;
  266. margin-bottom: 20rpx;
  267. }
  268. .carVin{
  269. color: #666E75;
  270. text{
  271. color: #033692;
  272. }
  273. }
  274. }
  275. .carImage{
  276. padding-right: 20rpx;
  277. }
  278. .action{
  279. padding: 0 30rpx;
  280. color: #fff;
  281. border-radius: 100rpx;
  282. font-size: 24upx;
  283. &:after{
  284. border: 0;
  285. }
  286. &:active{
  287. opacity: 0.5;
  288. }
  289. }
  290. .finish{
  291. background-color: #066cff;
  292. }
  293. .del{
  294. color: #666;
  295. border:2rpx solid #EDEDED;
  296. background: none;
  297. }
  298. }
  299. }
  300. }
  301. }
  302. .search-popup{
  303. .search-title{
  304. text-align: center;
  305. padding: 20upx;
  306. color: #333;
  307. border-bottom: 1px solid #eee;
  308. }
  309. .uni-list{
  310. padding:10upx 20upx;
  311. margin: 0;
  312. border-bottom: 1px solid #EEEEEE;
  313. .uni-list-cell{
  314. border: 0;
  315. .uni-list-cell-db{
  316. flex: 1;
  317. width: 100%;
  318. }
  319. .uni-input{
  320. height: 2.5em;
  321. line-height: 2.5em;
  322. font-size: 28upx;
  323. display: flex;
  324. align-items: center;
  325. > view{
  326. &:first-child{
  327. flex-grow: 1;
  328. color: #666;
  329. }
  330. &:last-child{
  331. color: #999;
  332. }
  333. }
  334. }
  335. .item-icon{
  336. margin-left: 10upx;
  337. }
  338. }
  339. }
  340. .uni-list-btns{
  341. display: flex;
  342. padding: 50upx 20upx;
  343. uni-button{
  344. font-size: 28upx;
  345. margin: 0 30upx;
  346. flex:1;
  347. border-radius: 100upx;
  348. &:after{
  349. border: 0;
  350. }
  351. }
  352. }
  353. .checkbox-items{
  354. display: flex;
  355. flex-wrap: wrap;
  356. justify-content: space-between;
  357. .checkbox{
  358. width: 24%;
  359. background: #F8F8F8;
  360. text-align: center;
  361. margin: 20upx 0;
  362. padding: 10upx 0;
  363. border-radius: 50upx;
  364. font-size: 24upx;
  365. border:1upx solid #eee;
  366. }
  367. .checked{
  368. background: rgba(4, 133, 246, 0.15);
  369. border-color: rgba(4, 133, 246, 0.5);
  370. color: rgba(4, 133, 246, 1);
  371. }
  372. }
  373. }
  374. </style>