Browse Source

修改扫描叫料

hella_online_20241024
lijuncheng 1 month ago
parent
commit
a877e54368
  1. 16
      src/api/request2.js
  2. 12
      src/mycomponents/qty/numberBox.vue
  3. 16
      src/mycomponents/scan/winScanPackLevel.vue
  4. 200
      src/pages/issue/request/issueScanRequest.vue

16
src/api/request2.js

@ -4846,6 +4846,22 @@ export function inventoryMoveRecordReceive(id) {
});
}
/**
* 扫描叫料查询信息
* @param {*} params
*/
export function getCallmaterials(params) {
return request({
url: baseApi + "/wms/issue-request-main/getCallmaterials",
method: "post",
data:params,
});
}

12
src/mycomponents/qty/numberBox.vue

@ -69,9 +69,21 @@
this.inputValue = +this.value;
},
methods: {
setValue(value){
this.inputValue=value;
},
//
onKeyInput: function(event) {
//console.log( event.detail.value)
//var hint = event.detail.value;
// this.value = event.target.value;
// if (!Number.isInteger(hint)) {
//
// this.inputValue = hint.toString().match(/^\d+/) || 0;
// } else {
//
// this.inputValue = hint;
// }
},
//(minus:;plus:)
_calcValue(type) {

16
src/mycomponents/scan/winScanPackLevel.vue

@ -21,10 +21,10 @@
<view class="uni-center" style="width: 25%; font-size: 32rpx; font-weight: bold;">
优先级
</view>
<view style="width: 100%;">
<uni-data-select style="padding: 20rpx;" v-model="priorityCode" :localdata="priorityList" @change="change"
:clear="false"></uni-data-select>
</view>
<view style="width: 100%;">
<uni-data-select style="padding: 20rpx;" v-model="priorityCode" :localdata="priorityList"
@change="change" :clear="false"></uni-data-select>
</view>
</view>
<view class="">
<view class="">
@ -123,7 +123,13 @@
getScanResult(result) {
if (result.success) {
result.priorityCode =this.priorityCode
result.priorityCode = this.priorityCode
var itemText = this.priorityList.find(res => {
if (res.value == this.priorityCode) {
return res
}
})
result.priorityText = itemText.text
this.$emit("getResult", result);
} else {
this.showMessage(result.message)

200
src/pages/issue/request/issueScanRequest.vue

@ -1,17 +1,83 @@
<template>
<view class="page-wraper">
<view class="">
<com-blank-view @goScan='goScan()'></com-blank-view>
<view class="page-wraper" style="background-color: gray;">
<view class="page-main">
<view class="" v-if="subList.length==0">
<com-blank-view @goScan='goScan()'></com-blank-view>
</view>
<scroll-view scroll-y="true" class="page-main-scroll" >
<view style="margin: 20rpx; font-size: 30rpx; color: red;">说明: 扫描成功后,如果10秒钟不修改数量,自动提交,如果修改数量,需手动点击提交按钮</view>
<view v-if="subList.length>0" class="" style="margin: 20rpx;border-radius: 20rpx; background-color: #DCDCE5">
<view class="" style="font-size: 38rpx; padding: 20rpx; padding-bottom: 0rpx;">
<view class="">
仓库 : {{detailSource.warehouseCode}}
</view>
<view class="">
生产线 : {{detailSource.productionLineCode}}
</view>
<view class="">
车间 : {{detailSource.workshopCode}}
</view>
<view class="">
工位 : {{detailSource.workStationCode}}
</view>
<view class="">
优先级 : {{detailSource.itemText}}
</view>
</view>
<view class="" v-if="subList.length>0" v-for="(item,index) in subList" :key="index">
<view class="" style="font-size: 38rpx; padding: 20rpx; padding-top: 0rpx; ">
<view class="">
物料代码 : {{item.itemCode}}
</view>
<view class="">
单位 : {{item.uom}}
</view>
<view class="">
包装规格 : {{item.packUnit}}
</view>
<view class="">
需求数量 : {{item.qty}}
</view>
<view class="">
包装数量 :
</view>
<view class="" style="margin-top: 10rpx;">
<numberBox :min="1" :step="1" :max="9999999" @change="calcQty($event,countQty)" :value="item.countQty">
</numberBox>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
<view class="page-footer">
<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="submit()">提交</button>
</view>
</view>
</view>
<winScanPackLevel ref="scanPopup" @getResult='getScanResult' headerType="HCMQ" title="叫料标签"
:isShowHistory="false">
</winScanPackLevel>
<comMessage ref="comMessage"></comMessage>
</view>
<winScanPackLevel ref="scanPopup" @getResult='getScanResult' headerType="HCMQ" title="叫料标签" :isShowHistory="false">
</winScanPackLevel>
<comMessage ref="comMessage"></comMessage>
</template>
<script>
import {
issueRequestSubmit,
getCallmaterials
} from '@/api/request2.js';
import {
@ -38,14 +104,16 @@
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue'
import winScanPackLevel from '@/mycomponents/scan/winScanPackLevel.vue'
import numberBox from '@/mycomponents/qty/numberBox.vue'
export default {
name: 'issueRequestSubmit',
components: {
comBlankView,
jobDetailPopup,
comIssueRequestCreator,
winScanPackLevel
winScanPackLevel,
numberBox
},
data() {
return {
@ -58,12 +126,18 @@
scanOptions: [],
requestList: [], //
itemCodeTypeList: [],
useOnTheWay: "FALSE"
useOnTheWay: "FALSE",
countQty: 1,
delayTime:10*1000,
timer:null,
first:true,
}
},
mounted() {},
onLoad(option) {
this.first=true
this.subList=[]
uni.setNavigationBarTitle({
title: option.title
})
@ -79,10 +153,21 @@
this.showErrorMessage(res.message)
}
});
},
onHide() {
this.stopRefresh();
},
onUnload() {
this.stopRefresh();
},
methods: {
goScan() {
this.subList=[]
this.detailSource={
subList: []
},
this.$refs.scanPopup.openScanPopup();
},
getScanResult(result) {
@ -90,29 +175,76 @@
subList: []
}
var labelInfo = result.label;
var data = {
itemCode: labelInfo.itemCode,
location: labelInfo.location,
qty: labelInfo.qty,
uom: labelInfo.uom,
packUnit: labelInfo.packUnit
};
this.detailSource.subList.push(data)
this.detailSource.productionLineCode = labelInfo.productionLineCode;
this.detailSource.workStationCode = labelInfo.workStationCode;
this.detailSource.warehouseCode = labelInfo.warehouseCode;
this.detailSource.workshopCode = labelInfo.workshopCode;
this.detailSource.priority = result.priorityCode
this.submit();
var parmas = {
item_code:labelInfo.itemCode,
pack_unit:labelInfo.packUnit,
workshop_code:labelInfo.workshopCode,
production_line_code:labelInfo.productionLineCode,
work_station_code:labelInfo.workStationCode
}
uni.showLoading({
title:"加载中",
mask:true
})
getCallmaterials(parmas).then(res=>{
uni.hideLoading()
if(res.data){
var testdata = {
itemCode: labelInfo.itemCode,
location: labelInfo.location,
qty: labelInfo.qty,
callmaterialQty:res.data.callmaterialQty,
countQty: res.data.qty,
uom: labelInfo.uom,
packUnit: labelInfo.packUnit
};
this.subList.push(testdata)
this.detailSource.productionLineCode = labelInfo.productionLineCode;
this.detailSource.workStationCode = labelInfo.workStationCode;
this.detailSource.warehouseCode = labelInfo.warehouseCode;
this.detailSource.workshopCode = labelInfo.workshopCode;
this.detailSource.priority = result.priorityCode
this.detailSource.itemText = result.priorityText
this.closeScanPopup()
this.$forceUpdate()
this.timerRefresh();
}else {
this.showErrorMessage("未获取到物料信息")
}
}).catch(error=>{
uni.hideLoading()
this.showErrorMessage(error)
})
},
setParams() {
// this.detailSource.dueTime = getCurrDateOneMonthsTimes();
this.detailSource.subList = this.subList
this.detailSource.isCallMaterialsLabel = "TRUE";
return this.detailSource
},
timerRefresh() {
var that =this;
this.stopRefresh()
this.timer = setInterval(function() {
that.submit();
that.stopRefresh()
console.log('扫描叫料提交');
}, that.delayTime)
},
stopRefresh() {
console.log('stopRefresh扫描叫料刷新');
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
},
submit() {
uni.showLoading({
title: "提交中....",
@ -121,6 +253,7 @@
var params = this.setParams()
console.log("提交参数", JSON.stringify(params));
issueRequestSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成发料申请[" + res.data + "]")
@ -159,6 +292,21 @@
this.$refs.scanPopup.getfocus();
}
},
calcQty(val) {
if(this.first){
this.first=false
return;
}
console.log("calcQty"+val);
this.stopRefresh()
if (val == 0) {
this.showErrorMessage("数量必须大于0")
}else {
this.subList[0].countQty=val
this.subList[0].qty =this.subList[0].countQty*this.subList[0].callmaterialQty
}
},
}
}
</script>

Loading…
Cancel
Save