王志国
3 weeks ago
5 changed files with 828 additions and 912 deletions
@ -1,240 +1,229 @@ |
|||||
<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"> |
||||
|
<uni-swipe-action ref="swipeAction" |
||||
|
style='padding:0px 0px 5px 0px;align-items: center;' |
||||
<view class="" v-for="(item,index) in dataContent.subList" :key="index"> |
:options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" |
||||
<uni-swipe-action ref="swipeAction"> |
@click="(...event)=>swipeClick(event,item)"> |
||||
<uni-swipe-action-item @click="swipeClick($event,item)" |
<view v-if="item.isRecommend" class="uni-flex" style="flex-direction: row;"> |
||||
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" |
<view class="" |
||||
style='padding:0px 0px 5px 0px;align-items: center;'> |
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 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> |
||||
推<br/> |
<view class="" style="flex:1;"> |
||||
荐 |
<batch v-if="item.batch" :batch="item.batch"></batch> |
||||
</view> |
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> |
||||
<view class="" style="flex:1;"> |
</location> |
||||
<batch v-if="item.batch" :batch="item.batch"></batch> |
</view> |
||||
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> |
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text> |
||||
</location> |
</view> |
||||
</view> |
<view v-else class="uni-flex" style="flex-direction: row; margin-top: 5rpx;"> |
||||
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text> |
<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> |
实<br/> |
||||
|
际 |
||||
<view v-else class="uni-flex" style="flex-direction: row; margin-top: 5rpx;"> |
</view> |
||||
<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="scan_view" style="flex:1;"> |
||||
实<br/> |
<batch v-if="item.batch" :batch="item.batch"></batch> |
||||
际 |
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> |
||||
</view> |
</location> |
||||
<view class="scan_view" style="flex:1;"> |
</view> |
||||
<batch v-if="item.batch" :batch="item.batch"></batch> |
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false"> |
||||
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> |
</recommend> --> |
||||
</location> |
</view> |
||||
</view> |
</uni-swipe-action> |
||||
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false"> |
</view> |
||||
</recommend> --> |
|
||||
</view> |
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" |
||||
|
@confirm="confirm"></balance-qty-edit> |
||||
|
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' |
||||
</uni-swipe-action-item> |
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> |
||||
</uni-swipe-action> |
<comMessage ref="message"></comMessage> |
||||
</view> |
</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> |
</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, |
dataContent: { |
||||
recommend, |
type: Object, |
||||
balanceQtyEdit, |
default: null |
||||
winScanLocation, |
}, |
||||
location, |
settingParam: { |
||||
toLocation, |
type: Object, |
||||
itemCompareQty, |
default: null |
||||
batch, |
}, |
||||
}, |
isShowPack: { |
||||
props: { |
type: Boolean, |
||||
dataContent: { |
default: true |
||||
type: Object, |
}, |
||||
default: null |
isShowBatch: { |
||||
}, |
type: Boolean, |
||||
settingParam: { |
default: true |
||||
type: Object, |
}, |
||||
default: null |
isShowLocation: { |
||||
}, |
type: Boolean, |
||||
isShowPack: { |
default: true |
||||
type: Boolean, |
}, |
||||
default: true |
locationAreaTypeList: { |
||||
}, |
type: Array, |
||||
isShowBatch: { |
default: null |
||||
type: Boolean, |
}, |
||||
default: true |
queryBalance: { |
||||
}, |
type: Boolean, |
||||
isShowLocation: { |
default: true |
||||
type: Boolean, |
}, |
||||
default: true |
isShowStatus: { |
||||
}, |
type: Boolean, |
||||
locationAreaTypeList: { |
default: true |
||||
type: Array, |
}, |
||||
default: null |
isEdit: { |
||||
}, |
type: Boolean, |
||||
queryBalance: { |
default: true |
||||
type: Boolean, |
} |
||||
default: true |
}); |
||||
}, |
const emit = defineEmits(['openDetail', 'remove', 'updateData']); |
||||
isShowStatus: { |
|
||||
type: Boolean, |
const collapse1 = ref(null); |
||||
default: true |
const qtyEdit = ref(null); |
||||
}, |
const message = ref(null); |
||||
isEdit: { |
const scanLocationCode = ref(null); |
||||
type: Boolean, |
|
||||
default: true |
const option = ref([]); |
||||
}, |
const showItem = ref({}); |
||||
}, |
const locatonItem = ref({}); |
||||
watch: { |
const editItem = ref({}); |
||||
dataContent: { |
const detailOptions = ref([]); |
||||
handler(newName, oldName) { |
const scanOptions = ref([]); |
||||
if (this.dataContent.subList.length > 0) { |
const options = ref([]); |
||||
this.$nextTick(res => { |
const removeOptions = ref([]); |
||||
setTimeout(() => { |
const editAndRemoveOptions = ref([]); |
||||
if (this.$refs.collapse1) { |
|
||||
this.$refs.collapse1.resize(); |
watch(() => props.dataContent, (newDataContent, oldDataContent) => { |
||||
} |
if (newDataContent?.subList.length > 0) { |
||||
}, 500) |
nextTick(() => { |
||||
}) |
setTimeout(() => { |
||||
} |
if (collapse1.value) { |
||||
}, |
collapse1.value.resize(); |
||||
immediate: true, |
} |
||||
deep: true |
}, 500); |
||||
} |
}); |
||||
}, |
} |
||||
|
}, { immediate: true, deep: true }); |
||||
data() { |
|
||||
return { |
onMounted(() => { |
||||
option: [], |
removeOptions.value = getRemoveOption(); |
||||
showItem: {}, |
editAndRemoveOptions.value = getEditRemoveOption(); |
||||
locatonItem: {}, |
// showLocation(); |
||||
editItem: {}, |
}); |
||||
detailOptions: [], |
|
||||
scanOptions: [], |
const swipeClick = (e, item) => { |
||||
|
switch (e.content.text) { |
||||
options: [], |
case "详情": |
||||
removeOptions: [], |
detail(item); |
||||
editAndRemoveOptions: [] |
break; |
||||
} |
case "编辑": |
||||
}, |
edit(item); |
||||
|
break; |
||||
mounted() { |
case "库位": |
||||
|
showLocation(item); |
||||
this.removeOptions = getRemoveOption(); |
break; |
||||
this.editAndRemoveOptions = getEditRemoveOption() |
case "移除": |
||||
// this.showLocation(); |
remove(item); |
||||
}, |
break; |
||||
|
} |
||||
methods: { |
}; |
||||
swipeClick(e, item) { |
|
||||
if (e.content.text == "详情") { |
const edit = (item) => { |
||||
this.detail(item) |
editItem.value = item; |
||||
} else if (e.content.text == "编辑") { |
qtyEdit.value.openEditPopup(item.balance, item.handleQty); |
||||
this.edit(item) |
}; |
||||
} else if (e.content.text == "库位") { |
|
||||
this.showLocation(item) |
const detail = (item) => { |
||||
} else if (e.content.text == "移除") { |
emit('openDetail', item); |
||||
this.remove(item) |
// showItem.value = item; |
||||
} |
// jobDetailPopup.value.openPopup(item); |
||||
}, |
}; |
||||
edit(item) { |
|
||||
this.editItem = item; |
const remove = (item) => { |
||||
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty); |
message.value.showQuestionMessage("确定移除扫描信息?", (res) => { |
||||
}, |
if (res) { |
||||
|
item.scaned = false; |
||||
detail(item) { |
item.balance = {}; |
||||
this.$emit('openDetail', item); |
item.handleQty = null; |
||||
// this.showItem = item; |
emit('remove', item); |
||||
// this.$refs.jobDetailPopup.openPopup(item) |
} |
||||
}, |
}); |
||||
remove(item) { |
}; |
||||
this.$refs.message.showQuestionMessage("确定移除扫描信息?", |
|
||||
res => { |
const confirm = (qty) => { |
||||
if (res) { |
editItem.value.handleQty = qty; |
||||
item.scaned = false |
emit('updateData'); |
||||
item.balance = {} |
}; |
||||
item.handleQty = null; |
|
||||
this.$forceUpdate() |
const showLocation = (item) => { |
||||
this.$emit('remove', item) |
locatonItem.value = item; |
||||
} |
scanLocationCode.value.openScanPopup(); |
||||
}); |
}; |
||||
}, |
|
||||
confirm(qty) { |
const getLocation = (location, code) => { |
||||
this.editItem.handleQty = qty; |
locatonItem.value.toLocationCode = code; |
||||
this.$emit('updateData') |
emit('updateData'); |
||||
}, |
}; |
||||
showLocation(item) { |
|
||||
this.locatonItem = item; |
const isDevlement = () => { |
||||
this.$refs.scanLocationCode.openScanPopup(); |
return config.isDevelopment; |
||||
}, |
}; |
||||
//扫描源库位 |
|
||||
getLocation(location, code) { |
const copy = (detail) => { |
||||
this.locatonItem.toLocationCode = code; |
console.log(detail); |
||||
this.$emit('updateData') |
const content = `HPQ;V1.0;I${detail.itemCode};P${detail.packingNumber};B${detail.batch};Q${detail.qty}`; |
||||
}, |
// #ifdef H5 |
||||
isDevlement() { |
navigator.clipboard.writeText(content).then( |
||||
return config.isDevelopment; |
() => { |
||||
}, |
uni.showToast({ |
||||
copy(detail) { |
title: '复制采购标签成功', |
||||
console.log(detail) |
icon: 'none' |
||||
// 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 |
uni.showToast({ |
||||
this.$copyText(content).then( |
title: '复制失败', |
||||
res => { |
icon: 'none' |
||||
uni.showToast({ |
}); |
||||
title: '复制采购标签成功', |
} |
||||
icon: 'none' |
); |
||||
}) |
// #endif |
||||
} |
// #ifndef H5 |
||||
) |
uni.setClipboardData({ |
||||
// #endif |
data: content, |
||||
// #ifndef H5 |
success: () => { |
||||
uni.setClipboardData({ |
uni.showToast({ |
||||
data: content, |
title: '复制采购标签成功' |
||||
success: () => { |
}); |
||||
uni.showToast({ |
} |
||||
title: '复制采购标签成功' |
}); |
||||
}) |
// #endif |
||||
} |
}; |
||||
}) |
|
||||
// #endif |
|
||||
}, |
|
||||
} |
|
||||
} |
|
||||
</script> |
</script> |
||||
|
|
||||
<style> |
<style> |
||||
|
Loading…
Reference in new issue