|
@ -1,19 +1,16 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view class="" style="background-color: #fff;"> |
|
|
<view class="" style="background-color: #fff;"> |
|
|
|
|
|
|
|
|
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" |
|
|
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" |
|
|
:isShowStdPack="false"> |
|
|
:isShowStdPack="false"> |
|
|
</item-compare-qty> |
|
|
</item-compare-qty> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<view class="" v-for="(item,index) in dataContent.subList" :key="index"> |
|
|
<view class="" v-for="(item,index) in dataContent.subList" :key="index"> |
|
|
<uni-swipe-action ref="swipeAction"> |
|
|
<uni-swipe-action ref="swipeAction" |
|
|
<uni-swipe-action-item @click="swipeClick($event,item)" |
|
|
style='padding:0px 0px 5px 0px;align-items: center;' |
|
|
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" |
|
|
:options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" |
|
|
style='padding:0px 0px 5px 0px;align-items: center;'> |
|
|
@click="(...event)=>swipeClick(event,item)"> |
|
|
|
|
|
|
|
|
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row;"> |
|
|
<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;"> |
|
|
<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/> |
|
|
推<br/> |
|
|
荐 |
|
|
荐 |
|
|
</view> |
|
|
</view> |
|
@ -23,11 +20,10 @@ |
|
|
</location> |
|
|
</location> |
|
|
</view> |
|
|
</view> |
|
|
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text> |
|
|
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view v-else class="uni-flex" style="flex-direction: row; margin-top: 5rpx;"> |
|
|
<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;"> |
|
|
<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/> |
|
|
实<br/> |
|
|
际 |
|
|
际 |
|
|
</view> |
|
|
</view> |
|
@ -39,47 +35,35 @@ |
|
|
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false"> |
|
|
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false"> |
|
|
</recommend> --> |
|
|
</recommend> --> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</uni-swipe-action-item> |
|
|
|
|
|
</uni-swipe-action> |
|
|
</uni-swipe-action> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit> |
|
|
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" |
|
|
|
|
|
@confirm="confirm"></balance-qty-edit> |
|
|
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' |
|
|
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' |
|
|
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> |
|
|
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> |
|
|
<comMessage ref="message"></comMessage> |
|
|
<comMessage ref="message"></comMessage> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script setup> |
|
|
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
|
|
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
|
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
|
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
|
|
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
|
|
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
import location from '@/mycomponents/balance/location.vue' |
|
|
import location from '@/mycomponents/balance/location.vue' |
|
|
import toLocation from '@/mycomponents/balance/toLocation.vue' |
|
|
import toLocation from '@/mycomponents/balance/toLocation.vue' |
|
|
import batch from '@/mycomponents/balance/batch.vue' |
|
|
import batch from '@/mycomponents/balance/batch.vue' |
|
|
import config from '@/static/config.js' |
|
|
import config from '@/static/config.js' |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getRemoveOption, |
|
|
getRemoveOption, |
|
|
getEditRemoveOption |
|
|
getEditRemoveOption |
|
|
} from '@/common/array.js'; |
|
|
} from '@/common/array.js'; |
|
|
|
|
|
|
|
|
export default { |
|
|
import { ref, watch, onMounted, nextTick } from 'vue'; |
|
|
emits: ['openDetail', "updateData"], |
|
|
|
|
|
components: { |
|
|
const props = defineProps({ |
|
|
itemCompareQty, |
|
|
|
|
|
recommend, |
|
|
|
|
|
balanceQtyEdit, |
|
|
|
|
|
winScanLocation, |
|
|
|
|
|
location, |
|
|
|
|
|
toLocation, |
|
|
|
|
|
itemCompareQty, |
|
|
|
|
|
batch, |
|
|
|
|
|
}, |
|
|
|
|
|
props: { |
|
|
|
|
|
dataContent: { |
|
|
dataContent: { |
|
|
type: Object, |
|
|
type: Object, |
|
|
default: null |
|
|
default: null |
|
@ -115,112 +99,119 @@ |
|
|
isEdit: { |
|
|
isEdit: { |
|
|
type: Boolean, |
|
|
type: Boolean, |
|
|
default: true |
|
|
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) |
|
|
}); |
|
|
}) |
|
|
const emit = defineEmits(['openDetail', 'remove', 'updateData']); |
|
|
|
|
|
|
|
|
|
|
|
const collapse1 = ref(null); |
|
|
|
|
|
const qtyEdit = ref(null); |
|
|
|
|
|
const message = ref(null); |
|
|
|
|
|
const scanLocationCode = ref(null); |
|
|
|
|
|
|
|
|
|
|
|
const option = ref([]); |
|
|
|
|
|
const showItem = ref({}); |
|
|
|
|
|
const locatonItem = ref({}); |
|
|
|
|
|
const editItem = ref({}); |
|
|
|
|
|
const detailOptions = ref([]); |
|
|
|
|
|
const scanOptions = ref([]); |
|
|
|
|
|
const options = ref([]); |
|
|
|
|
|
const removeOptions = ref([]); |
|
|
|
|
|
const editAndRemoveOptions = ref([]); |
|
|
|
|
|
|
|
|
|
|
|
watch(() => props.dataContent, (newDataContent, oldDataContent) => { |
|
|
|
|
|
if (newDataContent?.subList.length > 0) { |
|
|
|
|
|
nextTick(() => { |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
if (collapse1.value) { |
|
|
|
|
|
collapse1.value.resize(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, 500); |
|
|
immediate: true, |
|
|
}); |
|
|
deep: true |
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, { immediate: true, deep: true }); |
|
|
|
|
|
|
|
|
data() { |
|
|
onMounted(() => { |
|
|
return { |
|
|
removeOptions.value = getRemoveOption(); |
|
|
option: [], |
|
|
editAndRemoveOptions.value = getEditRemoveOption(); |
|
|
showItem: {}, |
|
|
// showLocation(); |
|
|
locatonItem: {}, |
|
|
}); |
|
|
editItem: {}, |
|
|
|
|
|
detailOptions: [], |
|
|
const swipeClick = (e, item) => { |
|
|
scanOptions: [], |
|
|
switch (e.content.text) { |
|
|
|
|
|
case "详情": |
|
|
options: [], |
|
|
detail(item); |
|
|
removeOptions: [], |
|
|
break; |
|
|
editAndRemoveOptions: [] |
|
|
case "编辑": |
|
|
|
|
|
edit(item); |
|
|
|
|
|
break; |
|
|
|
|
|
case "库位": |
|
|
|
|
|
showLocation(item); |
|
|
|
|
|
break; |
|
|
|
|
|
case "移除": |
|
|
|
|
|
remove(item); |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}; |
|
|
|
|
|
|
|
|
mounted() { |
|
|
const edit = (item) => { |
|
|
|
|
|
editItem.value = item; |
|
|
|
|
|
qtyEdit.value.openEditPopup(item.balance, item.handleQty); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
this.removeOptions = getRemoveOption(); |
|
|
const detail = (item) => { |
|
|
this.editAndRemoveOptions = getEditRemoveOption() |
|
|
emit('openDetail', item); |
|
|
// this.showLocation(); |
|
|
// showItem.value = item; |
|
|
}, |
|
|
// jobDetailPopup.value.openPopup(item); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
methods: { |
|
|
const remove = (item) => { |
|
|
swipeClick(e, item) { |
|
|
message.value.showQuestionMessage("确定移除扫描信息?", (res) => { |
|
|
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) { |
|
|
if (res) { |
|
|
item.scaned = false |
|
|
item.scaned = false; |
|
|
item.balance = {} |
|
|
item.balance = {}; |
|
|
item.handleQty = null; |
|
|
item.handleQty = null; |
|
|
this.$forceUpdate() |
|
|
emit('remove', item); |
|
|
this.$emit('remove', item) |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}; |
|
|
confirm(qty) { |
|
|
|
|
|
this.editItem.handleQty = qty; |
|
|
const confirm = (qty) => { |
|
|
this.$emit('updateData') |
|
|
editItem.value.handleQty = qty; |
|
|
}, |
|
|
emit('updateData'); |
|
|
showLocation(item) { |
|
|
}; |
|
|
this.locatonItem = item; |
|
|
|
|
|
this.$refs.scanLocationCode.openScanPopup(); |
|
|
const showLocation = (item) => { |
|
|
}, |
|
|
locatonItem.value = item; |
|
|
//扫描源库位 |
|
|
scanLocationCode.value.openScanPopup(); |
|
|
getLocation(location, code) { |
|
|
}; |
|
|
this.locatonItem.toLocationCode = code; |
|
|
|
|
|
this.$emit('updateData') |
|
|
const getLocation = (location, code) => { |
|
|
}, |
|
|
locatonItem.value.toLocationCode = code; |
|
|
isDevlement() { |
|
|
emit('updateData'); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const isDevlement = () => { |
|
|
return config.isDevelopment; |
|
|
return config.isDevelopment; |
|
|
}, |
|
|
}; |
|
|
copy(detail) { |
|
|
|
|
|
console.log(detail) |
|
|
const copy = (detail) => { |
|
|
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100 |
|
|
console.log(detail); |
|
|
var content = "HPQ;V1.0;I" + detail.itemCode + ";P" + detail.packingNumber + ";B" + detail |
|
|
const content = `HPQ;V1.0;I${detail.itemCode};P${detail.packingNumber};B${detail.batch};Q${detail.qty}`; |
|
|
.batch + ";Q" + detail.qty |
|
|
|
|
|
// #ifdef H5 |
|
|
// #ifdef H5 |
|
|
this.$copyText(content).then( |
|
|
navigator.clipboard.writeText(content).then( |
|
|
res => { |
|
|
() => { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '复制采购标签成功', |
|
|
title: '复制采购标签成功', |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}) |
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
() => { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: '复制失败', |
|
|
|
|
|
icon: 'none' |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
) |
|
|
); |
|
|
// #endif |
|
|
// #endif |
|
|
// #ifndef H5 |
|
|
// #ifndef H5 |
|
|
uni.setClipboardData({ |
|
|
uni.setClipboardData({ |
|
@ -228,13 +219,11 @@ |
|
|
success: () => { |
|
|
success: () => { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '复制采购标签成功' |
|
|
title: '复制采购标签成功' |
|
|
}) |
|
|
}); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}); |
|
|
// #endif |
|
|
// #endif |
|
|
}, |
|
|
}; |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style> |
|
|
<style> |
|
|