Commit ebdc95fc by LJM

取消理货

parent 9388f1ec
Showing with 45 additions and 3 deletions
......@@ -69,7 +69,7 @@
<text class="check-box-icon" :class="{ curr: filter_list.length == filter_id.length }"></text>
<text class="text">全选</text>
</view>
<view class="btn3 row rowCenter verCenter">取消理货</view>
<view class="btn3 row rowCenter verCenter" @click="cancelTallyReceive()">取消理货</view>
<view class="btn2 row rowCenter verCenter" style="width: calc(100% - 308rpx);">批量打印入库标签</view>
</view>
<!-- 理货详情弹窗 -->
......@@ -235,7 +235,7 @@ export default {
filterChange(index) {
this.$set(this.filter_list, index, (this.filter_list[index] = !this.filter_list[index]));
let filter_arr = this.findIndex(this.filter_list, true);
this.filter_id = filter_arr.map(i => this.list[i].stock_in_item_id);
this.filter_id = filter_arr.map(i => this.list[i].tally_id);
},
/**
* 全选
......@@ -245,7 +245,7 @@ export default {
this.filter_list = createArray(this.list.length, this.all_flag);
if (this.all_flag) {
this.filter_id = this.list.map(function(item) {
return item.stock_in_item_id;
return item.tally_id;
});
} else {
this.filter_id = [];
......@@ -309,6 +309,48 @@ export default {
});
}
});
},
/**
* 取消理货
*/
cancelTallyReceive() {
if (this.filter_id.length == 0) {
uni.showToast({
title: '请选择货品',
icon: 'error'
});
return false;
}
uni.showModal({
title: '提示',
content: '确定要取消理货吗?',
showCancel: true,
success: res => {
if (res.confirm) {
this.request(API.cancelTallyReceive, 'POST', { tally_id: this.filter_id.join(',') }, false).then(res => {
if (res.code === 0) {
uni.showToast({
title: '取消理货成功',
icon: 'success'
});
setTimeout(() => {
this.getData();
this.filter_id = [];
}, 2000);
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
} else if (res.cancel) {
// 用户点击取消操作
console.log('用户点击取消');
}
}
});
}
}
};
......
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 sign in to comment