niexiting
7 months ago
84 changed files with 2103 additions and 1042 deletions
@ -1,468 +1,522 @@ |
|||||
<template> |
<template> |
||||
<view> |
<view> |
||||
<uni-popup ref="popup" @change="change" :mask-click="false"> |
<uni-popup ref="popup" @change="change" :mask-click="false" > |
||||
<view class="popup_box"> |
<view class="popup_box"> |
||||
<view class="pop_title uni-flex space-between"> |
<view class="pop_title uni-flex space-between"> |
||||
<view class="" style="font-size: 35rpx;"> |
<view class="" style="font-size: 35rpx;"> |
||||
扫描{{title}} |
扫描{{title}} |
||||
</view> |
</view> |
||||
|
|
||||
<view class=""> |
<view class=""> |
||||
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg" |
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg" |
||||
@click="closeScanPopup()"></image> |
@click="closeScanPopup()"></image> |
||||
</view> |
</view> |
||||
</view> |
</view> |
||||
<view class="uni-flex uni-row" style="align-items: center; |
<view class="uni-flex uni-row" style="align-items: center; |
||||
background-color: #fff; |
background-color: #fff; |
||||
margin-left: 20rpx; |
margin-left: 20rpx; |
||||
margin-right: 20rpx; |
margin-right: 20rpx; |
||||
border-radius: 8rpx; |
border-radius: 8rpx; |
||||
height: 30px;"> |
height: 30px;"> |
||||
<view class="uni-center" style="width: 25%; "> |
<view class="uni-center" style="width: 25%; "> |
||||
来源库位 |
来源库位 |
||||
</view> |
</view> |
||||
<!-- style="width: 75%;padding: 8rpx" --> |
<!-- style="width: 75%;padding: 8rpx" --> |
||||
<view class=""> |
<view class=""> |
||||
<!-- <input v-model="fromLocationCode" placeholder="请扫描来源库位" :focus="locationOnFocus" |
<!-- <input v-model="fromLocationCode" placeholder="请扫描来源库位" :focus="locationOnFocus" |
||||
placeholder-style="font-size:12px" style="padding: 5px;" @confirm="scanLocation" /> --> |
placeholder-style="font-size:12px" style="padding: 5px;" @confirm="scanLocation" /> --> |
||||
|
|
||||
<view v-if='allowModifyLocation'> |
<view v-if='allowModifyLocation'> |
||||
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位" |
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位" |
||||
@confirm="" style='height: 30rpx;border:1px solid #fff ;'></uni-combox> |
@confirm="handleConfirm" style='height: 30rpx;border:1px solid #fff ;'></uni-combox> |
||||
</view> |
</view> |
||||
<view v-else> |
<view v-else> |
||||
<text style="padding: 5px"> |
<text style="padding: 5px"> |
||||
{{fromLocationCode}} |
{{fromLocationCode}} |
||||
</text> |
</text> |
||||
</view> |
</view> |
||||
</view> |
</view> |
||||
</view> |
</view> |
||||
<view class=""> |
<view class=""> |
||||
<view class=""> |
<view class=""> |
||||
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" |
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" |
||||
:isShowHistory="isShowHistory" :clearResult="true" :headerType="headerType"></win-com-scan> |
:isShowHistory="isShowHistory" :clearResult="true" :headerType="headerType"></win-com-scan> |
||||
</view> |
</view> |
||||
</view> |
</view> |
||||
</view> |
</view> |
||||
</uni-popup> |
</uni-popup> |
||||
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> |
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> |
||||
</view> |
<!-- 模拟扫描功能 --> |
||||
<comMessage ref="comMessage"></comMessage> |
<win-com-scan v-show="false" ref="comscansimulate" @getResult="getScanResult" :headerType="headerType" |
||||
</template> |
:isShowHistory="false" :clearResult="true"></win-com-scan> |
||||
|
|
||||
<script> |
</view> |
||||
import winComScan from '@/mycomponents/scan/winComScan.vue' |
<comMessage ref="comMessage"></comMessage> |
||||
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
</template> |
||||
import { |
|
||||
getBalanceByManagementPrecision, |
<script> |
||||
} from '@/common/balance.js'; |
import winComScan from '@/mycomponents/scan/winComScan.vue' |
||||
|
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
||||
import { |
import { |
||||
getBasicLocationByCode, |
getBalanceByManagementPrecisionByPacking, |
||||
} from '@/api/request2.js'; |
} from '@/common/balance.js'; |
||||
|
|
||||
import { |
import { |
||||
getListLocationAreaTypeDesc, |
getBasicLocationByCode, |
||||
checkDirectoryItemExist, |
} from '@/api/request2.js'; |
||||
getDirectoryItemArray, |
|
||||
getLocationAreaTypeName, |
import { |
||||
getInventoryStatusDesc |
getListLocationAreaTypeDesc, |
||||
} from '@/common/directory.js'; |
checkDirectoryItemExist, |
||||
export default { |
getDirectoryItemArray, |
||||
name: 'winScanPack', |
getLocationAreaTypeName, |
||||
emits: ["getResult", "close", "getCountScanResult"], |
getInventoryStatusDesc |
||||
components: { |
} from '@/common/directory.js'; |
||||
winComScan, |
export default { |
||||
balanceSelect |
name: 'winScanPack', |
||||
}, |
emits: ["getResult", "close", "getCountScanResult", "confirm"], |
||||
props: { |
components: { |
||||
title: { |
winComScan, |
||||
type: String, |
balanceSelect |
||||
default: '箱标签' |
}, |
||||
}, |
props: { |
||||
isShowHistory: { |
title: { |
||||
type: Boolean, |
type: String, |
||||
default: true |
default: '箱标签' |
||||
}, |
}, |
||||
allowNullBalance: { |
isShowHistory: { |
||||
type: Boolean, |
type: Boolean, |
||||
default: false |
default: true |
||||
}, |
}, |
||||
//不提示库存错误 |
allowNullBalance: { |
||||
noShowBalanceMessage: { |
type: Boolean, |
||||
type: Boolean, |
default: false |
||||
default: false |
}, |
||||
}, |
//不提示库存错误 |
||||
//是否允许修改库位 |
noShowBalanceMessage: { |
||||
allowModifyLocation: { |
type: Boolean, |
||||
type: Boolean, |
default: false |
||||
default: true |
}, |
||||
}, |
//是否允许修改库位 |
||||
headerType: { |
allowModifyLocation: { |
||||
type: String, |
type: Boolean, |
||||
default: "HPQ,HMQ" |
default: true |
||||
}, |
}, |
||||
queryBalance: { |
headerType: { |
||||
type: Boolean, |
type: String, |
||||
default: true |
default: "HPQ,HMQ" |
||||
}, |
}, |
||||
balanceFromInventoryStatuses:{//是否传fromInventoryStatuses |
queryBalance: { |
||||
type: Boolean, |
type: Boolean, |
||||
default: true |
default: true |
||||
} |
}, |
||||
}, |
balanceFromInventoryStatuses: { //是否传fromInventoryStatuses |
||||
data() { |
type: Boolean, |
||||
return { |
default: true |
||||
scanResult: {}, |
} |
||||
show: false, |
}, |
||||
scanList: [], |
data() { |
||||
expand: false, |
return { |
||||
showScanResult: {}, |
scanResult: {}, |
||||
expendIcon: 'arrow-down', |
show: false, |
||||
fromLocationCode: '', |
scanList: [], |
||||
fromLocation: '', |
expand: false, |
||||
fromLocationList: [], |
showScanResult: {}, |
||||
fromLocationAreaTypeList: [], |
expendIcon: 'arrow-down', |
||||
locationOnFocus: false, |
fromLocationCode: '', |
||||
businessType: {}, |
fromLocation: '', |
||||
inventoryStatus: [], |
fromLocationList: [], |
||||
managementPrecision: '', |
fromLocationAreaTypeList: [], |
||||
fromInventoryStatuses: "", |
locationOnFocus: false, |
||||
isCheck: false |
businessType: {}, |
||||
} |
inventoryStatus: [], |
||||
}, |
managementPrecision: '', |
||||
created() { |
fromInventoryStatuses: "", |
||||
|
isCheck: false, |
||||
}, |
} |
||||
methods: { |
}, |
||||
//直接扫描 |
created() { |
||||
openScanPopupForType(fromLocationCode, businessType) { |
|
||||
this.businessType = businessType; |
}, |
||||
this.fromLocationCode = fromLocationCode; |
methods: { |
||||
if (fromLocationCode != '') { |
|
||||
this.packGetFocus(); |
handleConfirm() { |
||||
} else { |
this.$emit('confirm', this.fromLocationCode) |
||||
this.locationGetFocus(); |
}, |
||||
} |
//直接扫描 |
||||
this.fromInventoryStatuses = getDirectoryItemArray(this.businessType.outInventoryStatuses) |
openScanPopupForType(fromLocationCode, businessType) { |
||||
this.inventoryStatus = getDirectoryItemArray(this.businessType.outInventoryStatuses); //出库库存状态 |
|
||||
this.fromLocationAreaTypeList = getDirectoryItemArray(this.businessType.fromLocationAreaTypeList); //出库库区 |
this.businessType = businessType; |
||||
setTimeout(res => { |
this.fromLocationCode = fromLocationCode; |
||||
this.$refs.popup.open('bottom') |
if (fromLocationCode != '') { |
||||
}, 500) |
this.packGetFocus(); |
||||
}, |
} else { |
||||
|
this.locationGetFocus(); |
||||
//在任务中扫描 |
} |
||||
openScanPopupForJob(fromLocationCode, fromLocationList, jobContent) { |
this.fromInventoryStatuses = getDirectoryItemArray(this.businessType.outInventoryStatuses) |
||||
this.fromLocationCode = fromLocationCode; |
this.inventoryStatus = getDirectoryItemArray(this.businessType.outInventoryStatuses); //出库库存状态 |
||||
this.fromLocationList = fromLocationList; |
this.fromLocationAreaTypeList = getDirectoryItemArray(this.businessType.fromLocationAreaTypeList); //出库库区 |
||||
if (fromLocationCode != '') { |
if (!this.show) { |
||||
this.packGetFocus(); |
setTimeout(res => { |
||||
} else { |
this.$refs.popup.open('bottom') |
||||
if (this.fromLocationList.length == 0) { |
}, 500) |
||||
this.locationGetFocus(); |
} |
||||
} else { |
}, |
||||
this.fromLocationCode = this.fromLocationList[0]; |
|
||||
} |
//在任务中扫描 |
||||
} |
openScanPopupForJob(fromLocationCode, fromLocationList, jobContent) { |
||||
setTimeout(res => { |
this.fromLocationCode = fromLocationCode; |
||||
this.$refs.popup.open('bottom') |
this.fromLocationList = fromLocationList; |
||||
}, 500) |
if (fromLocationCode != '') { |
||||
this.fromInventoryStatuses = getDirectoryItemArray(jobContent.outInventoryStatuses) |
this.packGetFocus(); |
||||
this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //出库库存状态; //出库库存状态 |
} else { |
||||
this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //出库库存状态 |
if (this.fromLocationList.length == 0) { |
||||
}, |
this.locationGetFocus(); |
||||
|
} else { |
||||
closeScanPopup(content) { |
this.fromLocationCode = this.fromLocationList[0]; |
||||
this.$refs.popup.close(); |
} |
||||
this.$emit("close", ''); |
} |
||||
}, |
setTimeout(res => { |
||||
|
this.$refs.popup.open('bottom') |
||||
|
}, 500) |
||||
scanLocation(scanResult) { |
this.fromInventoryStatuses = getDirectoryItemArray(jobContent.outInventoryStatuses) |
||||
var isCheck = false; |
this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //出库库存状态; //出库库存状态 |
||||
if (this.fromLocationCode == '') { |
this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //出库库存状态 |
||||
this.showErrorMessage('来源库位不能为空', callback => { |
}, |
||||
this.locationGetFocus(); |
//模拟扫描 |
||||
}) |
openScanPopupForJobSimulate(fromLocationCode, fromLocationList, jobContent, item) { |
||||
return; |
this.fromLocationCode = fromLocationCode; |
||||
} |
this.fromLocationList = fromLocationList; |
||||
|
if (fromLocationCode != '') { |
||||
if (this.fromLocationList.length > 0) { |
// this.packGetFocus(); |
||||
if (!this.isInLocationList(this.fromLocationCode)) { |
if (this.$refs.comscansimulate != undefined) { |
||||
this.showErrorMessage("扫描库位【" + this.fromLocationCode + '】不在任务来源库位中', callback => { |
this.$refs.comscansimulate.getfocus(); |
||||
this.locationGetFocus(); |
} |
||||
}) |
|
||||
return; |
} else { |
||||
} |
if (this.fromLocationList.length == 0) { |
||||
} |
// this.locationGetFocus(); |
||||
|
alert('没有来源库位:List') |
||||
uni.showLoading({ |
} else { |
||||
title: '扫描中...', |
this.fromLocationCode = this.fromLocationList[0]; |
||||
mask: true |
} |
||||
}); |
} |
||||
getBasicLocationByCode(this.fromLocationCode).then(res => { |
|
||||
uni.hideLoading(); |
this.fromInventoryStatuses = getDirectoryItemArray(jobContent.outInventoryStatuses) |
||||
if (res.data.total > 0) { |
this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //出库库存状态; //出库库存状态 |
||||
let result = res.data.list[0]; |
this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //出库库存状态 |
||||
var type = result.areaType; |
let timer = setTimeout(res => { |
||||
var available = result.available; |
if (timer) { |
||||
if (available == "TRUE") { |
clearTimeout(timer) |
||||
if (checkDirectoryItemExist(this.fromLocationAreaTypeList, type)) { |
} |
||||
this.location = result; |
this.$refs.comscansimulate.setItemCodeSimulate(item.copyContent) |
||||
// this.packGetFocus(); |
this.$refs.comscansimulate.clickScanMsg(); |
||||
this.checkPackage(scanResult); |
}, 500) |
||||
} else { |
|
||||
var hint = getListLocationAreaTypeDesc(this.fromLocationAreaTypeList); |
|
||||
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]是[" + |
}, |
||||
getLocationAreaTypeName(result.areaType) + "],需要的库区是[" + hint + "]") |
|
||||
} |
closeScanPopup(content) { |
||||
} else { |
this.$refs.popup.close(); |
||||
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => { |
this.$emit("close", ''); |
||||
this.locationGetFocus(); |
}, |
||||
}) |
|
||||
} |
|
||||
} else { |
scanLocation(scanResult) { |
||||
uni.hideLoading(); |
var isCheck = false; |
||||
this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']', res => { |
if (this.fromLocationCode == '') { |
||||
this.locationGetFocus(); |
this.showErrorMessage('来源库位不能为空', callback => { |
||||
}) |
this.locationGetFocus(); |
||||
} |
}) |
||||
}).catch(error => { |
return; |
||||
uni.hideLoading(); |
} |
||||
this.showErrorMessage(error, res => { |
|
||||
this.locationGetFocus(); |
if (this.fromLocationList.length > 0) { |
||||
}) |
if (!this.isInLocationList(this.fromLocationCode)) { |
||||
}) |
this.showErrorMessage("扫描库位【" + this.fromLocationCode + '】不在任务来源库位中', callback => { |
||||
}, |
this.locationGetFocus(); |
||||
|
}) |
||||
getScanResult(result) { |
return; |
||||
// console.log("扫描", result) |
} |
||||
// if (this.fromLocationCode == '' || this.fromLocationCode == null) { |
} |
||||
// this.showMessage('请先扫描来源库位', callback => { |
|
||||
// this.locationGetFocus(); |
uni.showLoading({ |
||||
// }) |
title: '扫描中...', |
||||
// return; |
mask: true |
||||
// } else |
}); |
||||
this.scanLocation(result); |
getBasicLocationByCode(this.fromLocationCode).then(res => { |
||||
// debugger |
if (res.data.total > 0) { |
||||
// if(this.isCheck){ |
let result = res.data.list[0]; |
||||
// this.checkPackage(result); |
if(result.code!=this.fromLocationCode){ |
||||
// } |
this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']') |
||||
}, |
return; |
||||
|
} |
||||
checkPackage(result) { |
var type = result.areaType; |
||||
if (result.label != null) { |
var available = result.available; |
||||
this.scanResult = result; |
if (available == "TRUE") { |
||||
if (this.queryBalance == true) { |
if (checkDirectoryItemExist(this.fromLocationAreaTypeList, type)) { |
||||
// uni.showLoading({ |
this.location = result; |
||||
// title: '查询中...', |
// this.packGetFocus(); |
||||
// mask: true |
this.checkPackage(scanResult); |
||||
// }) |
} else { |
||||
// 采购上架任务--大哥让去掉 fromInventoryStatuses |
uni.hideLoading(); |
||||
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.balanceFromInventoryStatuses?this.fromInventoryStatuses:undefined, |
var hint = getListLocationAreaTypeDesc(this.fromLocationAreaTypeList); |
||||
res => { |
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]是[" + |
||||
uni.hideLoading(); |
getLocationAreaTypeName(result.areaType) + "],需要的库区是[" + hint + "]") |
||||
if (res.success) { |
} |
||||
this.managementPrecision = res.managementPrecision |
} else { |
||||
this.afterQueryBalance(res.data.list); |
uni.hideLoading(); |
||||
} else { |
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => { |
||||
this.showErrorMessage(res.message, res => { |
this.locationGetFocus(); |
||||
this.packGetFocus(); |
}) |
||||
}) |
} |
||||
} |
} else { |
||||
// uni.hideLoading(); |
uni.hideLoading(); |
||||
}); |
this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']', res => { |
||||
} else { |
this.locationGetFocus(); |
||||
this.packCallBack(null); |
}) |
||||
} |
} |
||||
} |
}).catch(error => { |
||||
}, |
uni.hideLoading(); |
||||
|
this.showErrorMessage(error, res => { |
||||
|
this.locationGetFocus(); |
||||
afterQueryBalance(datas) { |
}) |
||||
if (this.allowNullBalance) { |
}) |
||||
this.allowNoneBalance(datas); |
}, |
||||
} else if (this.noShowBalanceMessage) { |
|
||||
if(Array.isArray(datas)){ |
getScanResult(result) { |
||||
this.countCallBack(datas[0]); |
// console.log("扫描", result) |
||||
}else{ |
// if (this.fromLocationCode == '' || this.fromLocationCode == null) { |
||||
this.countCallBack(datas); |
// this.showMessage('请先扫描来源库位', callback => { |
||||
} |
// this.locationGetFocus(); |
||||
} else { |
// }) |
||||
this.mustHavaBalance(datas); |
// return; |
||||
} |
// } else |
||||
uni.hideLoading(); |
this.scanLocation(result); |
||||
}, |
// debugger |
||||
|
// if(this.isCheck){ |
||||
//允许无库存 |
// this.checkPackage(result); |
||||
allowNoneBalance(datas) { |
// } |
||||
if (datas.length == 0) { |
}, |
||||
this.packCallBack(null); |
|
||||
} else { |
checkPackage(result) { |
||||
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],已经查找到该包装的库存记录,请重新扫描', res => { |
if (result.label != null) { |
||||
this.packGetFocus(); |
this.scanResult = result; |
||||
}) |
if (this.queryBalance == true) { |
||||
} |
// uni.showLoading({ |
||||
}, |
// title: '查询中...', |
||||
|
// mask: true |
||||
//必须有库存 |
// }) |
||||
mustHavaBalance(datas) { |
// 采购上架任务--大哥让去掉 fromInventoryStatuses |
||||
if (datas.length == 0) { |
getBalanceByManagementPrecisionByPacking(result.label,result.package, this.fromLocationCode, this |
||||
this.showErrorMessage(this.getQueryCondition() + '<br>未查找到库存记录', res => { |
.balanceFromInventoryStatuses ? this.fromInventoryStatuses : undefined, |
||||
this.packGetFocus(); |
res => { |
||||
}) |
uni.hideLoading(); |
||||
} else if (datas.length == 1) { |
if (res.success) { |
||||
let balance = datas[0]; |
this.managementPrecision = res.managementPrecision |
||||
this.packCallBack(balance); |
this.afterQueryBalance(res.data.list); |
||||
|
} else { |
||||
//因为盘点时有负库存,暂时去掉判断 2023年12月28日 |
this.showErrorMessage(res.message, res => { |
||||
|
this.packGetFocus(); |
||||
// if (balance.qty > 0) { |
}) |
||||
// this.packCallBack(balance); |
} |
||||
// } else { |
// uni.hideLoading(); |
||||
// this.showErrorMessage(this.getQueryCondition() + '<br>查找到库存记录数量为[' + balance.qty + "],<br>不可以进行操作", |
}); |
||||
// res => { |
} else { |
||||
// this.packGetFocus(); |
uni.hideLoading(); |
||||
// }) |
this.packCallBack(null); |
||||
// } |
} |
||||
} else { |
} |
||||
this.showBalanceSelect(datas); |
}, |
||||
} |
|
||||
}, |
|
||||
|
afterQueryBalance(datas) { |
||||
showBalanceSelect(items) { |
if (this.allowNullBalance) { |
||||
this.$refs.balanceSelect.openPopup(items); |
this.allowNoneBalance(datas); |
||||
}, |
} else if (this.noShowBalanceMessage) { |
||||
|
if (Array.isArray(datas)) { |
||||
selectBalanceItem(balance) { |
this.countCallBack(datas[0]); |
||||
this.packCallBack(balance); |
} else { |
||||
//因为盘点时有负库存,暂时去掉判断 2023年12月28日 |
this.countCallBack(datas); |
||||
// if (balance.qty > 0) { |
} |
||||
// this.packCallBack(balance); |
} else { |
||||
// } else { |
this.mustHavaBalance(datas); |
||||
// this.showErrorMessage(this.getQueryCondition() + '<br>查找到库存记录数量为[' + balance.qty + "],不可以进行操作", |
} |
||||
// res => { |
uni.hideLoading(); |
||||
// this.packGetFocus(); |
}, |
||||
// }) |
|
||||
// } |
//允许无库存 |
||||
}, |
allowNoneBalance(datas) { |
||||
|
if (datas.length == 0) { |
||||
//盘点回调 |
this.packCallBack(null); |
||||
countCallBack(datas) { |
} else { |
||||
this.$refs.comscan.clear(); |
this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],已经查找到该包装的库存记录,请重新扫描', res => { |
||||
//返回标签信息、库存信息和管理模式 |
this.packGetFocus(); |
||||
let data = { |
}) |
||||
label: this.scanResult.label, |
} |
||||
package: this.scanResult.package, |
}, |
||||
balance: datas, |
|
||||
fromLocationCode: this.fromLocationCode, |
//必须有库存 |
||||
} |
mustHavaBalance(datas) { |
||||
this.packGetFocus(); |
if (datas.length == 0) { |
||||
this.$emit("getResult", data); |
this.showErrorMessage(this.getQueryCondition() + '<br>未查找到库存记录', res => { |
||||
this.$emit("getCountScanResult", data); |
this.packGetFocus(); |
||||
}, |
}) |
||||
|
} else if (datas.length == 1) { |
||||
packCallBack(item) { |
let balance = datas[0]; |
||||
this.$refs.comscan.clear(); |
this.packCallBack(balance); |
||||
//返回标签信息、库存信息和管理模式 |
|
||||
let data = { |
//因为盘点时有负库存,暂时去掉判断 2023年12月28日 |
||||
label: this.scanResult.label, |
|
||||
package: this.scanResult.package, |
// if (balance.qty > 0) { |
||||
balance: item, |
// this.packCallBack(balance); |
||||
fromLocationCode: this.fromLocationCode, |
// } else { |
||||
} |
// this.showErrorMessage(this.getQueryCondition() + '<br>查找到库存记录数量为[' + balance.qty + "],<br>不可以进行操作", |
||||
this.packGetFocus(); |
// res => { |
||||
this.$emit("getResult", data); |
// this.packGetFocus(); |
||||
}, |
// }) |
||||
|
// } |
||||
packGetFocus() { |
} else { |
||||
if (this.$refs.comscan != undefined) { |
this.showBalanceSelect(datas); |
||||
this.$refs.comscan.getfocus(); |
} |
||||
} |
}, |
||||
}, |
|
||||
|
showBalanceSelect(items) { |
||||
packLoseFocus() { |
this.$refs.balanceSelect.openPopup(items); |
||||
if (this.$refs.comscan != undefined) { |
}, |
||||
this.$refs.comscan.losefocus(); |
|
||||
} |
selectBalanceItem(balance) { |
||||
}, |
this.packCallBack(balance); |
||||
|
//因为盘点时有负库存,暂时去掉判断 2023年12月28日 |
||||
locationGetFocus() { |
// if (balance.qty > 0) { |
||||
this.fromLocationCode = ''; |
// this.packCallBack(balance); |
||||
this.locationOnFocus = true; |
// } else { |
||||
}, |
// this.showErrorMessage(this.getQueryCondition() + '<br>查找到库存记录数量为[' + balance.qty + "],不可以进行操作", |
||||
|
// res => { |
||||
getQueryCondition() { |
// this.packGetFocus(); |
||||
let condition = '按照以下条件:<br>'; |
// }) |
||||
let label = this.scanResult.label; |
// } |
||||
let status = getInventoryStatusDesc(this.inventoryStatus); |
}, |
||||
switch (this.managementPrecision) { |
|
||||
case 'BY_PACKAGING': |
//盘点回调 |
||||
condition = condition + '物料号=[' + label.itemCode + ']<br>箱码=[' + label.packingNumber + |
countCallBack(datas) { |
||||
']<br>批次=[' + |
if (this.$refs.comscan) { |
||||
label.batch + |
this.$refs.comscan.clear(); |
||||
']<br>库位=[' + this.fromLocationCode + ']' |
} |
||||
|
//返回标签信息、库存信息和管理模式 |
||||
break; |
let data = { |
||||
case 'BY_BATCH': |
label: this.scanResult.label, |
||||
condition = condition + '物料号=[' + label.itemCode + ']<br>批次=[' + |
package: this.scanResult.package, |
||||
label.batch + |
balance: datas, |
||||
']<br>库位=[' + this.fromLocationCode + ']' |
fromLocationCode: this.fromLocationCode, |
||||
break; |
} |
||||
case 'BY_QUANTITY': |
this.packGetFocus(); |
||||
condition = condition + '物料号=[' + label.itemCode + ']<br>库位=[' + this.fromLocationCode + ']' |
this.$emit("getResult", data); |
||||
break; |
this.$emit("getCountScanResult", data); |
||||
case 'BY_UNIQUEID': |
}, |
||||
condition = condition + '物料号=[' + label.itemCode + ']' |
|
||||
break; |
packCallBack(item) { |
||||
} |
if (this.$refs.comscan) { |
||||
if (this.inventoryStatus.length > 0) { |
this.$refs.comscan.clear(); |
||||
condition = condition + '<br>库存状态=[' + status + ']' |
} |
||||
} |
//返回标签信息、库存信息和管理模式 |
||||
return condition; |
let data = { |
||||
}, |
label: this.scanResult.label, |
||||
|
package: this.scanResult.package, |
||||
|
balance: item, |
||||
showMessage(message, callback) { |
fromLocationCode: this.fromLocationCode, |
||||
setTimeout(r => { |
} |
||||
this.packLoseFocus(); |
this.packGetFocus(); |
||||
this.$refs.comMessage.showMessage(message, callback); |
this.$emit("getResult", data); |
||||
}) |
}, |
||||
}, |
|
||||
|
packGetFocus() { |
||||
showErrorMessage(message, callback) { |
if (this.$refs.comscan != undefined) { |
||||
setTimeout(r => { |
this.$refs.comscan.getfocus(); |
||||
this.packLoseFocus(); |
} |
||||
this.$refs.comMessage.showErrorMessage(message, callback) |
}, |
||||
}) |
|
||||
}, |
packLoseFocus() { |
||||
|
if (this.$refs.comscan != undefined) { |
||||
change(e) { |
this.$refs.comscan.losefocus(); |
||||
this.show = e.show |
} |
||||
}, |
}, |
||||
isInLocationList(location) { |
|
||||
|
locationGetFocus() { |
||||
var item = this.fromLocationList.find(res => res == location) |
this.fromLocationCode = ''; |
||||
|
this.locationOnFocus = true; |
||||
if (item = undefined) { |
}, |
||||
return false |
|
||||
} |
getQueryCondition() { |
||||
return true |
let condition = '按照以下条件:<br>'; |
||||
}, |
let label = this.scanResult.label; |
||||
addLocationCode(code) { |
let status = getInventoryStatusDesc(this.inventoryStatus); |
||||
if (!this.isInLocationList(code)) { |
switch (this.managementPrecision) { |
||||
this.fromLocationList.push(code) |
case 'BY_PACKAGING': |
||||
} |
condition = condition + '物料号=[' + label.itemCode + ']<br>箱码=[' + label.packingNumber + |
||||
} |
']<br>批次=[' + |
||||
} |
label.batch + |
||||
} |
']<br>库位=[' + this.fromLocationCode + ']' |
||||
</script> |
|
||||
|
break; |
||||
<style lang="scss"> |
case 'BY_BATCH': |
||||
.scroll-view { |
condition = condition + '物料号=[' + label.itemCode + ']<br>批次=[' + |
||||
overflow-y: scroll; |
label.batch + |
||||
height: auto; |
']<br>库位=[' + this.fromLocationCode + ']' |
||||
max-height: 300rpx; |
break; |
||||
} |
case 'BY_QUANTITY': |
||||
</style> |
condition = condition + '物料号=[' + label.itemCode + ']<br>库位=[' + this.fromLocationCode + ']' |
||||
|
break; |
||||
|
case 'BY_UNIQUEID': |
||||
|
condition = condition + '物料号=[' + label.itemCode + ']' |
||||
|
break; |
||||
|
} |
||||
|
if (this.inventoryStatus.length > 0) { |
||||
|
condition = condition + '<br>库存状态=[' + status + ']' |
||||
|
} |
||||
|
return condition; |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
showMessage(message, callback) { |
||||
|
setTimeout(r => { |
||||
|
this.packLoseFocus(); |
||||
|
this.$refs.comMessage.showMessage(message, callback); |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
showErrorMessage(message, callback) { |
||||
|
setTimeout(r => { |
||||
|
this.packLoseFocus(); |
||||
|
this.$refs.comMessage.showErrorMessage(message, callback) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
change(e) { |
||||
|
this.show = e.show |
||||
|
}, |
||||
|
isInLocationList(location) { |
||||
|
|
||||
|
var item = this.fromLocationList.find(res => res == location) |
||||
|
|
||||
|
if (item = undefined) { |
||||
|
return false |
||||
|
} |
||||
|
return true |
||||
|
}, |
||||
|
addLocationCode(code) { |
||||
|
if (!this.isInLocationList(code)) { |
||||
|
this.fromLocationList.push(code) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.scroll-view { |
||||
|
overflow-y: scroll; |
||||
|
height: auto; |
||||
|
max-height: 300rpx; |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue