7 changed files with 1057 additions and 3 deletions
@ -0,0 +1,226 @@ |
|||||
|
<template> |
||||
|
<view style="background-color: #fff;"> |
||||
|
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false"> |
||||
|
</item-compare-qty> |
||||
|
<view class="" v-for="(item,index) in dataContent.subList" :key="index" :class="item.scaned?'scan_view':''"> |
||||
|
<uni-swipe-action ref="swipeAction" v-if='index==0'> |
||||
|
|
||||
|
<uni-swipe-action-item |
||||
|
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" |
||||
|
@click="swipeClick($event,item,'parent')" style='padding:0px 0px 5px 0px;align-items: center;'> |
||||
|
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false" isShowPack='false'> |
||||
|
</recommend> --> |
||||
|
|
||||
|
<div style="display: flex;"> |
||||
|
<div style="flex: 1;"> |
||||
|
<batch v-if="item.batch" :batch="item.batch"></batch> |
||||
|
<location title="来源库位" v-if="item.fromLocationCode" :locationCode="item.fromLocationCode"></location> |
||||
|
</div> |
||||
|
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text> |
||||
|
</div> |
||||
|
|
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
</view> |
||||
|
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" |
||||
|
@confirm="confirm"></balance-qty-edit> |
||||
|
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' |
||||
|
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> |
||||
|
<comMessage ref="message"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import config from '@/static/config.js' |
||||
|
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
||||
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import toLocation from '@/mycomponents/balance/toLocation.vue' |
||||
|
import batch from '@/mycomponents/balance/batch.vue' |
||||
|
|
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getPurchaseReceiptOption, |
||||
|
getRemoveOption, |
||||
|
getEditRemoveOption |
||||
|
} from '@/common/array.js'; |
||||
|
|
||||
|
export default { |
||||
|
emits: ['openDetail', "updateData"], |
||||
|
components: { |
||||
|
itemCompareQty, |
||||
|
recommend, |
||||
|
balanceQtyEdit, |
||||
|
winScanLocation, |
||||
|
location, |
||||
|
toLocation, |
||||
|
batch, |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
isShowPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowBatch: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
locationAreaTypeList: { |
||||
|
type: Array, |
||||
|
default: null |
||||
|
}, |
||||
|
queryBalance: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isEdit: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
dataContent: { |
||||
|
handler(newName, oldName) { |
||||
|
if (this.dataContent.subList.length > 0) { |
||||
|
this.$nextTick(res => { |
||||
|
setTimeout(() => { |
||||
|
if (this.$refs.collapse1) { |
||||
|
this.$refs.collapse1.resize(); |
||||
|
} |
||||
|
}, 500) |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
immediate: true, |
||||
|
deep: true |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
option: [], |
||||
|
showItem: {}, |
||||
|
locatonItem: {}, |
||||
|
editItem: {}, |
||||
|
detailOptions: [], |
||||
|
scanOptions: [], |
||||
|
options: [], |
||||
|
removeOptions: [], |
||||
|
editAndRemoveOptions: [] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
if (this.detailOptions.length == 0) { |
||||
|
this.detailOptions = getDetailOption(); |
||||
|
} |
||||
|
if (this.scanOptions.length == 0) { |
||||
|
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false) |
||||
|
} |
||||
|
this.removeOptions = getRemoveOption(); |
||||
|
this.editAndRemoveOptions = getEditRemoveOption() |
||||
|
// this.showLocation(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
swipeClick(e, item) { |
||||
|
if (e.content.text == "详情") { |
||||
|
this.detail(item) |
||||
|
} else if (e.content.text == "编辑") { |
||||
|
this.edit(item) |
||||
|
} else if (e.content.text == "库位") { |
||||
|
this.showLocation(item) |
||||
|
} else if (e.content.text == "移除") { |
||||
|
this.remove(item) |
||||
|
} |
||||
|
}, |
||||
|
edit(item) { |
||||
|
this.editItem = item; |
||||
|
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty); |
||||
|
}, |
||||
|
|
||||
|
detail(item) { |
||||
|
this.$emit('openDetail', item); |
||||
|
// this.showItem = item; |
||||
|
// this.$refs.jobDetailPopup.openPopup(item) |
||||
|
}, |
||||
|
remove(item) { |
||||
|
this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
item.scaned = false |
||||
|
item.balance = {} |
||||
|
item.handleQty = null; |
||||
|
this.$forceUpdate() |
||||
|
this.$emit('remove', item) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
confirm(qty) { |
||||
|
this.editItem.handleQty = qty; |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
showLocation(item) { |
||||
|
this.locatonItem = item; |
||||
|
this.$refs.scanLocationCode.openScanPopup(); |
||||
|
}, |
||||
|
//扫描源库位 |
||||
|
getLocation(location, code) { |
||||
|
this.locatonItem.toLocationCode = code; |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
isDevlement() { |
||||
|
return config.isDevelopment; |
||||
|
}, |
||||
|
copy(detail) { |
||||
|
console.log(detail) |
||||
|
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
||||
|
var content = "HPQ;V1.0;I" + detail.itemCode + ";P" + detail.packingNumber + ";B" + detail |
||||
|
.batch + ";Q" + detail.qty |
||||
|
// #ifdef H5 |
||||
|
this.$copyText(content).then( |
||||
|
res => { |
||||
|
uni.showToast({ |
||||
|
title: '复制采购标签成功', |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
} |
||||
|
) |
||||
|
// #endif |
||||
|
// #ifndef H5 |
||||
|
uni.setClipboardData({ |
||||
|
data: content, |
||||
|
success: () => { |
||||
|
uni.showToast({ |
||||
|
title: '复制采购标签成功' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
// #endif |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,184 @@ |
|||||
|
<!-- 采购上架任务详情按批次显示详情的组件 --> |
||||
|
<template> |
||||
|
<view class="" style="background-color: #fff;"> |
||||
|
<uni-swipe-action> |
||||
|
<uni-swipe-action-item |
||||
|
:right-options="(dataContent.scaned&&isEdit)?editAndRemoveOptions : dataContent.scaned? removeOptions:options" |
||||
|
@click="swipeClick($event,dataContent,'parent')"> |
||||
|
<itemCompareQty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowPackUnit="true"> |
||||
|
</itemCompareQty> |
||||
|
<batch v-if="dataContent.subList[0].batch" :batch="dataContent.subList[0].batch"></batch> |
||||
|
<location title="来源库位" v-if="dataContent.subList[0].fromLocationCode" |
||||
|
:locationCode="dataContent.subList[0].fromLocationCode"> |
||||
|
</location> |
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
|
||||
|
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> |
||||
|
</recommend-qty-edit> |
||||
|
<comMessage ref="message"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' |
||||
|
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue' |
||||
|
import receiptDetailInfoPopup from '@/pages/purchaseReceipt/coms/receiptDetailInfoPopup.vue' |
||||
|
import pack from '@/mycomponents/balance/pack.vue' |
||||
|
import detailList from '@/mycomponents/detail/detailList.vue' |
||||
|
import packageList from '@/mycomponents/package/packageList.vue' |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import toLocation from '@/mycomponents/balance/toLocation.vue' |
||||
|
import batch from '@/mycomponents/balance/batch.vue' |
||||
|
import { |
||||
|
getRemoveOption, |
||||
|
getEditRemoveOption |
||||
|
} from '@/common/array.js'; |
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getPurchaseReceiptOption |
||||
|
} from '@/common/array.js'; |
||||
|
|
||||
|
export default { |
||||
|
emits: ["updateData"], |
||||
|
components: { |
||||
|
itemCompareQty, |
||||
|
recommend, |
||||
|
recommendQtyEdit, |
||||
|
jobDetailPopup, |
||||
|
receiptDetailInfoPopup, |
||||
|
detailList, |
||||
|
packageList, |
||||
|
location, |
||||
|
toLocation, |
||||
|
batch, |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
locationAreaTypeList: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowPackListStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isEdit: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
} |
||||
|
}, |
||||
|
watch: { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
showItem: {}, |
||||
|
editItem: { |
||||
|
record: { |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
locatonItem: {}, |
||||
|
detailOptions: [], |
||||
|
scanOptions: [], |
||||
|
options: [], |
||||
|
removeOptions: [], |
||||
|
editAndRemoveOptions: [] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
if (this.detailOptions.length == 0) { |
||||
|
this.detailOptions = getDetailOption(); |
||||
|
} |
||||
|
if (this.scanOptions.length == 0) { |
||||
|
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam |
||||
|
.allowModifyLocation) |
||||
|
} |
||||
|
this.removeOptions = getRemoveOption(); |
||||
|
this.editAndRemoveOptions = getEditRemoveOption() |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
|
||||
|
updated() { |
||||
|
console.log('updated') |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
collapseChange() { |
||||
|
setTimeout(() => { |
||||
|
this.resizeCollapse(); |
||||
|
}, 500) |
||||
|
}, |
||||
|
|
||||
|
resizeCollapse() { |
||||
|
this.$nextTick(r => { |
||||
|
this.$refs.collapse.resize() |
||||
|
}); |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
refreshCollapse() { |
||||
|
this.$nextTick(r => { |
||||
|
this.$refs.collapse.forEach(r => { |
||||
|
r.childrens.forEach(i => { |
||||
|
i.init(); |
||||
|
}) |
||||
|
r.resize(); |
||||
|
}) |
||||
|
}); |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
|
||||
|
swipeClick(e, item, type) { |
||||
|
if (e.content.text == "编辑") { |
||||
|
this.edit(item) |
||||
|
} else if (e.content.text == "移除") { |
||||
|
this.remove(item) |
||||
|
} |
||||
|
}, |
||||
|
edit(item) { |
||||
|
this.editItem = item; |
||||
|
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty); |
||||
|
}, |
||||
|
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() { |
||||
|
this.$emit('updateData') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,190 @@ |
|||||
|
<template> |
||||
|
<view class="" style="background-color: #fff;"> |
||||
|
<uni-collapse ref="collapse1" @change=""> |
||||
|
<uni-collapse-item :open="true"> |
||||
|
<template v-slot:title> |
||||
|
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" |
||||
|
:isShowStdPack="false"> |
||||
|
</item-compare-qty> |
||||
|
</template> |
||||
|
|
||||
|
<view class="" v-for="(item,index) in dataContent.subList" :key="index"> |
||||
|
<uni-swipe-action ref="swipeAction"> |
||||
|
<uni-swipe-action-item @click="swipeClick($event,item)" |
||||
|
:right-options="item.scaned?scanOptions:detailOptions" |
||||
|
style='padding:0px 0px 5px 0px;align-items: center;'> |
||||
|
<recommend :detail="item" :isShowFromLocation="isShowFromLocation" |
||||
|
:isShowStatus="isShowStatus" :isShowToLocation="isShowToLocation"> |
||||
|
</recommend> |
||||
|
|
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
</view> |
||||
|
</uni-collapse-item> |
||||
|
</uni-collapse> |
||||
|
<recommend-qty-edit ref="receiptEdit" :dataContent="editItem" :settingParam="settingParam" @confirm="confirm"> |
||||
|
</recommend-qty-edit> |
||||
|
|
||||
|
|
||||
|
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' |
||||
|
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> |
||||
|
<comMessage ref="message"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import recommendQtyEdit from '@/mycomponents/qty/recommendQtyEdit.vue' |
||||
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getPurchaseReceiptOption |
||||
|
} from '@/common/array.js'; |
||||
|
|
||||
|
export default { |
||||
|
emits: ['openDetail', "updateData","remove"], |
||||
|
components: { |
||||
|
itemCompareQty, |
||||
|
recommend, |
||||
|
recommendQtyEdit, |
||||
|
winScanLocation |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
isShowPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowBatch: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowFromLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowToLocation: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
|
||||
|
locationAreaTypeList: { |
||||
|
type: Array, |
||||
|
default: null |
||||
|
}, |
||||
|
queryBalance: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
dataContent: { |
||||
|
handler(newName, oldName) { |
||||
|
if (this.dataContent.subList.length > 0) { |
||||
|
this.$nextTick(res => { |
||||
|
setTimeout(() => { |
||||
|
if (this.$refs.collapse1) { |
||||
|
this.$refs.collapse1.resize(); |
||||
|
} |
||||
|
}, 500) |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
immediate: true, |
||||
|
deep: true |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
option: [], |
||||
|
showItem: {}, |
||||
|
locatonItem: {}, |
||||
|
editItem: {}, |
||||
|
detailOptions: [], |
||||
|
scanOptions: [] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
if (this.detailOptions.length == 0) { |
||||
|
this.detailOptions = getDetailOption(); |
||||
|
} |
||||
|
if (this.scanOptions.length == 0) { |
||||
|
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false) |
||||
|
} |
||||
|
|
||||
|
// this.showLocation(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
swipeClick(e, item) { |
||||
|
if (e.content.text == "详情") { |
||||
|
this.detail(item) |
||||
|
} else if (e.content.text == "编辑") { |
||||
|
this.edit(item) |
||||
|
} else if (e.content.text == "库位") { |
||||
|
this.showLocation(item) |
||||
|
} else if (e.content.text == "移除") { |
||||
|
this.remove(item) |
||||
|
} |
||||
|
}, |
||||
|
edit(item) { |
||||
|
this.editItem = item; |
||||
|
this.$refs.receiptEdit.openTaskEditPopup(item.qty, item.handleQty, item.labelQty); |
||||
|
}, |
||||
|
|
||||
|
detail(item) { |
||||
|
this.$emit('openDetail', item); |
||||
|
// this.showItem = item; |
||||
|
// this.$refs.jobDetailPopup.openPopup(item) |
||||
|
}, |
||||
|
remove(item) { |
||||
|
this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
item.scaned = false |
||||
|
item.balance = {} |
||||
|
item.handleQty = null; |
||||
|
this.$forceUpdate() |
||||
|
this.$emit('remove', item) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
confirm(qty) { |
||||
|
this.editItem.handleQty = qty; |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
showLocation(item) { |
||||
|
this.locatonItem = item; |
||||
|
this.$refs.scanLocationCode.openScanPopup(); |
||||
|
}, |
||||
|
//扫描源库位 |
||||
|
getLocation(location, code) { |
||||
|
this.locatonItem.toLocationCode = code; |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,194 @@ |
|||||
|
<template> |
||||
|
<view class="" style="background-color: #fff;"> |
||||
|
<uni-collapse ref="collapse1" > |
||||
|
<uni-collapse-item :open="true"> |
||||
|
<template v-slot:title> |
||||
|
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" |
||||
|
:isShowStdPack="false"> |
||||
|
</item-compare-qty> |
||||
|
</template> |
||||
|
|
||||
|
<view class="" v-for="(item,index) in dataContent.subList" :key="index"> |
||||
|
<uni-swipe-action ref="swipeAction"> |
||||
|
<uni-swipe-action-item @click="swipeClick($event,item)" |
||||
|
:right-options="item.scaned?scanOptions:detailOptions" |
||||
|
style='padding:0px 0px 5px 0px;align-items: center;'> |
||||
|
|
||||
|
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite;"> |
||||
|
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;"> |
||||
|
推 |
||||
|
荐 |
||||
|
</view> |
||||
|
|
||||
|
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false"> |
||||
|
</recommend> |
||||
|
</view> |
||||
|
|
||||
|
<view v-else class="uni-flex" style="flex-direction: row; align-items: center;background-color: antiquewhite; margin-top: 5rpx;"> |
||||
|
<view class="" style="font-size: 32rpx; color: red; font-weight: bold; text-align: center;"> |
||||
|
实 |
||||
|
际 |
||||
|
</view> |
||||
|
|
||||
|
<recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false"> |
||||
|
</recommend> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
</view> |
||||
|
</uni-collapse-item> |
||||
|
</uni-collapse> |
||||
|
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit> |
||||
|
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' |
||||
|
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> |
||||
|
<comMessage ref="message"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
||||
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
||||
|
import { |
||||
|
getDetailOption, |
||||
|
getPurchaseReceiptOption |
||||
|
} from '@/common/array.js'; |
||||
|
|
||||
|
export default { |
||||
|
emits: ['openDetail', "updateData"], |
||||
|
components: { |
||||
|
itemCompareQty, |
||||
|
recommend, |
||||
|
balanceQtyEdit, |
||||
|
winScanLocation |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
isShowPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowBatch: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
locationAreaTypeList: { |
||||
|
type: Array, |
||||
|
default: null |
||||
|
}, |
||||
|
queryBalance: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
dataContent: { |
||||
|
handler(newName, oldName) { |
||||
|
if (this.dataContent.subList.length > 0) { |
||||
|
this.$nextTick(res => { |
||||
|
setTimeout(() => { |
||||
|
if (this.$refs.collapse1) { |
||||
|
this.$refs.collapse1.resize(); |
||||
|
} |
||||
|
}, 500) |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
immediate: true, |
||||
|
deep: true |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
option: [], |
||||
|
showItem: {}, |
||||
|
locatonItem: {}, |
||||
|
editItem: {}, |
||||
|
detailOptions: [], |
||||
|
scanOptions: [] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
if (this.detailOptions.length == 0) { |
||||
|
this.detailOptions = getDetailOption(); |
||||
|
} |
||||
|
if (this.scanOptions.length == 0) { |
||||
|
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false) |
||||
|
} |
||||
|
|
||||
|
// this.showLocation(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
swipeClick(e, item) { |
||||
|
if (e.content.text == "详情") { |
||||
|
this.detail(item) |
||||
|
} else if (e.content.text == "编辑") { |
||||
|
this.edit(item) |
||||
|
} else if (e.content.text == "库位") { |
||||
|
this.showLocation(item) |
||||
|
} else if (e.content.text == "移除") { |
||||
|
this.remove(item) |
||||
|
} |
||||
|
}, |
||||
|
edit(item) { |
||||
|
this.editItem = item; |
||||
|
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty); |
||||
|
}, |
||||
|
|
||||
|
detail(item) { |
||||
|
this.$emit('openDetail', item); |
||||
|
// this.showItem = item; |
||||
|
// this.$refs.jobDetailPopup.openPopup(item) |
||||
|
}, |
||||
|
remove(item) { |
||||
|
this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
item.scaned = false |
||||
|
item.balance = {} |
||||
|
item.handleQty = null; |
||||
|
this.$forceUpdate() |
||||
|
this.$emit('remove', item) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
confirm(qty) { |
||||
|
this.editItem.handleQty = qty; |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
showLocation(item) { |
||||
|
this.locatonItem = item; |
||||
|
this.$refs.scanLocationCode.openScanPopup(); |
||||
|
}, |
||||
|
//扫描源库位 |
||||
|
getLocation(location, code) { |
||||
|
this.locatonItem.toLocationCode = code; |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
@ -0,0 +1,241 @@ |
|||||
|
<template> |
||||
|
<view class="" style="background-color: #fff;"> |
||||
|
|
||||
|
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" |
||||
|
:isShowStdPack="false"> |
||||
|
</item-compare-qty> |
||||
|
|
||||
|
|
||||
|
<view class="" v-for="(item,index) in dataContent.subList" :key="index"> |
||||
|
<uni-swipe-action ref="swipeAction"> |
||||
|
<uni-swipe-action-item @click="swipeClick($event,item)" |
||||
|
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" |
||||
|
style='padding:0px 0px 5px 0px;align-items: center;'> |
||||
|
|
||||
|
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row;"> |
||||
|
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;background-color: antiquewhite;display: flex;align-items: center;justify-content: center;padding: 0px 10rpx;"> |
||||
|
推<br/> |
||||
|
荐 |
||||
|
</view> |
||||
|
<view class="" style="flex:1;"> |
||||
|
<batch v-if="item.batch" :batch="item.batch"></batch> |
||||
|
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> |
||||
|
</location> |
||||
|
</view> |
||||
|
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text> |
||||
|
|
||||
|
</view> |
||||
|
|
||||
|
<view v-else class="uni-flex" style="flex-direction: row; margin-top: 5rpx;"> |
||||
|
<view class="" style="font-size: 32rpx; color: black; font-weight: bold; text-align: center;background-color: antiquewhite;display: flex;align-items: center;justify-content: center;padding: 0px 10rpx;"> |
||||
|
实<br/> |
||||
|
际 |
||||
|
</view> |
||||
|
<view class="scan_view" style="flex:1;"> |
||||
|
<batch v-if="item.batch" :batch="item.batch"></batch> |
||||
|
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> |
||||
|
</location> |
||||
|
</view> |
||||
|
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false"> |
||||
|
</recommend> --> |
||||
|
</view> |
||||
|
|
||||
|
|
||||
|
</uni-swipe-action-item> |
||||
|
</uni-swipe-action> |
||||
|
</view> |
||||
|
|
||||
|
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit> |
||||
|
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' |
||||
|
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> |
||||
|
<comMessage ref="message"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
||||
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
||||
|
import location from '@/mycomponents/balance/location.vue' |
||||
|
import toLocation from '@/mycomponents/balance/toLocation.vue' |
||||
|
import batch from '@/mycomponents/balance/batch.vue' |
||||
|
import config from '@/static/config.js' |
||||
|
|
||||
|
import { |
||||
|
getRemoveOption, |
||||
|
getEditRemoveOption |
||||
|
} from '@/common/array.js'; |
||||
|
|
||||
|
export default { |
||||
|
emits: ['openDetail', "updateData"], |
||||
|
components: { |
||||
|
itemCompareQty, |
||||
|
recommend, |
||||
|
balanceQtyEdit, |
||||
|
winScanLocation, |
||||
|
location, |
||||
|
toLocation, |
||||
|
itemCompareQty, |
||||
|
batch, |
||||
|
}, |
||||
|
props: { |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: null |
||||
|
}, |
||||
|
isShowPack: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowBatch: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowLocation: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
locationAreaTypeList: { |
||||
|
type: Array, |
||||
|
default: null |
||||
|
}, |
||||
|
queryBalance: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowStatus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isEdit: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
}, |
||||
|
watch: { |
||||
|
dataContent: { |
||||
|
handler(newName, oldName) { |
||||
|
if (this.dataContent.subList.length > 0) { |
||||
|
this.$nextTick(res => { |
||||
|
setTimeout(() => { |
||||
|
if (this.$refs.collapse1) { |
||||
|
this.$refs.collapse1.resize(); |
||||
|
} |
||||
|
}, 500) |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
immediate: true, |
||||
|
deep: true |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
option: [], |
||||
|
showItem: {}, |
||||
|
locatonItem: {}, |
||||
|
editItem: {}, |
||||
|
detailOptions: [], |
||||
|
scanOptions: [], |
||||
|
|
||||
|
options: [], |
||||
|
removeOptions: [], |
||||
|
editAndRemoveOptions: [] |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
mounted() { |
||||
|
|
||||
|
this.removeOptions = getRemoveOption(); |
||||
|
this.editAndRemoveOptions = getEditRemoveOption() |
||||
|
// this.showLocation(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
swipeClick(e, item) { |
||||
|
if (e.content.text == "详情") { |
||||
|
this.detail(item) |
||||
|
} else if (e.content.text == "编辑") { |
||||
|
this.edit(item) |
||||
|
} else if (e.content.text == "库位") { |
||||
|
this.showLocation(item) |
||||
|
} else if (e.content.text == "移除") { |
||||
|
this.remove(item) |
||||
|
} |
||||
|
}, |
||||
|
edit(item) { |
||||
|
this.editItem = item; |
||||
|
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty); |
||||
|
}, |
||||
|
|
||||
|
detail(item) { |
||||
|
this.$emit('openDetail', item); |
||||
|
// this.showItem = item; |
||||
|
// this.$refs.jobDetailPopup.openPopup(item) |
||||
|
}, |
||||
|
remove(item) { |
||||
|
this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
||||
|
res => { |
||||
|
if (res) { |
||||
|
item.scaned = false |
||||
|
item.balance = {} |
||||
|
item.handleQty = null; |
||||
|
this.$forceUpdate() |
||||
|
this.$emit('remove', item) |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
confirm(qty) { |
||||
|
this.editItem.handleQty = qty; |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
showLocation(item) { |
||||
|
this.locatonItem = item; |
||||
|
this.$refs.scanLocationCode.openScanPopup(); |
||||
|
}, |
||||
|
//扫描源库位 |
||||
|
getLocation(location, code) { |
||||
|
this.locatonItem.toLocationCode = code; |
||||
|
this.$emit('updateData') |
||||
|
}, |
||||
|
isDevlement() { |
||||
|
return config.isDevelopment; |
||||
|
}, |
||||
|
copy(detail) { |
||||
|
console.log(detail) |
||||
|
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
||||
|
var content = "HPQ;V1.0;I" + detail.itemCode + ";P" + detail.packingNumber + ";B" + detail |
||||
|
.batch + ";Q" + detail.qty |
||||
|
// #ifdef H5 |
||||
|
this.$copyText(content).then( |
||||
|
res => { |
||||
|
uni.showToast({ |
||||
|
title: '复制采购标签成功', |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
} |
||||
|
) |
||||
|
// #endif |
||||
|
// #ifndef H5 |
||||
|
uni.setClipboardData({ |
||||
|
data: content, |
||||
|
success: () => { |
||||
|
uni.showToast({ |
||||
|
title: '复制采购标签成功' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
// #endif |
||||
|
}, |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style> |
||||
|
</style> |
Loading…
Reference in new issue