Commit d9fed99d authored by Facius's avatar Facius

退件数量计算

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