王志国
2 weeks ago
30 changed files with 666 additions and 80 deletions
@ -0,0 +1,261 @@ |
|||
<template> |
|||
<view class=""> |
|||
<u-popup v-model="showOne" mode="bottom" border-radius="14" z-index='12'> |
|||
<view class="title"> |
|||
<view class="title-txt"> |
|||
需求信息 |
|||
</view> |
|||
<u-icon name="close" color="#4f4f4f" size="28" @click="showOne = false"></u-icon> |
|||
</view> |
|||
<view class="item"> |
|||
<view class="label">来源库位:</view> |
|||
<view class="value"> |
|||
<u-input v-model="fromLocationCode" @blur="fromLocationScanMsg"></u-input> |
|||
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="clickBtnClearFromLocation"></u-icon> |
|||
</view> |
|||
<view class="searchIcon"> |
|||
<image src="/static/search.svg" mode="" @click="fromLocationClick"/> |
|||
</view> |
|||
</view> |
|||
<view class="item"> |
|||
<view class="label">零件:</view> |
|||
<view class="value"> |
|||
<u-input v-model="itemCode" @blur="itemCodeScanMsg"></u-input> |
|||
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="clickBtnClearItemCode"></u-icon> |
|||
</view> |
|||
<view class="searchIcon"> |
|||
<image src="/static/search.svg" mode="" @click="itemCodeClick"/> |
|||
</view> |
|||
</view> |
|||
<view class="item"> |
|||
<view class="label">批次:</view> |
|||
<view class="value"> |
|||
<u-input v-model='batch'></u-input> |
|||
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="batch = ''"></u-icon> |
|||
</view> |
|||
<view class="searchIcon"></view> |
|||
</view> |
|||
<view class="item"> |
|||
<view class="label">数量:</view> |
|||
<view class="value1"> |
|||
<u-number-box v-model="handleQty" @change="valChange"></u-number-box> |
|||
<view class="uom">EA</view> |
|||
</view> |
|||
</view> |
|||
<view class="uni-flex uni-row hide_border"> |
|||
<button class="btn_edit_big_cancle" hover-class="btn_edit_big_after" @click="showOne = false">取消</button> |
|||
<button class="btn_edit_big_confirm" hover-class="btn_edit_big_after" @click="confirm()">确认</button> |
|||
</view> |
|||
</u-popup> |
|||
|
|||
<!-- <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getFromLocation' |
|||
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> --> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup> |
|||
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|||
import { |
|||
getBusinessType |
|||
} from '@/common/record.js'; |
|||
|
|||
import { |
|||
getLabelInfo |
|||
} from '@/common/label.js'; |
|||
|
|||
|
|||
import {ref, onMounted} from 'vue'; |
|||
|
|||
const props = defineProps({ |
|||
showOnePop: { |
|||
type: Boolean, |
|||
default: false |
|||
} |
|||
}); |
|||
|
|||
const handleQty = ref(0) |
|||
const fromLocationCode = ref('') |
|||
const itemCode = ref('') |
|||
const batch = ref('') |
|||
const showOne = ref(false) |
|||
// 未定义字段 |
|||
const boxfocus = ref(false) |
|||
const scanMsg = ref('') |
|||
const fromWitch = ref('') |
|||
const scanList = ref([]) |
|||
const isShowHistory = ref('') |
|||
const headerType = ref('') |
|||
|
|||
const scanLocationCode = ref(null); |
|||
const comMessage = ref(null); |
|||
|
|||
const emit = defineEmits(['showFromLocationPopup', 'itemCodeClick', 'confirm', 'getInputMsgResult', 'clickBtnClearFromLocation', 'clickBtnClearItemCode']); |
|||
|
|||
onMounted(() => { |
|||
}); |
|||
|
|||
const fromLocationClick = () => { |
|||
emit('showFromLocationPopup'); |
|||
}; |
|||
|
|||
const itemCodeClick = () => { |
|||
if (!fromLocationCode.value) { |
|||
comMessage.value.showMessage("请先扫描来源库位"); |
|||
return; |
|||
} |
|||
emit('itemCodeClick'); |
|||
}; |
|||
|
|||
const confirm = () => { |
|||
const obj = { |
|||
fromLocationCode: fromLocationCode.value, |
|||
itemCode: itemCode.value, |
|||
batch: batch.value, |
|||
handleQty: handleQty.value, |
|||
}; |
|||
emit('confirm', obj); |
|||
}; |
|||
|
|||
const fromLocationScanMsg = () => { |
|||
if (fromLocationCode.value) { |
|||
scanMsg.value = fromLocationCode.value; |
|||
fromWitch.value = 'fromLocationScanMsg'; |
|||
handelScanMsg(); |
|||
} |
|||
}; |
|||
|
|||
const itemCodeScanMsg = () => { |
|||
if (itemCode.value) { |
|||
if (!fromLocationCode.value) { |
|||
comMessage.value.showMessage("请先扫描来源库位"); |
|||
return; |
|||
} |
|||
fromWitch.value = 'itemCodeScanMsg'; |
|||
scanMsg.value = itemCode.value; |
|||
handelScanMsg(); |
|||
} |
|||
}; |
|||
|
|||
const handelScanMsg = () => { |
|||
if (scanMsg.value) { |
|||
setTimeout(() => { |
|||
losefocus(); |
|||
let content = uni.$u.trim(scanMsg.value); |
|||
if (content === "") { |
|||
comMessage.value.showErrorMessage("扫描内容为空,请重新扫描", res => { |
|||
if (res) { |
|||
scanMsg.value = ""; |
|||
getfocus(); |
|||
} |
|||
}); |
|||
return; |
|||
} |
|||
|
|||
if (isShowHistory.value) { |
|||
scanList.value.unshift(content); |
|||
} |
|||
|
|||
getLabelInfo(content, headerType.value, callback => { |
|||
let scanResult = callback; |
|||
scanResult.scanMessage = content; |
|||
if (scanResult.success) { |
|||
console.log(scanResult); |
|||
emit('getInputMsgResult', scanResult, fromWitch.value); |
|||
} else { |
|||
losefocus(); |
|||
comMessage.value.showErrorMessage(scanResult.message, res => { |
|||
if (res) { |
|||
getfocus(); |
|||
} |
|||
}); |
|||
} |
|||
}); |
|||
}, 200); |
|||
} |
|||
}; |
|||
|
|||
const losefocus = () => { |
|||
boxfocus.value = false; |
|||
}; |
|||
|
|||
const clickBtnClearFromLocation = () => { |
|||
emit('clickBtnClearFromLocation'); |
|||
}; |
|||
|
|||
const clickBtnClearItemCode = () => { |
|||
emit('clickBtnClearItemCode'); |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.title { |
|||
padding: 30rpx 20rpx; |
|||
display: flex; |
|||
border-bottom: 1px solid rgba(230, 230, 230, 1); |
|||
|
|||
.title-txt { |
|||
flex: 1; |
|||
font-weight: bold; |
|||
font-size: 32rpx; |
|||
} |
|||
|
|||
} |
|||
|
|||
.select { |
|||
display: flex; |
|||
} |
|||
|
|||
.border { |
|||
border: 1px solid rgba(230, 230, 230, 1) |
|||
} |
|||
|
|||
::v-deep .u-input__right-icon__clear { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
color: #a7a7a7; |
|||
} |
|||
|
|||
.item { |
|||
display: flex; |
|||
align-items: center; |
|||
padding: 20rpx; |
|||
border-bottom: 1px solid #dedede; |
|||
|
|||
.value { |
|||
flex: 1; |
|||
width: 0px; |
|||
height: 80rpx; |
|||
border: 1px solid #dedede; |
|||
display: flex; |
|||
align-items: center; |
|||
font-size: 32rpx; |
|||
padding: 0px 20rpx; |
|||
} |
|||
|
|||
.value1 { |
|||
flex: 1; |
|||
width: 0px; |
|||
height: 80rpx; |
|||
display: flex; |
|||
align-items: center; |
|||
font-size: 32rpx; |
|||
} |
|||
|
|||
.searchIcon { |
|||
width: 40rpx; |
|||
margin-left: 20rpx; |
|||
|
|||
image { |
|||
width: 40rpx; |
|||
height: 40rpx |
|||
} |
|||
} |
|||
|
|||
.uom { |
|||
margin-left: 10rpx; |
|||
} |
|||
|
|||
} |
|||
</style> |
Loading…
Reference in new issue