|
@@ -1,8 +1,7 @@
|
|
|
<template>
|
|
|
<view class="pagesCons">
|
|
|
<view class="utabs">
|
|
|
- <u-tabs-swiper ref="uTabs" :list="tabList" name="dispName" :current="current" @change="tabsChange" :is-scroll="false"
|
|
|
- swiperWidth="750"></u-tabs-swiper>
|
|
|
+ <u-tabs-swiper ref="uTabs" :list="tabList" name="dispName" :current="current" @change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
|
|
|
</view>
|
|
|
<swiper class="check-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
|
|
|
<swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
|
|
@@ -12,17 +11,16 @@
|
|
|
v-if="index==current"
|
|
|
v-for="(item,sindex) in list"
|
|
|
:key="item.id+'-'+sindex"
|
|
|
- @click="viewRow(item)"
|
|
|
- >
|
|
|
+ @click="viewRow(item)" >
|
|
|
<view class="check-row">
|
|
|
- <view>{{item.shelfName}}</view>
|
|
|
+ <view>{{item.shelfInfo&&item.shelfInfo.shelfName}}</view>
|
|
|
<view>
|
|
|
- <text :style="{color:$config('errorColor')}">待退库</text>
|
|
|
+ <text :style="{color: item.billState=='FINISH'?$config('successColor'):item.billState=='CANCEL'?$config('infoColor'):$config('errorColor')}">{{item.billStateDictValue}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="check-col">
|
|
|
<view>调货单号:{{item.recallBillNo}}</view>
|
|
|
- <view>调回数量:{{item.totalConfirmQty}}</view>
|
|
|
+ <view>调回数量:{{(item.totalConfirmQty || item.totalConfirmQty==0)?item.totalConfirmQty:'--'}}</view>
|
|
|
<view>{{item.createDate}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -46,28 +44,27 @@
|
|
|
status: 'loadmore',
|
|
|
noDataText: '暂无数据',
|
|
|
tabList: [
|
|
|
- {
|
|
|
+ {
|
|
|
dispName: '全部',
|
|
|
- typeId: 0,
|
|
|
- status: ''
|
|
|
- },
|
|
|
- {
|
|
|
- dispName: '待退库',
|
|
|
- typeId: 1,
|
|
|
- status: '',
|
|
|
- count: 12
|
|
|
- },
|
|
|
- {
|
|
|
- dispName: '已完成',
|
|
|
- typeId: 2,
|
|
|
- status: ''
|
|
|
- },
|
|
|
- {
|
|
|
- dispName: '已取消',
|
|
|
- typeId: 3,
|
|
|
- status: ''
|
|
|
- },
|
|
|
- ],
|
|
|
+ status: 'ALL',
|
|
|
+ count: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dispName: '待退库',
|
|
|
+ status: 'WAIT_CONFIRM',
|
|
|
+ count: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dispName: '已完成',
|
|
|
+ status: 'FINISH',
|
|
|
+ count: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ dispName: '已取消',
|
|
|
+ status: 'CANCEL',
|
|
|
+ count: 0
|
|
|
+ }
|
|
|
+ ],
|
|
|
current: 0,
|
|
|
swiperCurrent: 0,
|
|
|
pageNo: 1,
|
|
@@ -77,9 +74,21 @@
|
|
|
action:'swiperChange', // 操作类型,上划分页,或左右滑动
|
|
|
}
|
|
|
},
|
|
|
- onLoad() {
|
|
|
+ onLoad(options) {
|
|
|
+ const _this = this
|
|
|
+ if(options&&options.billState){ // 指定单据状态
|
|
|
+ this.tabList.map((item,index) => {
|
|
|
+ if(item.status == options.billState){
|
|
|
+ _this.swiperCurrent = index
|
|
|
+ _this.current = index
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ _this.swiperCurrent = 0
|
|
|
+ _this.current = 0
|
|
|
+ }
|
|
|
// 监听整改完成后刷新事件
|
|
|
- uni.$on('refreshBL',this.pageInit)
|
|
|
+ uni.$on('refreshBL', this.pageInit)
|
|
|
this.pageInit()
|
|
|
},
|
|
|
onUnload() {
|
|
@@ -87,14 +96,16 @@
|
|
|
},
|
|
|
methods:{
|
|
|
pageInit(){
|
|
|
- queryStateCount({billState:'待退货'}).then(res =>{
|
|
|
- this.tabList[1].count = res.data.totalConfirmQty
|
|
|
+ queryStateCount({}).then(res =>{
|
|
|
+ this.tabList[1].count = res.data.WAIT_CONFIRM || 0
|
|
|
+ this.tabList[2].count = res.data.FINISH || 0
|
|
|
+ this.tabList[3].count = res.data.CANCEL || 0
|
|
|
this.getRow(1)
|
|
|
})
|
|
|
},
|
|
|
// tabs通知swiper切换
|
|
|
tabsChange(index) {
|
|
|
- this.swiperCurrent = index;
|
|
|
+ this.swiperCurrent = index
|
|
|
},
|
|
|
swiperChange(event){
|
|
|
this.action = 'swiperChange'
|
|
@@ -102,21 +113,21 @@
|
|
|
},
|
|
|
// swiper-item左右移动,通知tabs的滑块跟随移动
|
|
|
transition(e) {
|
|
|
- let dx = e.detail.dx;
|
|
|
- this.$refs.uTabs.setDx(dx);
|
|
|
+ let dx = e.detail.dx
|
|
|
+ this.$refs.uTabs.setDx(dx)
|
|
|
},
|
|
|
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
|
|
|
// swiper滑动结束,分别设置tabs和swiper的状态
|
|
|
animationfinish(e) {
|
|
|
- let current = e.detail.current;
|
|
|
+ let current = e.detail.current
|
|
|
let isCurtab = this.current == current
|
|
|
if(this.status!="nomore"){
|
|
|
- let loadData = this.action == 'swiperChange' ? !isCurtab : isCurtab;
|
|
|
+ let loadData = this.action == 'swiperChange' ? !isCurtab : isCurtab
|
|
|
if(loadData){
|
|
|
- this.$refs.uTabs.setFinishCurrent(current);
|
|
|
- this.swiperCurrent = current;
|
|
|
- this.current = current;
|
|
|
- this.resetPage();
|
|
|
+ this.$refs.uTabs.setFinishCurrent(current)
|
|
|
+ this.swiperCurrent = current
|
|
|
+ this.current = current
|
|
|
+ this.resetPage()
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -137,7 +148,7 @@
|
|
|
let params = {
|
|
|
pageNo: this.pageNo,
|
|
|
pageSize: this.pageSize,
|
|
|
- billState: this.tabList[this.current].status,
|
|
|
+ billState: this.tabList[this.current].status=='ALL'?'':this.tabList[this.current].status
|
|
|
}
|
|
|
this.status = "loading"
|
|
|
shelfRecallList(params).then(res => {
|
|
@@ -165,30 +176,18 @@
|
|
|
}
|
|
|
// 左右切换tab
|
|
|
if(this.action == 'swiperChange'){
|
|
|
- this.list = [];
|
|
|
- this.getRow(1);
|
|
|
+ this.list = []
|
|
|
+ this.getRow(1)
|
|
|
}
|
|
|
},
|
|
|
- // 待退库
|
|
|
+ // 详细页
|
|
|
viewRow(item){
|
|
|
- // 已完成的
|
|
|
- uni.navigateTo({
|
|
|
- url: "/pages/shuntBackManage/cancellingStocks?recallBillSn="+item.recallBillSn
|
|
|
- })
|
|
|
- },
|
|
|
- // 状态颜色处理
|
|
|
- clsStatus(status){
|
|
|
- if(status == 'CHECK_PENDING'){
|
|
|
- return 'dsh'
|
|
|
- }
|
|
|
- if(status == 'PENDING'){
|
|
|
- return 'dzg'
|
|
|
- }
|
|
|
- if(status == 'FINISHED'){
|
|
|
- return 'ywc'
|
|
|
- }
|
|
|
- if(status == 'EXPIRED'){
|
|
|
- return 'ygq'
|
|
|
+ if(item.billState=='WAIT_CONFIRM'){ // 待退库
|
|
|
+ uni.navigateTo({ url: "/pages/shuntBackManage/cancellingStocks?sn="+item.recallBillSn })
|
|
|
+ }else if(item.billState=='FINISH'){ // 已完成
|
|
|
+ // uni.navigateTo({ url: "/pages/replenishmentManage/detail?sn="+item.replenishBillSn+"&type=success" })
|
|
|
+ }else if(item.billState=='CANCEL'){ // 已取消
|
|
|
+ // uni.navigateTo({ url: "/pages/replenishmentManage/detail?sn="+item.replenishBillSn+"&type=cancel" })
|
|
|
}
|
|
|
}
|
|
|
}
|