Compare commits

...

3 Commits

  1. 75
      src/pages/inventoryMove/coms/comMoveRecord.vue
  2. 195
      src/pages/inventoryMove/coms/okToHoldRecordPack.vue

75
src/pages/inventoryMove/coms/comMoveRecord.vue

@ -36,12 +36,13 @@
<!-- 合格转隔离单独的弹窗-->
<okToHoldRecordPack ref="okToHoldRecordPackRef" :showOnePop='showOnePop'
@showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup'
@confirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult"
@itemCodeScanMsg='itemCodeScanMsg'></okToHoldRecordPack>
@onConfirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult"
></okToHoldRecordPack>
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :title="'箱码'">
</win-scan-pack-and-location>
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location>
:locationAreaTypeList="fromLocationAreaTypeList"
@clearFromLocation="clearFromLocationCode"></win-scan-location>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -157,7 +158,7 @@
itemCodeTypeList: [],
isShowEditLocation: false,
isJustReplay: true, //
fromWarehouseCode:""
fromWarehouseCode: ""
}
},
@ -287,14 +288,13 @@
this.toLocationInfo = location;
},
getScanResult(result, managementTypeParams) {
console.log(222,result)
this.fromWarehouseCode =result.fromWarehouseCode
this.managementType = managementTypeParams
if (this.showOnePop) {
if (this.isJustReplay) {
this.$refs.okToHoldRecordPackRef.itemCode = result.label.itemCode
this.$refs.okToHoldRecordPackRef.batch = result.label.batch
this.$refs.okToHoldRecordPackRef.uom = result.package.uom
this.$refs.okToHoldRecordPackRef.uom = result.balance?result.balance.uom:""
this.getResult = result //
this.$refs.scanPopup.closeScanPopup()
} else {
@ -323,32 +323,17 @@
this.$refs.comMessage.showErrorMessage('请输入数量');
return;
}
this.checkItemCode(obj.itemCode, callBack => {
if (callBack) {
if (checkDirectoryItemExist(this.itemCodeTypeList, callBack)) {
this.getResult = this.getResult ? this.getResult : {
label: {},
fromLocationCode: ''
}
this.getResult.fromLocationCode = obj.fromLocationCode
this.getResult.label.itemCode = obj.itemCode
this.getResult.label.batch = obj.batch
this.getResult.label.qty = obj.handleQty
this.isJustReplay = false
this.$refs.scanPopup.getScanResult(this.getResult, this.businessType)
} else {
var hint = getListItemTypeDesc(this.itemCodeTypeList);
this.showErrorMessage("扫描物料[" + obj.itemCode + "]是[" +
getItemTypeName(callBack) + "],需要的物料类型是[" + hint + "]")
}
} else {
this.showErrorMessage('未查找到物料【' + obj.itemCode + '】');
}
})
this.getResult = this.getResult ? this.getResult : {
label: {},
fromLocationCode: ''
}
this.getResult.fromLocationCode = obj.fromLocationCode
this.getResult.label.itemCode = obj.itemCode
this.getResult.label.batch = obj.batch
this.getResult.label.qty = obj.handleQty
this.isJustReplay = false
this.$refs.scanPopup.getScanResult(this.getResult, this.businessType)
},
//checkItemCode
@ -375,6 +360,10 @@
return true
},
clearFromLocationCode() {
this.$refs.okToHoldRecordPackRef.fromLocationCode = ''
},
getScanResultAfter(result) {
var balance = result.balance;
@ -545,10 +534,28 @@
if (fromWitch == 'fromLocationScanMsg') {
this.isClearFromLocationCode = false
this.$refs.scanFromLocationCode.getScanResult(result)
} else if (fromWitch == 'itemCodeScanMsg') {
} else if (fromWitch == 'itemCodeScan') {
result.fromLocationCode = this.fromLocationCode
result.label.itemCode = result.label.code
this.checkItemCode(result.label.itemCode, callBack => {
if (callBack) {
if (checkDirectoryItemExist(this.itemCodeTypeList, callBack)) {
this.$refs.scanPopup.getScanResult(result)
} else {
this.$refs.okToHoldRecordPackRef.itemCode = ''
var hint = getListItemTypeDesc(this.itemCodeTypeList);
this.showErrorMessage("扫描物料[" + result.label.itemCode + "]是[" +
getItemTypeName(callBack) + "],需要的物料类型是[" + hint + "]")
}
} else {
this.$refs.okToHoldRecordPackRef.itemCode = ''
this.showErrorMessage('未查找到物料【' + result.label.itemCode + '】');
}
})
this.$refs.scanPopup.getScanResult(result)
console.log(result)
}
},
//

195
src/pages/inventoryMove/coms/okToHoldRecordPack.vue

@ -1,53 +1,59 @@
<template>
<view class="">
<u-popup v-model="showOne" mode="bottom" border-radius="14" z-index='12'>
<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>
<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"></u-input>
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="fromLocationCode=''" v-if="fromLocationCode"></u-icon>
<u-input v-model="fromLocationCode" @confirm="fromLocationScanMsg" @blur="fromLocationScanMsg"
></u-input>
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="fromLocationCode=''"
v-if="fromLocationCode"></u-icon>
</view>
<view class="searchIcon">
<image src="/static/search.svg" mode="" @click="fromLocationClick"/>
<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"></u-input>
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="itemCode=''" v-if="itemCode"></u-icon>
<u-input v-model="itemCode" @confirm="itemCodeScanMsg" @blur="itemCodeScanMsg"></u-input>
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="itemCode=''"
v-if="itemCode"></u-icon>
</view>
<view class="searchIcon">
<image src="/static/search.svg" mode="" @click="itemCodeClick"/>
<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 = ''" v-if="batch"></u-icon>
<u-icon name="close-circle-fill" color="#acacac" size="36" @click="batch = ''"
v-if="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" ></u-number-box>
<u-number-box v-model="handleQty"></u-number-box>
<uom :uom="uom"></uom>
</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>
<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="clickConfirm">确认</button>
</view>
</u-popup>
<!-- <win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getFromLocation'
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> -->
<comMessage ref="comMessage"></comMessage>
@ -59,30 +65,36 @@
import {
getBusinessType
} from '@/common/record.js';
import {
getLabelInfo
} from '../../../common/label.js';
import uom from '@/mycomponents/qty/uom.vue'
import {
getBasicLocationByCode,
} from '@/api/request2.js';
import uom from '@/mycomponents/qty/uom.vue'
export default {
components: {
winScanLocation,
uom
},
emits: ["showFromLocationPopup",'itemCodeClick','confirm','getInputMsgResult','clearFromLocationCode','clickBtnClearItemCode'],
emits: ["showFromLocationPopup", 'itemCodeClick', 'onConfirm', 'getInputMsgResult', 'clearFromLocationCode',
'clickBtnClearItemCode'
],
data() {
return {
handleQty:0,
fromLocationCode:'',
itemCode:'',
batch:'',
showOne:false,
isFromLocationFocus:false,
uom:""
handleQty: 0,
fromLocationCode: '',
itemCode: '',
batch: '',
showOne: false,
isFromLocationFocus: false,
uom: ""
}
},
props: {
@ -92,33 +104,32 @@ import uom from '@/mycomponents/qty/uom.vue'
default: false
},
},
mounted() {
},
mounted() {},
methods: {
//
fromLocationClick(){
fromLocationClick() {
// this.$refs.scanLocationCode.openScanPopup()
this.$emit("showFromLocationPopup");
},
//
itemCodeClick(){
itemCodeClick() {
// this.$refs.scanLocationCode.openScanPopup()
if(!this.fromLocationCode){
if (!this.fromLocationCode) {
this.$refs.comMessage.showMessage("请先扫描来源库位")
return
}
this.$emit("itemCodeClick");
},
confirm(){
clickConfirm() {
// this.$refs.scanLocationCode.openScanPopup()
let obj = {
fromLocationCode:this.fromLocationCode,
itemCode:this.itemCode,
batch:this.batch,
handleQty:this.handleQty,
fromLocationCode: this.fromLocationCode,
itemCode: this.itemCode,
batch: this.batch,
handleQty: this.handleQty,
}
this.$emit("confirm",obj);
this.$emit("onConfirm", obj);
// if(!obj.fromLocationCode){
// this.$refs.comMessage.showErrorMessage('');
// return;
@ -131,26 +142,32 @@ import uom from '@/mycomponents/qty/uom.vue'
// this.$refs.comMessage.showErrorMessage('');
// return;
// }
},
fromLocationScanMsg(){
if (this.fromLocationCode) {
this.scanMsg = this.fromLocationCode
this.fromWitch = 'fromLocationScanMsg'
this.isFromLocationFocus = false
this.handelScanMsg()
}
fromLocationScanMsg() {
setTimeout(() => {
if (this.fromLocationCode) {
this.scanMsg = this.fromLocationCode
this.fromWitch = 'fromLocationScanMsg'
this.isFromLocationFocus = false
this.handelScanMsg()
}
}, 500);
},
itemCodeScanMsg(){
if (this.itemCode) {
if(!this.fromLocationCode){
this.$refs.comMessage.showMessage("请先扫描来源库位")
return
}
this.fromWitch = 'itemCodeScanMsg'
this.scanMsg = this.itemCode
this.handelScanMsg()
}
itemCodeScanMsg() {
setTimeout(() => {
if (this.itemCode) {
if (!this.fromLocationCode) {
this.$refs.comMessage.showMessage("请先扫描来源库位")
return
}
this.fromWitch = 'itemCodeScan'
this.scanMsg = this.itemCode
this.handelScanMsg()
}
}, 500);
},
handelScanMsg() {
//
@ -159,7 +176,7 @@ import uom from '@/mycomponents/qty/uom.vue'
// mask: true
// })
let that = this;
console.log(777,that.scanMsg)
console.log(777, that.scanMsg)
// if(index==-1){
// that.scanMsg =that.scanMsg + "\n";
// }
@ -179,11 +196,11 @@ import uom from '@/mycomponents/qty/uom.vue'
})
return;
}
if (that.isShowHistory) {
that.scanList.unshift(content);
}
getLabelInfo(content, this.headerType, callback => {
// uni.hideLoading();
let scanResult = callback;
@ -191,7 +208,7 @@ import uom from '@/mycomponents/qty/uom.vue'
if (scanResult.success) {
// that.getfocus();//
console.log(scanResult)
that.$emit("getInputMsgResult", scanResult,this.fromWitch);
that.$emit("getInputMsgResult", scanResult, this.fromWitch);
} else {
that.losefocus();
this.$refs.comMessage.showErrorMessage(scanResult.message, res => {
@ -210,50 +227,56 @@ import uom from '@/mycomponents/qty/uom.vue'
that.boxfocus = false;
});
},
clickBtnClearFromLocation(){
clickBtnClearFromLocation() {
this.$emit("clickBtnClearFromLocation");
},
clickBtnClearItemCode(){
clickBtnClearItemCode() {
this.$emit("clickBtnClearItemCode");
},
},
watch: {
}
}
</script>
<style lang="scss">
.title{
padding:30rpx 20rpx;
.title {
padding: 30rpx 20rpx;
display: flex;
border-bottom:1px solid rgba(230, 230, 230, 1);
.title-txt{
flex:1;
border-bottom: 1px solid rgba(230, 230, 230, 1);
.title-txt {
flex: 1;
font-weight: bold;
font-size: 32rpx;
}
}
.select{
.select {
display: flex;
}
.border{
border:1px solid rgba(230, 230, 230, 1)
.border {
border: 1px solid rgba(230, 230, 230, 1)
}
::v-deep .u-input__right-icon__clear{
::v-deep .u-input__right-icon__clear {
display: flex;
align-items: center;
justify-content: center;
color: #a7a7a7;
}
.item{
.item {
display: flex;
align-items: center;
padding: 20rpx;
border-bottom: 1px solid #dedede;
.value{
flex:1;
.value {
flex: 1;
width: 0px;
height: 80rpx;
border: 1px solid #dedede;
@ -262,25 +285,29 @@ import uom from '@/mycomponents/qty/uom.vue'
font-size: 32rpx;
padding: 0px 20rpx;
}
.value1{
flex:1;
.value1 {
flex: 1;
width: 0px;
height: 80rpx;
display: flex;
align-items: center;
font-size: 32rpx;
}
.searchIcon{
.searchIcon {
width: 40rpx;
margin-left: 20rpx;
image{
image {
width: 40rpx;
height:40rpx
height: 40rpx
}
}
.uom{
.uom {
margin-left: 10rpx;
}
}
</style>
Loading…
Cancel
Save