5.6重庆结束任务判断修改

This commit is contained in:
FrancisHu 2024-05-06 16:48:20 +08:00
parent c76df2aded
commit b9f7bd4c2e
2 changed files with 44 additions and 7 deletions

View File

@ -11,7 +11,7 @@
</view> </view>
<view> <view>
<span>待退料数量</span> <span>待退料数量</span>
<h4>{{ fetch.num }}</h4> <h4>{{ fetch.manageType == 2 ? fetch.partNum : fetch.num }}</h4>
</view> </view>
<text <text
v-show="fetch.manageType == 2" v-show="fetch.manageType == 2"
@ -181,12 +181,28 @@ export default {
this.transMaCode = list.code this.transMaCode = list.code
this.sendTypeId = list.typeId this.sendTypeId = list.typeId
this.parentId = list.id this.parentId = list.id
if (list.manageType == 2) {
if (Number(list.partNum) == 0) {
uni.showToast({
icon: 'none',
title: '待退料数据为0请勿再点击'
})
}
return
} else {
if (Number(list.num) == 0) {
uni.showToast({
icon: 'none',
title: '待退料数据为0请勿再点击'
})
}
return
}
if (Number(list.num) == 0) { if (Number(list.num) == 0) {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '待退料数据为0请勿再点击' title: '待退料数据为0请勿再点击'
}) })
return
} }
if (this.infoList.manageType == '0') { if (this.infoList.manageType == '0') {
this.$refs.popup1.open() this.$refs.popup1.open()
@ -400,9 +416,24 @@ export default {
}, },
reduceNumTotal() { reduceNumTotal() {
const that = this const that = this
let sum = that.fetchList.reduce((accumulator, currentValue) => { let sum = 0
return accumulator + Number(currentValue.num); console.log(that.fetchList);
}, 0); that.fetchList.forEach(item => {
if (item.manageType == 2) {
sum += item.partNum
} else {
sum += Number(item.num.split('.')[0])
}
})
/* if (that.fetchList.manageType == 2) {
sum = that.fetchList.reduce((accumulator, currentValue) => {
return accumulator + Number(currentValue.partNum);
}, 0);
} else {
sum = that.fetchList.reduce((accumulator, currentValue) => {
return accumulator + Number(currentValue.num);
}, 0);
} */
console.log("numaccumulator", sum) console.log("numaccumulator", sum)
return sum return sum
} }

File diff suppressed because one or more lines are too long