|
@ -92,9 +92,11 @@ |
|
|
:updateTypeEdiltSubList="true" |
|
|
:updateTypeEdiltSubList="true" |
|
|
@tableSelectionDelete="tableSelectionDelete" |
|
|
@tableSelectionDelete="tableSelectionDelete" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
|
|
@clearSearchInput="clearSearchInput" |
|
|
@submitForm="submitForm" |
|
|
@submitForm="submitForm" |
|
|
@onEnter="onEnter" |
|
|
@onEnter="onEnter" |
|
|
@onChange="onChangeForm" |
|
|
@onChange="onChangeForm" |
|
|
|
|
|
@inputNumberChange="inputNumberChange" |
|
|
> |
|
|
> |
|
|
|
|
|
|
|
|
<template #hahaha> |
|
|
<template #hahaha> |
|
@ -367,6 +369,21 @@ const searchTableSuccess1 = (formField, searchField, val, type, row) => { |
|
|
formRef.value.formRef.setValues(setV) |
|
|
formRef.value.formRef.setValues(setV) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const clearSearchInput = (formField) => { |
|
|
|
|
|
if(formField == 'supplierCode'){ |
|
|
|
|
|
formRef.value.formRef.setValues({ |
|
|
|
|
|
hahaha:'', |
|
|
|
|
|
hehehe:'', |
|
|
|
|
|
poNumber:'', |
|
|
|
|
|
receiptNumber:'', |
|
|
|
|
|
asnNumber:'', |
|
|
|
|
|
}) |
|
|
|
|
|
tableData.value = [] |
|
|
|
|
|
}else if(formField == 'locationCode'){ |
|
|
|
|
|
tableData.value = [] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = async (formField, searchField, val, formRef, type, row) => { |
|
|
const searchTableSuccess = async (formField, searchField, val, formRef, type, row) => { |
|
|
console.log('searchTableSuccess', formField, searchField, val, formRef, type, row) |
|
|
console.log('searchTableSuccess', formField, searchField, val, formRef, type, row) |
|
@ -381,32 +398,37 @@ const searchTableSuccess = async (formField, searchField, val, formRef, type, ro |
|
|
if(formField=='supplierCode'){ |
|
|
if(formField=='supplierCode'){ |
|
|
setV['supplierName'] = val[0]['shortName'] |
|
|
setV['supplierName'] = val[0]['shortName'] |
|
|
tableData.value = [] |
|
|
tableData.value = [] |
|
|
}else if(formField == 'locationCode' ){ |
|
|
|
|
|
// 退货库位 获取明细列表 |
|
|
|
|
|
let subList = await PurchasereturnRequestDetailApi.queryBalancePurchaseReceiptSpareReturn({ |
|
|
|
|
|
supplierCode:formRef.formModel.supplierCode,//供应商代码 |
|
|
|
|
|
poNumber:formRef.formModel.poNumber,// |
|
|
|
|
|
receiptNumber:formRef.formModel.receiptNumber,//采购收货记录单号 |
|
|
|
|
|
fromLocationCode:val[0][searchField]//库位代码 |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
console.log('subList',subList) |
|
|
|
|
|
if(subList&&subList.length>0){ |
|
|
|
|
|
tableData.value = subList |
|
|
|
|
|
tableData.value.forEach((item,index)=>({ |
|
|
|
|
|
'id':index |
|
|
|
|
|
})) |
|
|
|
|
|
}else{ |
|
|
|
|
|
tableData.value = [] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
formRef.setValues(setV) |
|
|
formRef.setValues(setV) |
|
|
|
|
|
if(formField == 'locationCode' ){ |
|
|
|
|
|
// 退货库位 获取明细列表 |
|
|
|
|
|
getTableData() |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
const getTableData = async ()=>{ |
|
|
|
|
|
let formModel = formRef.value.formRef.formModel |
|
|
|
|
|
console.log('formRef',formRef.value) |
|
|
|
|
|
console.log('formModel',formModel) |
|
|
|
|
|
|
|
|
|
|
|
let subList = await PurchasereturnRequestDetailApi.queryBalancePurchaseReceiptSpareReturn({ |
|
|
|
|
|
supplierCode:formModel.supplierCode,//供应商代码 |
|
|
|
|
|
poNumber:formModel.poNumber,// |
|
|
|
|
|
receiptNumber:formModel.receiptNumber,//采购收货记录单号 |
|
|
|
|
|
fromLocationCode:formModel.locationCode//库位代码 |
|
|
|
|
|
}) |
|
|
|
|
|
console.log('subList',subList) |
|
|
|
|
|
if(subList&&subList.length>0){ |
|
|
|
|
|
tableData.value = subList |
|
|
|
|
|
tableData.value.forEach((item,index)=>({ |
|
|
|
|
|
'id':index |
|
|
|
|
|
})) |
|
|
|
|
|
}else{ |
|
|
|
|
|
tableData.value = [] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// 查询页面返回——详情 |
|
|
// 查询页面返回——详情 |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
@ -823,6 +845,16 @@ const tableSelectionDelete = (selection) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//为true表示子表数据中存在数量为0的数据 |
|
|
|
|
|
const inputNumberChange = (field, val,row, index) => { |
|
|
|
|
|
console.log('inputNumberChange',formRef.value.formRef) |
|
|
|
|
|
if(field=='qty'){ |
|
|
|
|
|
if(row['balanceQty']!=null&&row['qty']>row['balanceQty']){ |
|
|
|
|
|
message.error(`物料${row['itemCode']}退货数量不能大于库存余额`) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
console.log('inputNumberChange',field, val,row, index) |
|
|
|
|
|
} |
|
|
// 主子数据 提交 |
|
|
// 主子数据 提交 |
|
|
const submitForm = async (formType, submitData) => { |
|
|
const submitForm = async (formType, submitData) => { |
|
|
let data = { ...submitData } |
|
|
let data = { ...submitData } |
|
@ -834,15 +866,12 @@ const submitForm = async (formType, submitData) => { |
|
|
item['poNumber'] = data['poNumber'] |
|
|
item['poNumber'] = data['poNumber'] |
|
|
}) |
|
|
}) |
|
|
console.log('submitForm', tableData.value) |
|
|
console.log('submitForm', tableData.value) |
|
|
// if(tableData.value.find(item=>Number(item.returnedQty)>Number(item.receiptQty))){ |
|
|
let errorItemCode = tableData.value.find((item) => Number(item.qty) > Number(item.balanceQty)) |
|
|
// message.warning("退货数量不能大于收获数量") |
|
|
if (errorItemCode) { |
|
|
// return; |
|
|
message.error(`物料${errorItemCode['itemCode']}退货数量不能大于库存余额`) |
|
|
// } |
|
|
|
|
|
if (tableData.value.find((item) => Number(item.qty) > Number(item.inventoryBalance))) { |
|
|
|
|
|
message.warning('退货数量不能大于库存余额') |
|
|
|
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
data.subList = tableData.value.filter(item=>Number(item['qty'])>0) // 拼接子表数据参数 |
|
|
formRef.value.formLoading = true |
|
|
formRef.value.formLoading = true |
|
|
try { |
|
|
try { |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
|