Commit d9fed99d authored by Facius's avatar Facius

退件数量计算

parent 306ad32e
......@@ -47,7 +47,6 @@
return {
value: 0, // 选数
check: false, // 选中
oldCount: 0 // 旧选数
}
},
computed: {
......@@ -67,32 +66,24 @@
},
},
watch: {
showChecked(val) {
this.oldCount = 0
},
'item.quantity'(val) {
this.value = val
'item.quantity'(val) {
this.check = val > 0
this.value = val
},
'item.selected'(val) {
this.check = val
this.value = val ? this.item.stock : 0
this.value = val ? this.item.stock : 0
},
},
methods: {
handleChange(event) {
this.value = event.value ? this.item.stock : 0
this.oldCount = this.value
this.$emit('change', event.value)
this.$emit('change', event.value)
this.$emit('numChange', this.value)
},
numChange(event) {
if (event.value == 0 && this.oldCount > 0) {
this.check = false
this.$emit('change', this.check)
} else if (event.value > 0 && this.oldCount == 0) {
this.check = true
this.$emit('change', this.check)
}
this.oldCount = event.value
numChange(event) {
this.check = event.value > 0
this.$emit('change', this.check)
this.$emit('numChange', event.value)
},
}
......
......@@ -564,7 +564,7 @@
"path" : "returnParts",
"style" :
{
"navigationBarTitleText": "退返件",
"navigationBarTitleText": "退件",
"navigationStyle":"custom",
"enablePullDownRefresh": false
}
......
......@@ -307,7 +307,8 @@
.image-view {
width: 72rpx;
height: 72rpx;
height: 72rpx;
flex-shrink: 0;
}
.right-view {
......
......@@ -143,6 +143,7 @@
let list = res.data || []
for (var item of list) {
item.selected = false
item.stock = 12
this.partsList.push(item)
}
......@@ -176,7 +177,8 @@
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) {
......
<template>
<view class="parts-wrap">
<w-navbar title="退返件"></w-navbar>
<w-navbar title="退件"></w-navbar>
<view class="form">
<view class="row">
<view class="label">返件方式</view>
......
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