10 changed files with 2005 additions and 2 deletions
@ -0,0 +1,311 @@ |
|||
<template> |
|||
<view class="uni-combox" :class="border ? '' : 'uni-combox__no-border'"> |
|||
<view v-if="label" class="uni-combox__label" :style="labelStyle"> |
|||
<text>{{label}}</text> |
|||
</view> |
|||
<view class="uni-combox__input-box" :style="inputStyle"> |
|||
<input class="uni-combox__input " type="text" :placeholder="placeholder" |
|||
:disabled="inputDisabled" |
|||
placeholder-class="uni-combox__input-plac" v-model="inputVal" @input="onInput" @focus="onFocus" |
|||
@blur="onBlur" @confirm ="confirm"/> |
|||
<uni-icons :type="showSelector? 'top' : 'bottom'" size="14" color="#999" @click="toggleSelector"> |
|||
</uni-icons> |
|||
</view> |
|||
<view class="uni-combox__selector" v-if="showSelector"> |
|||
<view class="uni-popper__arrow"></view> |
|||
<scroll-view scroll-y="true" class="uni-combox__selector-scroll"> |
|||
<view class="uni-combox__selector-empty" v-if="filterCandidatesLength === 0"> |
|||
<text>{{emptyTips}}</text> |
|||
</view> |
|||
<view class="uni-combox__selector-item" v-for="(item,index) in filterCandidates" :key="index" |
|||
@click="onSelectorClick(index)"> |
|||
<view class=""> |
|||
<text>{{item}}</text> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
/** |
|||
* Combox 组合输入框 |
|||
* @description 组合输入框一般用于既可以输入也可以选择的场景 |
|||
* @tutorial https://ext.dcloud.net.cn/plugin?id=1261 |
|||
* @property {String} label 左侧文字 |
|||
* @property {String} labelWidth 左侧内容宽度 |
|||
* @property {String} placeholder 输入框占位符 |
|||
* @property {Array} candidates 候选项列表 |
|||
* @property {String} emptyTips 筛选结果为空时显示的文字 |
|||
* @property {String} value 组合框的值 |
|||
*/ |
|||
export default { |
|||
name: 'uniCombox', |
|||
emits: ['input', 'update:modelValue','confirm'], |
|||
props: { |
|||
border: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
label: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
labelWidth: { |
|||
type: String, |
|||
default: 'auto' |
|||
}, |
|||
inputWidth:{ |
|||
type: String, |
|||
default: 'auto' |
|||
}, |
|||
placeholder: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
candidates: { |
|||
type: Array, |
|||
default () { |
|||
return [] |
|||
} |
|||
}, |
|||
emptyTips: { |
|||
type: String, |
|||
default: '无匹配项' |
|||
}, |
|||
//true 不可点击,false 可以点击,默认可以点击 |
|||
inputDisabled: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
|
|||
// #ifndef VUE3 |
|||
value: { |
|||
type: [String, Number], |
|||
default: '' |
|||
}, |
|||
// #endif |
|||
// #ifdef VUE3 |
|||
modelValue: { |
|||
type: [String, Number], |
|||
default: '' |
|||
}, |
|||
// #endif |
|||
}, |
|||
data() { |
|||
return { |
|||
showSelector: false, |
|||
inputVal: '' |
|||
} |
|||
}, |
|||
computed: { |
|||
labelStyle() { |
|||
if (this.labelWidth === 'auto') { |
|||
return "" |
|||
} |
|||
|
|||
return `width: ${this.labelWidth}` |
|||
}, |
|||
|
|||
inputStyle(){ |
|||
if (this.inputWidth === 'auto') { |
|||
return "" |
|||
} |
|||
|
|||
return `width: ${this.inputWidth}` |
|||
}, |
|||
filterCandidates() { |
|||
// return this.candidates.filter((item) => { |
|||
// return item.toString().indexOf(this.inputVal) > -1 |
|||
// }) |
|||
return this.candidates; |
|||
}, |
|||
filterCandidatesLength() { |
|||
return this.filterCandidates.length |
|||
} |
|||
}, |
|||
watch: { |
|||
// #ifndef VUE3 |
|||
value: { |
|||
handler(newVal) { |
|||
this.inputVal = newVal |
|||
}, |
|||
immediate: true |
|||
}, |
|||
// #endif |
|||
// #ifdef VUE3 |
|||
modelValue: { |
|||
handler(newVal) { |
|||
this.inputVal = newVal |
|||
}, |
|||
immediate: true |
|||
}, |
|||
// #endif |
|||
}, |
|||
methods: { |
|||
toggleSelector() { |
|||
this.showSelector = !this.showSelector |
|||
}, |
|||
onFocus() { |
|||
this.showSelector = true |
|||
}, |
|||
onBlur() { |
|||
setTimeout(() => { |
|||
this.showSelector = false |
|||
}, 153) |
|||
}, |
|||
onSelectorClick(index) { |
|||
this.inputVal = this.filterCandidates[index] |
|||
this.showSelector = false |
|||
this.$emit('input', this.inputVal) |
|||
this.$emit('update:modelValue', this.inputVal) |
|||
}, |
|||
onInput() { |
|||
setTimeout(() => { |
|||
this.$emit('input', this.inputVal) |
|||
this.$emit('update:modelValue', this.inputVal) |
|||
}) |
|||
}, |
|||
confirm(){ |
|||
setTimeout(() => { |
|||
this.$emit('confirm', this.inputVal) |
|||
this.$emit('update:modelValue', this.inputVal) |
|||
}) |
|||
} |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="less"> |
|||
.uni-combox { |
|||
font-size: 14px; |
|||
border: 1px solid #DCDFE6; |
|||
border-radius: 4px; |
|||
padding: 6px 10px; |
|||
position: relative; |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
// height: 40px; |
|||
flex-direction: row; |
|||
align-items: center; |
|||
// border-bottom: solid 1px #DDDDDD; |
|||
} |
|||
|
|||
.uni-combox__label { |
|||
font-size: 16px; |
|||
line-height: 22px; |
|||
padding-right: 10px; |
|||
color: #999999; |
|||
} |
|||
|
|||
.uni-combox__input-box { |
|||
position: relative; |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
/* #endif */ |
|||
flex: 1; |
|||
flex-direction: row; |
|||
align-items: center; |
|||
} |
|||
|
|||
.uni-combox__input { |
|||
flex: 1; |
|||
font-size: 35rpx; |
|||
height: 26px; |
|||
line-height: 26px; |
|||
} |
|||
|
|||
.uni-combox__input-plac { |
|||
font-size: 14px; |
|||
color: #999; |
|||
} |
|||
|
|||
.uni-combox__selector { |
|||
/* #ifndef APP-NVUE */ |
|||
box-sizing: border-box; |
|||
/* #endif */ |
|||
position: absolute; |
|||
top: calc(100% + 12px); |
|||
left: 0; |
|||
width: 100%; |
|||
background-color: #FFFFFF; |
|||
border: 1px solid #EBEEF5; |
|||
border-radius: 6px; |
|||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); |
|||
z-index: 2; |
|||
padding: 4px 0; |
|||
} |
|||
|
|||
.uni-combox__selector-scroll { |
|||
/* #ifndef APP-NVUE */ |
|||
max-height: 500rpx; |
|||
height: 500rpx; |
|||
box-sizing: border-box; |
|||
/* #endif */ |
|||
height: 500rpx; |
|||
} |
|||
|
|||
.uni-combox__selector-empty, |
|||
.uni-combox__selector-item { |
|||
/* #ifndef APP-NVUE */ |
|||
display: flex; |
|||
cursor: pointer; |
|||
/* #endif */ |
|||
line-height: 36px; |
|||
font-size: 36rpx; |
|||
text-align: center; |
|||
// border-bottom: solid 1px #DDDDDD; |
|||
padding: 0px 10px; |
|||
} |
|||
|
|||
.uni-combox__selector-item:hover { |
|||
background-color: #f9f9f9; |
|||
} |
|||
|
|||
.uni-combox__selector-empty:last-child, |
|||
.uni-combox__selector-item:last-child { |
|||
/* #ifndef APP-NVUE */ |
|||
border-bottom: none; |
|||
/* #endif */ |
|||
} |
|||
|
|||
// picker 弹出层通用的指示小三角 |
|||
.uni-popper__arrow, |
|||
.uni-popper__arrow::after { |
|||
position: absolute; |
|||
display: block; |
|||
width: 0; |
|||
height: 0; |
|||
border-color: transparent; |
|||
border-style: solid; |
|||
border-width: 6px; |
|||
} |
|||
|
|||
.uni-popper__arrow { |
|||
filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.03)); |
|||
top: -6px; |
|||
left: 10%; |
|||
margin-right: 3px; |
|||
border-top-width: 0; |
|||
border-bottom-color: #EBEEF5; |
|||
} |
|||
|
|||
.uni-popper__arrow::after { |
|||
content: " "; |
|||
top: 1px; |
|||
margin-left: -6px; |
|||
border-top-width: 0; |
|||
border-bottom-color: #fff; |
|||
} |
|||
|
|||
.uni-combox__no-border { |
|||
border: none; |
|||
} |
|||
|
|||
.uni-input-input { |
|||
font-size: 40rpx; |
|||
} |
|||
</style> |
@ -0,0 +1,248 @@ |
|||
<template> |
|||
<view> |
|||
<uni-popup ref="popup" :mask-click="false"> |
|||
<view class="popup_box"> |
|||
<view class="pop_title uni-flex space-between"> |
|||
<view class="" style="font-size: 35rpx;"> |
|||
扫描{{title}} |
|||
</view> |
|||
|
|||
<view class=""> |
|||
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg" |
|||
@click="closeScanPopup()"></image> |
|||
</view> |
|||
</view> |
|||
<view class=""> |
|||
<view class=""> |
|||
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" |
|||
:isShowHistory="isShowHistory" :clearResult="true" :headerType="headerType"></win-com-scan> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</uni-popup> |
|||
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> |
|||
</view> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</template> |
|||
|
|||
<script> |
|||
import winComScan from '@/mycomponents/scan/winComScan.vue' |
|||
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
|||
import { |
|||
getBalanceByManagementPrecisionByPacking, |
|||
} from '@/common/balance.js'; |
|||
|
|||
import { |
|||
getBalanceByPalletLabel, |
|||
getBasicItemByCode, |
|||
getBalanceByFilter |
|||
} from '@/api/request2.js'; |
|||
|
|||
import { |
|||
getListLocationAreaTypeDesc, |
|||
checkDirectoryItemExist, |
|||
getDirectoryItemArray, |
|||
getLocationAreaTypeName, |
|||
getInventoryStatusDesc, |
|||
getListItemTypeDesc, |
|||
getItemTypeInfo |
|||
} from '@/common/directory.js'; |
|||
export default { |
|||
name: 'winScanPack', |
|||
emits: ["getBalance"], |
|||
components: { |
|||
winComScan, |
|||
balanceSelect |
|||
}, |
|||
props: { |
|||
title: { |
|||
type: String, |
|||
default: '箱标签' |
|||
}, |
|||
isShowHistory: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
headerType: { |
|||
type: String, |
|||
default: "HPQ,HMQ" |
|||
}, |
|||
balanceFromInventoryStatuses: { //是否传fromInventoryStatuses |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
bussinessCode: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
verifyCategory: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
isTargetScan: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
|
|||
|
|||
}, |
|||
data() { |
|||
return { |
|||
scanResult: {}, |
|||
show: false, |
|||
scanList: [], |
|||
expand: false, |
|||
showScanResult: {}, |
|||
expendIcon: 'arrow-down', |
|||
fromLocationCode: '', |
|||
fromLocation: '', |
|||
fromLocationList: [], |
|||
fromLocationAreaTypeList: [], |
|||
toLocationAreaTypeList: [], |
|||
locationOnFocus: false, |
|||
businessType: {}, |
|||
inventoryStatus: [], |
|||
managementPrecision: '', |
|||
fromInventoryStatuses: [], |
|||
itemTypesList: [], |
|||
isCheck: false, |
|||
resultData: {} |
|||
} |
|||
}, |
|||
created() { |
|||
|
|||
}, |
|||
methods: { |
|||
openScanPopup(businessType) { |
|||
this.businessType = businessType |
|||
this.fromInventoryStatuses = getDirectoryItemArray(businessType.outInventoryStatuses) |
|||
this.fromLocationAreaTypeList = getDirectoryItemArray(businessType.outAreaTypes) |
|||
this.toLocationAreaTypeList = getDirectoryItemArray(businessType.inAreaTypes) |
|||
this.itemTypesList = getDirectoryItemArray(businessType.itemTypes) |
|||
this.$refs.popup.open('bottom') |
|||
setTimeout(res=>{ |
|||
this.getfocus() |
|||
},500) |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
this.resultData = result; |
|||
if (!result.package) { |
|||
this.showErrorMessage(result.label.code + "包装信息为空") |
|||
return; |
|||
} |
|||
this.getItemCodeType(result.package.itemCode, callBack => { |
|||
this.queryBalance(this.resultData) |
|||
|
|||
}) |
|||
}, |
|||
|
|||
queryBalance(result) { |
|||
|
|||
var params = { |
|||
packingNumber:result.label.packingNumber, |
|||
isTargetScan:this.isTargetScan//true 查托码。false 是查箱码 |
|||
} |
|||
uni.showLoading({ |
|||
title: '查询中', |
|||
mask: true |
|||
}) |
|||
getBalanceByPalletLabel(params).then(res => { |
|||
uni.hideLoading() |
|||
if(res.data.packageList){ |
|||
if (res.data.packageList.length == 0) { |
|||
this.showErrorMessage("按包装号【"+params.packingNumber+"】未查找到库存余额") |
|||
} else if (res.data.packageList.length>0) { |
|||
result.balance = res.data |
|||
this.$emit("getBalance", result) |
|||
} |
|||
} |
|||
|
|||
}).catch(error => { |
|||
uni.hideLoading() |
|||
this.showErrorMessage(error) |
|||
}) |
|||
}, |
|||
|
|||
getItemCodeType(itemCode, callBack) { |
|||
uni.showLoading({ |
|||
title: "加载中", |
|||
mask: true |
|||
}) |
|||
getBasicItemByCode(itemCode).then(res => { |
|||
if (res.data != null && res.data.list.length > 0) { |
|||
var result = res.data.list[0]; |
|||
var status = result.available; |
|||
var type = result.type; |
|||
if (status == "TRUE") { |
|||
if (checkDirectoryItemExist(this.itemTypesList, type)) { |
|||
if (this.verifyCategory) { |
|||
if (result.category == 'LCJ' || result.category == 'BJ') { |
|||
callBack() |
|||
} else { |
|||
this.showErrorMessage("扫描物料的种类不是【量产件】或者【备件】") |
|||
} |
|||
} else { |
|||
callBack() |
|||
} |
|||
} else { |
|||
var hint = getListItemTypeDesc(this.itemTypesList); |
|||
uni.hideLoading() |
|||
this.showErrorMessage("扫描物料[" + itemCode + "]是[" + |
|||
getItemTypeInfo(type).label + "],需要的物料类型是[" + hint + "]") |
|||
} |
|||
} else { |
|||
uni.hideLoading() |
|||
this.showErrorMessage('物料【' + itemCode + '】不可用'); |
|||
} |
|||
} else { |
|||
uni.hideLoading() |
|||
this.showErrorMessage('未查找到物料【' + itemCode + '】'); |
|||
} |
|||
}).catch(error => { |
|||
uni.hideLoading(); |
|||
this.showErrorMessage(error) |
|||
}) |
|||
}, |
|||
|
|||
showErrorMessage(message) { |
|||
this.losefocus() |
|||
this.$refs.comMessage.showErrorMessage(message, res => { |
|||
if (res) { |
|||
if (this.$refs.comscan) { |
|||
this.$refs.comscan.getfocus() |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
selectBalanceItem(item) { |
|||
this.resultData.balance = item |
|||
this.$emit("getBalance", this.resultData) |
|||
// this.closeScanPopup() |
|||
}, |
|||
closeScanPopup() { |
|||
this.losefocus(); |
|||
this.$refs.popup.close() |
|||
}, |
|||
getfocus() { |
|||
if (this.$refs.comscan) { |
|||
this.$refs.comscan.getfocus() |
|||
} |
|||
}, |
|||
losefocus() { |
|||
if (this.$refs.comscan) { |
|||
this.$refs.comscan.losefocus() |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.scroll-view { |
|||
overflow-y: scroll; |
|||
height: auto; |
|||
max-height: 300rpx; |
|||
} |
|||
</style> |
@ -0,0 +1,341 @@ |
|||
<template> |
|||
<view> |
|||
<uni-popup ref="popup" :mask-click="false"> |
|||
<view class="popup_box"> |
|||
<view class="pop_title uni-flex space-between"> |
|||
<view class="" style="font-size: 35rpx;"> |
|||
扫描{{title}} |
|||
</view> |
|||
|
|||
<view class=""> |
|||
<image class="fr icons_scan_close" src="/static/icons/icons_scan_close.svg" |
|||
@click="closeScanPopup()"></image> |
|||
</view> |
|||
</view> |
|||
<view class=""> |
|||
<view class=""> |
|||
<win-com-scan ref="comscan" :placeholder="title" @getResult="getScanResult" |
|||
:isShowHistory="isShowHistory" :clearResult="true" :headerType="headerType"></win-com-scan> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</uni-popup> |
|||
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> |
|||
</view> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</template> |
|||
|
|||
<script> |
|||
import winComScan from '@/mycomponents/scan/winComScan.vue' |
|||
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
|||
import { |
|||
getBalanceByManagementPrecisionByPacking, |
|||
} from '@/common/balance.js'; |
|||
|
|||
import { |
|||
getBalanceByParams, |
|||
getBasicItemByCode, |
|||
getBalanceByFilter |
|||
} from '@/api/request2.js'; |
|||
|
|||
import { |
|||
getListLocationAreaTypeDesc, |
|||
checkDirectoryItemExist, |
|||
getDirectoryItemArray, |
|||
getLocationAreaTypeName, |
|||
getInventoryStatusDesc, |
|||
getListItemTypeDesc, |
|||
getItemTypeInfo |
|||
} from '@/common/directory.js'; |
|||
export default { |
|||
name: 'winScanPack', |
|||
emits: ["getBalance"], |
|||
components: { |
|||
winComScan, |
|||
balanceSelect |
|||
}, |
|||
props: { |
|||
title: { |
|||
type: String, |
|||
default: '箱标签' |
|||
}, |
|||
isShowHistory: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
headerType: { |
|||
type: String, |
|||
default: "HPQ,HMQ" |
|||
}, |
|||
balanceFromInventoryStatuses: { //是否传fromInventoryStatuses |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
bussinessCode: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
verifyCategory: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
isCheckLocationBalance: { |
|||
type: Boolean, |
|||
default: true |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
scanResult: {}, |
|||
show: false, |
|||
scanList: [], |
|||
expand: false, |
|||
showScanResult: {}, |
|||
expendIcon: 'arrow-down', |
|||
fromLocationCode: '', |
|||
fromLocation: '', |
|||
fromLocationList: [], |
|||
fromLocationAreaTypeList: [], |
|||
toLocationAreaTypeList: [], |
|||
locationOnFocus: false, |
|||
businessType: {}, |
|||
inventoryStatus: [], |
|||
managementPrecision: '', |
|||
fromInventoryStatuses: [], |
|||
itemTypesList: [], |
|||
isCheck: false, |
|||
resultData: {} |
|||
} |
|||
}, |
|||
created() { |
|||
|
|||
}, |
|||
methods: { |
|||
openScanPopup() { |
|||
this.$refs.popup.open('bottom') |
|||
setTimeout(res=>{ |
|||
this.getfocus() |
|||
},500) |
|||
}, |
|||
|
|||
openScanPopupss(businessType) { |
|||
this.businessType = businessType |
|||
this.fromInventoryStatuses = getDirectoryItemArray(businessType.outInventoryStatuses) |
|||
this.fromLocationAreaTypeList = getDirectoryItemArray(businessType.outAreaTypes) |
|||
this.toLocationAreaTypeList = getDirectoryItemArray(businessType.inAreaTypes) |
|||
this.itemTypesList = getDirectoryItemArray(businessType.itemTypes) |
|||
this.$refs.popup.open('bottom') |
|||
setTimeout(res=>{ |
|||
this.getfocus() |
|||
},500) |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
this.resultData = result; |
|||
if (!result.package) { |
|||
this.showErrorMessage(result.label.code + "包装信息为空") |
|||
return; |
|||
} |
|||
this.getItemCodeType(result.package.itemCode, callBack => { |
|||
this.queryBalance(this.resultData) |
|||
}) |
|||
}, |
|||
|
|||
//查询到目标库位的库存余额 |
|||
getToLocationBalance(result) { |
|||
uni.showLoading({ |
|||
title: '查询中', |
|||
mask: true |
|||
}) |
|||
var filters = [] |
|||
if (result.package.parentNumber) { |
|||
var packingNumber = result.package.parentNumber + "," + result.package.number; |
|||
filters.push({ |
|||
column: "packingNumber", |
|||
action: "in", |
|||
value: packingNumber |
|||
}) |
|||
} else { |
|||
filters.push({ |
|||
column: "packingNumber", |
|||
action: "==", |
|||
value: result.package.number |
|||
}) |
|||
} |
|||
|
|||
filters.push({ |
|||
column: "itemCode", |
|||
action: "==", |
|||
value: result.package.itemCode |
|||
}) |
|||
filters.push({ |
|||
column: "batch", |
|||
action: "==", |
|||
value: result.package.batch |
|||
}) |
|||
|
|||
filters.push({ |
|||
column: "areaType", |
|||
action: "in", |
|||
value: this.toLocationAreaTypeList.join(',') |
|||
}) |
|||
|
|||
|
|||
var params = { |
|||
filters: filters, |
|||
pageNo: 1, |
|||
pageSize: 100, |
|||
} |
|||
getBalanceByFilter(params).then(res => { |
|||
uni.hideLoading() |
|||
if (res.data.list.length > 0) { |
|||
if(this.bussinessCode=="Repleinment"){ |
|||
this.showErrorMessage("此物料已补料"); |
|||
}else { |
|||
this.showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额"); |
|||
} |
|||
} else { |
|||
this.queryBalance(this.resultData); |
|||
} |
|||
// callback(res.data) |
|||
}).catch(err => { |
|||
this.showErrorMessage(err.message); |
|||
}) |
|||
}, |
|||
|
|||
queryBalance(result) { |
|||
var params = { |
|||
itemCode: result.package.itemCode, |
|||
batch: result.label.batch, |
|||
packingNumber: result.label.packingNumber, |
|||
parentPackingNumber: result.package.parentNumber, |
|||
inventoryStatus: this.fromInventoryStatuses, |
|||
areaType: this.fromLocationAreaTypeList, |
|||
bussinessCode: this.bussinessCode |
|||
} |
|||
uni.showLoading({ |
|||
title: '查询中', |
|||
mask: true |
|||
}) |
|||
getBalanceByParams(params).then(res => { |
|||
uni.hideLoading() |
|||
if (res.data.length == 0) { |
|||
var status = getInventoryStatusDesc(params.inventoryStatus) |
|||
var areaType = getListLocationAreaTypeDesc(params.areaType) |
|||
var hint = |
|||
"按物料号 [" + params.itemCode + "] \n" + |
|||
"包装号 [" + params.packingNumber + "] \n" + |
|||
"批次 [" + params.batch + "] \n" + |
|||
"状态 [" + status + "] \n" + |
|||
"库区 [" + areaType + "] \n" + |
|||
"未查找到库存余额" |
|||
this.showErrorMessage(hint) |
|||
} else if (res.data.length == 1) { |
|||
|
|||
result.balance = res.data[0] |
|||
if (result.label.packingNumber != result.balance.packingNumber) { |
|||
result.balance.lableQty = result.label.qty |
|||
} |
|||
this.$emit("getBalance", result) |
|||
// this.closeScanPopup() |
|||
} else { |
|||
//多条记录 |
|||
this.$refs.balanceSelect.openPopup(res.data); |
|||
} |
|||
|
|||
}).catch(error => { |
|||
uni.hideLoading() |
|||
if(this.bussinessCode=="Repleinment"){ |
|||
if(error.includes("库存余额不足")){ |
|||
this.showErrorMessage("没有此物料库存,请核对库存余额与标签是否一致") |
|||
}else { |
|||
this.showErrorMessage(error) |
|||
} |
|||
}else { |
|||
this.showErrorMessage(error) |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
getItemCodeType(itemCode, callBack) { |
|||
uni.showLoading({ |
|||
title: "加载中", |
|||
mask: true |
|||
}) |
|||
getBasicItemByCode(itemCode).then(res => { |
|||
if (res.data != null && res.data.list.length > 0) { |
|||
var result = res.data.list[0]; |
|||
var status = result.available; |
|||
var type = result.type; |
|||
if (status == "TRUE") { |
|||
if (checkDirectoryItemExist(this.itemTypesList, type)) { |
|||
if (this.verifyCategory) { |
|||
if (result.category == 'LCJ' || result.category == 'BJ') { |
|||
callBack() |
|||
} else { |
|||
this.showErrorMessage("扫描物料的种类不是【量产件】或者【备件】") |
|||
} |
|||
} else { |
|||
callBack() |
|||
} |
|||
} else { |
|||
var hint = getListItemTypeDesc(this.itemTypesList); |
|||
uni.hideLoading() |
|||
this.showErrorMessage("扫描物料[" + itemCode + "]是[" + |
|||
getItemTypeInfo(type).label + "],需要的物料类型是[" + hint + "]") |
|||
} |
|||
} else { |
|||
uni.hideLoading() |
|||
this.showErrorMessage('物料【' + itemCode + '】不可用'); |
|||
} |
|||
} else { |
|||
uni.hideLoading() |
|||
this.showErrorMessage('未查找到物料【' + itemCode + '】'); |
|||
} |
|||
}).catch(error => { |
|||
uni.hideLoading(); |
|||
this.showErrorMessage(error) |
|||
}) |
|||
}, |
|||
|
|||
showErrorMessage(message) { |
|||
this.losefocus() |
|||
this.$refs.comMessage.showErrorMessage(message, res => { |
|||
if (res) { |
|||
if (this.$refs.comscan) { |
|||
this.$refs.comscan.getfocus() |
|||
} |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
selectBalanceItem(item) { |
|||
this.resultData.balance = item |
|||
this.$emit("getBalance", this.resultData) |
|||
// this.closeScanPopup() |
|||
}, |
|||
closeScanPopup() { |
|||
this.losefocus(); |
|||
this.$refs.popup.close() |
|||
}, |
|||
getfocus() { |
|||
if (this.$refs.comscan) { |
|||
this.$refs.comscan.getfocus() |
|||
} |
|||
}, |
|||
losefocus() { |
|||
if (this.$refs.comscan) { |
|||
this.$refs.comscan.losefocus() |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
.scroll-view { |
|||
overflow-y: scroll; |
|||
height: auto; |
|||
max-height: 300rpx; |
|||
} |
|||
</style> |
@ -0,0 +1,406 @@ |
|||
<template> |
|||
<view class="page-wraper"> |
|||
<view class=""> |
|||
<com-blank-view @goScan='openScanPopup' v-if="detailSource.length==0"></com-blank-view> |
|||
</view> |
|||
<view class="page-wraper" v-if="detailSource.length>0"> |
|||
<view class="page-main" style="background-color: #EEEEEE;"> |
|||
<scroll-view scroll-y="true" class="page-main-scroll"> |
|||
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|||
<view class=""> |
|||
<comPallLabelCard :dataContent="item" :index="index" @removeData="removeData" |
|||
:isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack' |
|||
:allowEditStatus="allowEditStatus"> |
|||
</comPallLabelCard> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
</view> |
|||
|
|||
<view class="page-footer"> |
|||
<view class="uni-flex uni-column"> |
|||
<comPalletLabel v-if="!isEmpty(showItemInfo)" ref="palletLabelRef" style="z-index: 10;" |
|||
:businessType="businessType" :bussinessCode="businessTypeCode" :showItemInfo="showItemInfo"> |
|||
</comPalletLabel> |
|||
|
|||
<view class="uni-flex u-col-center space-between padding_10" |
|||
style="background-color:ghostwhite; width: 100%; "> |
|||
<view class=""> |
|||
</view> |
|||
<view class=" uni-flex uni-row"> |
|||
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
<win-scan-button style="z-index: 9;" @goScan='openScanPopup'></win-scan-button> |
|||
|
|||
</view> |
|||
<view class=" " style="z-index: 11;"> |
|||
<winComScanBalanceBind ref="scanPopup" :isTargetScan="false" @getBalance='getScanResult' |
|||
:bussinessCode="businessTypeCode"> |
|||
</winComScanBalanceBind> |
|||
</view> |
|||
|
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import comEmptyView from '@/mycomponents/common/comEmptyView.vue' |
|||
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|||
import comPallLabelCard from '@/pages/palletLabel/coms/comPallLabelCard.vue' |
|||
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|||
import winComScanBalanceBind from "@/mycomponents/scan/winComScanBalanceBind.vue" |
|||
import comPalletLabel from '@/pages/palletLabel/coms/comPalletLabel.vue' |
|||
|
|||
|
|||
import { |
|||
getInventoryStatusName |
|||
} from '@/common/directory.js'; |
|||
import { |
|||
palletLabelBindSubmit, |
|||
getBasicLocationByCode, |
|||
getPackUnitByItemCode |
|||
} from '@/api/request2.js'; |
|||
|
|||
|
|||
import { |
|||
getPackingNumberAndBatchByList, |
|||
deepCopyData |
|||
} from '@/common/basic.js'; |
|||
|
|||
import { |
|||
Decimal |
|||
} from 'decimal.js'; //引入 |
|||
|
|||
import { |
|||
calc |
|||
} from '@/common/calc' |
|||
|
|||
import { |
|||
getBusinessType, |
|||
calcHandleQty |
|||
} from '@/common/record.js'; |
|||
|
|||
export default { |
|||
components: { |
|||
comEmptyView, |
|||
winScanButton, |
|||
comPallLabelCard, |
|||
comBlankView, |
|||
winComScanBalanceBind, |
|||
comPalletLabel |
|||
}, |
|||
data() { |
|||
return { |
|||
fromLocationCode: "", |
|||
fromLocationInfo: {}, |
|||
toLocationTypeArray: [], |
|||
toInventoryStatus: "", |
|||
businessType: {}, //业务类型 |
|||
detailSource: [], //绑定在页面上的数据源 |
|||
title: "", |
|||
dataContent: {}, |
|||
isShowEditLocation: false, |
|||
isShowStatus: true, |
|||
allowEditStatus: true, |
|||
businessTypeCode: "MergeTuoPackage", |
|||
itemCode: "", |
|||
showItemInfo: {} |
|||
} |
|||
}, |
|||
|
|||
onLoad(option) { |
|||
getBusinessType(this.businessTypeCode, res => { |
|||
if (res.success) { |
|||
this.businessType = res.businessType; |
|||
this.openScanPopup(); |
|||
} else { |
|||
this.showErrorMessage(res.message) |
|||
} |
|||
}); |
|||
uni.setNavigationBarTitle({ |
|||
title: option.title |
|||
}) |
|||
this.title =option.title |
|||
}, |
|||
|
|||
|
|||
methods: { |
|||
isEmpty(item) { |
|||
return Object.keys(item).length === 0 |
|||
|
|||
}, |
|||
openScanPopup() { |
|||
if (this.businessType) { |
|||
this.$refs.scanPopup.openScanPopup(this.businessType); |
|||
} else { |
|||
this.getBusinessType() |
|||
} |
|||
}, |
|||
|
|||
createItemInfo(data) { |
|||
var itemInfo = { |
|||
itemCode: data.itemCode, |
|||
itemName: data.itemName, |
|||
itemDesc1: data.itemDesc1, |
|||
itemDesc2: data.itemDesc2, |
|||
qty: 0, |
|||
subList: [] |
|||
} |
|||
return itemInfo |
|||
}, |
|||
|
|||
createDetailInfo(item) { |
|||
var itemDetail = { |
|||
itemCode: item.itemCode, |
|||
parentPackingNumber: item.parentPackingNumber, |
|||
packingNumber: item.packingNumber, |
|||
batch: item.batch, |
|||
fromLocationCode: item.locationCode, |
|||
packQty: item.packQty, |
|||
packUnit: item.packUnit, |
|||
uom: item.uom, |
|||
qty: item.qty, |
|||
inventoryStatus: item.inventoryStatus, |
|||
scaned: true |
|||
} |
|||
return itemDetail; |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
let data = result.balance |
|||
let label = result.label |
|||
|
|||
var item = this.detailSource.find(res => { |
|||
if (res.itemCode == data.itemCode) { |
|||
return res |
|||
} |
|||
}) |
|||
|
|||
if (!data.packageList) { |
|||
this.showErrorMessage("扫描的数据无效") |
|||
return; |
|||
} |
|||
|
|||
if (item == undefined) { |
|||
//没有扫描 |
|||
if (this.itemCode && this.itemCode != data.itemCode) { |
|||
this.showErrorMessage("扫描物料不是[" + this.itemCode + "]不可以添加") |
|||
return |
|||
} |
|||
var itemp = this.createItemInfo(data); |
|||
this.itemCode = itemp.itemCode |
|||
//添加到详细 |
|||
|
|||
data.packageList.forEach(item => { |
|||
var itemDetail = this.createDetailInfo(item) |
|||
itemp.subList.push(itemDetail) |
|||
}) |
|||
let firstItem = data.packageList[0] |
|||
this.detailSource.push(itemp) |
|||
this.showItemInfo = deepCopyData(firstItem) |
|||
this.calacQty() |
|||
this.scanPopupGetFocus() |
|||
} else { |
|||
|
|||
var resultArray = data.packageList.map(itemPage => itemPage.packingNumber) |
|||
|
|||
var commonArray = item.subList.filter(item => resultArray.includes(item.packingNumber)); |
|||
if (commonArray && commonArray.length > 0) { |
|||
//扫描的是箱 |
|||
if (data.packageList.length == 1) { |
|||
this.showErrorMessage("箱码[" + label.packingNumber + "]批次[" + label.batch + "]已经扫描\n") |
|||
} else { |
|||
if (commonArray.length ==resultArray.length) { |
|||
this.showErrorMessage("箱码[" + label.packingNumber + "]批次[" + label.batch + "]已经扫描\n") |
|||
return; |
|||
} |
|||
//扫描的是托 |
|||
data.packageList.forEach(itemPage => { |
|||
var itemDetail = this.createDetailInfo(itemPage) |
|||
var isHave = item.subList.find(r => r.packingNumber == itemDetail.packingNumber) |
|||
if (!isHave) { |
|||
item.subList.push(itemDetail) |
|||
} |
|||
}) |
|||
|
|||
this.calacQty() |
|||
this.scanPopupGetFocus() |
|||
} |
|||
|
|||
} else { |
|||
data.packageList.forEach(itemPage => { |
|||
var itemDetail = this.createDetailInfo(itemPage) |
|||
var isHave = item.subList.find(r => r.packingNumber == itemDetail.packingNumber) |
|||
if (!isHave) { |
|||
item.subList.push(itemDetail) |
|||
} |
|||
}) |
|||
this.calacQty() |
|||
this.scanPopupGetFocus() |
|||
} |
|||
|
|||
} |
|||
|
|||
}, |
|||
|
|||
calacQty() { |
|||
this.detailSource.forEach(item => { |
|||
item.qty = 0; |
|||
item.subList.forEach(detail => { |
|||
item.qty = calc.add(item.qty, detail.qty); |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
showErrorMessage(message) { |
|||
this.scanPopupLoseFocus() |
|||
this.$refs.comMessage.showErrorMessage(message, res => { |
|||
if (res) { |
|||
this.scanPopupGetFocus() |
|||
} |
|||
}); |
|||
}, |
|||
updateData() { |
|||
calcHandleQty(this.detailSource); |
|||
for (var i = 0; i < this.detailSource.length; i++) { |
|||
let item = this.detailSource[i]; |
|||
if (item.qty == 0) { |
|||
this.detailSource.splice(i, 1) |
|||
} |
|||
} |
|||
}, |
|||
|
|||
removePack() { |
|||
for (var i = 0; i < this.detailSource.length; i++) { |
|||
var item = this.detailSource[i]; |
|||
if (item.subList.length == 0) { |
|||
this.detailSource.splice(i, 1) |
|||
} |
|||
} |
|||
this.updateData(); |
|||
}, |
|||
|
|||
|
|||
removeData(item) { |
|||
for (let i = 0; i < this.detailSource.length; i++) { |
|||
if (this.detailSource[i].itemCode == item.itemCode) { |
|||
this.detailSource.splice(i, 1) |
|||
} |
|||
} |
|||
}, |
|||
showCommitSuccessMessage(hint) { |
|||
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|||
this.clearData() |
|||
}) |
|||
}, |
|||
clearData() { |
|||
this.itemCode = "" |
|||
this.subList = []; |
|||
this.detailSource = []; |
|||
this.dataContent = {} |
|||
this.showItemInfo = {} |
|||
this.$refs.palletLabelRef.clearPalletCode() |
|||
}, |
|||
commit() { |
|||
var palletLabelInfo = this.$refs.palletLabelRef.getData() |
|||
|
|||
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|||
if (!palletLabelInfo.isCheck) { |
|||
this.$refs.palletLabelRef.isShowCollapse() |
|||
return; |
|||
} |
|||
|
|||
|
|||
//查询管理模式 |
|||
uni.showLoading({ |
|||
title: "提交中....", |
|||
mask: true |
|||
}); |
|||
this.submit(palletLabelInfo) |
|||
|
|||
} else { |
|||
this.showErrorMessage("没有要提交的数据,请先扫描") |
|||
} |
|||
|
|||
}, |
|||
|
|||
scanPopupGetFocus() { |
|||
if (this.$refs.scanPopup != undefined) { |
|||
this.$refs.scanPopup.getfocus(); |
|||
} |
|||
}, |
|||
|
|||
scanPopupLoseFocus() { |
|||
if (this.$refs.scanPopup != undefined) { |
|||
this.$refs.scanPopup.losefocus(); |
|||
} |
|||
}, |
|||
|
|||
submit(palletLabelInfo) { |
|||
var params = this.setParams(palletLabelInfo) |
|||
//目标数量不能大于标包数量 |
|||
if ( params.qty > params.packQty) { |
|||
this.showErrorMessage("合托的总数量[" + params.qty + "]不能大于托包装的标包数量[" + params.packQty + "]") |
|||
return; |
|||
} |
|||
return; |
|||
console.log("提交", JSON.stringify(params)) |
|||
palletLabelBindSubmit(params).then(res => { |
|||
uni.hideLoading() |
|||
if (res.data) { |
|||
this.showCommitSuccessMessage("提交成功\n生成" + this.title + "\n" + |
|||
res.data) |
|||
} else { |
|||
this.showErrorMessage("提交失败[" + res.msg + "]") |
|||
} |
|||
}).catch(error => { |
|||
uni.hideLoading() |
|||
this.showErrorMessage(error) |
|||
}) |
|||
}, |
|||
|
|||
setParams(palletLabelInfo) { |
|||
var subList = [] |
|||
var creator = this.$store.state.user.id |
|||
var totalQty = 0 |
|||
this.detailSource.forEach(item => { |
|||
totalQty = item.qty |
|||
item.subList.forEach(detail => { |
|||
if (detail.scaned) { |
|||
var submitItem = deepCopyData(detail) |
|||
submitItem.itemCode = detail.itemCode; |
|||
submitItem.fromPackingNumber = detail.packingNumber; |
|||
submitItem.fromParentPackingNumber = detail.parentPackingNumber; |
|||
submitItem.fromLocationCode = detail.fromLocationCode; |
|||
submitItem.fromBatch = detail.batch; |
|||
submitItem.fromInventoryStatus = detail.inventoryStatus |
|||
submitItem.uom == detail.uom |
|||
submitItem.package = null; |
|||
submitItem.Records = null; |
|||
submitItem.fromQty = detail.qty; |
|||
subList.push(submitItem) |
|||
} |
|||
}) |
|||
}) |
|||
this.dataContent.subList = subList; |
|||
this.dataContent.itemCode = palletLabelInfo.itemCode; |
|||
this.dataContent.toPackingNumber = palletLabelInfo.toPackingNumber=="请扫描目标托码,非必填项"?"":palletLabelInfo.toPackingNumber; |
|||
this.dataContent.batch = palletLabelInfo.batch; |
|||
this.dataContent.packQty = palletLabelInfo.packQty; |
|||
this.dataContent.packUnit = palletLabelInfo.packUnit; |
|||
this.dataContent.toLocationCode = palletLabelInfo.toLocationCode; |
|||
this.dataContent.toInventoryStatus = palletLabelInfo.toInventoryStatus; |
|||
this.dataContent.qty = totalQty; |
|||
|
|||
return this.dataContent; |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,275 @@ |
|||
<template> |
|||
<view class="" style="background-color: #fff;"> |
|||
<uni-collapse ref="collapse1"> |
|||
<uni-collapse-item :open="true"> |
|||
<template v-slot:title> |
|||
<uni-swipe-action ref="swipeAction"> |
|||
<uni-swipe-action-item @click="removeData($event,dataContent)" :right-options="removeOptions"> |
|||
<view class="uni-flex uni-row space-between center" |
|||
style="background-color:#fff; margin-left: 15px;"> |
|||
<view> |
|||
<item :dataContent="dataContent"></item> |
|||
</view> |
|||
<view> |
|||
<view class="center"> |
|||
<view class="uni-flex uni-row text_balance"> |
|||
<text> |
|||
{{Number(dataContent.qty)}} |
|||
</text> |
|||
</view> |
|||
<!-- v-if="dataContent.packQty==undefined" --> |
|||
|
|||
</view> |
|||
<!-- <view class="" style="font-size: 25rpx;color: gray "> |
|||
{{dataContent.packQty}} • {{dataContent.uom}} |
|||
</view> --> |
|||
</view> |
|||
</view> |
|||
|
|||
|
|||
</uni-swipe-action-item> |
|||
</uni-swipe-action> |
|||
</template> |
|||
<view class="split_line"></view> |
|||
|
|||
|
|||
<view class="" v-for="(item,index) in dataContent.subList"> |
|||
<uni-swipe-action ref="swipeAction"> |
|||
<uni-swipe-action-item @click="swipeClick($event,item,index)" |
|||
:right-options="removeOptions"> |
|||
<view class=""> |
|||
|
|||
<view :class="item.scaned?'scan_view':''"> |
|||
<view class="uni-flex uni-column "> |
|||
<view class="uni-flex uni-row space-between " style="align-items: center"> |
|||
<view> |
|||
<view class="card_view"> |
|||
<text class="card_packing_code " style="color: #BA5A59;">托码</text> |
|||
<text class="card_content ">{{item.parentPackingNumber}}</text> |
|||
</view> |
|||
<pack :packingCode="item.packingNumber"> |
|||
</pack> |
|||
<batch :batch="item.batch"></batch> |
|||
<location title="来源库位" :locationCode="item.fromLocationCode"></location> |
|||
</view> |
|||
<view> |
|||
|
|||
<view class="uni-flex uni-row"> |
|||
<view class="uni-flex uni-row " style=" align-items: center;"> |
|||
<view :class="statusStyle(item.inventoryStatus)" style="font-size: 40rpx;"> |
|||
• |
|||
</view> |
|||
<view style="font-size: 35rpx;"> |
|||
{{Number(item.qty)}} |
|||
</view> |
|||
<view style=" margin-left: 5rpx; font-size: 15rpx;color: gray; display: flex; align-items: center ">{{dataContent.uom}}</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
</uni-swipe-action-item> |
|||
</uni-swipe-action> |
|||
<view class='split_line'></view> |
|||
|
|||
</view> |
|||
</uni-collapse-item> |
|||
</uni-collapse> |
|||
<balanceQtyEdit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="isShowStatus" |
|||
:allowEditStatus="allowEditStatus" :allowEditQty="allowEditQty"> |
|||
</balanceQtyEdit> |
|||
<job-detail-popup ref="winHint" :dataContent="showItem"></job-detail-popup> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import itemQty from '@/mycomponents/item/itemQty.vue' |
|||
import recommend from '@/mycomponents/recommend/recommend.vue' |
|||
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' |
|||
import balance from '@/mycomponents/balance/balance.vue' |
|||
import balanceMove from '@/mycomponents/balance/balanceMove.vue' |
|||
import comMovebalance from '@/pages/inventoryMove/coms/comMovebalance.vue' |
|||
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' |
|||
import pack from '@/mycomponents/balance/pack.vue' |
|||
import item from '@/mycomponents/item/item.vue' |
|||
import balanceQty from '@/mycomponents/qty/balanceQty.vue' |
|||
import uom from '@/mycomponents/qty/uom.vue' |
|||
import location from '@/mycomponents/balance/location.vue' |
|||
import batch from '@/mycomponents/balance/batch.vue' |
|||
|
|||
import { |
|||
getDetailOption, |
|||
getDetailEditRemoveOption, |
|||
getRemoveOption |
|||
} from '@/common/array.js'; |
|||
import { |
|||
getInventoryStatusStyle, |
|||
} from '@/common/directory.js'; |
|||
export default { |
|||
components: { |
|||
itemQty, |
|||
recommend, |
|||
jobDetailPopup, |
|||
balance, |
|||
balanceQtyEdit, |
|||
balanceMove, |
|||
comMovebalance, |
|||
pack, |
|||
balanceQty, |
|||
item, |
|||
uom, |
|||
location, |
|||
batch |
|||
}, |
|||
props: { |
|||
dataContent: { |
|||
type: Object, |
|||
default: {} |
|||
}, |
|||
settingParam: { |
|||
type: Object, |
|||
default: {} |
|||
}, |
|||
fromInventoryStatus: { |
|||
type: String, |
|||
default: "" |
|||
}, |
|||
toInventoryStatus: { |
|||
type: String, |
|||
default: "" |
|||
}, |
|||
isShowStatus: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
allowEditStatus: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
allowEditQty: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
|
|||
}, |
|||
watch: { |
|||
dataContent: { |
|||
handler(newName, oldName) { |
|||
if (this.dataContent.subList.length > 0) { |
|||
this.$nextTick(res => { |
|||
setTimeout(() => { |
|||
if (this.$refs.collapse1) { |
|||
this.$refs.collapse1.resize(); |
|||
} |
|||
}, 500) |
|||
}) |
|||
} |
|||
}, |
|||
|
|||
|
|||
immediate: true, |
|||
deep: true |
|||
} |
|||
}, |
|||
|
|||
data() { |
|||
return { |
|||
option: [], |
|||
title: "推荐详情", |
|||
showItem: {}, |
|||
editItem: {}, |
|||
detailOptions: [], |
|||
scanOptions: [], |
|||
removeOptions: [], |
|||
dataList: [], |
|||
currentHandleQty: 0 |
|||
} |
|||
}, |
|||
|
|||
mounted() { |
|||
// this.detailOptions = getDetailOption(); |
|||
// this.scanOptions = getDetailEditRemoveOption(); |
|||
this.removeOptions = getRemoveOption(); |
|||
}, |
|||
|
|||
methods: { |
|||
statusStyle: function(val) { |
|||
return getInventoryStatusStyle(val); |
|||
}, |
|||
removeData(e, dataContent) { |
|||
if (e.content.text == "移除") { |
|||
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?", |
|||
res => { |
|||
if (res) { |
|||
this.$emit('removeData', dataContent) |
|||
} |
|||
}); |
|||
} |
|||
}, |
|||
swipeClick(e, item, index) { |
|||
if (e.content.text == "详情") { |
|||
this.detail(item) |
|||
} else if (e.content.text == "编辑") { |
|||
this.edit(item) |
|||
} else if (e.content.text == "移除") { |
|||
this.remove(item, index) |
|||
} |
|||
}, |
|||
|
|||
edit(item) { |
|||
this.editItem = item; |
|||
this.currentHandleQty = item.handleQty; |
|||
this.$refs.balanceQtyEdit.openEditPopup(item, item.qty); |
|||
}, |
|||
|
|||
detail(item) { |
|||
this.showItem = item; |
|||
this.dataList = [ |
|||
|
|||
{ |
|||
title: "箱码", |
|||
content: item.packingNumber |
|||
}, |
|||
{ |
|||
title: "批次", |
|||
content: item.batch |
|||
}, |
|||
{ |
|||
title: "库位", |
|||
content: item.formLocationCode |
|||
}, |
|||
{ |
|||
title: "数量", |
|||
content: item.qty |
|||
}, |
|||
{ |
|||
title: "单位", |
|||
content: item.uom |
|||
} |
|||
] |
|||
this.$refs.winHint.openScanPopup(this.showItem) |
|||
}, |
|||
remove(item, index) { |
|||
this.$refs.comMessage.showQuestionMessage("确定移除扫描信息?", |
|||
res => { |
|||
if (res) { |
|||
this.dataContent.subList.splice(index, 1) |
|||
this.$emit('removePack', item) |
|||
} |
|||
}); |
|||
}, |
|||
confirm(qty) { |
|||
this.editItem.handleQty = this.currentHandleQty; |
|||
this.$emit('updateData') |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,361 @@ |
|||
<template> |
|||
<view class=""> |
|||
<uni-collapse @change="handleChange" ref="collapse1" style="background-color: #fff; border-radius: 20rpx;"> |
|||
|
|||
<uni-collapse-item :open="isShow"> |
|||
<template v-slot:title> |
|||
<view class="" style="font-size: 35rpx; font-weight: bold; margin: 20rpx;"> |
|||
目标托标签信息 |
|||
</view> |
|||
</template> |
|||
|
|||
<view class='split_line'></view> |
|||
|
|||
<view class="" style="width: 100%; margin-bottom: 20rpx;"> |
|||
<view class="uni-flex uni-row" style=" align-items: center;margin-left: 30rpx; margin-top: 10rpx;"> |
|||
<view style="font-size: 32rpx; width: 25%; margin-top: 15rpx; margin-bottom: 15rpx;" >目标托码 : </view> |
|||
<view class="uni-flex uni-row" style="margin-left: 10rpx; width: 80%;"> |
|||
<view class="" style="width: 85%; height: 60rpx; font-size: 30rpx; padding: 10rpx; border: 1rpx solid darkgray; border-radius: 10rpx; font-size: 30rpx;"> |
|||
{{toPackingNumber}} |
|||
</view> |
|||
<!-- <uni-easyinput v-model="toPackingNumber" :disabled="true" placeholder="请扫描目标托码,非必填项" > </uni-easyinput> --> |
|||
<u-icon v-if="isShowToPackingNumber" style="margin-left: -50rpx;color: darkgray;" name="close-circle-fill" size="45" @click="clearPalletCode"></u-icon> |
|||
<u-icon name="scan" style="margin-left: 10rpx;color: darkgray; " @click="showPalletLabel" size="50"></u-icon> |
|||
</view> |
|||
</view> |
|||
<view class='split_line'></view> |
|||
</view> |
|||
<view class="" style="margin-bottom: 20rpx;"> |
|||
<view class="uni-flex uni-row" style="align-items: center;margin-left: 30rpx; justify-content: space-between; margin-top: 10rpx;"> |
|||
<view style="font-size: 32rpx;" >托包装规格 : </view> |
|||
<view class="" style="margin-left: 10rpx; width: 70%;"> |
|||
<view class="" v-if="isShowToPackingNumber" style="margin: 10rpx;font-size: 35rpx;"> |
|||
{{toPackUnitCode}} |
|||
</view> |
|||
<selectList v-if="!isShowToPackingNumber" |
|||
:candidates="toPackList" |
|||
:inputDisabled="true" |
|||
placeholder="请选择目标包装规格" |
|||
v-model="toPackUnitCode" |
|||
@input="selectPack" |
|||
></selectList> |
|||
</view> |
|||
</view> |
|||
<view class='split_line'></view> |
|||
</view> |
|||
|
|||
<view class="" style="margin-bottom: 20rpx;"> |
|||
<view class="uni-flex uni-row" style="align-items: center;margin-left: 30rpx; justify-content: space-between; margin-top: 10rpx;"> |
|||
<view style="font-size: 32rpx;" >托包装数量 : </view> |
|||
<view class="" style="margin-left: 10rpx; margin-bottom: 10rpx;"> |
|||
<text style="font-size: 35rpx;color: darkgray;">{{packQty}}</text> |
|||
<text style="font-size: 25rpx; color: darkgray;">{{uom}}</text> |
|||
</view> |
|||
</view> |
|||
<view class='split_line'></view> |
|||
</view> |
|||
<view class="" style="margin-bottom: 20rpx;"> |
|||
<view class="uni-flex uni-row" style="align-items: center;margin-left: 30rpx; margin-top: 10rpx;"> |
|||
<view style="font-size: 32rpx;" > |
|||
<text>批次 :</text> |
|||
<text v-show="false">批次</text> </view> |
|||
<view class="uni-flex uni-row" style="margin-left: 10rpx;"> |
|||
<view class="" v-if="isShowToPackingNumber" style="margin: 10rpx;font-size: 35rpx;"> |
|||
{{batch}} |
|||
</view> |
|||
|
|||
<uni-easyinput v-if="!isShowToPackingNumber" v-model="batch" :disabled="isBatchDisabled" placeholder="请输入批次" > </uni-easyinput> |
|||
</view> |
|||
</view> |
|||
<view class='split_line'></view> |
|||
</view> |
|||
|
|||
|
|||
|
|||
<view class="" style="margin-bottom: 20rpx;"> |
|||
<view class="uni-flex uni-row" style="align-items: center;margin-left: 30rpx; justify-content: space-between; margin-top: 10rpx;"> |
|||
<view style="font-size: 32rpx;" >状态 : </view> |
|||
<view class="" v-if="toInventoryStatus" style="margin-left: 10rpx; "> |
|||
<balanceStatus ref="balanceStatus" |
|||
:isShowStatusPoint="true" |
|||
:status="toInventoryStatus" :allowEdit='isEdit' |
|||
@updateStatus="updateStatus" > |
|||
</balanceStatus> |
|||
</view> |
|||
</view> |
|||
<view class='split_line'></view> |
|||
</view> |
|||
|
|||
<view class="" style="width: 100%; margin-bottom: 20rpx;"> |
|||
<view class="uni-flex uni-row" style=" align-items: center;margin-left: 30rpx; margin-top: 10rpx;"> |
|||
<view style="font-size: 32rpx; width: 25%; margin-top: 15rpx; margin-bottom: 15rpx;" >库位 : </view> |
|||
<view class="uni-flex uni-row" style="margin-left: 10rpx; width: 80%;"> |
|||
<view class="" style="width: 85%; height: 60rpx; font-size: 30rpx; padding: 10rpx; border: 1rpx solid darkgray; border-radius: 10rpx; font-size: 30rpx;"> |
|||
{{toLocationCode}} |
|||
</view> |
|||
<!-- <uni-easyinput v-model="toPackingNumber" :disabled="true" placeholder="请扫描目标托码,非必填项" > </uni-easyinput> --> |
|||
<u-icon v-if="isShowToPackingNumber&&toLocationCode" style="margin-left: -50rpx;color: darkgray;" name="close-circle-fill" size="45" @click="clearToLocationCode"></u-icon> |
|||
<u-icon name="scan" style="margin-left: 10rpx;color: darkgray; " @click="showLocation" size="50"></u-icon> |
|||
</view> |
|||
</view> |
|||
<view class='split_line'></view> |
|||
</view> |
|||
|
|||
|
|||
</uni-collapse-item> |
|||
</uni-collapse> |
|||
<winScanLocation ref="scanPopupLoc" title="库位代码" @getLocation='getScanCode'></winScanLocation> |
|||
<winComScanBalanceBind ref="scanPopupBind" title="托标签" |
|||
:bussinessCode="bussinessCode" |
|||
@getBalance="getScanResult" |
|||
:isTargetScan="true"></winComScanBalanceBind> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</view> |
|||
|
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getPackUnitByItemCode |
|||
} from '@/api/request2.js'; |
|||
|
|||
import selectList from '@/mycomponents/list/selectList.vue' |
|||
import balanceStatus from '@/mycomponents/status/balanceStatus.vue' |
|||
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue' |
|||
import winComScanBalanceBind from '@/mycomponents/scan/winComScanBalanceBind.vue' |
|||
|
|||
|
|||
export default { |
|||
components: { |
|||
selectList, |
|||
balanceStatus, |
|||
winScanLocation, |
|||
winComScanBalanceBind |
|||
}, |
|||
data() { |
|||
return { |
|||
// toPackingNumber:"",//目标托码 |
|||
toPackingNumber:"请扫描目标托码,非必填项",//目标托码 |
|||
toPackUnitCode:"", //目标包装规格 |
|||
packQty:"", |
|||
uom:"", |
|||
batch:"", |
|||
toInventoryStatus:"", |
|||
toLocationCode:"", |
|||
toPackList:[], |
|||
toPackInfoList:[], |
|||
isBatchDisabled:false, |
|||
isLocationDisabled:true, |
|||
isEdit:true, |
|||
isShow:false, |
|||
itemCode:"" |
|||
|
|||
}; |
|||
}, |
|||
|
|||
props: { |
|||
dataContent: { |
|||
type: Object, |
|||
default: {} |
|||
}, |
|||
businessType: { |
|||
type: Object, |
|||
default: {} |
|||
}, |
|||
bussinessCode: { |
|||
type: String, |
|||
default: "" |
|||
}, |
|||
|
|||
showItemInfo:{ |
|||
type: Object, |
|||
default: {} |
|||
} |
|||
|
|||
}, |
|||
computed:{ |
|||
isShowToPackingNumber(){ |
|||
return this.toPackingNumber!="请扫描目标托码,非必填项" |
|||
} |
|||
}, |
|||
watch:{ |
|||
|
|||
}, |
|||
|
|||
|
|||
methods: { |
|||
isShowCollapse(){ |
|||
this.isShow=true |
|||
}, |
|||
handleChange(e){ |
|||
//点击展开 |
|||
if(e.length>0){ |
|||
uni.showLoading({ |
|||
title:"加载中...", |
|||
mask:true |
|||
}) |
|||
this.itemCode =this.showItemInfo.itemCode |
|||
getPackUnitByItemCode(this.itemCode).then(res=>{ |
|||
uni.hideLoading() |
|||
if(res.data.list&&res.data.list.length>0){ |
|||
this.toPackInfoList =res.data.list |
|||
res.data.list.forEach(item=>{ |
|||
this.toPackList.push(item.packUnit) |
|||
}) |
|||
} |
|||
}).catch(error=>{ |
|||
uni.hideLoading() |
|||
this.showErrorMessage(error) |
|||
}) |
|||
|
|||
if(this.showItemInfo){ |
|||
if(!this.toPackUnitCode){ |
|||
this.toPackUnitCode=this.showItemInfo.packUnit |
|||
} |
|||
|
|||
if(!this.packQty){ |
|||
this.packQty=this.showItemInfo.packQty |
|||
} |
|||
|
|||
if(!this.uom){ |
|||
this.uom=this.showItemInfo.uom |
|||
} |
|||
|
|||
if(!this.batch){ |
|||
this.batch=this.showItemInfo.batch |
|||
} |
|||
if(!this.toInventoryStatus){ |
|||
this.toInventoryStatus=this.showItemInfo.inventoryStatus |
|||
} |
|||
|
|||
if(!this.toLocationCode){ |
|||
this.toLocationCode=this.showItemInfo.locationCode |
|||
} |
|||
} |
|||
|
|||
} |
|||
}, |
|||
//扫描之后设置按钮不可编辑 |
|||
//true 不可编辑,false 可编辑 |
|||
setDisable(isDisable){ |
|||
this.isBatchDisabled=isDisable, |
|||
this.isLocationDisabled=!isDisable, |
|||
this.isEdit=!isDisable |
|||
}, |
|||
updateStatus(value) { |
|||
this.toInventoryStatus = value |
|||
}, |
|||
selectPack(value){ |
|||
this.toPackUnitCode=value |
|||
var toPackInfo = this.toPackInfoList.find(r=>r.packUnit==this.toPackUnitCode) |
|||
this.packQty =toPackInfo?.packQty |
|||
this.uom=toPackInfo?.uom |
|||
}, |
|||
|
|||
getScanResult(result){ |
|||
let balance = result.balance; |
|||
var data =result.balance.packageList[0]; |
|||
if(this.itemCode!=balance.itemCode){ |
|||
this.showErrorMessage("扫描物料["+balance.itemCode+"]与绑定物料["+this.itemCode+"]不一致") |
|||
} |
|||
|
|||
this.toPackUnitCode =data.packUnit; |
|||
this.packQty =data.packQty |
|||
this.uom =data.uom; |
|||
this.batch =data.batch; |
|||
this.toPackingNumber =data.packingNumber |
|||
this.toInventoryStatus =data.inventoryStatus |
|||
this.toLocationCode =data.locationCode |
|||
|
|||
this.setDisable(true) |
|||
}, |
|||
|
|||
getData() { |
|||
var data={ |
|||
itemCode:this.itemCode, |
|||
toPackingNumber:this.toPackingNumber, |
|||
packQty:this.packQty, |
|||
packUnit:this.toPackUnitCode, |
|||
batch:this.batch, |
|||
toInventoryStatus:this.toInventoryStatus, |
|||
toLocationCode:this.toLocationCode, |
|||
isCheck:true |
|||
} |
|||
|
|||
if(!data.packUnit){ |
|||
this.showErrorMessage("请填写托包装规格") |
|||
data.isCheck=false; |
|||
return data; |
|||
} |
|||
|
|||
if(!data.packQty){ |
|||
this.showErrorMessage("请填写托包装数量") |
|||
data.isCheck=false; |
|||
return data; |
|||
} |
|||
|
|||
if(!data.batch){ |
|||
this.showErrorMessage("请填写批次") |
|||
data.isCheck=false; |
|||
return data; |
|||
} |
|||
|
|||
if(!data.toInventoryStatus){ |
|||
this.showErrorMessage("请填写状态") |
|||
data.isCheck=false; |
|||
return data; |
|||
} |
|||
|
|||
if(!data.toLocationCode){ |
|||
this.showErrorMessage("请填写库位") |
|||
data.isCheck=false; |
|||
return data; |
|||
} |
|||
|
|||
return data; |
|||
}, |
|||
|
|||
showLocation(){ |
|||
this.$refs.scanPopupLoc.openScanPopup(); |
|||
}, |
|||
|
|||
showPalletLabel(){ |
|||
this.$refs.scanPopupBind.openScanPopup(this.businessType); |
|||
}, |
|||
getScanCode(location, code){ |
|||
this.toLocationCode=code |
|||
}, |
|||
clearPalletCode(){ |
|||
this.toPackingNumber="请扫描目标托码,非必填项" |
|||
this.toPackUnitCode="", //目标包装规格 |
|||
this.packQty="", |
|||
this.uom="", |
|||
this.batch="", |
|||
this.toInventoryStatus="", |
|||
this.toLocationCode="" |
|||
this.toPackInfoList=[] |
|||
this.toPackList=[] |
|||
this.itemCode="" |
|||
this.setDisable(false) |
|||
}, |
|||
clearToLocationCode(){ |
|||
this.toLocationCode="" |
|||
}, |
|||
showErrorMessage(message){ |
|||
this.$refs.comMessage.showErrorMessage(message, res => { |
|||
if (res) { |
|||
} |
|||
}); |
|||
}, |
|||
|
|||
|
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
>>>.uni-easyinput__content-input { |
|||
font-size: 50rpx; |
|||
} |
|||
|
|||
</style> |
Loading…
Reference in new issue