Compare commits

...

2 Commits

Author SHA1 Message Date
xiaofajia
78bb5006ab 解决冲突 2024-11-15 16:36:00 +08:00
xiaofajia
7396441361 修改仓库通知领料和退料 2024-11-15 16:25:44 +08:00
2 changed files with 125 additions and 63 deletions

View File

@ -69,15 +69,15 @@
</view>
<view class="order-footer">
<template v-if="!queryParams.isBack && isShow">
<template v-if="!queryParams.isBack && typeof queryParams.isBack === 'boolean'">
<view @click="inOutWareHouse(item,true)" class="order-btn yes">通知领料</view>
<!-- <view class="order-btn yes">采购</view>-->
</template>
<template v-else-if="!queryParams.isBack && !isShow">
<template v-else-if="!queryParams.isBack && typeof queryParams.isBack === 'undefined'">
<view @click="inOutWareHouse(item,true)" class="order-btn yes">查看申请</view>
<!-- <view class="order-btn yes">采购</view>-->
</template>
<template v-else-if="queryParams.isBack && isShow">
<template v-else-if="queryParams.isBack">
<view @click="inOutWareHouse(item,false)" class="order-btn yes">通知退料</view>
</template>
</view>
@ -160,6 +160,8 @@ export default {
noReadNum: 0,
//
noticeNum: 0,
//
ifFirstLogin: true,
}
},
onLoad() {
@ -203,19 +205,33 @@ export default {
*/
activeTab(index) {
this.active = index
if (index == 1) {
if (index === 0) {
this.queryParams.isBack = false
this.queryParams.isToBeReviewed = undefined
this.isShow = true
} else if (index === 1) {
this.queryParams.isBack = true
this.queryParams.isToBeReviewed = undefined
this.isShow = true
} else if (index == 2) {
} else if (index === 2) {
this.isShow = false
this.queryParams.isToBeReviewed = true
this.queryParams.isBack = undefined
} else {
this.isShow = true
this.queryParams.isBack = undefined
this.queryParams.isToBeReviewed = undefined
}
// this.active = index
// if (index == 1) {
// this.queryParams.isBack = false
// this.queryParams.isToBeReviewed = undefined
// this.isShow = true
// } else if (index == 2) {
// this.isShow = true
// this.queryParams.isToBeReviewed = true
// this.queryParams.isBack = undefined
// } else {
// this.isShow = true
// this.queryParams.isBack = undefined
// this.queryParams.isToBeReviewed = undefined
// }
this.onRefresherrefresh()
},
@ -377,6 +393,11 @@ export default {
if (res.code == 200) {
this.noReadNum = res.data > 99 ? 99 : res.data
}
if (this.ifFirstLogin && this.noReadNum > 0) {
console.log("播放")
this.$refs.tarBar.dianyidain()
this.ifFirstLogin = false
}
})
},
/**

View File

@ -94,10 +94,12 @@ export default {
method: 'get',
params: params
}).then((res) => {
res.data.map((item)=>{
if(!item.waresAlreadyCount){
item.waresAlreadyCount = 0
this.wares = res.data
if (this.isToBeReviewed){
this.wares = this.wares.filter(item => item.waresStatus === '1')
this.wares = this.wares.filter(item => this.isReceive ? (item.waresCount > item.waresAlreadyCount) : (item.waresAlreadyCount > 0))
}
this.wares.forEach(item => {
if (!item.wares.stock){
item.wares.stock = 0
}
@ -114,7 +116,27 @@ export default {
item.thisNum = 0
}
})
this.wares = res.data;
// res.data.map((item)=>{
// if(!item.waresAlreadyCount){
// item.waresAlreadyCount = 0
// }
// if(!item.wares.stock){
// item.wares.stock=0
// }
// if(this.isReceive){
// //-
// item.maxNum = parseInt(item.waresCount) - parseInt(item.waresAlreadyCount)
// if(item.maxNum >item.wares.stock){
// item.maxNum = item.wares.stock
// }
// item.thisNum = item.maxNum
// }else{
// //退0,0
// item.maxNum = item.waresAlreadyCount
// item.thisNum = 0
// }
// })
// this.wares = res.data;
})
},
/**
@ -129,13 +151,16 @@ export default {
return
}
this.$set(repair, 'thisNum', repair.thisNum + 1)
const find = this.wares.find(f => f.id == repair.id)
if (find) {
find.thisNum = repair.thisNum
} else {
this.wares.push(JSON.parse(JSON.stringify(repair)))
const findIndex = this.wares.findIndex(f => f.id === repair.id);
if (findIndex !== -1) {
this.$set(this.wares, findIndex, repair);
}
console.log('repair', repair)
// const find = this.wares.find(f => f.id == repair.id)
// if (find) {
// find.thisNum = repair.thisNum
// } else {
// this.wares.push(JSON.parse(JSON.stringify(repair)))
// }
},
/**
*
@ -146,12 +171,16 @@ export default {
return
}
this.$set(repair, 'thisNum', repair.thisNum - 1)
const find = this.wares.find(f => f.id == repair.id)
if (find) {
find.thisNum = repair.thisNum
} else {
this.wares.push(JSON.parse(JSON.stringify(repair)))
const findIndex = this.wares.findIndex(f => f.id === repair.id);
if (findIndex !== -1) {
this.$set(this.wares, findIndex, repair);
}
// const find = this.wares.find(f => f.id == repair.id)
// if (find) {
// find.thisNum = repair.thisNum
// } else {
// this.wares.push(JSON.parse(JSON.stringify(repair)))
// }
},
/**
* 出库
@ -164,6 +193,16 @@ export default {
userName: this.formData.repairName,
soStatus: this.isReceive ? '04' : '07'
}
// thisNum0
const flag = this.wares.filter(item => item.thisNum > 0)
if (!flag || flag.length === 0){
uni.showToast({
title: '请设置配件数量!',
icon: 'none'
})
return
}
this.wares = flag
this.formData.repairSois = [...this.wares.map(item => {
return {
soiType: this.isReceive ? '02' : "04",
@ -283,9 +322,11 @@ export default {
.listItem {
padding: 30rpx 0;
border-bottom: 2rpx solid #DDDDDD;
&:last-child {
border-bottom: none;
}
.repairName {
font-size: 32rpx;
color: #333333;