7 changed files with 327 additions and 8 deletions
@ -0,0 +1,111 @@ |
|||
<template> |
|||
<view> |
|||
<uni-popup ref="popup" @change="change" @maskClick="closeScanPopup()"> |
|||
<view class="popup_box"> |
|||
<view class="pop_title"> |
|||
扫描工位码 |
|||
<text class="fr" @click="closeScanPopup()">关闭</text> |
|||
</view> |
|||
<view class="pop_tab"> |
|||
<view class="tab_info"> |
|||
<win-com-scan ref="comscan" @getScanResult="getScanResult" placeholder="工位码" |
|||
:clearResult="true"></win-com-scan> |
|||
<view class="uni-flex"> |
|||
<button class="clean_scan_btn" @click="cancelClick()">清空</button> |
|||
<button class="scan_btn" @click="scanClick()">扫描</button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</uni-popup> |
|||
<com-message ref="comMessage" @afterClose="getfocus"></com-message> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import winComScan from '@/mycomponents/wincom/winComScan.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import { |
|||
getPositionCodeInfo |
|||
} from '@/api/index.js'; |
|||
import { |
|||
getPositionCodeName |
|||
} from '@/common/basic.js'; |
|||
|
|||
|
|||
export default { |
|||
name: 'winScanByPack', |
|||
components: { |
|||
winComScan, |
|||
comMessage |
|||
}, |
|||
props: { |
|||
title: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
codeType: { |
|||
type: String, |
|||
default: "" |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
scanResult: {}, |
|||
show: false, |
|||
} |
|||
}, |
|||
created() { |
|||
|
|||
}, |
|||
methods: { |
|||
openScanPopup(content) { |
|||
this.$refs.popup.open('bottom'); |
|||
}, |
|||
|
|||
closeScanPopup(content) { |
|||
this.$refs.popup.close(); |
|||
this.$emit("close", ''); |
|||
}, |
|||
|
|||
scanClick() { |
|||
this.$refs.comscan.handelScanMsg(); |
|||
}, |
|||
cancelClick() { |
|||
this.$refs.comscan.clearScanValue(); |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
console.log("扫描",result.data.code) |
|||
this.scanResult =result.data.code |
|||
this.callBack() |
|||
this.closeScanPopup() |
|||
}, |
|||
|
|||
|
|||
callBack() { |
|||
this.$refs.comscan.clear(); |
|||
this.$emit("getScanResult", this.scanResult); |
|||
}, |
|||
getfocus() { |
|||
if (this.$refs.comscan != undefined) { |
|||
this.$refs.comscan.getfocus(); |
|||
} |
|||
}, |
|||
losefocus() { |
|||
if (this.$refs.comscan != undefined) { |
|||
this.$refs.comscan.losefocus(); |
|||
} |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
change(e) { |
|||
this.show = e.show |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,191 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<win-blank-view @goScan='openScanPopup' v-if="!workStationCode"></win-blank-view> |
|||
<view class="top_wrap" v-if="workStationCode"> |
|||
<view class="top_card"> |
|||
<view class="device-detail"> |
|||
<view class="list-style nopad"> |
|||
<view class="ljh_box nopad"> |
|||
<view class="tit_ljh uni-flex"> |
|||
<text class="font_xl text_black text_bold">工位码 : {{workStationCode}}</text> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="uni-flex" style="flex-direction: row; align-items: center;" v-if="workStationCode"> |
|||
<view class="" style="font-size: 35rpx; font-weight: bold; margin: 20rpx;"> |
|||
数量 |
|||
</view> |
|||
|
|||
<com-number-box ref="comNumberBox" v-model="qty" |
|||
:max="999999" :min="0" style='width: 100px;' |
|||
@change="qtyChanged($event)"> |
|||
</com-number-box> |
|||
</view> |
|||
|
|||
<div class="new_bot_box" v-show="workStationCode"> |
|||
<view class="new_btn_bot bot_pos uni-flex"> |
|||
<button class="new_save_btn btn_double" @click="submit()">提交</button> |
|||
</view> |
|||
</div> |
|||
|
|||
<winScanContent ref="scanPopup" @getScanResult='getScanResult' ></winScanContent> |
|||
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan' |
|||
@afterCloseCommitMessage='closeCommitMessage'> |
|||
</com-message> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
returnWarhouseSubmit, |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
showConfirmMsg, |
|||
goHome, |
|||
getRemoveOption, |
|||
getISODateTime, |
|||
scanSuccessAudio, |
|||
scanFailedAudio |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winBlankView from '@/mycomponents/wincom/winBlankView.vue' |
|||
import winScanContent from '@/mycomponents/wincom/winScanContent.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
|||
|
|||
export default { |
|||
name: 'purchasePutaway', |
|||
components: { |
|||
winBlankView, |
|||
comMessage, |
|||
winScanContent, |
|||
comNumberBox |
|||
}, |
|||
data() { |
|||
return { |
|||
workStationCode:"", |
|||
qty:0 |
|||
}; |
|||
}, |
|||
props: { |
|||
}, |
|||
|
|||
onNavigationBarButtonTap(e) { |
|||
if (e.index === 0) { |
|||
goHome(); |
|||
} else if (e.index === 1) { |
|||
window.location.reload(); |
|||
} |
|||
}, |
|||
mounted: function() { |
|||
this.options = getRemoveOption(); |
|||
this.openScanPopup(); |
|||
}, |
|||
|
|||
methods: { |
|||
|
|||
openScanPopup() { |
|||
this.$refs.scanPopup.openScanPopup() |
|||
}, |
|||
|
|||
getScanResult(result) { |
|||
this.workStationCode = result; |
|||
this.$forceUpdate() |
|||
}, |
|||
|
|||
clear() { |
|||
this.workStationCode = "" |
|||
this.qty = "" |
|||
}, |
|||
|
|||
submit() { |
|||
let that = this; |
|||
if (!that.workStationCode) { |
|||
that.showMessage('请扫描工位码'); |
|||
return; |
|||
} |
|||
|
|||
if (that.qty<0) { |
|||
that.showMessage('数量不允许小于0'); |
|||
return; |
|||
} |
|||
|
|||
uni.showLoading({ |
|||
title: "提交中....", |
|||
mask: true |
|||
}); |
|||
var params = this.setParams(); |
|||
console.log(JSON.stringify(params)) |
|||
returnWarhouseSubmit(params).then(res => { |
|||
uni.hideLoading(); |
|||
this.showMessage("提交成功") |
|||
this.clear(); |
|||
}).catch(error => { |
|||
uni.hideLoading(); |
|||
this.showMessage(error.message); |
|||
}) |
|||
|
|||
}, |
|||
setParams() { |
|||
|
|||
var param ={ |
|||
matCode:"", |
|||
endPosition:this.workStationCode, |
|||
returnQty:this.qty |
|||
} |
|||
|
|||
return param; |
|||
|
|||
}, |
|||
|
|||
qtyChanged(value, item, index) { |
|||
if (value <= 0) { |
|||
item.qty = item.defaultHandleQty |
|||
this.$refs['comNumberBox_' + index][0].setValue(item.qty); |
|||
this.showMessage('发料数量不能小于或等于0') |
|||
return; |
|||
} |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
}, |
|||
showConfirmMessage(message) { |
|||
this.$refs.comMessage.showConfirmMessage(message); |
|||
}, |
|||
showCommitSuccess() { |
|||
this.$refs.comMessage.showCommitSuccess(); |
|||
}, |
|||
showScanMessage(message) { |
|||
this.$refs.comMessage.showScanMessage(message); |
|||
}, |
|||
showRescanMessage(message) { |
|||
this.$refs.comMessage.showRescanMessage(message); |
|||
}, |
|||
|
|||
closeScanMessage() { |
|||
this.scanPopupGetFocus(); |
|||
}, |
|||
|
|||
closeCommitMessage() { |
|||
}, |
|||
|
|||
scanPopupGetFocus() { |
|||
this.$refs.scanPopup.getfocus(); |
|||
}, |
|||
|
|||
scanPopupLoseFocus(message) { |
|||
this.$refs.scanPopup.losefocus(); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
Loading…
Reference in new issue