Browse Source

修改发料添加供应商代码

intex
lijuncheng 5 days ago
parent
commit
e0668bc2f0
  1. 635
      src/pages/issue/job/issueDetailBatch.vue
  2. 6
      src/pages/issue/record/directIssueByBatch.vue

635
src/pages/issue/job/issueDetailBatch.vue

@ -8,17 +8,16 @@
<work-station :workshopCode="jobContent.workShopCode"
:productionLineCode="jobContent.detailProductionLineCode"
:workStationCode="jobContent.detailWorkStationCode"
:rawLocationCode="jobContent.detailToLocationCode"
:itemGroup="jobContent.itemGroup" :isShowItemGroup='true'>
:rawLocationCode="jobContent.detailToLocationCode" :itemGroup="jobContent.itemGroup"
:isShowItemGroup='true'>
</work-station>
</view>
</view>
<view class="page-main">
<scroll-view scroll-y="true" class="page-main-scroll">
<view v-for="(toLocation, index) in detailSource">
<comIssueDetailCardBatch ref='comIssueDetailCardBatch' :dataContent="toLocation" :settingParam="jobContent"
@updateData='updateData'
>
<comIssueDetailCardBatch ref='comIssueDetailCardBatch' :dataContent="toLocation"
:settingParam="jobContent" @updateData='updateData'>
</comIssueDetailCardBatch>
<view class="split_line"></view>
</view>
@ -40,11 +39,11 @@
<!-- <com-scan-issue-pack ref="comScanIssuePack" @closeScan='closeScan' @updateData='updateData'
@afterScan='afterScan' :locationCode='fromLocationCode'>
</com-scan-issue-pack> -->
<winScanPackAndLocation :balanceFromInventoryStatuses="true" ref="scanPopup"
@getResult='getScanResult' :noShowBalanceMessage="false" @confirm='confirmFromLocation'>
<winScanPackAndLocation :balanceFromInventoryStatuses="true" ref="scanPopup" @getResult='getScanResult'
:noShowBalanceMessage="false" @confirm='confirmFromLocation'>
</winScanPackAndLocation>
<balance-select ref="balanceSelect" ></balance-select>
<balance-select ref="balanceSelect"></balance-select>
<comMessage ref="comMessage"></comMessage>
</view>
</template>
@ -75,8 +74,8 @@
import {
calc
} from '@/common/calc.js';
import {
getDataSourceBatch,
getTreeDataSource,
@ -84,7 +83,7 @@
getScanCount,
getThreeDataSource
} from '@/common/detail.js';
import {
calcHandleQtyAdd
} from '@/common/record.js';
@ -124,7 +123,7 @@
scanMessage: '',
managementList: [],
managementType: "",
fromLocationCode:''
fromLocationCode: ''
};
},
@ -223,12 +222,12 @@
that.subList = res.data.subList;
that.detailSource = getDataSourceBatch(that.subList)
that.jobContent.detailToLocationCode = res.data.subList[0].toLocationCode
that.toLocationCode= res.data.subList[0].toLocationCode
that.toLocationCode = res.data.subList[0].toLocationCode
that.fromLocationCode = that.subList[0].fromLocationCode
that.detailSource.forEach(r => {
r.subList.forEach(s => {
s.isRecommTaskItem = true//
s.isRecommTaskItem = true //
})
})
//
@ -266,213 +265,213 @@
this.resizeCollapse();
},
getScanResult(result, managementTypeParams) {
if(!result.package.number){
if (!result.package.number) {
this.showErrorMessage("包装号不能为空")
return;
}
this.managementType = managementTypeParams
let array1 = []//
let array2 = []//
this.detailSource.forEach(item=>{
item.subList.forEach(cur=>{
let array1 = [] //
let array2 = [] //
this.detailSource.forEach(item => {
item.subList.forEach(cur => {
array1.push(cur.fromLocationCode)
array2.push(cur.batch)
})
})
//
const obj1 = array1.find(item=>item == result.fromLocationCode)
const obj2 = array2.find(item=>item == result.label.batch)
if(this.jobContent.allowModifyLocation == 'FALSE'){
if(!obj1){
const obj1 = array1.find(item => item == result.fromLocationCode)
const obj2 = array2.find(item => item == result.label.batch)
if (this.jobContent.allowModifyLocation == 'FALSE') {
if (!obj1) {
this.showErrorMessage(`不可以扫描推荐库位【${array1.join(',')}】以外的库位`)
return
}
}
if(this.jobContent.allowModifyBatch == 'FALSE'){
if(!obj2){
if (this.jobContent.allowModifyBatch == 'FALSE') {
if (!obj2) {
this.showErrorMessage(`不可以扫描推荐批次【${array2.join(',')}】以外的批次`)
return
}
}
if(!obj1){
if (!obj1) {
this.recommendQty = 0
}else{
} else {
this.recommendQty = result.balance.qty
}
// this.managementType = managementTypeParams
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") {
this.setDataBatch(result)
}
},
setDataBatch11(result) {
console.log(result)
try {
let that = this
this.balanceinfo = result.balance
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;
}
// 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&&
r.packingNumber==packingNumber
})
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,
packingNumber:packingNumber,
fromLocationCode:this.fromLocationCode,
toLocationCode:this.toLocationCode,
batch:result.label.batch,
handleQty:result.label.qty,
qty:0,
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,
isRecommTaskItem:false,//
// packList:[{
// scaned : true,
// handleQty : Number(result.label.qty),
// toLocationCode : result.balance.toLocationCode,
// }]
})
detail.handleQty = 0
detail.qty = 0
detail.subList.forEach(item=>{
item.handleQty =item.handleQty || 0
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)
return r.batch == batch &&
r.fromLocationCode == result.fromLocationCode &&
r.packingNumber == packingNumber
})
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,
packingNumber: packingNumber,
fromLocationCode: this.fromLocationCode,
toLocationCode: this.toLocationCode,
batch: result.label.batch,
handleQty: result.label.qty,
qty: 0,
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,
isRecommTaskItem: false, //
// packList:[{
// scaned : true,
// handleQty : Number(result.label.qty),
// toLocationCode : result.balance.toLocationCode,
// }]
})
detail.handleQty = 0
detail.qty = 0
detail.subList.forEach(item => {
item.handleQty = item.handleQty || 0
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 {
if (!isExit.cancleScanedHiht && isExit.scaned) {
// this.showMessage("" + batch + "")
isExit.scaned = true
let qty = 0;
if (result.balance != null) {
qty = Number(result.balance.qty);
} 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;
qty = Number(result.label.qty);
}
itemDetail.handleQty = calc.add(itemDetail.handleQty,result.label.qty);
detail.handleQty = 0
detail.balance = result.balance,
detail.subList.forEach(item=>{
item.handleQty =item.handleQty || 0
detail.handleQty = calc.add(detail.handleQty,item.handleQty)
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 => {
item.handleQty = item.handleQty || 0
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()
// 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 {
var scanedLength = 0;
// itemDetail.packList.forEach(res => {
// if (res.scaned) {
// scanedLength++;
// }
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.fromlocationCode = this.fromLocationCode
itemDetail.toLocationCode = this.toLocationCode
itemDetail.isRecommTaskItem = true //
// itemDetail.toInventoryStatus = "OK"
// itemDetail.packList.forEach(pac => {
// pac.scaned = true
// pac.handleQty = Number(result.label.qty);
// pac.toLocationCode = result.balance.toLocationCode;
// })
//
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.fromlocationCode=this.fromLocationCode
itemDetail.toLocationCode=this.toLocationCode
itemDetail.isRecommTaskItem = true//
// 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 => {
console.log(item.handleQty)
item.handleQty = item.handleQty || 0
detail.handleQty = calc.add(detail.handleQty, item.handleQty)
// item.packList.forEach(cur=>{
// cur.handleQty = calc.add(detail.handleQty,item.handleQty)
// })
detail.handleQty = 0
detail.subList.forEach(item=>{
console.log(item.handleQty)
item.handleQty =item.handleQty || 0
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()
}
})
// calcTreeHandleQty(this.detailSource);
this.continueScan()
this.$forceUpdate()
}
}
}
// this.detailSource.forEach(item => {
// item.subList.forEach(detail => {
@ -483,70 +482,71 @@
this.showMessage(e.message)
}
},
setDataBatch(result) {
try {
let that = this
this.balanceinfo = result.balance
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;
}
// 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&&
r.packingNumber==packingNumber
})
//
if (itemDetail == undefined) {
var item ={
scaned:true,
packingNumber:packingNumber,
fromLocationCode:this.fromLocationCode,
toLocationCode:this.toLocationCode,
batch:result.label.batch,
handleQty:result.label.qty,
qty:0,
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,
isRecommTaskItem:false,//
}
detail.subList.push(item)
//
detail.handleQty = 0
detail.qty = 0
detail.subList.forEach(item=>{
item.handleQty =item.handleQty || 0
detail.handleQty = calc.add(detail.handleQty,item.handleQty)
detail.qty = calc.add(detail.qty,item.qty)
})
setTimeout(r => {
that.resizeCollapse();
that.$forceUpdate()
}, 100)
}else {
itemDetail.handleQty=calc.add(itemDetail.handleQty,result.label.qty)
return r.batch == batch &&
r.fromLocationCode == result.fromLocationCode &&
r.packingNumber == packingNumber
})
//
if (itemDetail == undefined) {
var item = {
scaned: true,
packingNumber: packingNumber,
fromLocationCode: this.fromLocationCode,
toLocationCode: this.toLocationCode,
batch: result.label.batch,
handleQty: result.label.qty,
qty: 0,
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,
isRecommTaskItem: false, //
supplierCode: result.label.supplierCode
}
detail.subList.push(item)
//
detail.handleQty = 0
detail.qty = 0
detail.subList.forEach(item => {
item.handleQty = item.handleQty || 0
detail.handleQty = calc.add(detail.handleQty, item.handleQty)
detail.qty = calc.add(detail.qty, item.qty)
})
setTimeout(r => {
that.resizeCollapse();
that.$forceUpdate()
}, 100)
} else {
itemDetail.handleQty = calc.add(itemDetail.handleQty, result.label.qty)
}
}
} catch (e) {
this.showMessage(e.message)
@ -561,7 +561,7 @@
this.scanPopupGetFocus();
}
},
submit() {
uni.showLoading({
title: "提交中....",
@ -589,23 +589,22 @@
submitJob() {
var params = this.setParams()
// if (!params.subList || params.subList.length == 0) {
// uni.hideLoading()
// this.showErrorMessage("")
// return
// }
const isTrue = params.subList.some(item=>{
return item.recordList.some(cur=>cur.scaned) == true
const isTrue = params.subList.some(item => {
return item.recordList.some(cur => cur.scaned) == true
})
if(!isTrue){
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的发料任务")
return
if (!isTrue) {
uni.hideLoading()
this.showErrorMessage("请扫描您需要提交的发料任务")
return
}
console.log("提交参数", params);
issueJobSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
@ -624,43 +623,47 @@
var creator = this.$store.state.user.id
this.detailSource.forEach(toLocationCode => {
let arr = []
toLocationCode.subList.forEach(record=>{
if(record.scaned){
let obj = {...toLocationCode,...record}
obj.recordList = []
delete obj.balance
delete obj.subList
let obj1 ={}
obj1.supplierCode = record.supplierCode;
obj1.batch = record.batch;
obj1.copyContent =record.copyContent;
obj1.fromInventoryStatus =record.fromInventoryStatus;
obj1.fromLocationCode =record.fromLocationCode;
obj1.handleQty =record.handleQty;
obj1.inventoryStatus =record.fromInventoryStatus;
obj1.packQty =record.packQty;
obj1.packUnit =record.packUnit;
obj1.packingNumber =record.packingNumber;
obj1.qty =record.qty;
obj1.scaned =record.scaned;
obj1.toLocationCode =record.toLocationCode;
obj1.fromPackingNumber =record.packingNumber;
obj1.fromBatch = record.batch;
obj1.toBatch = record.batch;
obj1.toInventoryStatus = record.inventoryStatus;
obj1.toPackingNumber ="";
obj1.packingNumber = "";
let single_price = record.balance.singlePrice == null ? 0 : record.balance.singlePrice;
obj1.singlePrice = single_price;
obj1.amount = single_price *record.qty;
obj.recordList.push(obj1)
subList.push(obj)
toLocationCode.subList.forEach(record => {
if (record.scaned) {
let obj = {
...toLocationCode,
...record
}
obj.recordList = []
delete obj.balance
delete obj.subList
let obj1 = {}
obj1.supplierCode = record.supplierCode;
obj1.batch = record.batch;
obj1.copyContent = record.copyContent;
obj1.fromInventoryStatus = record.fromInventoryStatus;
obj1.fromLocationCode = record.fromLocationCode;
obj1.handleQty = record.handleQty;
obj1.inventoryStatus = record.fromInventoryStatus;
obj1.packQty = record.packQty;
obj1.packUnit = record.packUnit;
obj1.packingNumber = record.packingNumber;
obj1.qty = record.qty;
obj1.scaned = record.scaned;
obj1.toLocationCode = record.toLocationCode;
obj1.fromPackingNumber = record.packingNumber;
obj1.fromBatch = record.batch;
obj1.toBatch = record.batch;
obj1.toInventoryStatus = record.inventoryStatus;
obj1.toPackingNumber = "";
obj1.packingNumber = "";
let single_price = record.balance.singlePrice == null ? 0 : record.balance
.singlePrice;
obj1.singlePrice = single_price;
obj1.amount = single_price * record.qty;
obj.recordList.push(obj1)
subList.push(obj)
}
})
})
this.jobContent.subList = subList
this.jobContent.creator = creator;
return this.jobContent;
@ -697,10 +700,10 @@
},
updateData(record) {
this.detailSource.forEach(item=>{
item.handleQty = 0
item.subList.forEach(cur=>{
item.handleQty = calc.add(cur.handleQty,item.handleQty)
this.detailSource.forEach(item => {
item.handleQty = 0
item.subList.forEach(cur => {
item.handleQty = calc.add(cur.handleQty, item.handleQty)
})
})
},
@ -709,33 +712,33 @@
this.resizeCollapse();
// this.autoCommit()
},
autoCommit(){
let str=""
let str1=""
let str2=""
let str3=""
autoCommit() {
let str = ""
let str1 = ""
let str2 = ""
let str3 = ""
let isTrue = true
this.detailSource.forEach(detail=>{
var itemHandleQty=0
detail.subList.forEach(item=>{
this.detailSource.forEach(detail => {
var itemHandleQty = 0
detail.subList.forEach(item => {
//
if(item.scaned){
itemHandleQty=calc.add(itemHandleQty,item.handleQty)
if (item.scaned) {
itemHandleQty = calc.add(itemHandleQty, item.handleQty)
}
})
if(itemHandleQty<detail.qty){
str += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许小于任务数量【${detail.qty}\n`
if (itemHandleQty < detail.qty) {
str += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许小于任务数量【${detail.qty}\n`
}
if(itemHandleQty>detail.qty){
str1 += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许大于任务数量【${detail.qty}\n】`
if (itemHandleQty > detail.qty) {
str1 += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许大于任务数量【${detail.qty}\n】`
}
})
if (this.jobContent.allowSmallerQty == "FALSE") {
if (str) {
str = '不允许提交\n' + str
@ -750,15 +753,15 @@
return
}
}
if (str2) {
str2 = '不允许提交\n' + str2
this.showErrorMessage(str2)
return
}
console.log(str3)
if(str3){
str3 = str3+"是否提交"
if (str3) {
str3 = str3 + "是否提交"
this.$refs.comMessage.showQuestionMessage1(str3, 'red', res => {
if (res) {
//
@ -767,48 +770,50 @@
this.scanPopupGetFocus()
}
});
}else {
} else {
//
this.$throttle(this.submit, 2000, this)()
}
},
autoCommit11(){
// this.$throttle(this.submit, 2000, this)()
// this.jobContent.allowSmallerQty = 'FALSE'
// this.jobContent.allowBiggerQty = 'FALSE'
let str=""
let str1=""
let str2=""
let str3=""
autoCommit11() {
// this.$throttle(this.submit, 2000, this)()
// this.jobContent.allowSmallerQty = 'FALSE'
// this.jobContent.allowBiggerQty = 'FALSE'
let str = ""
let str1 = ""
let str2 = ""
let str3 = ""
let isTrue = true
this.detailSource.forEach(detail => {
const isScaned = detail.subList.some(cur=>cur.scaned)
if(isScaned){
if(parseFloat(detail.handleQty)<parseFloat(detail.qty)){
str += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许小于任务数量【${detail.qty}\n`
const isScaned = detail.subList.some(cur => cur.scaned)
if (isScaned) {
if (parseFloat(detail.handleQty) < parseFloat(detail.qty)) {
str += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许小于任务数量【${detail.qty}\n`
}
if(parseFloat(detail.handleQty)>parseFloat(detail.qty)){
str1 += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许大于任务数量【${detail.qty}\n】`
if (parseFloat(detail.handleQty) > parseFloat(detail.qty)) {
str1 += `物料号【${detail.itemCode}】提交数量【${detail.handleQty}】不允许大于任务数量【${detail.qty}\n】`
}
}
detail.subList.forEach(item => {
if(item.scaned){
if(parseFloat(item.handleQty)>parseFloat(item.balance.qty)){
str2 += `物料号【${detail.itemCode}】批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不可以大于库存数量【${item.balance.qty}\n`
if (item.scaned) {
if (parseFloat(item.handleQty) > parseFloat(item.balance.qty)) {
str2 +=
`物料号【${detail.itemCode}】批次【${item.batch}】提交数量【${parseFloat(item.handleQty)}】不可以大于库存数量【${item.balance.qty}\n`
}
}
if(item.isRecommTaskItem){//
if (item.isRecommTaskItem) { //
item.handleQty = item.handleQty || 0
if(item.handleQty == 0 && isTrue){
if (item.handleQty == 0 && isTrue) {
isTrue = false
str3 = '推荐的箱码没扫,'
}
if(parseFloat(item.handleQty)!=parseFloat(item.qty)){
str3 += `物料号【${detail.itemCode}】批次【${item.batch}】扫描数量【${parseFloat(item.handleQty)}】和任务数量【${item.qty}】不一致\n`
if (parseFloat(item.handleQty) != parseFloat(item.qty)) {
str3 +=
`物料号【${detail.itemCode}】批次【${item.batch}】扫描数量【${parseFloat(item.handleQty)}】和任务数量【${item.qty}】不一致\n`
}
}
})
})
@ -826,15 +831,15 @@
return
}
}
if (str2) {
str2 = '不允许提交\n' + str2
this.showErrorMessage(str2)
return
}
console.log(str3)
if(str3){
str3 = str3+"是否提交"
if (str3) {
str3 = str3 + "是否提交"
this.$refs.comMessage.showQuestionMessage1(str3, 'red', res => {
if (res) {
//
@ -843,7 +848,7 @@
this.scanPopupGetFocus()
}
});
}else {
} else {
//
this.$throttle(this.submit, 2000, this)()
}
@ -932,7 +937,7 @@
closeScanPopup() {
// this.updateCommitBtn();
},
confirmFromLocation(fromLocationCodeParams){
confirmFromLocation(fromLocationCodeParams) {
this.fromLocationCode = fromLocationCodeParams
}
}

6
src/pages/issue/record/directIssueByBatch.vue

@ -245,6 +245,7 @@
let newDetail = createDetailInfo(balance, pack); //
newDetail.packingNumber = pack.number
newDetail.handleQty =label.qty
newDetail.supplierCode =label.supplierCode
itemp.subList.push(newDetail);
this.detailSource.push(itemp)
} else {
@ -260,6 +261,7 @@
let newDetail = createDetailInfo(balance, pack);
newDetail.packingNumber = pack.number
newDetail.handleQty =label.qty
newDetail.supplierCode =label.supplierCode
item.subList.push(newDetail);
} else {
detail.handleQty=calc.add(detail.handleQty,result.label.qty)
@ -455,7 +457,6 @@
var params = {
...this.setRecordParams()
}
console.log("提交参数", JSON.stringify(params));
const isHaveItem = params.subList.find(item => item.handleQty > item.balanceQty)
if (isHaveItem) {
this.showErrorMessage(`物料号${isHaveItem.itemCode}`)
@ -520,7 +521,8 @@
fromPackUnit: detail.packUnit,
toPackUnit: detail.packUnit,
fromPackQty: detail.packQty,
toPackQty: detail.packQty
toPackQty: detail.packQty,
supplierCode:detail.supplierCode
}]
subList.push(submitItem)
}

Loading…
Cancel
Save