diff --git a/src/mycomponents/package/packageList.vue b/src/mycomponents/package/packageList.vue index 30cad4ee..fa822d9e 100644 --- a/src/mycomponents/package/packageList.vue +++ b/src/mycomponents/package/packageList.vue @@ -4,14 +4,23 @@ - + @@ -104,13 +113,36 @@ }, methods: { - swipeClick(e, item) { + swipeClick(e, item, type) { if (e.content.text == "编辑") { this.edit(item) } else if (e.content.text == "移除") { - this.remove(item) + if (type == 'parent') { + this.removeParent(item); + } else { + this.remove(item) + } } }, + removeParent(item) { + this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?", + res => { + if (res) { + item.scaned = false + item.handleQty = null; + item.packList.forEach(subItem => { + subItem.scaned = false + subItem.handleQty = null; + }) + + this.$emit('updateData') + this.$forceUpdate() + } + }); + }, + + + remove(item) { this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?", res => { diff --git a/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue b/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue index 7906aa22..6f69f982 100644 --- a/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue +++ b/src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue @@ -3,10 +3,17 @@ - + @@ -32,11 +39,12 @@ import { getDetailOption, - getPurchaseReceiptOption + getPurchaseReceiptOption, + getRemoveOption } from '@/common/array.js'; export default { - + components: { itemCompareQty, recommend, @@ -77,7 +85,9 @@ }, locatonItem: {}, detailOptions: [], - scanOptions: [] + scanOptions: [], + options: [], + removeOptions: [], } }, @@ -89,21 +99,23 @@ this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam .allowModifyLocation) } - + if (this.removeOptions.length == 0) { + this.removeOptions = getRemoveOption(); + } }, updated() { console.log('updated') }, - methods: { - collapseChange(){ + methods: { + collapseChange() { setTimeout(() => { this.resizeCollapse(); }, 500) }, - + resizeCollapse() { this.$nextTick(r => { this.$refs.collapse.resize() @@ -132,7 +144,7 @@ } else if (e.content.text == "库位") { this.showLocation(item) } else if (e.content.text == "移除") { - this.remove(item) + this.removeScan(item) } }, edit(item) { @@ -153,22 +165,42 @@ this.showItem = item; this.$refs.jobDetailPopup.openPopup(item) }, - remove(item) { - this.$refs.message.showQuestionMessage("确定移除扫描信息?", + + removeScan(item) { + this.$refs.message.showQuestionMessage("确定移除物料的所有扫描信息?", res => { if (res) { - item.scaned = false item.handleQty = null - this.$forceUpdate() - this.$emit('remove', item) + item.subList.forEach(lst => { + lst.scaned = false; + lst.handleQty = null; + lst.packList.forEach(pack => { + pack.scaned = false; + pack.handleQty = null; + }) + }) + // this.$forceUpdate() + // this.$emit('remove', item) } }); }, + + // remove(item) { + // this.$refs.message.showQuestionMessage("确定移除扫描信息?", + // res => { + // if (res) { + // item.scaned = false + // item.handleQty = null + // this.$forceUpdate() + // this.$emit('remove', item) + // } + // }); + // }, confirm(qty) { this.editItem.handleQty = qty; this.$emit('updateData') }, - updateData(){ + updateData() { this.$emit('updateData') } }