Browse Source

YT-573生产退料PDA不显示批次且扫描不上YT-499制品回收时,扫描箱标签时报错;要根据来源库位所在库区查询管理精度,根据管理精度查询库存余额

intex_online20241111
张立 4 months ago
parent
commit
7350388b4f
  1. 2
      src/api/request2.js
  2. 6
      src/common/label.js
  3. 108
      src/mycomponents/detail/comDetailCardBatch.vue
  4. 1
      src/mycomponents/scan/winScanPack.vue
  5. 21
      src/pages/deliver/coms/comScanDeliverPackBatch.vue
  6. 575
      src/pages/deliver/job/deliverDetailBatch.vue
  7. 84
      src/pages/productRecycle/job/productRecycleJobDetail.vue
  8. 80
      src/pages/productionReturn/job/okToReturnDetail.vue

2
src/api/request2.js

@ -4302,7 +4302,7 @@ export function overPackageRecordSubmit(params) {
* *
*/ */
export async function getManagementPrecision(params) { export async function getManagementPrecision(params) {
return request({ return await request({
url: baseApi + "/wms/rule/getPrecisionStrategyByItemCodes", url: baseApi + "/wms/rule/getPrecisionStrategyByItemCodes",
method: "post", method: "post",
data: params, data: params,

6
src/common/label.js

@ -105,6 +105,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode) {
} }
export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) { export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
let managementType = ""
let labelResult = analysisQRCodeLabel(labelItem, scanMsg); let labelResult = analysisQRCodeLabel(labelItem, scanMsg);
if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') { if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') {
//查询包装信息 //查询包装信息
@ -114,7 +115,7 @@ export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
await getManagementPrecisions([labelResult.label.itemCode], locationCode, res => { await getManagementPrecisions([labelResult.label.itemCode], locationCode, res => {
if (res.success) { if (res.success) {
const managementList = res.list; const managementList = res.list;
const managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING' managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING'
if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){ if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){
packingNumber = '' packingNumber = ''
} }
@ -137,11 +138,12 @@ export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
callBack(labelResult); callBack(labelResult);
}) })
} else { } else {
console.log(999,labelResult)
//线边的物料可能没有箱码 //线边的物料可能没有箱码
labelResult.package = labelResult.label; labelResult.package = labelResult.label;
labelResult.package.number = packingNumber1 ? packingNumber1 : '' labelResult.package.number = packingNumber1 ? packingNumber1 : ''
labelResult.package.packingNumber='' labelResult.package.packingNumber=''
labelResult.managementType = managementType
console.log(999,labelResult)
callBack(labelResult); callBack(labelResult);
// labelResult.success = false; // labelResult.success = false;
// labelResult.message = '在条码中未解析到箱码'; // labelResult.message = '在条码中未解析到箱码';

108
src/mycomponents/detail/comDetailCardBatch.vue

@ -1,29 +1,27 @@
<template> <template>
<view style="background-color: #fff;"> <view class="" style="background-color: #fff;">
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false"> <uni-collapse ref="collapse1" @change="">
</item-compare-qty> <uni-collapse-item :open="true">
<view class="" v-for="(item,index) in dataContent.subList" :key="index" :class="item.scaned?'scan_view':''"> <template v-slot:title>
<uni-swipe-action ref="swipeAction" v-if='index==0'> <item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty"
:isShowStdPack="false">
</item-compare-qty>
</template>
<uni-swipe-action-item <view class="" v-for="(item,index) in dataContent.subList" :key="index">
:right-options="(item.scaned&&isEdit)?editAndRemoveOptions : item.scaned? removeOptions:options" <uni-swipe-action ref="swipeAction">
@click="swipeClick($event,item,'parent')" style='padding:0px 0px 5px 0px;align-items: center;'> <uni-swipe-action-item @click="swipeClick($event,item)"
<!-- <recommend :detail="item" :isShowStatus="isShowStatus" :isShowToLocation="false" isShowPack='false'> :right-options="item.scaned?scanOptions:detailOptions"
</recommend> --> style='padding:0px 0px 5px 0px;align-items: center;'>
<recommend :detail="item" :isShowFromLocation="isShowFromLocation" :isShowStatus="isShowStatus" :isShowToLocation="isShowToLocation">
</recommend>
<div style="display: flex;"> </uni-swipe-action-item>
<div style="flex: 1;"> </uni-swipe-action>
<batch v-if="item.batch" :batch="item.batch"></batch> </view>
<location title="来源库位" v-if="item.fromLocationCode" :locationCode="item.fromLocationCode"></location> </uni-collapse-item>
</div> </uni-collapse>
<text style="font-size: 30rpx;color: #2979ff; " @click="copy(item)" v-if="isDevlement()">复制</text> <balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit>
</div>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance"
@confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation' <win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationAreaTypeList="locationAreaTypeList"></win-scan-location> :locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<comMessage ref="message"></comMessage> <comMessage ref="message"></comMessage>
@ -31,20 +29,13 @@
</template> </template>
<script> <script>
import config from '@/static/config.js'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue' import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue' import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue' import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import { import {
getDetailOption, getDetailOption,
getPurchaseReceiptOption, getPurchaseReceiptOption
getRemoveOption,
getEditRemoveOption
} from '@/common/array.js'; } from '@/common/array.js';
export default { export default {
@ -53,10 +44,7 @@
itemCompareQty, itemCompareQty,
recommend, recommend,
balanceQtyEdit, balanceQtyEdit,
winScanLocation, winScanLocation
location,
toLocation,
batch,
}, },
props: { props: {
dataContent: { dataContent: {
@ -79,6 +67,15 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
locationAreaTypeList: { locationAreaTypeList: {
type: Array, type: Array,
default: null default: null
@ -91,10 +88,6 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
isEdit: {
type: Boolean,
default: true
},
}, },
watch: { watch: {
dataContent: { dataContent: {
@ -123,10 +116,7 @@
locatonItem: {}, locatonItem: {},
editItem: {}, editItem: {},
detailOptions: [], detailOptions: [],
scanOptions: [], scanOptions: []
options: [],
removeOptions: [],
editAndRemoveOptions: []
} }
}, },
@ -137,8 +127,7 @@
if (this.scanOptions.length == 0) { if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false) this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, false)
} }
this.removeOptions = getRemoveOption();
this.editAndRemoveOptions = getEditRemoveOption()
// this.showLocation(); // this.showLocation();
}, },
@ -189,35 +178,6 @@
this.locatonItem.toLocationCode = code; this.locatonItem.toLocationCode = code;
this.$emit('updateData') this.$emit('updateData')
}, },
isDevlement() {
return config.isDevelopment;
},
copy(detail) {
console.log(detail)
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
var content = "HPQ;V1.0;I" + detail.itemCode + ";P" + detail.packingNumber + ";B" + detail
.batch + ";Q" + detail.qty
// #ifdef H5
this.$copyText(content).then(
res => {
uni.showToast({
title: '复制采购标签成功',
icon: 'none'
})
}
)
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制采购标签成功'
})
}
})
// #endif
},
} }
} }
</script> </script>

1
src/mycomponents/scan/winScanPack.vue

@ -49,7 +49,6 @@
type: String, type: String,
default: 'HPQ' default: 'HPQ'
}, },
}, },
data() { data() {
return { return {

21
src/pages/deliver/coms/comScanDeliverPackBatch.vue

@ -6,7 +6,7 @@
<view class="pop_title uni-flex space-between"> <view class="pop_title uni-flex space-between">
<view class="" style="font-size: 35rpx;"> <view class="" style="font-size: 35rpx;">
扫描箱码 扫描箱码
</view> </view>
<view class=""> <view class="">
@ -55,7 +55,7 @@
<view class=""> <view class="">
<view class=""> <view class="">
<win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true" <win-com-scan ref="comscan" placeholder="箱标签" @getResult="onScan" :clearResult="true"
headerType="HPQ,HMQ" :isShowHistory="false"> headerType="HPQ,HMQ" :isShowHistory="false" :locationCode='locationCode'>
</win-com-scan> </win-com-scan>
<view style="width: 100%;"> <view style="width: 100%;">
@ -152,6 +152,10 @@
type: String, type: String,
default: '' default: ''
}, },
locationCode:{
type: String,
default: ''
}
}, },
data() { data() {
return { return {
@ -410,7 +414,7 @@
) )
return; return;
} }
if (this.toLocation && result.package.packUnit) { if (this.toLocation) {
let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode); let item = this.toLocation.Items.find(r => r.itemCode == result.package.itemCode);
if (!item) { if (!item) {
this.showErrorMessage('扫描物料代码不属于该任务'); this.showErrorMessage('扫描物料代码不属于该任务');
@ -533,11 +537,12 @@
} }
} else { } else {
that.showErrorMessage('箱码【' + packingCode + '】已经扫描,请继续扫描下一箱', // that.showErrorMessage('' + packingCode + ',',
res => { // res => {
that.getfocus(); // that.getfocus();
} // }
) // )
that.addRecord(batch, label, balance, packageInfo)
} }
} else { } else {

575
src/pages/deliver/job/deliverDetailBatch.vue

@ -9,7 +9,7 @@
<view class="cell_box uni-flex uni-row"> <view class="cell_box uni-flex uni-row">
<view class="cell_info"> <view class="cell_info">
<view class="text_lightblue">发货类型</view> <view class="text_lightblue">发货类型</view>
<view>{{jobContent.deliverType}}</view> <view style="line-height: 34rpx;">{{jobContent.deliverType}}</view>
</view> </view>
<view class="cell_info"> <view class="cell_info">
@ -19,7 +19,7 @@
<view class="cell_info"> <view class="cell_info">
<view class="text_lightblue">目标库位</view> <view class="text_lightblue">目标库位</view>
<view>{{toLocationCode}}</view> <view >{{toLocationCode}}</view>
</view> </view>
</view> </view>
</view> </view>
@ -28,20 +28,19 @@
<view class="page-main"> <view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll"> <scroll-view scroll-y="true" class="page-main-scroll">
<view>
</view>
<view v-for="(toLocation, index) in detailSource"> <view v-for="(toLocation, index) in detailSource">
<comDeliverDetailCardBatch ref='comIssueDetailCardBatch' :dataContent="toLocation" :settingParam="jobContent" <comDeliverDetailCardBatch ref='comIssueDetailCard'
@updateData='updateData' :allowBiggerQty='allowBiggerQty'> :dataContent="toLocation"
</comDeliverDetailCardBatch> :settingParam="jobContent"
<view class="split_line"></view> @updateData='updateData'>
</comDeliverDetailCardBatch>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
<view class="page-footer"> <view class="page-footer">
<view class="uni-flex u-col-center space-between padding_10" style="background-color:ghostwhite; width: 100%; "> <view class="uni-flex u-col-center space-between padding_10"
style="background-color:ghostwhite; width: 100%; ">
<view class=""> <view class="">
</view> </view>
<view class=" uni-flex uni-row"> <view class=" uni-flex uni-row">
@ -49,14 +48,9 @@
</view> </view>
</view> </view>
</view> </view>
<win-scan-button @goScan='openScanDetailPopup'></win-scan-button>
<win-scan-button @goScan='openScanPopup'></win-scan-button> <comScanDeliverPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData' :locationCode='fromLocationCode'>
<!-- <comScanDeliverPackBatch ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'> </comScanDeliverPackBatch>
</comScanDeliverPackBatch> -->
<winScanPackAndLocation :balanceFromInventoryStatuses="false" :toLocationCode="jobToLocationCode" ref="scanPopup"
@getResult='getScanResult' :noShowBalanceMessage="false" @confirm='confirmFromLocation'>
</winScanPackAndLocation>
<comMessage ref="comMessage"></comMessage> <comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -80,19 +74,13 @@
getRemoveOption, getRemoveOption,
getCurrDateTime, getCurrDateTime,
getPackingNumberAndBatch, getPackingNumberAndBatch,
deepCopyData, deepCopyData
compareAsc,
} from '@/common/basic.js'; } from '@/common/basic.js';
import { import {
getTreeDataSource, getDataSource
calcTreeHandleQty, } from '@/pages/issue/js/issue.js';
getScanCount,
getThreeDataSource,
getDataSource,
calcHandleQty,
} from '@/common/detail.js';
import { import {
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
@ -100,10 +88,10 @@
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue' import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import comDeliverDetailCard from '@/pages/deliver/coms/comDeliverDetailCard.vue'
import comDeliverDetailCardBatch from '@/pages/deliver/coms/comDeliverDetailCardBatch.vue' import comDeliverDetailCardBatch from '@/pages/deliver/coms/comDeliverDetailCardBatch.vue'
import comScanDeliverPackBatch from '@/pages/deliver/coms/comScanDeliverPackBatch.vue' import comScanDeliverPackBatch from '@/pages/deliver/coms/comScanDeliverPackBatch.vue'
import jobTop from '@/mycomponents/job/jobTop.vue' import jobTop from '@/mycomponents/job/jobTop.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
export default { export default {
name: 'issueDetail', name: 'issueDetail',
@ -111,9 +99,8 @@
jobDetailPopup, jobDetailPopup,
winScanButton, winScanButton,
comDeliverDetailCardBatch, comDeliverDetailCardBatch,
comScanDeliverPackBatch,
jobTop, jobTop,
winScanPackAndLocation comScanDeliverPackBatch
}, },
data() { data() {
return { return {
@ -126,7 +113,7 @@
status: "", status: "",
toLocationCode: "", toLocationCode: "",
jobStatus: "", jobStatus: "",
allowBiggerQty:"TRUE",// fromLocationCode:''
}; };
}, },
@ -197,16 +184,13 @@
}); });
getDeliverDetail(that.id).then(res => { getDeliverDetail(that.id).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.data && res.data.subList.length > 0) { if (res.data &&res.data.subList.length > 0) {
that.jobContent = res.data; that.jobContent = res.data;
that.jobStatus = res.data.status; that.jobStatus = res.data.status;
that.subList = res.data.subList; that.subList = res.data.subList;
// that.detailSource = res.data; that.detailSource = getDataSource(that.detailSource, that.subList)
that.detailSource = getThreeDataSource(that.jobContent) that.fromLocationCode = that.subList[0].fromLocationCode
console.log(999,that.detailSource)
that.toLocationCode = that.subList[0].toLocationCode that.toLocationCode = that.subList[0].toLocationCode
that.allowBiggerQty = res.data.allowBiggerQty;
that.resizeCollapse(); that.resizeCollapse();
} else { } else {
that.showMessage('未获取到详情'); that.showMessage('未获取到详情');
@ -223,193 +207,14 @@
resizeCollapse() { resizeCollapse() {
this.$nextTick(r => { this.$nextTick(r => {
this.$refs.comIssueDetailCardBatch.forEach(r => { this.$refs.comIssueDetailCard.forEach(r => {
r.resizeCollapse(); r.resizeCollapse();
}) })
}); });
}, },
getScanResult(result, managementTypeParams) {
console.log(222,result)
this.managementType = managementTypeParams
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
this.setDataBatch(result)
}else{
this.setData(result)
}
},
setDataBatch(result) {
try {
let that = this
this.balanceinfo = result.balance
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var locationCode = result.fromLocationCode;
if (!result.balance) {
this.showMessage("没有库存余额")
return;
}
console.log(9558,result)
// var inventoryStatus = "OK";
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.batch == batch &&
r.fromLocationCode == result.fromLocationCode
})
if (itemDetail == undefined) {
var isExit;
for (let subItem of detail.subList) {
var item;
// for (let pack of subItem.packList) {
// if (pack.batch == batch) {
// item = pack;
// isExit = pack;
// break;
// }
// }
// if (item != undefined) {
// subItem.scaned = true
// subItem.handleQty = 0;
// item = undefined
// }
}
if (isExit == undefined) {
// this.showErrorMessage("" + batch + "" + result
// .fromLocationCode + "")
detail.subList.push({
scaned:true,
fromLocationCode:this.fromLocationCode,
batch:result.label.batch,
handleQty:result.label.qty,
qty:result.balance.qty,
inventoryStatus:result.balance.inventoryStatus,
toLocation:result.balance.toLocation,
balance:result.balance,
balanceQty:result.balance.qty,
packQty:result.package.packQty,
packUnit:result.package.packUnit,
uom:result.balance.uom,
// packList:[{
// scaned : true,
// handleQty : Number(result.label.qty),
// toLocationCode : result.balance.toLocationCode,
// }]
})
console.log(999,detail)
detail.handleQty = 0
detail.qty = 0
detail.subList.forEach(item=>{
detail.handleQty = calc.add(detail.handleQty,item.handleQty)
detail.qty = calc.add(detail.qty,item.qty)
// item.packList.forEach(cur=>{
// cur.handleQty = calc.add(detail.handleQty,item.handleQty)
// })
})
setTimeout(r => {
that.resizeCollapse();
that.$forceUpdate()
}, 100)
} else {
if (!isExit.cancleScanedHiht && isExit.scaned) {
// this.showMessage("" + batch + "")
} else {
isExit.scaned = true
let qty = 0;
if (result.balance != null) {
qty = Number(result.balance.qty);
} else {
qty = Number(result.label.qty);
}
isExit.handleQty = Number(result.label.qty);
isExit.toLocationCode = this.toLocationCode;
}
itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty);
detail.handleQty = 0
detail.balance = result.balance,
detail.subList.forEach(item=>{
detail.handleQty = calc.add(detail.handleQty,item.handleQty)
// item.packList.forEach(cur=>{ // cur.handleQty = calc.add(detail.handleQty,item.handleQty) // })
})
// calcHandleQtyAdd(this.detailSource, result.label);
}
this.continueScan()
this.$forceUpdate()
} else {
var scanedLength = 0;
// itemDetail.packList.forEach(res => {
// if (res.scaned) {
// scanedLength++;
// }
// })
//
itemDetail.fromInventoryStatus = result.balance.inventoryStatus;
if (itemDetail.scaned ) {
// this.showMessage("" + packingNumber + "")
// calcHandleQtyAdd(this.detailSource, result.label);
itemDetail.balance=result.balance
itemDetail.balanceQty=result.balance.qty
itemDetail.uom=result.balance.uom,
itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty);
detail.handleQty = 0
detail.subList.forEach(item=>{
detail.handleQty = calc.add(detail.handleQty,item.handleQty)
})
} else {
itemDetail.scaned = true;
this.detailSource[0].subList.sort(compareAsc('scaned')); //
itemDetail.handleQty = result.label.qty;
itemDetail.scaned = true
itemDetail.balance=result.balance
itemDetail.balanceQty=result.balance.qty
itemDetail.uom=result.balance.uom
itemDetail.packQty=result.package.packQty
itemDetail.packUnit=result.package.packUnit
// itemDetail.toInventoryStatus = "OK"
// itemDetail.packList.forEach(pac => {
// pac.scaned = true
// pac.handleQty = Number(result.label.qty);
// pac.toLocationCode = result.balance.toLocationCode;
// })
detail.handleQty = 0
detail.subList.forEach(item=>{
detail.handleQty = calc.add(detail.handleQty,item.handleQty)
// item.packList.forEach(cur=>{ // cur.handleQty = calc.add(detail.handleQty,item.handleQty) // })
})
// calcTreeHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
}
}
}
this.detailSource.forEach(item => {
item.subList.forEach(detail => {
detail.packingNumber = ''
})
})
} catch (e) {
this.showMessage(e.message)
}
},
//
continueScan() {
this.scanCount = getScanCount(this.subList);
if (this.scanCount == this.subList.length) {
this.closeScanPopup();
} else {
this.scanPopupGetFocus();
}
},
submit() { submit() {
uni.showLoading({ uni.showLoading({
title: "提交中....", title: "提交中....",
@ -418,168 +223,103 @@
// //
var itemCodes = [] var itemCodes = []
// let locationCode = this.detailSource[0].toLocationCode
var itemCodes = [] this.detailSource.forEach(toLocationCode => {
let locationCode = this.detailSource[0].subList[0].toLocationCode toLocationCode.Items.forEach(item => {
this.detailSource.forEach(toLocation => { itemCodes.push(item.itemCode)
itemCodes.push(toLocation.itemCode) })
}) })
console.log( this.detailSource)
//
getManagementPrecisions(itemCodes, locationCode, res => {
if (res.success) {
this.managementList = res.list;
console.log(res)
this.managementType = this.managementList && this.managementList[0] ? this.managementList[0].ManagementPrecision : 'BY_PACKAGING'
this.submitJob(); //使
} else { if (locationCode == null) {
uni.hideLoading(); this.submitJob();
// this.showErrorMessage(res.message); } else {
} //
}); getManagementPrecisions(itemCodes, locationCode, res => {
// //使 if (res.success) {
// if (locationCode == null) { this.managementList = res.list;
// this.submitJob(); this.submitJob();
// } else { } else {
// // uni.hideLoading();
// getManagementPrecisions(itemCodes, locationCode, res => { this.showErrorMessage(res.message);
// if (res.success) { }
// this.managementList = res.list; });
// this.submitJob(); }
// } else {
// uni.hideLoading();
// this.showErrorMessage(res.message);
// }
// });
// }
}, },
checkCount() { checkCount(){
let str="" let str=""
this.detailSource.forEach(detail => { this.detailSource.forEach(detail => {
detail.Items.forEach(item => { detail.Items.forEach(item => {
var taskQty =0; var taskQty =0;
item.taskQty =calc.add(taskQty,item.qty) item.taskQty =calc.add(taskQty,item.qty)
var totalQty =0; var totalQty =0;
item.Locations.forEach(lco => { item.Locations.forEach(lco => {
lco.Batchs.forEach(batch => { lco.Batchs.forEach(batch => {
batch.Records.forEach(record => { batch.Records.forEach(record => {
if(record){ // if (batch.qty != record.qty) {
var hanleQty =record.qty?record.qty:0 // var tempHandleQty = 0
totalQty = calc.add(totalQty,hanleQty) // if (record.qty) {
} // tempHandleQty = record.qty
// } else {
// tempHandleQty = 0
// }
// if (batch.qty != 0) {
// str +=
// `${record.packingNumber}${tempHandleQty}${batch.qty}\n`
// }
// }
if(record){
var hanleQty =record.qty?record.qty:0
totalQty = calc.add(totalQty,hanleQty)
}
})
}) })
}) })
}) //
// item.totalQty =totalQty
item.totalQty =totalQty
})
}) })
}) //
// this.detailSource.forEach(detail=>{
this.detailSource.forEach(detail=>{ detail.Items.forEach(item=>{
detail.Items.forEach(item=>{ if(this.jobContent.allowPartialComplete=="FALSE"){
if(this.jobContent.allowPartialComplete=="FALSE"){ if(item.taskQty!=item.totalQty){
if(item.taskQty!=item.totalQty){ str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n`
str += `物料号【${item.itemCode}】任务数量【${item.taskQty}】与实际提交数量【${item.totalQty}】不一致\n` }
}
}
})
})
if(str){
str = '不允许提交\n' + str
this.showErrorMessage(str)
}
return str?false:true
},
checkCountBatch() {
let str = ""
let str1 = ""
let str2 = ""
this.detailSource.forEach(detail => {
var taskQty = 0;
var totalQty = 0;
detail.subList.forEach(item => {
if(item.scaned){
item.taskQty=0
item.totalQty=0
item.taskQty =calc.add(item.taskQty,item.qty)
item.totalQty =calc.add(item.totalQty,item.handleQty)
if (this.jobContent.allowPartialComplete == "FALSE") {
if(item.handleQty!=item.taskQty){
str += `批次【${item.batch}】提交数量【${item.handleQty}】与任务物料数量【${item.taskQty}】不一致\n`
}
}
if (this.allowBiggerQty == 'FALSE') {
if ( item.taskQty < item.totalQty) {
str1 += '数量[' + item.totalQty + ']不允许大于任务数量[' + item.taskQty + ']'
}
}
if(item.handleQty>item.balance.qty){
str2 += `批次【${item.batch}】提交数量【${item.handleQty}】不可以大于库存数量【${item.balance.qty}`
}
} }
}) })
}) })
if(str){
if (str) {
str = '不允许提交\n' + str str = '不允许提交\n' + str
this.showErrorMessage(str) this.showErrorMessage(str)
} }
if (str1) {
str1 = '不允许提交\n' + str1 return str?false:true
this.showErrorMessage(str1)
}
if (str2) {
str2 = '不允许提交\n' + str2
this.showErrorMessage(str2)
}
return str || str1 || str2 ? false : true
}, },
submitJob() { submitJob() {
var params = this.setParams() var params = this.setParams()
console.log("提交参数", params); console.log("提交参数", JSON.stringify(params));
const isTrue = params.subList.some(item=>{
console.log(item.recordList.some(cur=>cur.scaned)) if (params.subList.length == 0) {
return item.recordList.some(cur=>cur.scaned) == true uni.hideLoading()
}) this.$refs.comMessage.showConfirmMessageModal('请扫描箱码')
if(!isTrue){ return
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的发货任务")
return
} }
// return;
// if (params.subList.length == 0) { if(!this.checkCount()){
// uni.hideLoading() uni.hideLoading()
// this.$refs.comMessage.showConfirmMessageModal('') return ;
// return
// }
if(this.managementType == "BY_BATCH" ||this.managementType == "BY_QUANTITY" ){
if (!this.checkCountBatch()) {
uni.hideLoading()
return;
}
}else{
if (!this.checkCount()) {
uni.hideLoading()
return;
}
} }
debugger
deliverJobSubmit(params).then(res => { deliverJobSubmit(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data) { if (res.data) {
this.showCommitSuccessMessage("提交成功\n生成发货记录\n" + res.data) this.showCommitSuccessMessage("提交成功\n生成发货记录\n" + res.data)
} else { } else {
this.showErrorMessage("提交失败[" + res.msg + "]") this.showErrorMessage("提交失败[" + res.msg + "]")
@ -594,34 +334,55 @@
var subList = [] var subList = []
var createTime = getCurrDateTime(); var createTime = getCurrDateTime();
var creator = this.$store.state.user.id var creator = this.$store.state.user.id
console.log(222,this.detailSource)
this.detailSource.forEach(toLocationCode => { this.detailSource.forEach(toLocationCode => {
let obj = {...toLocationCode} toLocationCode.Items.forEach(item => {
delete obj.subList item.Locations.forEach(fromLocation => {
obj.recordList = [] fromLocation.Batchs.forEach(batch => {
let obj1 ={} let subItem = batch.detail;
let arr = toLocationCode.subList.filter(item=>item.scaned) subItem.recordList = [];
arr.forEach(record=>{ if (batch.Records.length > 0) {
obj1.scaned =record.scaned; batch.Records.forEach(r => {
obj1.handleQty =record.handleQty; let record = {};
obj1.fromLocationCode =record.fromLocationCode; record.handleQty = r.qty;
obj1.fromInventoryStatus =record.fromInventoryStatus; record.fromPackingNumber = r
obj1.copyContent =record.copyContent; .packingNumber;
obj1.toContainerNumber = record.ContainerNumber; record.toContainerNumber = r
obj1.toInventoryStatus =record.inventoryStatus; .ContainerNumber;
obj1.toLocationCode = record.toLocationCode; record.toInventoryStatus = r
obj1.supplierCode = record.supplierCode; .inventoryStatus;
obj1.toPackingNumber =''; // record.toLocationCode = subItem
obj1.packingNumber = '' // .toLocationCode;
obj1.fromPackingNumber = ''; record.toLocationCode = this.toLocationCode;
obj1.toBatch = record.batch; record.supplierCode = r.supplierCode;
obj1.toPackingNumber = '';
obj1.packingNumber = ''; //使
obj1.fromPackingNumber =''; if (this.toLocationCode == null) {
obj.recordList.push(obj1) record.toPackingNumber = r
.packingNumber;
record.toBatch = r.batch;
} else {
var info =
getPackingNumberAndBatch(
this.managementList, r
.itemCode,
r.packingNumber, r
.batch);
record.toPackingNumber = info
.packingNumber;
record.toBatch = info.batch;
}
record.fromParentPackingNumber = r
.parentPackingNumber;
subItem.toLocationCode = this.toLocationCode
subItem.recordList.push(record);
})
subList.push(deepCopyData(subItem));
}
})
})
}) })
subList.push(obj)
}) })
this.jobContent.subList = subList this.jobContent.subList = subList
this.jobContent.createTime = createTime; this.jobContent.createTime = createTime;
this.jobContent.creator = creator; this.jobContent.creator = creator;
@ -659,12 +420,30 @@
}, },
updateData(record) { updateData(record) {
calcHandleQty(this.detailSource); let requestLocation = this.detailSource.find(r => r.toLocationCode == record.toLocationCode);
let item = requestLocation.Items.find(r => r.itemCode == record.itemCode);
let itemHandleQty = 0;
if (item != undefined) {
item.Locations.forEach(l => {
let batch = l.Batchs.find(b => (b.packingNumber == record.packingNumber || b
.packingNumber == null || b.packingNumber == '') && b.batch ==
record.batch);
let handleQty = 0;
if (batch != undefined) {
batch.Records.forEach(res => {
handleQty = calc.add(handleQty, res.qty)
})
batch.handleQty = handleQty;
itemHandleQty = calc.add(itemHandleQty, handleQty)
}
})
}
// item.handleQty=itemHandleQty;
}, },
scanPopupGetFocus() { scanPopupGetFocus() {
if (this.$refs.scanPopup != undefined) { if (this.$refs.scanPopup != undefined) {
this.$refs.scanPopup.packGetFocus(); this.$refs.scanPopup.getfocus();
} }
}, },
@ -717,37 +496,15 @@
this.dataContent = result; this.dataContent = result;
this.$forceUpdate(); this.$forceUpdate();
}, },
// openScanDetailPopup() { openScanDetailPopup() {
// var datacontent = {} var datacontent = {}
// // //
// // Object.assign(datacontent, this.detailSource); // Object.assign(datacontent, this.detailSource);
// this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent); this.$refs.comScanIssuePack.openScanPopup(this.detailSource, this.jobContent);
// },
closeScanPopup() {
// this.updateCommitBtn();
}, },
openScanPopup() { closeScanPopup() {
let fromlocationCode = ''; this.updateCommitBtn();
let fromlocationList = [];
for (var i = 0; i < this.detailSource.length; i++) {
let item = this.detailSource[i];
item.subList.forEach(l => {
//
var location = fromlocationList.find(res => res == l.fromLocationCode)
if (location == undefined) {
fromlocationList.push(l.fromLocationCode);
}
//
if (fromlocationCode == '') {
if (!l.scaned) {
fromlocationCode = l.fromLocationCode;
}
}
})
}
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent);
}, },
} }
}; };
</script> </script>

84
src/pages/productRecycle/job/productRecycleJobDetail.vue

@ -72,6 +72,10 @@
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
import {
calc
} from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue' import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue" import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
@ -366,20 +370,22 @@
if (itemDetail) { if (itemDetail) {
// //
if (itemDetail.scaned) { if (itemDetail.scaned) {
this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result // this.showErrorMessage("\n" + batch + "\n" + result
.fromLocationCode + "】\n状态【" + balanceStatus + "】\n已经扫描") // .fromLocationCode + "\n" + balanceStatus + "\n")
return; itemDetail.handleQty = calc.add(itemDetail.handleQty,Number(result.label.qty));
itemDetail.balanceQty = Number(result.label.qty);
} else { } else {
itemDetail.scaned = true; itemDetail.scaned = true;
itemDetail.handleQty = Number(result.balance.qty); itemDetail.handleQty = Number(result.label.qty);
itemDetail.balanceQty = Number(result.label.qty);
itemDetail.toInventoryStatus = result.balance.inventoryStatus; itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.inventoryStatus = result.balance.inventoryStatus; itemDetail.inventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance; itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = Number(result.balance.qty); itemDetail.balance.balanceQty = Number(result.balance.qty);
itemDetail.balance.packQty = Number(result.package.packQty) itemDetail.balance.packQty = Number(result.package.packQty)
itemDetail.balance.packUnit = result.package.packUnit itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
} }
this.calcHandleQty();
} else { } else {
// //
itemDetail = detail.subList.find(r => { itemDetail = detail.subList.find(r => {
@ -390,30 +396,44 @@
if (itemDetail) { if (itemDetail) {
let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus); let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
// //
if (this.jobContent.allowModifyInventoryStatus == "TRUE") { if(balanceStatus!=itemStatus){
this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus + if (this.jobContent.allowModifyInventoryStatus == "TRUE") {
']不一致,是否继续回收?', res => { this.showQuestionMessage('实际库存状态[' + balanceStatus + ']与推荐库存状态[' + itemStatus +
if (res) { ']不一致,是否继续回收?', res => {
itemDetail.scaned = true; if (res) {
itemDetail.handleQty = Number(result.balance.qty); itemDetail.scaned = true;
itemDetail.toInventoryStatus = result.balance.inventoryStatus; itemDetail.handleQty = itemDetail.handleQty ? calc.add(itemDetail.handleQty,Number(result.label.qty)) : Number(result.label.qty);
itemDetail.inventoryStatus = result.balance.inventoryStatus; itemDetail.toInventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance; itemDetail.inventoryStatus = result.balance.inventoryStatus;
itemDetail.balance.balanceQty = result.balance.qty; itemDetail.balance = result.balance;
itemDetail.balance.packQty = result.package.packQty itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.packUnit = result.package.packUnit itemDetail.balance.packQty = result.package.packQty
this.calcHandleQty(); itemDetail.balance.packUnit = result.package.packUnit
} else { this.calcHandleQty();
} else {
this.scanPopupGetFocus();
}
});
} else {
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' +
itemStatus +
']不一致,不允许回收!', res => {
this.scanPopupGetFocus(); this.scanPopupGetFocus();
} });
}); }
} else { //
this.showQuestionMessage('任务中不允许修改库存状态,实际库存状态[' + balanceStatus + ']与推荐库存状态[' + }else{
itemStatus + itemDetail.scaned = true;
']不一致,不允许回收!', res => { itemDetail.handleQty = itemDetail.handleQty ? calc.add(itemDetail.handleQty,Number(result.label.qty)) : Number(result.label.qty);
this.scanPopupGetFocus(); itemDetail.toInventoryStatus = result.balance.inventoryStatus;
}); itemDetail.inventoryStatus = result.balance.inventoryStatus;
itemDetail.balance = result.balance;
itemDetail.balance.balanceQty = result.balance.qty;
itemDetail.balance.packQty = result.package.packQty
itemDetail.balance.packUnit = result.package.packUnit
this.calcHandleQty();
} }
} else { } else {
this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result this.showErrorMessage("\n批次【" + batch + "】\n库位【" + result
.fromLocationCode + "】\n状态【" + balanceStatus + "】\n不在任务列表中") .fromLocationCode + "】\n状态【" + balanceStatus + "】\n不在任务列表中")
@ -492,6 +512,7 @@
checkCountBatch(){ checkCountBatch(){
// //
let str = '' let str = ''
let str1 = ''
this.detailSource.forEach((item) => { this.detailSource.forEach((item) => {
item.subList.forEach(cur => { item.subList.forEach(cur => {
if (cur.qty != cur.handleQty) { if (cur.qty != cur.handleQty) {
@ -503,10 +524,17 @@
} }
str += `物料号【${item.itemCode}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致` str += `物料号【${item.itemCode}】提交数量【${tempHandleQty}】与任务物料数量【${cur.qty}】不一致`
} }
if(cur.handleQty > cur.balance.qty){
str1 += `物料号【${item.itemCode}】提交数量【${cur.handleQty}】不可以大于库存数量【${cur.balance.qty}`
}
}) })
}) })
if (str1) {
this.$refs.comMessage.showMessage(str1);
return
}
if (str) { if (str) {
str = '任务明细未全部完成,是否提交?\n'+str str = '任务明细未全部完成,是否提交?\n'+ str
this.$refs.comMessage.showQuestionMessage1(str, 'red', res => { this.$refs.comMessage.showQuestionMessage1(str, 'red', res => {
if (res) { if (res) {
this.submitJob() this.submitJob()

80
src/pages/productionReturn/job/okToReturnDetail.vue

@ -66,7 +66,9 @@
getManagementPrecisions getManagementPrecisions
} from '@/common/balance.js'; } from '@/common/balance.js';
import {
calc
} from '@/common/calc'
import { import {
getDataSource, getDataSource,
createRecordInfo, createRecordInfo,
@ -256,7 +258,7 @@
}, },
openScanPopup() { openScanPopup() {
this.$refs.scanPopup.openScanPopup(); this.$refs.scanPopup.openScanPopup(this.fromLocationCode);
// let fromlocationCode = ''; // let fromlocationCode = '';
// let fromlocationList = []; // let fromlocationList = [];
// for (var i = 0; i < this.detailSource.length; i++) { // for (var i = 0; i < this.detailSource.length; i++) {
@ -282,6 +284,79 @@
getScanResult(result) { getScanResult(result) {
this.managementType = result.managementType
if (this.managementType == 'BY_BATCH' || this.managementType == 'BY_QUANTITY') {
this.setDataBatch(result)
} else {
this.setData(result)
}
},
setDataBatch(result){
try {
var packingNumber = result.label.packingNumber;
var batch = result.label.batch;
var qty = result.label.qty;
var itemCode = result.label.itemCode;
var detail = this.detailSource.find(r => r.itemCode == itemCode);
if (detail == undefined) {
this.showErrorMessage("物料号【" + itemCode + "】不在列表中")
} else {
var itemDetail = detail.subList.find(r => {
return r.batch == batch
})
if (itemDetail == undefined) {
this.showErrorMessage("批次[" + batch + "]不在列表中")
} else {
if (itemDetail.scaned) {
// this.showErrorMessage("[" + batch + "]")
itemDetail.handleQty =calc.add(itemDetail.handleQty,Number(result.package.qty))
} else {
itemDetail.scaned = true;
itemDetail.handleQty = Number(result.package.qty)
itemDetail.inventoryStatus = "OK"
itemDetail.packQty = result.package.packQty
itemDetail.packUnit = result.package.packUnit
//退,退000000 --nxt
// let balanceStatus = getInventoryStatusName(result.balance.inventoryStatus);
// let itemStatus = getInventoryStatusName(itemDetail.inventoryStatus);
// if (itemDetail.inventoryStatus != result.balance.inventoryStatus) {
// this.showQuestionMessage('[' + balanceStatus + '][' + itemStatus +
// '],?', res => {
// if (res) {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty)
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = result.balance.qty;
// itemDetail.balance.packQty = result.package.packQty
// itemDetail.balance.packUnit = result.package.packUnit
// this.calcHandleQty();
// } else {
// this.scanPopupGetFocus();
// }
// });
// } else {
// itemDetail.scaned = true;
// itemDetail.handleQty = Number(result.balance.qty)
// itemDetail.balance = result.balance;
// itemDetail.balance.balanceQty = result.balance.qty;
// itemDetail.balance.packQty = result.package.packQty
// itemDetail.balance.packUnit = result.package.packUnit
// this.calcHandleQty();
// }
}
this.calcHandleQty();
}
}
this.scanPopupGetFocus();
} catch (e) {
this.showErrorMessage(e.message);
}
},
setData(result){
try { try {
var packingNumber = result.label.packingNumber; var packingNumber = result.label.packingNumber;
var batch = result.label.batch; var batch = result.label.batch;
@ -400,6 +475,7 @@
itemCode: itemCodes, itemCode: itemCodes,
locationCode: this.toLocationCode locationCode: this.toLocationCode
} }
getManagementPrecisions(itemCodes, this.toLocationCode, res => { getManagementPrecisions(itemCodes, this.toLocationCode, res => {
if (res.success) { if (res.success) {
this.managementList = res.list; this.managementList = res.list;

Loading…
Cancel
Save