12 changed files with 671 additions and 8 deletions
@ -0,0 +1,190 @@ |
|||
<template> |
|||
<view> |
|||
<uni-popup ref="popupqtyedit" type="center"> |
|||
<view class="uni-popup-view" style="display: flex;flex-direction: column; width: 500rpx;"> |
|||
<view |
|||
style="display: flex; justify-content: center; align-items: center; padding: 10rpx;flex-direction: column;"> |
|||
<view style="padding: 10rpx; font-weight: bold; font-size: 35rpx;">{{title}}</view> |
|||
<view class="" style="width: 100%; background-color: black;height: 1rpx;"> |
|||
</view> |
|||
</view> |
|||
<view style="padding: 6rpx;margin-left: 15rpx;">箱码 : {{dataContent.recommendPackingCode}}</view> |
|||
<view style="padding: 6rpx;margin-left: 15rpx;">物料号 : {{dataContent.itemCode}}</view> |
|||
<view style="padding: 6rpx;margin-left: 15rpx;">名称 : {{dataContent.itemName}}</view> |
|||
<view style="padding: 6rpx;margin-left: 15rpx;">描述 : {{dataContent.itemDesc1}}</view> |
|||
<view style="display: flex; justify-content: center;align-items: center; padding: 6rpx;"> |
|||
<com-number-box v-model="value" :max="99999999" :min="0" style='margin: 0px 5px' /> |
|||
<view class=""> |
|||
({{dataContent.uom}}) |
|||
</view> |
|||
</view> |
|||
<view class="uni-popup-button-box"> |
|||
<button @click="submit" class="save-button" style="width: 220rpx;margin-top: 10rpx; " type="primary">确定</button> |
|||
|
|||
|
|||
</view> |
|||
</view> |
|||
<comMessage ref="comMessage"></comMessage> |
|||
</uni-popup> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
showErrorMsg, |
|||
} from '@/common/basic.js'; |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import comNumberBox from '@/mycomponents/common/comNumberBox.vue' |
|||
export default { |
|||
components: { |
|||
comMessage, |
|||
comNumberBox |
|||
}, |
|||
props: { |
|||
title: { |
|||
type: String, |
|||
default: "" |
|||
} |
|||
}, |
|||
data() { |
|||
return { |
|||
value: 0, |
|||
defaultValue: 0, |
|||
vaildMaxValue: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
//允许小于等于0 |
|||
allowZero: { |
|||
type: Boolean, |
|||
default: true |
|||
}, |
|||
dataContent: {}, |
|||
} |
|||
}, |
|||
created() { |
|||
|
|||
}, |
|||
methods: { |
|||
openPopup(qty) { |
|||
this.value = qty; |
|||
this.defaultValue = qty; |
|||
this.$refs['popupqtyedit'].open("center"); |
|||
}, |
|||
//vaild,提交是是否校验数量 |
|||
openPopup1(qty, vaild) { |
|||
this.value = qty; |
|||
this.defaultValue = qty; |
|||
this.vaildMaxValue = vaild; |
|||
this.$refs['popupqtyedit'].open("center"); |
|||
}, |
|||
//vaildqty校验的数量,提交时与输入的值做比较 |
|||
openPopup2(qty, vaildqty) { |
|||
this.value = qty; |
|||
this.defaultValue = vaildqty; |
|||
this.vaildMaxValue = true; |
|||
this.$refs['popupqtyedit'].open("center"); |
|||
}, |
|||
//qty当前数量,vaildqty校验的最大数量 , isZero数量是否允许为0 |
|||
openPopup3(item, qty, vaildqty, isZero) { |
|||
this.dataContent = item |
|||
this.value = qty; |
|||
this.defaultValue = vaildqty; |
|||
this.vaildMaxValue = true; |
|||
this.allowZero = isZero; |
|||
this.$refs['popupqtyedit'].open("center"); |
|||
}, |
|||
//qty当前数量,不验证最大值,不允许为0 |
|||
openPopup4(qty, vaildMaxValue, isZero) { |
|||
this.value = qty; |
|||
this.defaultValue = qty; |
|||
this.vaildMaxValue = vaildMaxValue; |
|||
this.allowZero = isZero; |
|||
this.$refs['popupqtyedit'].open("center"); |
|||
}, |
|||
//确定 |
|||
submit() { |
|||
let that = this; |
|||
if (that.value === "") { |
|||
this.showMessage('数量不能为空'); |
|||
that.value = that.defaultValue; |
|||
} else { |
|||
let qty = Number(that.value); |
|||
if (that.vaildMaxValue) { |
|||
if (qty > that.defaultValue) { |
|||
this.showMessage('数量不能大于' + that.defaultValue); |
|||
that.value = that.defaultValue; |
|||
} else { |
|||
if (!that.allowZero) //不允许0 |
|||
{ |
|||
if (qty == 0) { |
|||
this.showMessage('数量不能为0'); |
|||
that.value = that.value; |
|||
} else if (qty < 0) { |
|||
this.showMessage('数量不能小于0'); |
|||
that.value = that.value; |
|||
} else { |
|||
that.$emit("getvalue", qty); |
|||
that.$refs['popupqtyedit'].close(); |
|||
} |
|||
} else { |
|||
that.$emit("getvalue", qty); |
|||
that.$refs['popupqtyedit'].close(); |
|||
} |
|||
} |
|||
} else { |
|||
if (!that.allowZero) //不允许0 |
|||
{ |
|||
if (qty == 0) { |
|||
this.showMessage('数量不能为0'); |
|||
that.value = that.defaultValue; |
|||
} else if (qty < 0) { |
|||
this.showMessage('数量不能小于0'); |
|||
that.value = that.defaultValue; |
|||
} else { |
|||
that.$emit("getvalue", qty); |
|||
that.$refs['popupqtyedit'].close(); |
|||
} |
|||
} else { |
|||
that.$emit("getvalue", qty); |
|||
that.$refs['popupqtyedit'].close(); |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
showMessage(message) { |
|||
this.$refs.comMessage.showMessage(message); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<!-- background-color: #fff; --> |
|||
<style scoped lang="scss"> |
|||
.center { |
|||
flex: auto; |
|||
display: flex; |
|||
flex-direction: column; |
|||
justify-content: center; |
|||
// align-items: center; |
|||
} |
|||
|
|||
.flex-item { |
|||
width: 50%; |
|||
text-align: center; |
|||
} |
|||
|
|||
.messageButton { |
|||
border-color: #F8F8F8; |
|||
} |
|||
|
|||
.messagePopup { |
|||
background-color: #fff; |
|||
border-radius: 5px; |
|||
} |
|||
|
|||
/deep/ .uni-input-input { |
|||
font-size: 20px; |
|||
height: 46px; |
|||
} |
|||
</style> |
@ -0,0 +1,164 @@ |
|||
<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'; |
|||
|
|||
export default { |
|||
name: 'winScanByPack', |
|||
components: { |
|||
winComScan, |
|||
comMessage |
|||
}, |
|||
props: { |
|||
title: { |
|||
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) |
|||
if (result != null) { |
|||
if(result.data.code[0].toUpperCase()!="W"){ |
|||
this.showMessage("标签格式不正确") |
|||
return; |
|||
} |
|||
// uni.showLoading({ |
|||
// title: '扫描中...', |
|||
// mask: true |
|||
// }) |
|||
var data = |
|||
{ |
|||
code: "W19", |
|||
partCode: "TMDLYA0AFM6A", |
|||
partName: "P000000000000015", |
|||
partDesc: "MY前保总成件售后件(冲孔)", |
|||
basicUom: "PC", |
|||
locationCode: "W", |
|||
locationName: "原物料库位", |
|||
stdPackQty: 100, |
|||
remark: null, |
|||
tenantId: null, |
|||
extraProperties: {}, |
|||
concurrencyStamp: "b3f2cf7ba3e14166bb97dac768d91741", |
|||
lastModificationTime: null, |
|||
lastModifierId: null, |
|||
creationTime: "2024-02-28T14:47:08.6878607", |
|||
creatorId: null, |
|||
qty:0, |
|||
id: "4c40f72b-a86d-54be-aed2-3a1100a46436" |
|||
} |
|||
this.scanResult = data; |
|||
this.callBack() |
|||
this.closeScanPopup() |
|||
|
|||
} |
|||
}, |
|||
|
|||
getLabelResult(label) { |
|||
let labelResult = { |
|||
sucess: true, |
|||
message: "", |
|||
data: label, |
|||
// data: { |
|||
// isPack: true, |
|||
// // scanType: null, |
|||
// itemCode: label.itemCode, |
|||
// itemName: label.itemName, |
|||
// itemDesc1: label.itemDesc1, |
|||
// itemDesc2: label.itemDesc2, |
|||
// lot: label.lot, |
|||
// qty: label.qty, |
|||
// uom: label.uom, |
|||
// poNumber: label.poNumber, |
|||
// // asn: null, |
|||
// packingCode: label.code, |
|||
// supplierBatch: label.supplierBatch, |
|||
// // order: null, |
|||
// // poLine: null, |
|||
// code: label.code, |
|||
// } |
|||
|
|||
}; |
|||
labelResult.data.isPack = true; |
|||
labelResult.data.packingCode = label.code; |
|||
return labelResult; |
|||
}, |
|||
|
|||
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,264 @@ |
|||
<template> |
|||
<page-meta root-font-size="18px"></page-meta> |
|||
<view class=""> |
|||
<win-blank-view @goScan='openScanPopup' v-if="itemList.length==0"></win-blank-view> |
|||
<view class="top_wrap" v-if="itemList.length>0"> |
|||
<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">位置码 : {{dataContent.code}}</text> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
|
|||
<scroll-view scroll-y="true" |
|||
@scroll="scroll" class="scroll-detail"> |
|||
|
|||
<view class="detail-list margin_top" v-for="(item, index) in itemList" :key="item.id"> |
|||
<view class="detail-content"> |
|||
<view class="choose_main"> |
|||
<view class="ljh_box"> |
|||
<view class="tit_ljh">{{ item.partCode }}</view> |
|||
<view class="ljh_left desc_ljh"> |
|||
<view class="font_xs text_lightblue">{{ item.partName }}</view> |
|||
<view class="font_xs text_lightblue">{{ item.partDesc }}</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="list_form"> |
|||
<view class="uni-container"> |
|||
<uni-table style="overflow-x: hidden;"> |
|||
<uni-tr> |
|||
<uni-th width="50">库位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.locationCode }}({{item.locationName}}) |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">数量</text></uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view |
|||
style="display: flex;flex-direction: row;justify-content:center;align-items: center;"> |
|||
<com-number-box :ref="'comNumberBox_'+index" v-model="item.qty" |
|||
:max="999999" :min="0" style='width: 100px;' |
|||
@change="qtyChanged($event,item,index)"> |
|||
</com-number-box> |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">单位</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_packingCode"> |
|||
{{ item.basicUom }} |
|||
</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
<uni-tr> |
|||
<uni-th width="50">标包数</uni-th> |
|||
<uni-th width="240" align="center"> |
|||
<view class="text_black">{{item.stdPackQty }}</view> |
|||
</uni-th> |
|||
</uni-tr> |
|||
</uni-table> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="choose_marked" v-if="item.scaned"> |
|||
<image src="@/static/image_marked.svg"></image> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</scroll-view> |
|||
|
|||
<div class="new_bot_box" v-show="itemList.length>0"> |
|||
<view class="new_btn_bot bot_pos uni-flex"> |
|||
<button class="new_clear_btn btn_double" @click="clear()">清空</button> |
|||
<button class="new_save_btn btn_double" @click="submit()">提交</button> |
|||
</view> |
|||
</div> |
|||
|
|||
<!-- <win-scan-button @goScan='openScanPopup' v-if="itemList.length>0"></win-scan-button> --> |
|||
<winScanByPosition ref="scanPopup" @getScanResult='getScanResult'></winScanByPosition> |
|||
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan' |
|||
@afterCloseCommitMessage='closeCommitMessage'> |
|||
</com-message> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
issueRequest |
|||
} from '@/api/index.js'; |
|||
|
|||
import { |
|||
showConfirmMsg, |
|||
goHome, |
|||
getRemoveOption |
|||
} from '@/common/basic.js'; |
|||
|
|||
import winBlankView from '@/mycomponents/wincom/winBlankView.vue' |
|||
import winScanButton from '@/mycomponents/wincom/winScanButton.vue' |
|||
import winScanByPosition from '@/mycomponents/wincom/winScanByPosition.vue' |
|||
import comMessage from '@/mycomponents/common/comMessage.vue' |
|||
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
|||
|
|||
export default { |
|||
name: 'purchasePutaway', |
|||
components: { |
|||
winBlankView, |
|||
comMessage, |
|||
winScanButton, |
|||
winScanByPosition, |
|||
comNumberBox |
|||
}, |
|||
data() { |
|||
return { |
|||
itemList: [], |
|||
dataContent:{} |
|||
}; |
|||
}, |
|||
props: { |
|||
// locationTypes: { |
|||
// type: [Array, String, Number], |
|||
// value: '' |
|||
// }, |
|||
}, |
|||
|
|||
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.dataContent = result; |
|||
this.itemList.push(result) |
|||
|
|||
}, |
|||
|
|||
clear() { |
|||
this.itemList=[]; |
|||
this.dataContent ={} |
|||
}, |
|||
|
|||
|
|||
submit() { |
|||
let that = this; |
|||
if (that.itemList.length === 0) { |
|||
that.showMessage('请扫描位置码'); |
|||
return; |
|||
} |
|||
|
|||
// uni.showLoading({ |
|||
// title: "提交中....", |
|||
// mask: true |
|||
// }); |
|||
var params = this.setParams(); |
|||
console.log(JSON.stringify(params)) |
|||
// issueRequest(params).then(res=>{ |
|||
// uni.hideLoading(); |
|||
// if (res) { |
|||
// this.showCommitSuccess() |
|||
// }else { |
|||
// this.showMessage("提交失败"); |
|||
// } |
|||
// }).catch(error=>{ |
|||
// uni.hideLoading(); |
|||
// this.showMessage(error.message); |
|||
// }) |
|||
|
|||
}, |
|||
setParams(){ |
|||
var param ={ |
|||
worker:localStorage.userName_CN ==""?localStorage.userName:localStorage.userName_CN, |
|||
type:"Issue_Manual", |
|||
details:[] |
|||
} |
|||
|
|||
this.itemList.forEach(res=>{ |
|||
var data = { |
|||
itemCode:res.partCode, |
|||
itemName:res.partName, |
|||
uom:res.basicUom, |
|||
qty:res.qty, |
|||
toLocationCode:res.locationCode, |
|||
status:1 |
|||
} |
|||
param.details.push(data) |
|||
}) |
|||
return param; |
|||
|
|||
}, |
|||
|
|||
qtyChanged(value, item, index) { |
|||
if (value <= 0) { |
|||
this.showMessage('发料数量不能小于或等于0') |
|||
item.handledQty = item.defaultHandleQty |
|||
this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|||
return ; |
|||
} |
|||
// else if (value > item.defaultHandleQty) { |
|||
// item.handledQty = item.defaultHandleQty |
|||
// this.showMessage('发料数量不能大于库存数量:' + item.handledQty) |
|||
// this.$refs['comNumberBox_' + index][0].setValue(item.handledQty); |
|||
// } |
|||
}, |
|||
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() { |
|||
// this.openScanPopup(); |
|||
}, |
|||
|
|||
scanPopupGetFocus() { |
|||
this.$refs.scanPopup.getfocus(); |
|||
}, |
|||
|
|||
scanPopupLoseFocus(message) { |
|||
this.$refs.scanPopup.losefocus(); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
</style> |
Loading…
Reference in new issue