test
3 months ago
6 changed files with 313 additions and 32 deletions
@ -0,0 +1,186 @@ |
|||||
|
<template> |
||||
|
<view class="" style="background-color: #fff;"> |
||||
|
|
||||
|
<!-- <item-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"></item-qty> --> |
||||
|
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false"> |
||||
|
</item-compare-qty> |
||||
|
<view class='split_line'></view> |
||||
|
<view class="" v-for="(item,index) in dataContent.subList"> |
||||
|
<u-swipe-action ref="swipeAction" v-if="index ==0" :class="item.scaned?'scan_view':''"> |
||||
|
<u-swipe-action-item |
||||
|
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" |
||||
|
@click="swipeClick($event,item)"> |
||||
|
<div style="display: flex;"> |
||||
|
<div style="flex: 1;"> |
||||
|
<batch v-if="item.batch" :batch="item.batch"></batch> |
||||
|
<location v-if="item.fromLocationCode" title="来源库位" :locationCode="item.fromLocationCode"> |
||||
|
</location> |
||||
|
<to-location v-if="item.toLocationCode" title="目标库位" :locationCode="item.toLocationCode"> |
||||
|
</to-location> |
||||
|
</div> |
||||
|
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text> |
||||
|
</div> |
||||
|
</u-swipe-action-item> |
||||
|
</u-swipe-action> |
||||
|
</view> |
||||
|
|
||||
|
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm" |
||||
|
:allowEditStatus="true"></balance-qty-edit> |
||||
|
<win-scan-location ref="scanLocationCode" :locationAreaTypeList="locationAreaTypeList" title="目标库位" |
||||
|
@getLocation='getLocation'></win-scan-location> |
||||
|
<detail-info-popup ref="detailInfoPopup"></detail-info-popup> |
||||
|
<comMessage ref="message"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import {ref, watch, onMounted, computed} from 'vue'; |
||||
|
import itemQty from '@/mycomponents/item/itemQty.vue' |
||||
|
import recommend from '@/mycomponents/recommend/recommend.vue' |
||||
|
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
||||
|
import detailInfoPopup from '@/pages/inventoryMove/coms/detailInfoPopup.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 itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' |
||||
|
import config from '@/static/config.js' |
||||
|
|
||||
|
import {getRemoveOption, getEditRemoveOption} from '@/common/array.js'; |
||||
|
|
||||
|
const props = defineProps({ |
||||
|
dataContent: { |
||||
|
type: Object, |
||||
|
default: () => ({}) |
||||
|
}, |
||||
|
settingParam: { |
||||
|
type: Object, |
||||
|
default: () => ({}) |
||||
|
}, |
||||
|
allowEditQty: { |
||||
|
type: Boolean, |
||||
|
default: false |
||||
|
}, |
||||
|
locationAreaTypeList: { |
||||
|
type: Array, |
||||
|
default: () => [] |
||||
|
}, |
||||
|
isEdit: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
} |
||||
|
}); |
||||
|
const emit = defineEmits(['openDetail', 'remove']) |
||||
|
|
||||
|
const option = ref([]); |
||||
|
const title = ref("推荐详情"); |
||||
|
const showItem = ref({}); |
||||
|
const editItem = ref({}); |
||||
|
const detailOptions = ref([]); |
||||
|
const scanOptions = ref([]); |
||||
|
const options = ref([]); |
||||
|
const removeOptions = ref([]); |
||||
|
const editAndRemoveOptions = ref([]); |
||||
|
const collapse1 = ref(null) |
||||
|
const qtyEdit = ref(null) |
||||
|
const winHint = ref(null) |
||||
|
const message = ref(null) |
||||
|
const locatonItem = ref({}) |
||||
|
const scanLocationCode = ref(null) |
||||
|
|
||||
|
watch(() => props.dataContent, (newName, oldName) => { |
||||
|
if (props.dataContent.subList.length > 0) { |
||||
|
setTimeout(() => { |
||||
|
if (collapse1.value) { |
||||
|
collapse1.value.init(); |
||||
|
} |
||||
|
}, 200); |
||||
|
} |
||||
|
}, {immediate: true, deep: true}); |
||||
|
onMounted(() => { |
||||
|
removeOptions.value = getRemoveOption(); |
||||
|
editAndRemoveOptions.value = getEditRemoveOption(); |
||||
|
}); |
||||
|
|
||||
|
const openDetailCardPopup = () => { |
||||
|
winHint.value.openScanPopup(); |
||||
|
}; |
||||
|
|
||||
|
const swipeClick = (e, item) => { |
||||
|
switch (e.content.text) { |
||||
|
case "详情": |
||||
|
detail(item); |
||||
|
break; |
||||
|
case "编辑": |
||||
|
edit(item); |
||||
|
break; |
||||
|
case "库位": |
||||
|
showLocation(item); |
||||
|
break; |
||||
|
case "移除": |
||||
|
remove(item); |
||||
|
break; |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
const edit = (item) => { |
||||
|
editItem.value = item; |
||||
|
qtyEdit.value.openEditPopup(item.balance, item.handleQty); |
||||
|
}; |
||||
|
|
||||
|
const detail = (item) => { |
||||
|
emit('openDetail', item); |
||||
|
}; |
||||
|
|
||||
|
const remove = (item) => { |
||||
|
message.value.showQuestionMessage("确定移除扫描信息?", (res) => { |
||||
|
if (res) { |
||||
|
item.scaned = false; |
||||
|
item.balance = {}; |
||||
|
item.handleQty = 0; |
||||
|
emit('remove', item); |
||||
|
} |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
|
const confirm = (qty) => { |
||||
|
editItem.value.handleQty = qty; |
||||
|
emit('updateData'); |
||||
|
}; |
||||
|
|
||||
|
const showLocation = (item) => { |
||||
|
locatonItem.value = item; |
||||
|
scanLocationCode.value.openScanPopup(); |
||||
|
}; |
||||
|
|
||||
|
const getLocation = (location, code) => { |
||||
|
locatonItem.value.toLocationCode = code; |
||||
|
emit('updateData'); |
||||
|
}; |
||||
|
|
||||
|
const isDevlement = () => { |
||||
|
return config.isDevelopment; |
||||
|
}; |
||||
|
|
||||
|
const copy = (detail) => { |
||||
|
const content = `HPQ;V1.0;I${detail.itemCode};P${detail.packingNumber};B${detail.batch};Q${detail.qty}`; |
||||
|
|
||||
|
// #ifdef H5 |
||||
|
navigator.clipboard.writeText(content).then(() => { |
||||
|
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