stockPut.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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
  12. class="check-order-list"
  13. v-for="(item,index) in list"
  14. :key="item.id"
  15. @click="viewRow(item)"
  16. >
  17. <view class="check-row">
  18. <view class="orderNo">{{item.replenishBillNo||'--'}}</view>
  19. <view class="times" v-if="item.billState=='WAIT_CHECK'">{{item.outStockTime}}</view>
  20. <view class="times" v-if="item.billState=='FINISH'">{{item.putStockTime}}</view>
  21. </view>
  22. <view class="check-row flex align-center">
  23. <view>
  24. <view class="carModel">
  25. {{item.dealerName||'--'}}
  26. </view>
  27. <view class="carVin" v-if="item.billState=='WAIT_CHECK'">
  28. 待入库数量:<text>{{item.totalConfirmQty||item.totalConfirmQty==0?item.totalConfirmQty:'--'}}</text>
  29. </view>
  30. <view class="carVin" v-if="item.billState=='FINISH'">
  31. 已入库数量:<text>{{item.totalPutQty||item.totalPutQty==0?item.totalPutQty:'--'}}</text>
  32. </view>
  33. </view>
  34. <view>
  35. <button :hover-stop-propagation="true" @click.stop="viewRow(item)" class="action finish" size="mini">查看详情</button>
  36. <!-- <button v-if="swiperCurrent==0" :hover-stop-propagation="true" @click.stop="toPut(item)" class="action finish" size="mini">立即入库</button> -->
  37. </view>
  38. </view>
  39. </view>
  40. <u-empty :src="`/static/def_imgs.png`" icon-size="240" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
  41. <view style="padding: 20upx;">
  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: 100%;
  222. }
  223. .digitShelf-pagesCons{
  224. width: 100%;
  225. height: 100%;
  226. display: flex;
  227. flex-direction: column;
  228. .tab-body{
  229. .check-list{
  230. height: calc(100vh - 44px);
  231. }
  232. .check-order-list{
  233. background: #ffffff;
  234. padding: 10upx 20upx;
  235. margin: 25upx;
  236. border-radius: 30upx;
  237. box-shadow: 1px 1px 3px #EEEEEE;
  238. .check-row{
  239. display: flex;
  240. align-items: center;
  241. padding: 20upx 10upx;
  242. font-size: 28upx;
  243. &:first-child{
  244. color: #666E75;
  245. font-size: 28upx;
  246. padding-bottom: 10upx;
  247. .orderNo{
  248. font-size: 34upx;
  249. color: #222222;
  250. width: 45%;
  251. }
  252. border-bottom: 2upx solid #f5f5f5;
  253. }
  254. > view{
  255. justify-content: space-between;
  256. &:first-child{
  257. flex-grow: 1;
  258. width: 65%;
  259. }
  260. .carModel{
  261. color: #222222;
  262. font-size: 32upx;
  263. font-weight: bold;
  264. line-height: normal;
  265. margin-bottom: 10rpx;
  266. }
  267. .carVin{
  268. color: #666E75;
  269. text{
  270. color: #033692;
  271. }
  272. }
  273. }
  274. .carImage{
  275. padding-right: 20rpx;
  276. }
  277. .action{
  278. padding: 0 30rpx;
  279. color: #fff;
  280. border-radius: 100rpx;
  281. font-size: 24upx;
  282. &:after{
  283. border: 0;
  284. }
  285. &:active{
  286. opacity: 0.5;
  287. }
  288. }
  289. .finish{
  290. background-color: #2d8cf0;
  291. }
  292. .del{
  293. color: #666;
  294. border:2rpx solid #EDEDED;
  295. background: none;
  296. }
  297. }
  298. }
  299. }
  300. }
  301. .search-popup{
  302. .search-title{
  303. text-align: center;
  304. padding: 20upx;
  305. color: #333;
  306. border-bottom: 1px solid #eee;
  307. }
  308. .uni-list{
  309. padding:10upx 20upx;
  310. margin: 0;
  311. border-bottom: 1px solid #EEEEEE;
  312. .uni-list-cell{
  313. border: 0;
  314. .uni-list-cell-db{
  315. flex: 1;
  316. width: 100%;
  317. }
  318. .uni-input{
  319. height: 2.5em;
  320. line-height: 2.5em;
  321. font-size: 28upx;
  322. display: flex;
  323. align-items: center;
  324. > view{
  325. &:first-child{
  326. flex-grow: 1;
  327. color: #666;
  328. }
  329. &:last-child{
  330. color: #999;
  331. }
  332. }
  333. }
  334. .item-icon{
  335. margin-left: 10upx;
  336. }
  337. }
  338. }
  339. .uni-list-btns{
  340. display: flex;
  341. padding: 50upx 20upx;
  342. uni-button{
  343. font-size: 28upx;
  344. margin: 0 30upx;
  345. flex:1;
  346. border-radius: 100upx;
  347. &:after{
  348. border: 0;
  349. }
  350. }
  351. }
  352. .checkbox-items{
  353. display: flex;
  354. flex-wrap: wrap;
  355. justify-content: space-between;
  356. .checkbox{
  357. width: 24%;
  358. background: #F8F8F8;
  359. text-align: center;
  360. margin: 20upx 0;
  361. padding: 10upx 0;
  362. border-radius: 50upx;
  363. font-size: 24upx;
  364. border:1upx solid #eee;
  365. }
  366. .checked{
  367. background: rgba(4, 133, 246, 0.15);
  368. border-color: rgba(4, 133, 246, 0.5);
  369. color: rgba(4, 133, 246, 1);
  370. }
  371. }
  372. }
  373. </style>