stockPut.vue 9.0 KB

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