Browse Source

组件扫码

hella_vue3
zhang_li 3 months ago
parent
commit
33a59d5e26
  1. 14
      src/mycomponents/package/packageCard.vue
  2. 3
      src/mycomponents/scan/winComScan.vue
  3. 11
      src/mycomponents/scan/winScanPack.vue
  4. 26
      src/mycomponents/scan/winScanPackAndLocation.vue
  5. 3
      src/pages/productReceipt/job/productReceiptDetail.vue
  6. 12
      src/pages/purchaseReceipt/job/receiptDetail.vue
  7. 37
      src/pages/putaway/job/putawayDetail.vue
  8. 2
      src/pages/putaway/job/putawayJob.vue

14
src/mycomponents/package/packageCard.vue

@ -70,6 +70,20 @@ const props = defineProps({
default: '库位'
}
})
watch(
() => props.dataContent,
(newVal, oldVal) => {
if (newVal.scaned) {
newVal.copyContent = `HPQ;V1.0;I${newVal.itemCode};P${newVal.packingNumber};B${newVal.batch};Q${newVal.qty}`
} else {
newVal.copyContent = ''
}
},
{
immediate: true,
deep: true
}
)
const copy = () => {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
const content = `HPQ;V1.0;I${props.dataContent.itemCode};P${props.dataContent.packingNumber};B${props.dataContent.batch};Q${props.dataContent.qty}`

3
src/mycomponents/scan/winComScan.vue

@ -102,6 +102,9 @@ watch(
placeholderValue.value = `请扫描${val}`
}
)
const setItemCodeSimulate = () => {
scanMsg.value = scanMsg
}
const hide = () => {
// #ifdef APP-PLUS
//

11
src/mycomponents/scan/winScanPack.vue

@ -16,6 +16,8 @@
</view>
</view>
</u-popup>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType" :isShowHistory="false" :clearResult="true"></win-com-scan>
<com-message ref="comMessageRef" @afterClose="getfocus" />
</view>
</template>
@ -41,6 +43,12 @@ const props = defineProps({
const show = ref(false)
const comMessageRef = ref()
const comscan = ref()
const comscansimulate = ref()
//
const simulateScan = (item) => {
comscansimulate.value.setItemCodeSimulate(item.itemCode, item.copyContent)
comscansimulate.value.clickScanMsg()
}
const openScanPopup = () => {
setTimeout((res) => {
show.value = true
@ -88,7 +96,8 @@ defineExpose({
openScanPopup,
closeScanPopup,
getfocus,
losefocus
losefocus,
simulateScan
})
</script>

26
src/mycomponents/scan/winScanPackAndLocation.vue

@ -34,6 +34,8 @@
</view>
</u-popup>
<balance-select ref="balanceSelectRef" @onSelectItem="selectBalanceItem"></balance-select>
<!-- 模拟扫描功能 -->
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType" :isShowHistory="false" :clearResult="true"></win-com-scan>
</view>
<com-message ref="comMessageRef" />
</template>
@ -141,6 +143,30 @@ const openScanPopupForJob = (fromLocationCodePrams, fromLocationListPrams, jobCo
inventoryStatus.value = getDirectoryItemArray(jobContent.outInventoryStatuses) // 出库库存状态; //出库库存状态
fromLocationAreaTypeList.value = getDirectoryItemArray(jobContent.fromAreaTypes) //
}
//
const openScanPopupForJobSimulate = (fromLocationCodeParams, fromLocationListParams, jobContent, item) => {
fromLocationCode.value = fromLocationCodeParams
fromLocationList.value = fromLocationListParams
if (fromLocationListParams != '') {
// this.packGetFocus();
if (comscansimulate.value != undefined) {
comscansimulate.value.getfocus()
}
} else if (fromLocationList.value.length == 0) {
// this.locationGetFocus();
alert('没有来源库位:List')
} else {
fromLocationCode.value = fromLocationList.value[0]
}
fromInventoryStatuses.value = getDirectoryItemArray(jobContent.outInventoryStatuses)
inventoryStatus.value = getDirectoryItemArray(jobContent.outInventoryStatuses) // 出库库存状态; //出库库存状态
fromLocationAreaTypeList.value = getDirectoryItemArray(jobContent.fromAreaTypes) //
const timer = setTimeout((res) => {
if (timer) {
clearTimeout(timer)
}
}, 500)
}
const closeScanPopup = (content) => {
show.value = false
emit('close', '')

3
src/pages/productReceipt/job/productReceiptDetail.vue

@ -180,7 +180,8 @@ const getDetail = () => {
r.subList.forEach((s) => {
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) {
s.scaned = true
s.handleQty = s.qty
scanPopup.value.simulateScan(s)
// s.handleQty = s.qty
}
})
})

12
src/pages/purchaseReceipt/job/receiptDetail.vue

@ -97,7 +97,7 @@ const comReceiptDetailCardRef = ref()
const count = ref(0)
onLoad((option) => {
id.value = option.id
// scanedPackingNumber.value = option.scaned || ''
scanedPackingNumber.value = option.scaned || ''
operation.value = option.operation
if (id.value != undefined) {
//
@ -168,14 +168,19 @@ const getDetail = () => {
jobStatus.value = res.data.status
jobToLocationCode.value = subList.value[0].toLocationCode
detailSource.value = getTreeDataSource(subList.value)
isAllReceived.value = false
nextTick(() => {
detailSource.value.forEach((r) => {
r.subList.forEach((s) => {
s.scaned = false
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) s.scaned = true
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) {
s.scaned = true
scanPopup.value.simulateScan(s)
}
})
})
count.value++
isAllReceived.value = false
})
} else {
showMessage('列表数据为0')
}
@ -406,7 +411,6 @@ const submitJob = () => {
pageSize: 1000
}).then((res1) => {
timerCount += 1
console.log(11111)
if (res1.data && res1.data.list && res1.data.list.length && res1.data.total >= res.data.detailCount) {
uni.hideLoading()
clearInterval(timer1)

37
src/pages/putaway/job/putawayDetail.vue

@ -146,13 +146,6 @@ const getDetail = () => {
subList.value = res.data.subList
detailSource.value = getTreeDataSource(subList.value)
detailSource.value.forEach((r) => {
r.subList.forEach((s) => {
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) s.scaned = true
s.inventoryStatus = s.inspectResult //
})
})
fromLocationCode.value = subList.value[0].fromLocationCode
jobToLocationCode.value = subList.value[0].toLocationCode
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes)
@ -162,6 +155,16 @@ const getDetail = () => {
} else {
toLocationCode.value = jobToLocationCode.value
}
detailSource.value.forEach((r) => {
r.subList.forEach((s) => {
if (scanedPackingNumber.value && scanedPackingNumber.value == s.packingNumber) {
s.scaned = true
s.packList.forEach((item) => (item.scaned = true))
s.inventoryStatus = s.inspectResult //
openScanPopupSimulate(s)
}
})
})
} else {
showMessage('列表数据为0')
}
@ -200,6 +203,26 @@ const continueScan = () => {
const updateData = () => {
calcTreeHandleQty(detailSource.value)
}
//
const openScanPopupSimulate = (item) => {
let fromlocationCode = ''
const fromlocationList = []
for (let i = 0; i < detailSource.value.length; i++) {
const item = detailSource.value[i]
item.subList.forEach((l) => {
//
const location = fromlocationList.find((res) => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode)
}
//
if (fromlocationCode == '') {
fromlocationCode = l.fromLocationCode
}
})
}
scanPopup.value.openScanPopupForJobSimulate(fromlocationCode, fromlocationList, jobContent.value, item)
}
const openScanPopup = () => {
let fromlocationCode = ''
const fromlocationList = []

2
src/pages/putaway/job/putawayJob.vue

@ -256,7 +256,7 @@ const openScanPopup = () => {
const selectItem = (item) => {
scanPopup.value.closeScanPopup()
uni.navigateTo({
url: `./putawayDetail?id=${item.masterId}&status=${item.status}`
url: `./putawayDetail?id=${item.masterId}&status=${item.status}&scaned=${item.packingNumber}`
})
}

Loading…
Cancel
Save