Browse Source

采购收货申请增加移除功能

hella_online_20240829
niexiting 4 months ago
parent
commit
19ad1242fa
  1. 40
      src/mycomponents/package/packageList.vue
  2. 56
      src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue

40
src/mycomponents/package/packageList.vue

@ -4,14 +4,23 @@
<uni-collapse ref="collapse2" @change="collapseChange">
<uni-collapse-item :disabled="false">
<template v-slot:title>
<uni-swipe-action>
<uni-swipe-action-item
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options"
@click="swipeClick($event,item,'parent')">
<package-card :dataContent="item" :isShowLocation="false"
:isShowFromLocation="isShowFromLocation" :isShowStatus="isShowStatus"></package-card>
:isShowFromLocation="isShowFromLocation"
:isShowStatus="isShowStatus"></package-card>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<view v-for="(pack,index) in item.packList" :key="pack.id"
style=" width: 100%; background-color: antiquewhite;">
<uni-swipe-action>
<uni-swipe-action-item :right-options="(pack.scaned&&isEdit)?editAndRemoveOptions : pack.scaned? removeOptions:options"
@click="swipeClick($event,pack)">
<uni-swipe-action-item
:right-options="(pack.scaned&&isEdit)?editAndRemoveOptions : pack.scaned? removeOptions:options"
@click="swipeClick($event,pack,'child')">
<package-card :dataContent="pack" :isShowLocation="false" :isShowFromLocation="false"
:isShowToLocation="false" :isShowBatch="false"></package-card>
</uni-swipe-action-item>
@ -104,13 +113,36 @@
},
methods: {
swipeClick(e, item) {
swipeClick(e, item, type) {
if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
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 => {

56
src/pages/purchaseReceipt/coms/comReceiptDetailCard.vue

@ -3,10 +3,17 @@
<uni-collapse ref="collapse">
<uni-collapse-item :open="true">
<template v-slot:title>
<uni-swipe-action>
<uni-swipe-action-item :right-options="dataContent.handleQty>0? removeOptions:options"
@click="swipeClick($event,dataContent)">
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowPackUnit="false"></itemCompareQty>
</uni-swipe-action-item>
</uni-swipe-action>
</template>
<package-list :dataContent="dataContent.subList" :isEdit="settingParam.allowModifyQty=='TRUE'" :settingParam="settingParam" @collapseChange="collapseChange" @updateData="updateData" :isShowFromLocation="false"></package-list>
<package-list :dataContent="dataContent.subList" :isEdit="settingParam.allowModifyQty=='TRUE'"
:settingParam="settingParam" @collapseChange="collapseChange" @updateData="updateData"
:isShowFromLocation="false"></package-list>
</uni-collapse-item>
</uni-collapse>
@ -32,7 +39,8 @@
import {
getDetailOption,
getPurchaseReceiptOption
getPurchaseReceiptOption,
getRemoveOption
} from '@/common/array.js';
export default {
@ -77,7 +85,9 @@
},
locatonItem: {},
detailOptions: [],
scanOptions: []
scanOptions: [],
options: [],
removeOptions: [],
}
},
@ -90,7 +100,9 @@
.allowModifyLocation)
}
if (this.removeOptions.length == 0) {
this.removeOptions = getRemoveOption();
}
},
updated() {
@ -98,7 +110,7 @@
},
methods: {
collapseChange(){
collapseChange() {
setTimeout(() => {
this.resizeCollapse();
}, 500)
@ -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')
}
}

Loading…
Cancel
Save