niexiting
6 months ago
7 changed files with 1017 additions and 9 deletions
@ -1,6 +1 @@ |
|||||
<<<<<<< HEAD |
|
||||
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api
# 租户配置
VITE_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]' |
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/api/admin-api
# 租户配置
VITE_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]' |
||||
======= |
|
||||
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api |
|
||||
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api
# 租户配置
VITE_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]' |
|
||||
>>>>>>> 1ccdeabc43457dad340e3fdcd18fd01e052931c6 |
|
||||
|
@ -0,0 +1,243 @@ |
|||||
|
<template> |
||||
|
<view> |
||||
|
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()"> |
||||
|
<view class="popup_box"> |
||||
|
<view class="pop_title uni-flex space-between"> |
||||
|
<view class="" style="font-size: 35rpx;"> |
||||
|
校验客户标签 |
||||
|
</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="" style="position: relative"> |
||||
|
<win-com-scan ref="comscanFgLabel" placeholder="WMS制品标签" @getResult="getScanFgResult" |
||||
|
:isShowHistory="false" :clearResult="false" :headerType="headerType"></win-com-scan> |
||||
|
<view class="uni-flex" |
||||
|
style="position: absolute; color: #3C9CFF; font-weight: bold; font-size: 15px; left: 10px;bottom:10px; z-index: 999;"> |
||||
|
{{itemCode}} |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class=""> |
||||
|
<win-com-scan-customer-label ref="comscanCustomerLabel" placeholder="客户标签" |
||||
|
@getResult="getScanCustomerResult" :isShowHistory="false" :clearResult="false" |
||||
|
:headerType="headerType"></win-com-scan-customer-label> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</uni-popup> |
||||
|
</view> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import winComScan from '@/mycomponents/scan/winComScan.vue' |
||||
|
import winComScanCustomerLabel from '@/mycomponents/scan/winComScanCustomerLabel.vue' |
||||
|
|
||||
|
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
||||
|
import { |
||||
|
getBalanceByManagementPrecision, |
||||
|
} from '@/common/balance.js'; |
||||
|
|
||||
|
import { |
||||
|
getBasicLocationByCode, |
||||
|
} from '@/api/request2.js'; |
||||
|
|
||||
|
import { |
||||
|
getListLocationAreaTypeDesc, |
||||
|
checkDirectoryItemExist, |
||||
|
getDirectoryItemArray, |
||||
|
getLocationAreaTypeName, |
||||
|
getInventoryStatusDesc |
||||
|
} from '@/common/directory.js'; |
||||
|
export default { |
||||
|
name: 'winScanPack', |
||||
|
emits: ["getResult", "close", "getCountScanResult"], |
||||
|
components: { |
||||
|
winComScan, |
||||
|
winComScanCustomerLabel |
||||
|
}, |
||||
|
props: { |
||||
|
title: { |
||||
|
type: String, |
||||
|
default: '箱标签' |
||||
|
}, |
||||
|
headerType: { |
||||
|
type: String, |
||||
|
default: "HPQ,HMQ" |
||||
|
}, |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
|
||||
|
scanResult: {}, |
||||
|
show: false, |
||||
|
scanList: [], |
||||
|
expand: false, |
||||
|
showScanResult: {}, |
||||
|
expendIcon: 'arrow-down', |
||||
|
fromLocationCode: '', |
||||
|
fromLocation: '', |
||||
|
fromLocationList: [], |
||||
|
fromLocationAreaTypeList: [], |
||||
|
locationOnFocus: false, |
||||
|
businessType: {}, |
||||
|
inventoryStatus: [], |
||||
|
managementPrecision: '', |
||||
|
fromInventoryStatuses: "", |
||||
|
isCheck: false, |
||||
|
itemCode: '', |
||||
|
customerItem: null |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
|
||||
|
}, |
||||
|
methods: { |
||||
|
//直接扫描 |
||||
|
openScanPopupForType(fromLocationCode, businessType) { |
||||
|
this.businessType = businessType; |
||||
|
this.fromLocationCode = fromLocationCode; |
||||
|
if (fromLocationCode != '') { |
||||
|
this.packGetFocus(); |
||||
|
} else { |
||||
|
this.locationGetFocus(); |
||||
|
} |
||||
|
this.fromInventoryStatuses = this.businessType.outInventoryStatuses |
||||
|
this.inventoryStatus = getDirectoryItemArray(this.businessType.outInventoryStatuses); //出库库存状态 |
||||
|
this.fromLocationAreaTypeList = getDirectoryItemArray(this.businessType.fromLocationAreaTypeList); //出库库区 |
||||
|
setTimeout(res => { |
||||
|
this.$refs.popup.open('bottom') |
||||
|
}, 500) |
||||
|
}, |
||||
|
|
||||
|
//在任务中扫描 |
||||
|
openScanPopupForJob(fromLocationCode, fromLocationList, jobContent) { |
||||
|
this.fromLocationCode = fromLocationCode; |
||||
|
this.fromLocationList = fromLocationList; |
||||
|
if (fromLocationCode != '') { |
||||
|
this.packGetFocus(); |
||||
|
} else { |
||||
|
if (this.fromLocationList.length == 0) { |
||||
|
this.locationGetFocus(); |
||||
|
} else { |
||||
|
this.fromLocationCode = this.fromLocationList[0]; |
||||
|
} |
||||
|
} |
||||
|
setTimeout(res => { |
||||
|
this.$refs.popup.open('bottom') |
||||
|
}, 500) |
||||
|
this.fromInventoryStatuses = jobContent.outInventoryStatuses |
||||
|
this.inventoryStatus = getDirectoryItemArray(jobContent.outInventoryStatuses); //出库库存状态; //出库库存状态 |
||||
|
this.fromLocationAreaTypeList = getDirectoryItemArray(jobContent.fromAreaTypes); //出库库存状态 |
||||
|
}, |
||||
|
|
||||
|
closeScanPopup(content) { |
||||
|
this.$refs.popup.close(); |
||||
|
this.$emit("close", ''); |
||||
|
}, |
||||
|
|
||||
|
getScanFgResult(result) { |
||||
|
this.itemCode = result.label.itemCode; |
||||
|
|
||||
|
var filters = [] |
||||
|
filters.push({ |
||||
|
column: "customerCode", |
||||
|
action: "==", |
||||
|
value: '20001004' |
||||
|
}) |
||||
|
filters.push({ |
||||
|
column: "itemCode", |
||||
|
action: "==", |
||||
|
value: this.itemCode |
||||
|
}) |
||||
|
|
||||
|
var params = { |
||||
|
filters: filters, |
||||
|
pageNo: this.pageCurrent, |
||||
|
pageSize: this.pageSize, |
||||
|
} |
||||
|
getCustomerItemList(params).then(res => { |
||||
|
if (res.data != null && res.data.list.length > 0) { |
||||
|
this.customerItem = res.data.list[0]; |
||||
|
} else { |
||||
|
this.showErrorMessage('未查找到客户物料代码'); |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
this.showErrorMessage(error); |
||||
|
}) |
||||
|
|
||||
|
|
||||
|
this.customerGetFocus(); |
||||
|
}, |
||||
|
|
||||
|
getScanCustomerResult(result) { |
||||
|
if (this.customerItem != null) { |
||||
|
if(this.customerItem |
||||
|
) |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
afterCheck() { |
||||
|
|
||||
|
}, |
||||
|
|
||||
|
packGetFocus() { |
||||
|
if (this.$refs.comscanFgLabel != undefined) { |
||||
|
this.$refs.comscanFgLabel.getfocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
packLoseFocus() { |
||||
|
if (this.$refs.comscanFgLabel != undefined) { |
||||
|
this.$refs.comscanFgLabel.losefocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
customerGetFocus() { |
||||
|
if (this.$refs.comscanCustomerLabel != undefined) { |
||||
|
this.$refs.comscanCustomerLabel.getfocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
customerLoseFocus() { |
||||
|
if (this.$refs.comscanCustomerLabel != undefined) { |
||||
|
this.$refs.comscanCustomerLabel.losefocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
locationGetFocus() { |
||||
|
this.fromLocationCode = ''; |
||||
|
this.locationOnFocus = true; |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
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) |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
.scroll-view { |
||||
|
overflow-y: scroll; |
||||
|
height: auto; |
||||
|
max-height: 300rpx; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,234 @@ |
|||||
|
<!--扫描组件--> |
||||
|
<template> |
||||
|
<!-- <page-meta root-font-size="18px"></page-meta> --> |
||||
|
<view> |
||||
|
<view class="pop_tab"> |
||||
|
<view class="tab_info"> |
||||
|
<view class="conbox"> |
||||
|
<textarea inputmode="none" v-model="scanMsg" trim="all" maxlength="1000" |
||||
|
style="margin-left: 5px;width: 90%;" :focus="boxfocus" :placeholder="placeholderValue" |
||||
|
@focus="getfocus" @blur="losefocus" @input="handelScanMsg" :cursor="cursorIndex"></textarea> |
||||
|
</view> |
||||
|
|
||||
|
<view class="uni-flex uni-row space-between u-col-center"> |
||||
|
<view class="uni-flex" style="padding: 10px ; color: #3C9CFF; font-weight: bold; font-size: 15px; "> |
||||
|
{{customerItemCode}} |
||||
|
</view> |
||||
|
<view class="uni-flex"> |
||||
|
<button class="clean_scan_btn" @click="clearScanValue()">清空</button> |
||||
|
<button class="scan_btn" @click="clickScanMsg()">扫描</button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
</view> |
||||
|
</template> |
||||
|
<script> |
||||
|
export default { |
||||
|
name: "winComScan", |
||||
|
emits: ["getResult"], |
||||
|
components: {}, |
||||
|
props: { |
||||
|
placeholder: { |
||||
|
type: String, |
||||
|
default: '请扫描标签' |
||||
|
}, |
||||
|
clearResult: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
boxFocus: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
isShowHistory: { |
||||
|
type: Boolean, |
||||
|
default: true |
||||
|
}, |
||||
|
headerType: { |
||||
|
type: String, |
||||
|
default: 'HPQ' //HLB HMQ HCQ HPQ |
||||
|
} |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
// scanMsg: "HPQ;V1.0;ICE115F11161AG;PP20230427000027;B20230427002;Q100", |
||||
|
scanMsg: "", |
||||
|
boxfocus: false, |
||||
|
placeholderValue: '', |
||||
|
scanResult: {}, |
||||
|
scanList: [], |
||||
|
expand: true, |
||||
|
expendIcon: 'arrow-down', |
||||
|
cursorIndex: 0, |
||||
|
customerItemCode: '' |
||||
|
} |
||||
|
}, |
||||
|
mounted() { |
||||
|
this.boxfocus = true; |
||||
|
uni.hideKeyboard(); |
||||
|
|
||||
|
// #ifdef H5 |
||||
|
if (document.querySelector('textarea') != null) { |
||||
|
document.querySelector('textarea').setAttribute('inputmode', 'none') |
||||
|
} |
||||
|
// #endif |
||||
|
this.hide() |
||||
|
// #ifdef APP-PLUS |
||||
|
// |
||||
|
// this.hide() |
||||
|
// uni.onKeyboardHeightChange(res => { |
||||
|
// console.log(res.height) |
||||
|
// if(res.height>0){ |
||||
|
// // uni.hideKeyboard(); |
||||
|
// plus.key.hideSoftKeybord(); |
||||
|
// } |
||||
|
// }) |
||||
|
// |
||||
|
// uni.onWindowResize((res) => { |
||||
|
// plus.key.hideSoftKeybord() |
||||
|
// }) |
||||
|
// plus.key.hideSoftKeybord(); |
||||
|
// setInterval(function(){ |
||||
|
// plus.key.hideSoftKeybord(); |
||||
|
// // uni.hideKeyboard();//隐藏软键盘 |
||||
|
// // plus.key.hideSoftKeybord(); |
||||
|
// },60); |
||||
|
|
||||
|
// #endif |
||||
|
|
||||
|
// if (this.$el.querySelector('textarea') != null) { |
||||
|
// this.$el.querySelector('textarea').setAttribute('inputmode', 'none') |
||||
|
// } |
||||
|
}, |
||||
|
watch: { |
||||
|
placeholder() { |
||||
|
this.placeholderValue = '请扫描' + this.placeholder; |
||||
|
} |
||||
|
}, |
||||
|
created() { |
||||
|
this.placeholderValue = '请扫描' + this.placeholder; |
||||
|
}, |
||||
|
methods: { |
||||
|
hide() { |
||||
|
// #ifdef APP-PLUS |
||||
|
// 只是解决软键盘的闪现 |
||||
|
var interval = setInterval(function() { |
||||
|
uni.hideKeyboard(); //隐藏软键盘 |
||||
|
console.log('刷新') |
||||
|
}, 5); |
||||
|
setTimeout(() => { |
||||
|
clearInterval(interval); |
||||
|
console.log('停止刷新') |
||||
|
}, 1000); |
||||
|
// #endif |
||||
|
}, |
||||
|
getValue() { |
||||
|
return this.scanMsg |
||||
|
}, |
||||
|
setValue(val) { |
||||
|
this.scanMsg = val |
||||
|
}, |
||||
|
clearScanValue() { |
||||
|
this.scanMsg = '' |
||||
|
this.getfocus(); |
||||
|
}, |
||||
|
clickScanMsg() { |
||||
|
this.scanMsg = this.scanMsg + "\n"; |
||||
|
this.handelScanMsg(); |
||||
|
}, |
||||
|
handelScanMsg() { |
||||
|
let that = this; |
||||
|
let index = that.scanMsg.indexOf('\n'); |
||||
|
if (index >= 0) { |
||||
|
setTimeout(() => { |
||||
|
that.losefocus(); |
||||
|
let content = uni.$u.trim(that.scanMsg) |
||||
|
if (content == "") { |
||||
|
that.getfocus(); |
||||
|
this.$refs.comMessage.showErrorMessage("扫描内容为空,请重新扫描", res => { |
||||
|
if (res) { |
||||
|
that.scanMsg = "" |
||||
|
that.getfocus(); |
||||
|
} |
||||
|
}) |
||||
|
return; |
||||
|
} |
||||
|
let items = that.scanMsg.split('*'); |
||||
|
this.customerItemCode = items[1]; |
||||
|
that.$emit("getResult", this.customerItemCode); |
||||
|
}, 500); |
||||
|
} |
||||
|
}, |
||||
|
getfocus() { |
||||
|
let that = this; |
||||
|
this.$nextTick(r => { |
||||
|
that.boxfocus = true; |
||||
|
}); |
||||
|
this.hide() |
||||
|
}, |
||||
|
losefocus() { |
||||
|
let that = this; |
||||
|
this.$nextTick(r => { |
||||
|
that.boxfocus = false; |
||||
|
}); |
||||
|
}, |
||||
|
clear() { |
||||
|
if (this.clearResult) { |
||||
|
this.cursorIndex = 0; |
||||
|
this.scanMsg = '' |
||||
|
} |
||||
|
}, |
||||
|
iconClick(type) { |
||||
|
this.$emit("clearResult", this.scanMsgk); |
||||
|
}, |
||||
|
expands() { |
||||
|
this.expand = !this.expand; |
||||
|
this.expendIcon = this.expand == true ? "arrow-down" : "arrow-up" |
||||
|
}, |
||||
|
scanClick() { |
||||
|
this.handelScanMsg(); |
||||
|
}, |
||||
|
cancelClick() { |
||||
|
this.clear(); |
||||
|
this.getfocus(); |
||||
|
}, |
||||
|
showItem(item) { |
||||
|
this.$refs.comMessage.showMessage(item, res => { |
||||
|
if (res) { |
||||
|
// this.$refs.modal.cancelClose(); |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
scanQRCode() { |
||||
|
let that = this; |
||||
|
uni.scanCode({ |
||||
|
onlyFromCamera: true, |
||||
|
success: (res) => { |
||||
|
that.scanMsg = res.result; |
||||
|
that.$emit("getResult", res.result); |
||||
|
console.log('扫描二维码成功,结果:' + res.result); |
||||
|
}, |
||||
|
fail: (res) => { |
||||
|
that.showItem('扫描出现错误:' + res.result); |
||||
|
console.log('扫描出现错误:' + res.result); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<script module="textarea" lang="renderjs"> |
||||
|
export default { |
||||
|
mounted() { |
||||
|
document.querySelector('textarea').setAttribute('inputmode', 'none') |
||||
|
}, |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
|
||||
|
</style> |
@ -0,0 +1,519 @@ |
|||||
|
<template> |
||||
|
<view class="page-wraper"> |
||||
|
<view class=""> |
||||
|
<com-blank-view @goScan='showFromLocationPopup' v-if="customerCode==''" title='选择用户'></com-blank-view> |
||||
|
</view> |
||||
|
<view class="page-wraper" v-if="customerCode!=''"> |
||||
|
<view class="page-header"> |
||||
|
<view class="header_item"> |
||||
|
客户代码 : {{customerCode}} |
||||
|
</view> |
||||
|
<view class='split_line'></view> |
||||
|
</view> |
||||
|
<view class="page-main"> |
||||
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
||||
|
<!-- <view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
||||
|
<view class=""> |
||||
|
<recordDetailCard :dataContent="item" :index="index" :settingParam="dataContent" |
||||
|
:isShowFromLocation="false" @removeItem="removeItem(index,item)" |
||||
|
@updateData="updateData" @removePack="removePack"> |
||||
|
</recordDetailCard> |
||||
|
</view> |
||||
|
</view> --> |
||||
|
</scroll-view> |
||||
|
</view> |
||||
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
||||
|
</view> |
||||
|
<u-select v-model="show" mode="mutil-column-auto" :list="customerList" |
||||
|
style="height: 50%; background-color: white; " @confirm="confirmSelect"></u-select> |
||||
|
|
||||
|
<win-check-fg-label ref="scanPopup"></win-check-fg-label> |
||||
|
<!-- <win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation='false'> |
||||
|
</win-scan-pack-and-location> --> |
||||
|
<comMessage ref="comMessage"></comMessage> |
||||
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
||||
|
:locationAreaTypeList="fromLocationAreaTypeList"></win-scan-location> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
issueRecordSubmit, |
||||
|
getWorkShopLineStation, |
||||
|
getBasicCustomerList |
||||
|
} from '@/api/request2.js'; |
||||
|
|
||||
|
import { |
||||
|
goHome, |
||||
|
getPackingNumberAndBatchByList, |
||||
|
deepCopyData |
||||
|
} from '@/common/basic.js'; |
||||
|
|
||||
|
import { |
||||
|
calc |
||||
|
} from '@/common/calc.js'; |
||||
|
|
||||
|
import { |
||||
|
getInventoryStatusDesc, |
||||
|
getDirectoryItemArray |
||||
|
} from '@/common/directory.js'; |
||||
|
|
||||
|
import { |
||||
|
getBusinessType, |
||||
|
createItemInfo, |
||||
|
createDetailInfo, |
||||
|
calcTreeHandleQty |
||||
|
} from '@/common/record.js'; |
||||
|
|
||||
|
import { |
||||
|
getManagementPrecisions, |
||||
|
getPrecisionStrategyList, |
||||
|
getPrecisionStrategyParams |
||||
|
} from '@/common/balance.js'; |
||||
|
|
||||
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
||||
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
||||
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
||||
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
||||
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
||||
|
import winCheckFgLabel from "@/mycomponents/scan/winCheckFgLabel.vue" |
||||
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
||||
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
||||
|
import recordDetailCard from '@/mycomponents/record/recordDetailCard.vue' |
||||
|
|
||||
|
export default { |
||||
|
components: { |
||||
|
winScanButton, |
||||
|
winScanPack, |
||||
|
requiredLocation, |
||||
|
comBlankView, |
||||
|
winScanLocation, |
||||
|
winCheckFgLabel, |
||||
|
recordComDetailCard, |
||||
|
recordDetailCard |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
id: '', |
||||
|
dataContent: {}, //内容 |
||||
|
detailSource: [], //绑定在页面上的数据源 |
||||
|
fromLocationInfo: {}, |
||||
|
fromLocationCode: "", |
||||
|
fromLocationAreaTypeList: [], |
||||
|
toLocationAreaTypeList: [], |
||||
|
inInventoryStatus: "", //目标入库库存状态 |
||||
|
outInventoryStatus: "", //来源出库库存状态 |
||||
|
businessType: {}, |
||||
|
showToLoaction: true, |
||||
|
recommendLocationList: [], //推荐库位列表 |
||||
|
fromWarehouseCode: '', //来源仓库 |
||||
|
businessTypeCode: "Issue", |
||||
|
positionList: [], |
||||
|
show: false, |
||||
|
positionInfo: "请选择生产线", |
||||
|
customerList: [], |
||||
|
show: true, |
||||
|
customerCode: '', |
||||
|
customerName: '', |
||||
|
}; |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
this.clearData(); |
||||
|
// getBusinessType(this.businessTypeCode, res => { |
||||
|
// if (res.success) { |
||||
|
// this.businessType = res.businessType; |
||||
|
// this.fromLocationAreaTypeList = res.fromLocationAreaTypeList; |
||||
|
// this.toLocationAreaTypeList = res.toLocationAreaTypeList; |
||||
|
// // this.showFromLocationPopup(); |
||||
|
// } else { |
||||
|
// this.showErrorMessage(res.message) |
||||
|
// } |
||||
|
// }); |
||||
|
|
||||
|
getBasicCustomerList().then(res => { |
||||
|
if (res.data.length > 0) { |
||||
|
var list = res.data; |
||||
|
list.forEach(item => { |
||||
|
item.label = item.name |
||||
|
item.value = item.code |
||||
|
}) |
||||
|
this.customerList = list; |
||||
|
|
||||
|
} |
||||
|
}).catch(error => { |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
//返回首页 |
||||
|
onNavigationBarButtonTap(e) { |
||||
|
if (e.index === 0) { |
||||
|
goHome(); |
||||
|
} |
||||
|
}, |
||||
|
//拦截返回按钮事件 |
||||
|
onBackPress(e) {}, |
||||
|
|
||||
|
onPullDownRefresh() {}, |
||||
|
|
||||
|
mounted() {}, |
||||
|
|
||||
|
methods: { |
||||
|
getScanResult(result) { |
||||
|
let balance = result.balance; |
||||
|
let label = result.label; |
||||
|
let pack = result.package; |
||||
|
var item = this.detailSource.find(res => { |
||||
|
if (res.itemCode == balance.itemCode) { |
||||
|
return res |
||||
|
} |
||||
|
}) |
||||
|
if (this.fromWarehouseCode == '') { |
||||
|
this.fromWarehouseCode = balance.warehouseCode; |
||||
|
} |
||||
|
if (item == undefined) { |
||||
|
// 获取推荐库位 |
||||
|
// this.getRecommendLocation(balance, pack, toLocation => { |
||||
|
var itemp = createItemInfo(balance, pack); |
||||
|
let newDetail = createDetailInfo(balance, pack); // |
||||
|
// newDetail.toLocationCode = toLocation.code; |
||||
|
// newDetail.toWarehouseCode = toLocation.warehouseCode; |
||||
|
itemp.subList.push(newDetail); |
||||
|
var dataList = pack.subList |
||||
|
this.detailSource.push(itemp) |
||||
|
this.detailSource.forEach(res => { |
||||
|
res.subList.forEach(pack => { |
||||
|
pack.packList = dataList.filter(c => c.parentNumber == pack |
||||
|
.packingNumber) |
||||
|
pack.packList.forEach(pac => { |
||||
|
pac.parentPackingNumber = pac.parentNumber; |
||||
|
pac.packingNumber = pac.number; |
||||
|
pac.inventoryStatus = "OK"; |
||||
|
pac.scaned = true; |
||||
|
}) |
||||
|
}) |
||||
|
}) |
||||
|
// }) |
||||
|
|
||||
|
} else { |
||||
|
var itemDetail = item.subList.find(r => r.packingNumber == balance.packingNumber && r.batch == |
||||
|
balance.batch); |
||||
|
if (itemDetail != undefined) { |
||||
|
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") |
||||
|
} |
||||
|
} |
||||
|
// calcTreeHandleQty(this.detailSource); |
||||
|
}, |
||||
|
|
||||
|
//获取推荐库位 |
||||
|
getRecommendLocation(balance, pack, callback) { |
||||
|
uni.showLoading({ |
||||
|
title: '扫描中...', |
||||
|
mask: true |
||||
|
}) |
||||
|
let recommend = this.recommendLocationList.find(r => r.itemCode == balance.itemCode); |
||||
|
if (recommend == undefined) { |
||||
|
let param = { |
||||
|
itemCode: balance.itemCode, |
||||
|
batch: balance.batch, |
||||
|
inventoryStatus: balance.inventoryStatus, |
||||
|
supplierCode: pack.supplierCode, |
||||
|
businessCode: this.businessTypeCode |
||||
|
}; |
||||
|
console.log(JSON.stringify(param)) |
||||
|
getPutawayRecommendLocation(param).then(res => { |
||||
|
this.recommendLocationList.push({ |
||||
|
itemCode: balance.itemCode, |
||||
|
locationCode: res.data.code |
||||
|
}) |
||||
|
callback(res.data); |
||||
|
uni.hideLoading(); |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error); |
||||
|
uni.hideLoading(); |
||||
|
}) |
||||
|
|
||||
|
} else { |
||||
|
callback(recommend); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
showErrorMessage(message) { |
||||
|
this.$refs.comMessage.showErrorMessage(message, res => { |
||||
|
if (res) {} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
calcTreeHandleQty() { |
||||
|
for (let item of this.detailSource) { |
||||
|
item.qty = 0; |
||||
|
for (let detail of item.subList) { |
||||
|
if (detail != undefined) { |
||||
|
item.qty = calc.add(item.qty, detail.qty) |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
this.$forceUpdate(); |
||||
|
}, |
||||
|
|
||||
|
showSelect() { |
||||
|
this.show = true |
||||
|
}, |
||||
|
|
||||
|
confirmSelect(e) { |
||||
|
if (e.length > 0) { |
||||
|
this.customerCode = e[0].value |
||||
|
this.customerName = e[0].label |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
updateData() { |
||||
|
this.calcTreeHandleQty(); |
||||
|
}, |
||||
|
|
||||
|
removeItem(index, item) { |
||||
|
this.detailSource.splice(index, 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(); |
||||
|
}, |
||||
|
|
||||
|
openScanPopup() { |
||||
|
// if (this.fromLocationCode == "") { |
||||
|
// this.showFromLocationPopup(); |
||||
|
// return |
||||
|
// } |
||||
|
this.$refs.scanPopup.openScanPopupForType(this.fromLocationCode, this.businessType); |
||||
|
}, |
||||
|
|
||||
|
showFromLocationPopup() { |
||||
|
this.show = true; |
||||
|
|
||||
|
// this.$nextTick(() => { |
||||
|
// this.$refs.scanLocationCode.openScanPopup(); |
||||
|
// }) |
||||
|
}, |
||||
|
|
||||
|
showCustomerList() { |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.scanLocationCode.openScanPopup(); |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
closeScanPopup() { |
||||
|
if (this.$refs.scanPopup != undefined) { |
||||
|
this.$refs.scanPopup.closeScanPopup(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
scanPopupGetFocus() { |
||||
|
if (this.$refs.scanPopup != undefined) { |
||||
|
this.$refs.scanPopup.getfocus(); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// scanLocationCode(location, code) { |
||||
|
// this.toLocationCode = code |
||||
|
// this.toLocationCode = location; |
||||
|
|
||||
|
// }, |
||||
|
|
||||
|
commit() { |
||||
|
uni.showLoading({ |
||||
|
title: "提交中....", |
||||
|
mask: true |
||||
|
}); |
||||
|
|
||||
|
//记录有目标库位,需要查询管理模式 |
||||
|
let precisionStrategyParams = getPrecisionStrategyParams(this.detailSource); |
||||
|
//2:获取管理模式,封装参数 |
||||
|
getPrecisionStrategyList(precisionStrategyParams, res => { |
||||
|
if (res.success) { |
||||
|
this.managementList = res.list; |
||||
|
var params = { |
||||
|
...this.setRecordParams() |
||||
|
} |
||||
|
console.log("提交参数", JSON.stringify(params)); |
||||
|
|
||||
|
issueRecordSubmit(params).then(res => { |
||||
|
uni.hideLoading() |
||||
|
if (res.data) { |
||||
|
this.showCommitSuccessMessage("提交成功<br>生成采购上架记录<br>" + res.data) |
||||
|
} else { |
||||
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
||||
|
} |
||||
|
}).catch(error => { |
||||
|
uni.hideLoading() |
||||
|
this.showErrorMessage(error) |
||||
|
}) |
||||
|
} else { |
||||
|
uni.hideLoading(); |
||||
|
this.showErrorMessage(res.message); |
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
getItemAndLocationRelations() { |
||||
|
var itemList = [] |
||||
|
this.detailSource.forEach(item => { |
||||
|
item.subList.forEach(detail => { |
||||
|
if (detail.scaned) { |
||||
|
detail.toLocationCode = this.toLocationCode; |
||||
|
var filterResult = itemList.filter(res => { |
||||
|
if (res.itemCode == item.itemCode && |
||||
|
res.locationCode == detail.toLocationCode && |
||||
|
res.batch == detail.batch && |
||||
|
res.inventoryStatus == detail.inventoryStatus) { |
||||
|
return res |
||||
|
} |
||||
|
}) |
||||
|
//去掉重复元素 |
||||
|
if (filterResult.length == 0) { |
||||
|
var result = { |
||||
|
itemCode: item.itemCode, |
||||
|
locationCode: detail.toLocationCode, |
||||
|
batch: detail.batch, |
||||
|
inventoryStatus: detail.inventoryStatus, |
||||
|
} |
||||
|
itemList.push(result) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
return itemList; |
||||
|
}, |
||||
|
|
||||
|
setRecordParams() { |
||||
|
var subList = [] |
||||
|
var creator = this.$store.state.user.id |
||||
|
this.detailSource.forEach(item => { |
||||
|
item.subList.forEach(detail => { |
||||
|
if (detail.scaned) { |
||||
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
||||
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
||||
|
var submitItem = deepCopyData(detail) |
||||
|
submitItem.toPackingNumber = info.packingNumber; |
||||
|
submitItem.toBatch = info.batch; |
||||
|
submitItem.toContainerNumber = detail.containerNumber; |
||||
|
|
||||
|
submitItem.fromPackingNumber = info.packingNumber; |
||||
|
submitItem.fromBatch = info.batch; |
||||
|
submitItem.fromContainerNumber = detail.containerNumber; |
||||
|
|
||||
|
submitItem.fromLocationCode = detail.locationCode; |
||||
|
submitItem.toLocationCode = detail.toLocationCode; |
||||
|
|
||||
|
// detail.toInventoryStatus = detail.inventoryStatus |
||||
|
// detail.toLocationCode = detail.toLocationCode |
||||
|
submitItem.qty = detail.handleQty; |
||||
|
submitItem.package = ""; |
||||
|
submitItem.recordList = [{ |
||||
|
toInventoryStatus: detail.inventoryStatus, |
||||
|
fromPackingNumber: info.packingNumber, |
||||
|
fromBatch: info.batch, |
||||
|
toPackingNumber: info.packingNumber, |
||||
|
toBatch: info.batch, |
||||
|
fromLocationCode: detail.locationCode, |
||||
|
toLocationCode: detail.toLocationCode, |
||||
|
handleQty: detail.handleQty |
||||
|
}] |
||||
|
subList.push(submitItem) |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
if (subList.length > 0) { |
||||
|
this.dataContent.toWarehouseCode = subList[0].toWarehouseCode; |
||||
|
} |
||||
|
this.dataContent.subList = subList |
||||
|
this.dataContent.creator = creator; |
||||
|
this.dataContent.fromWarehouseCode = this.fromWarehouseCode; |
||||
|
return this.dataContent; |
||||
|
}, |
||||
|
|
||||
|
showMessage(message) { |
||||
|
this.$refs.comMessage.showMessage(message, res => { |
||||
|
if (res) {} |
||||
|
}); |
||||
|
}, |
||||
|
showErrorMessage(message) { |
||||
|
this.$refs.comMessage.showErrorMessage(message, res => { |
||||
|
if (res) { |
||||
|
|
||||
|
} |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
showScanMessage(message) { |
||||
|
this.$refs.comMessage.showScanMessage(message); |
||||
|
}, |
||||
|
|
||||
|
afterCloseMessage() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
|
||||
|
closeScanMessage() { |
||||
|
this.scanPopupGetFocus(); |
||||
|
}, |
||||
|
getLocation(location, code) { |
||||
|
this.getFromLocationCode(location, code) |
||||
|
}, |
||||
|
getFromLocationCode(location, code) { |
||||
|
this.fromLocationInfo = location; |
||||
|
this.fromLocationCode = code; |
||||
|
this.openScanPopup(); |
||||
|
}, |
||||
|
getToLocationCode(location, code) { |
||||
|
if (this.fromLocationCode == code) { |
||||
|
uni.showToast({ |
||||
|
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", |
||||
|
duration: 2000 |
||||
|
}) |
||||
|
return |
||||
|
} |
||||
|
this.toLocationCode = code; |
||||
|
}, |
||||
|
|
||||
|
showCommitSuccessMessage(hint) { |
||||
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
||||
|
this.clearData(); |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
updateData() { |
||||
|
// this.calcTreeHandleQty(); |
||||
|
for (var i = 0; i < this.detailSource.length; i++) { |
||||
|
let item = this.detailSource[i]; |
||||
|
if (item.qty == 0) { |
||||
|
this.detailSource.splice(i, 1) |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
clearData() { |
||||
|
this.fromLocationInfo = {}; |
||||
|
this.fromLocationCode = ''; |
||||
|
this.fromWarehouseCode = ''; |
||||
|
this.toWarehouseCode = ''; |
||||
|
this.detailSource = []; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped lang="scss"> |
||||
|
.u-drawer-content { |
||||
|
height: 500rpx; |
||||
|
background-color: bisque; |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue