Browse Source

修改物料隔离输入框焦点校验

intex
lijuncheng 2 days ago
parent
commit
6f8338ef7a
  1. 33
      src/pages/inventoryMove/coms/comMoveRecord.vue
  2. 137
      src/pages/inventoryMove/coms/okToHoldRecordPack.vue

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

@ -41,7 +41,8 @@
<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,7 +288,7 @@
this.toLocationInfo = location;
},
getScanResult(result, managementTypeParams) {
this.fromWarehouseCode =result.fromWarehouseCode
this.fromWarehouseCode = result.fromWarehouseCode
this.managementType = managementTypeParams
if (this.showOnePop) {
if (this.isJustReplay) {
@ -373,6 +374,10 @@
return true
},
clearFromLocationCode() {
this.$refs.okToHoldRecordPackRef.fromLocationCode = ''
},
getScanResultAfter(result) {
var balance = result.balance;
@ -543,9 +548,29 @@
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 + '】');
}
})
}
},
//

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

@ -10,40 +10,46 @@
<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_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>
@ -64,7 +70,11 @@
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'
@ -73,16 +83,18 @@ import uom from '@/mycomponents/qty/uom.vue'
winScanLocation,
uom
},
emits: ["showFromLocationPopup",'itemCodeClick','confirm','getInputMsgResult','clearFromLocationCode','clickBtnClearItemCode'],
emits: ["showFromLocationPopup", 'itemCodeClick', 'confirm', '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(){
confirm() {
// 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("confirm", obj);
// if(!obj.fromLocationCode){
// this.$refs.comMessage.showErrorMessage('');
// return;
@ -133,24 +144,30 @@ import uom from '@/mycomponents/qty/uom.vue'
// }
},
fromLocationScanMsg(){
fromLocationScanMsg() {
setTimeout(() => {
if (this.fromLocationCode) {
this.scanMsg = this.fromLocationCode
this.fromWitch = 'fromLocationScanMsg'
this.isFromLocationFocus = false
this.handelScanMsg()
}
}, 500);
},
itemCodeScanMsg(){
itemCodeScanMsg() {
setTimeout(() => {
if (this.itemCode) {
if(!this.fromLocationCode){
if (!this.fromLocationCode) {
this.$refs.comMessage.showMessage("请先扫描来源库位")
return
}
this.fromWitch = 'itemCodeScanMsg'
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";
// }
@ -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,10 +227,10 @@ import uom from '@/mycomponents/qty/uom.vue'
that.boxfocus = false;
});
},
clickBtnClearFromLocation(){
clickBtnClearFromLocation() {
this.$emit("clickBtnClearFromLocation");
},
clickBtnClearItemCode(){
clickBtnClearItemCode() {
this.$emit("clickBtnClearItemCode");
},
},
@ -224,36 +241,42 @@ import uom from '@/mycomponents/qty/uom.vue'
</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,23 +285,27 @@ 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;
}

Loading…
Cancel
Save