stockPut.vue 9.0 KB

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