stockPut.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  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">
  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.swiperCurrent = index;
  127. },
  128. swiperChange(event){
  129. console.log(event.detail)
  130. this.list = []
  131. this.status = "loading"
  132. },
  133. // swiper-item左右移动,通知tabs的滑块跟随移动
  134. transition(e) {
  135. let dx = e.detail.dx;
  136. this.$refs.uTabs.setDx(dx);
  137. },
  138. // 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
  139. // swiper滑动结束,分别设置tabs和swiper的状态
  140. animationfinish(e) {
  141. let current = e.detail.current;
  142. if(current != this.current){
  143. this.$refs.uTabs.setFinishCurrent(current);
  144. this.swiperCurrent = current;
  145. this.current = current;
  146. this.pageInit()
  147. }
  148. },
  149. // scroll-view到底部加载更多
  150. onreachBottom() {
  151. console.log(this.list.length, this.total)
  152. if(this.list.length < this.total){
  153. this.pageNo += 1
  154. this.getRow()
  155. }else{
  156. this.status = "nomore"
  157. }
  158. },
  159. checkNums (states, i){
  160. if(states){
  161. let arr = states.split(',')
  162. return arr[i]
  163. }
  164. return 0
  165. },
  166. // 查询列表
  167. getRow (pageNo) {
  168. let _this = this
  169. if (pageNo) {
  170. this.pageNo = pageNo
  171. }
  172. let params = {
  173. pageNo: this.pageNo,
  174. pageSize: this.pageSize,
  175. billState:this.tabList[this.current].typeId
  176. }
  177. this.status = "loading"
  178. getShelfReplenishBilllList(params).then(res => {
  179. if (res.code == 200 || res.status == 204 || res.status == 200) {
  180. if(_this.pageNo>1){
  181. _this.list = _this.list.concat(res.data.list || [])
  182. }else{
  183. _this.list = res.data.list || []
  184. }
  185. _this.total = res.data.count || 0
  186. } else {
  187. _this.list = []
  188. _this.total = 0
  189. _this.noDataText = res.message
  190. }
  191. _this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
  192. })
  193. },
  194. // 详细页
  195. viewRow(item){
  196. uni.navigateTo({
  197. url: "/pagesA/digitalShelf/stockPutDetail?sn="+item.replenishBillSn
  198. })
  199. },
  200. // 立即入库
  201. toPut (params,index) {
  202. let _this = this
  203. uni.showModal({
  204. title: '提示',
  205. content: '确认立即入库?',
  206. success: (ret) => {
  207. if(ret.confirm||ret.index==0){
  208. }
  209. }
  210. })
  211. },
  212. }
  213. }
  214. </script>
  215. <style lang="scss">
  216. page{
  217. height: 100vh;
  218. background-color: #F8F8F8;
  219. }
  220. .digitShelf-pagesCons{
  221. width: 100%;
  222. height: 100vh;
  223. .tab-body{
  224. width: 100%;
  225. height: 100vh;
  226. display: flex;
  227. flex-direction: column;
  228. .check-list{
  229. height: calc(100vh - 44px);
  230. }
  231. .check-order-list{
  232. background: #ffffff;
  233. padding: 10upx 20upx;
  234. margin: 0 25rpx 25rpx 25rpx;
  235. border-radius: 20upx;
  236. box-shadow: 1px 1px 3px #EEEEEE;
  237. .check-row{
  238. display: flex;
  239. align-items: center;
  240. padding: 20upx 10upx;
  241. font-size: 28upx;
  242. &:first-child{
  243. color: #666E75;
  244. font-size: 28upx;
  245. padding-bottom: 10upx;
  246. .orderNo{
  247. font-size: 34upx;
  248. color: #222222;
  249. width: 45%;
  250. }
  251. border-bottom: 2upx solid #f5f5f5;
  252. }
  253. > view{
  254. justify-content: space-between;
  255. &:first-child{
  256. flex-grow: 1;
  257. width: 65%;
  258. }
  259. .carModel{
  260. color: #222222;
  261. font-size: 32upx;
  262. font-weight: bold;
  263. line-height: normal;
  264. margin-bottom: 20rpx;
  265. }
  266. .carVin{
  267. color: #666E75;
  268. text{
  269. color: #033692;
  270. }
  271. }
  272. }
  273. .carImage{
  274. padding-right: 20rpx;
  275. }
  276. .action{
  277. padding: 0 30rpx;
  278. color: #fff;
  279. border-radius: 100rpx;
  280. font-size: 24upx;
  281. &:after{
  282. border: 0;
  283. }
  284. &:active{
  285. opacity: 0.5;
  286. }
  287. }
  288. .finish{
  289. background-color: #066cff;
  290. }
  291. .del{
  292. color: #666;
  293. border:2rpx solid #EDEDED;
  294. background: none;
  295. }
  296. }
  297. }
  298. }
  299. }
  300. .search-popup{
  301. .search-title{
  302. text-align: center;
  303. padding: 20upx;
  304. color: #333;
  305. border-bottom: 1px solid #eee;
  306. }
  307. .uni-list{
  308. padding:10upx 20upx;
  309. margin: 0;
  310. border-bottom: 1px solid #EEEEEE;
  311. .uni-list-cell{
  312. border: 0;
  313. .uni-list-cell-db{
  314. flex: 1;
  315. width: 100%;
  316. }
  317. .uni-input{
  318. height: 2.5em;
  319. line-height: 2.5em;
  320. font-size: 28upx;
  321. display: flex;
  322. align-items: center;
  323. > view{
  324. &:first-child{
  325. flex-grow: 1;
  326. color: #666;
  327. }
  328. &:last-child{
  329. color: #999;
  330. }
  331. }
  332. }
  333. .item-icon{
  334. margin-left: 10upx;
  335. }
  336. }
  337. }
  338. .uni-list-btns{
  339. display: flex;
  340. padding: 50upx 20upx;
  341. uni-button{
  342. font-size: 28upx;
  343. margin: 0 30upx;
  344. flex:1;
  345. border-radius: 100upx;
  346. &:after{
  347. border: 0;
  348. }
  349. }
  350. }
  351. .checkbox-items{
  352. display: flex;
  353. flex-wrap: wrap;
  354. justify-content: space-between;
  355. .checkbox{
  356. width: 24%;
  357. background: #F8F8F8;
  358. text-align: center;
  359. margin: 20upx 0;
  360. padding: 10upx 0;
  361. border-radius: 50upx;
  362. font-size: 24upx;
  363. border:1upx solid #eee;
  364. }
  365. .checked{
  366. background: rgba(4, 133, 246, 0.15);
  367. border-color: rgba(4, 133, 246, 0.5);
  368. color: rgba(4, 133, 246, 1);
  369. }
  370. }
  371. }
  372. </style>