Browse Source

修改扫描叫料

hella_online_20241024
lijuncheng 4 months ago
parent
commit
a877e54368
  1. 16
      src/api/request2.js
  2. 12
      src/mycomponents/qty/numberBox.vue
  3. 12
      src/mycomponents/scan/winScanPackLevel.vue
  4. 166
      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; this.inputValue = +this.value;
}, },
methods: { methods: {
setValue(value){
this.inputValue=value;
},
// //
onKeyInput: function(event) { onKeyInput: function(event) {
//console.log( event.detail.value)
//var hint = event.detail.value;
// this.value = event.target.value; // this.value = event.target.value;
// if (!Number.isInteger(hint)) {
//
// this.inputValue = hint.toString().match(/^\d+/) || 0;
// } else {
//
// this.inputValue = hint;
// }
}, },
//(minus:;plus:) //(minus:;plus:)
_calcValue(type) { _calcValue(type) {

12
src/mycomponents/scan/winScanPackLevel.vue

@ -22,8 +22,8 @@
优先级 优先级
</view> </view>
<view style="width: 100%;"> <view style="width: 100%;">
<uni-data-select style="padding: 20rpx;" v-model="priorityCode" :localdata="priorityList" @change="change" <uni-data-select style="padding: 20rpx;" v-model="priorityCode" :localdata="priorityList"
:clear="false"></uni-data-select> @change="change" :clear="false"></uni-data-select>
</view> </view>
</view> </view>
<view class=""> <view class="">
@ -123,7 +123,13 @@
getScanResult(result) { getScanResult(result) {
if (result.success) { 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); this.$emit("getResult", result);
} else { } else {
this.showMessage(result.message) this.showMessage(result.message)

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

@ -1,17 +1,83 @@
<template> <template>
<view class="page-wraper"> <view class="page-wraper" style="background-color: gray;">
<view class=""> <view class="page-main">
<view class="" v-if="subList.length==0">
<com-blank-view @goScan='goScan()'></com-blank-view> <com-blank-view @goScan='goScan()'></com-blank-view>
</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>
<winScanPackLevel ref="scanPopup" @getResult='getScanResult' headerType="HCMQ" title="叫料标签" :isShowHistory="false"> <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> </winScanPackLevel>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view>
</template> </template>
<script> <script>
import { import {
issueRequestSubmit, issueRequestSubmit,
getCallmaterials
} from '@/api/request2.js'; } from '@/api/request2.js';
import { import {
@ -38,14 +104,16 @@
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue' import comIssueRequestCreator from '@/pages/issue/coms/comIssueRequestCreator.vue'
import winScanPackLevel from '@/mycomponents/scan/winScanPackLevel.vue' import winScanPackLevel from '@/mycomponents/scan/winScanPackLevel.vue'
import numberBox from '@/mycomponents/qty/numberBox.vue'
export default { export default {
name: 'issueRequestSubmit',
components: { components: {
comBlankView, comBlankView,
jobDetailPopup, jobDetailPopup,
comIssueRequestCreator, comIssueRequestCreator,
winScanPackLevel winScanPackLevel,
numberBox
}, },
data() { data() {
return { return {
@ -58,12 +126,18 @@
scanOptions: [], scanOptions: [],
requestList: [], // requestList: [], //
itemCodeTypeList: [], itemCodeTypeList: [],
useOnTheWay: "FALSE" useOnTheWay: "FALSE",
countQty: 1,
delayTime:10*1000,
timer:null,
first:true,
} }
}, },
mounted() {}, mounted() {},
onLoad(option) { onLoad(option) {
this.first=true
this.subList=[]
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: option.title title: option.title
}) })
@ -79,10 +153,21 @@
this.showErrorMessage(res.message) this.showErrorMessage(res.message)
} }
}); });
},
onHide() {
this.stopRefresh();
},
onUnload() {
this.stopRefresh();
}, },
methods: { methods: {
goScan() { goScan() {
this.subList=[]
this.detailSource={
subList: []
},
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup();
}, },
getScanResult(result) { getScanResult(result) {
@ -91,28 +176,75 @@
} }
var labelInfo = result.label; var labelInfo = result.label;
var data = { 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, itemCode: labelInfo.itemCode,
location: labelInfo.location, location: labelInfo.location,
qty: labelInfo.qty, qty: labelInfo.qty,
callmaterialQty:res.data.callmaterialQty,
countQty: res.data.qty,
uom: labelInfo.uom, uom: labelInfo.uom,
packUnit: labelInfo.packUnit packUnit: labelInfo.packUnit
}; };
this.detailSource.subList.push(data) this.subList.push(testdata)
this.detailSource.productionLineCode = labelInfo.productionLineCode; this.detailSource.productionLineCode = labelInfo.productionLineCode;
this.detailSource.workStationCode = labelInfo.workStationCode; this.detailSource.workStationCode = labelInfo.workStationCode;
this.detailSource.warehouseCode = labelInfo.warehouseCode; this.detailSource.warehouseCode = labelInfo.warehouseCode;
this.detailSource.workshopCode = labelInfo.workshopCode; this.detailSource.workshopCode = labelInfo.workshopCode;
this.detailSource.priority = result.priorityCode this.detailSource.priority = result.priorityCode
this.submit(); this.detailSource.itemText = result.priorityText
this.closeScanPopup()
this.$forceUpdate()
this.timerRefresh();
}else {
this.showErrorMessage("未获取到物料信息")
}
}).catch(error=>{
uni.hideLoading()
this.showErrorMessage(error)
})
}, },
setParams() { setParams() {
// this.detailSource.dueTime = getCurrDateOneMonthsTimes(); // this.detailSource.dueTime = getCurrDateOneMonthsTimes();
this.detailSource.subList = this.subList
this.detailSource.isCallMaterialsLabel = "TRUE"; this.detailSource.isCallMaterialsLabel = "TRUE";
return this.detailSource 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() { submit() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
@ -121,6 +253,7 @@
var params = this.setParams() var params = this.setParams()
console.log("提交参数", JSON.stringify(params)); console.log("提交参数", JSON.stringify(params));
issueRequestSubmit(params).then(res => { issueRequestSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成发料申请[" + res.data + "]") this.showCommitSuccessMessage("提交成功\n生成发料申请[" + res.data + "]")
@ -159,6 +292,21 @@
this.$refs.scanPopup.getfocus(); 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> </script>

Loading…
Cancel
Save