Commit 63902080 authored by Facius's avatar Facius

第三轮bug修复

parent 5d58647f
......@@ -72,7 +72,12 @@
},
noPartsImage() {
return process.uniEnv.qn_base_url + 'no_parts.png'
},
},
selectedParts() {
return this.lists.filter((item) => {
return item.quantity > 0
})
}
},
mounted() {
this.getWorkOrderParts()
......@@ -84,7 +89,7 @@
},
partsChange(val, index) {
this.$set(this.lists[index], 'quantity', val)
this.valueChange(JSON.stringify(this.lists))
this.valueChange(JSON.stringify(this.selectedParts))
},
valChange(val) {
val.forEach(v => {
......@@ -95,7 +100,7 @@
this.$set(this.lists, index, v)
}
})
this.valueChange(JSON.stringify(this.lists))
this.valueChange(JSON.stringify(this.selectedParts))
},
toParts() {
uni.navigateTo({
......
......@@ -13,7 +13,7 @@
<u-tabs height="66" activeColor="#2272FF" bg-color="none" inactive-color="#999" bar-height="4"
bar-width="44" :offset="[0,0]" :list="list" count="total" :current="currentIndex" @change="change"
:is-scroll="false" font-size="28" bold></u-tabs>
</view>
</view>
<view class="tab-view">
<scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="reachBottom" scroll-anchoring
refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" @scroll="scroll"
......@@ -22,7 +22,7 @@
<view class="loading-view" v-if="!loaded">
<u-loading mode="flower"></u-loading>
</view>
<NoOrder v-else-if="noParts" imageName="wupeijianxinxi.png" text="当前暂无配件信息"
<NoOrder v-else-if="noParts" imageName="wupeijianxinxi.png" text="当前暂无备件信息"
:customStyle="noPartsCustomStyle" />
<template v-else>
<view v-for="(item, index) in partsList" :key="item.id">
......@@ -33,7 +33,7 @@
bgColor="#F4F5F7"></u-loadmore>
</view>
</template>
</scroll-view>
</scroll-view>
</view>
<view class="fixed-button">
<ApplyButton :type.sync="buttonType" @click="handleClickApply" />
......@@ -123,21 +123,21 @@
},
},
onLoad(e) {
getApp().trackPage('备件订单页')
if (e && e.index) {
this.currentIndex = e.index
}
getApp().trackPage('备件订单页')
if (e && e.index) {
this.currentIndex = e.index
}
this._freshing = false;
this.reloadPartsList()
},
onShow() {
let pages = getCurrentPages()
let page = pages[pages.length - 1]
if (page.needApplyList) {
page.needApplyList = null
this.currentIndex = 0
this.reloadPartsList()
}
},
onShow() {
let pages = getCurrentPages()
let page = pages[pages.length - 1]
if (page.needRefresh) {
page.needRefresh = null
this.currentIndex = 0
this.reloadPartsList()
}
},
methods: {
// tab栏切换
......@@ -149,9 +149,9 @@
// 页面数据:未入库
getUnstockedList(status) {
// 状态处理
this.pageNumber += 1
if (this.pageNumber == 1) {
this.loaded = false
this.pageNumber += 1
if (this.pageNumber == 1) {
this.loaded = false
}
var param = {
'pageSize': this.pageSize,
......@@ -161,21 +161,21 @@
param.status = status //不传值 全部;待签收 15;待发货 10;待审核 1;已取消 -1;已驳回 -2;已签收 20
}
this.$u.api.applyList(param).then((res) => {
if (res.code == 200) {
if (res.code == 200) {
if (this.pageNumber == 1) {
this.partsList = []
}
}
let list = res.data || []
this.partsList.push(...list)
this.loadStatus = list.length < this.pageSize ? 'nomore' : 'loadmore'
this.loadStatus = list.length < this.pageSize ? 'nomore' : 'loadmore'
} else {
console.log(res.message)
}
this.$nextTick(()=>{
if (this._freshing) {
this.triggered = false;
this._freshing = false;
}
}
this.$nextTick(()=>{
if (this._freshing) {
this.triggered = false;
this._freshing = false;
}
})
this.loaded = true
});
......@@ -202,23 +202,23 @@
},
handleClickCell(info) {
this.setPageInfo(info)
this.setPageInfo(info)
uni.navigateTo({
url: 'pages/mine/warehouse/partsDetail'
})
},
handleClickExpress(info) {
this.setPageInfo(info)
uni.navigateTo({
url: 'pages/mine/warehouse/express'
})
},
setPageInfo(info) {
var pages = getCurrentPages();
if (pages.length >= 1) {
var page = pages[pages.length - 1];
page.info = info
}
},
handleClickExpress(info) {
this.setPageInfo(info)
uni.navigateTo({
url: 'pages/mine/warehouse/express'
})
},
setPageInfo(info) {
var pages = getCurrentPages();
if (pages.length >= 1) {
var page = pages[pages.length - 1];
page.info = info
}
},
handleClickApply() {
uni.navigateTo({
......@@ -234,9 +234,9 @@
radioChange(e) {
this.selectedAll = !this.selectedAll
},
onRefresh() {
onRefresh() {
if (this._freshing) return;
this._freshing = true;
this._freshing = true;
this.reloadPartsList()
},
onRestore() {
......@@ -247,9 +247,9 @@
this.loadStatus = 'loading'
this.getUnstockedList(this.currentTab.status)
},
reachBottom(e) {
reachBottom(e) {
if (this.loadStatus != 'loadmore') return
this.loadStatus == 'loading'
this.loadStatus == 'loading'
this.getUnstockedList(this.currentTab.status)
},
scroll() {
......@@ -311,4 +311,4 @@
}
}
</style>
</style>
......@@ -221,7 +221,7 @@
var pages = getCurrentPages();
if (pages.length >= 2) {
var page = pages[pages.length - 2];
page.needApplyList = true
page.needRefresh = true
uni.navigateBack()
}
}
......
......@@ -76,8 +76,8 @@
onShow() {
let pages = getCurrentPages()
let page = pages[pages.length - 1]
if (page.needApplyList) {
page.needApplyList = null
if (page.needRefresh) {
page.needRefresh = null
this.getPartsList()
}
},
......
......@@ -41,9 +41,9 @@
submitTxt="退件" :allChecked="subBarInfo.allChecked" :customStyle="customStyle" @select="allSelect"
@submit="$u.throttle(handleSubmit, 500)" />
</view>
</template>
<view class="fixed-button" v-show="!showBounce">
<ApplyButton :type.sync="buttonType" @click="handleClickApply"/>
</template>
<view class="fixed-button" v-show="!showBounce">
<ApplyButton :type.sync="buttonType" @click="handleClickApply"/>
</view>
</view>
</template>
......@@ -60,7 +60,7 @@
// AppliedCell,
NoOrder,
SubmitBar,
SpareCell,
SpareCell,
ApplyButton
},
data() {
......@@ -70,7 +70,7 @@
showBounce: false,
keyword: '',
searchedKeyword: '',
selectedParts: [],
selectedParts: [],
buttonType: 'expand' // 申请按钮宽 collapse': '80rpx', 'expand': '220rpx''
};
},
......@@ -127,7 +127,16 @@
getApp().trackPage('备件库页')
this.getReserveList()
},
onShow() {},
onShow() {
let pages = getCurrentPages();
let page = pages[pages.length - 1];
let needRefresh = page.needRefresh;
if (needRefresh) {
page.needRefresh = false
this.showBounce = false
this.getReserveList()
}
},
methods: {
getReserveList() { // 备件列表
this.loaded = false
......@@ -142,7 +151,7 @@
this.partsList = []
let list = res.data || []
for (var item of list) {
item.selected = false
item.selected = false
this.partsList.push(item)
}
......@@ -169,22 +178,22 @@
handleClickBounce() {
this.showBounce = false
for (var item of this.partsList) {
item.selected = false
item.selected = false
item.quantity = 0
}
},
allSelect(value) {
console.log(value)
for (var item of this.partsList) {
item.selected = value
item.selected = value
item.quantity = value ? item.stock : 0
}
},
handleChange(value, index) {
this.partsList[index].selected = value
},
handleNumChange(value, index) {
this.partsList[index].quantity = value
},
handleNumChange(value, index) {
this.partsList[index].quantity = value
},
handleSubmit() {
const getSelected = (element) => {
......@@ -195,14 +204,14 @@
this.$u.route({
url: 'pages/parts/returnParts',
})
},
handleClickApply() {
uni.navigateTo({
url: 'pages/parts/application?applyType=1'
})
},
scroll() {
this.buttonType = 'collapse'
},
handleClickApply() {
uni.navigateTo({
url: 'pages/parts/application?applyType=1'
})
},
scroll() {
this.buttonType = 'collapse'
},
}
};
......@@ -216,16 +225,16 @@
flex-direction: column;
.search-view {
margin-bottom: 30rpx;
margin-top: 10rpx;
/deep/ .u-search .u-content {
padding-left: 40rpx;
}
/deep/ .u-search .u-input {
margin: 0 20rpx;
}
/deep/ .u-search .u-icon--right .u-iconfont {
font-size: 36rpx !important;
margin-bottom: 30rpx;
margin-top: 10rpx;
/deep/ .u-search .u-content {
padding-left: 40rpx;
}
/deep/ .u-search .u-input {
margin: 0 20rpx;
}
/deep/ .u-search .u-icon--right .u-iconfont {
font-size: 36rpx !important;
}
}
......@@ -277,11 +286,11 @@
position: absolute;
}
}
.fixed-button {
position: fixed;
right: 20rpx;
bottom: 64rpx;
}
.fixed-button {
position: fixed;
right: 20rpx;
bottom: 64rpx;
}
}
</style>
</style>
......@@ -352,8 +352,8 @@
this.loadOrderDetail()
this.loadOrderRecord()
}
if (page.needApplyList) {
page.needApplyList = null
if (page.needRefresh) {
page.needRefresh = null
this.getApplyList()
}
},
......
......@@ -76,36 +76,19 @@
return process.uniEnv.qn_base_url + src
},
goBack() {
if(this.isParts){
var pages = getCurrentPages();
if(pages.length >= 2) {
var prevPage = pages[pages.length - 2];
prevPage.needApplyList = true
}
var pages = getCurrentPages();
if(pages.length >= 2) {
var prevPage = pages[pages.length - 2];
prevPage.needRefresh = true
}
if(this.isParts){ // 添加备件
this.$u.route({type:'back'})
}
if(this.isReturn){
// uni.switchTab({
// url: '/pages/index/mine',
// complete: () => {
// this.$nextTick(()=>{
// uni.navigateTo({
// url: 'pages/mine/warehouse/return'
// });
// })
// }
// });
if(this.isReturn){ // 退件
uni.redirectTo({
url: 'pages/mine/warehouse/return'
});
// var pages = getCurrentPages();
// if(pages.length >= 4) {
// var prevPage = pages[pages.length - 4];
// this.$u.route({type:'back', delta: 3})
// prevPage.$vm.$u.route({url: 'pages/mine/warehouse/return'})
// } else {
// this.$u.route({type:'back'})
// }
}
},
copyText(e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment