|
|
@ -43,7 +43,7 @@ |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
:isOpenSearchTable="true" |
|
|
|
fieldTableColumn="fromPackingNumber" |
|
|
|
fieldTableColumn="itemCode" |
|
|
|
@success="getList" |
|
|
|
:rules="InventorymoveRequestMainRules" |
|
|
|
:formAllSchemas="InventorymoveRequestMain.allSchemas" |
|
|
@ -251,7 +251,7 @@ InventorymoveRequestMain.allSchemas.tableFormColumns.map(item =>{ |
|
|
|
}) |
|
|
|
// 修改 tableform 属性 |
|
|
|
InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { |
|
|
|
if(item.field == 'fromPackingNumber') { |
|
|
|
if(item.field == 'itemCode') { |
|
|
|
if (fromInventoryStatus.value) { |
|
|
|
item.tableForm.searchCondition = [ |
|
|
|
{ |
|
|
@ -354,12 +354,12 @@ const fromManagementPrecision = ref('') |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
|
nextTick(async() => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
if(formField == 'fromPackingNumber'){ |
|
|
|
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['fromBatch']==item['batch']&&item1['fromPackingNumber']==item['packingNumber']&&item1['fromLocationCode']==item['locationCode']&&item1['fromInventoryStatus']==item['inventoryStatus'])) |
|
|
|
if(formField == 'itemCode'){ |
|
|
|
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode']&&item1['fromBatch']==item['batch']&&item1['fromLocationCode']==item['locationCode']&&item1['fromInventoryStatus']==item['inventoryStatus'])) |
|
|
|
if(val.length==0) return |
|
|
|
val.forEach(async item=>{ |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
|
newRow['fromPackingNumber'] = item['packingNumber'] |
|
|
|
// newRow['fromPackingNumber'] = item['packingNumber'] |
|
|
|
newRow['fromContainerNumber'] = item['containerNumber'] |
|
|
|
newRow['itemCode'] = item['itemCode'] |
|
|
|
if (item['batch'] != '') { |
|
|
@ -406,14 +406,14 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
if (formField == 'fromWarehouseCode') { |
|
|
|
if(InventorymoveRequestDetail.allSchemas.tableFormColumns.find(item => (item.field == 'fromPackingNumber')).tableForm.searchCondition.find(item => (item.key == 'warehouseCode')) == undefined){ |
|
|
|
InventorymoveRequestDetail.allSchemas.tableFormColumns.find(item => (item.field == 'fromPackingNumber')).tableForm.searchCondition.push({ |
|
|
|
if(InventorymoveRequestDetail?.allSchemas?.tableFormColumns?.find(item => (item.field == 'itemCode'))?.tableForm?.searchCondition?.find(item => (item.key == 'warehouseCode')) == undefined){ |
|
|
|
InventorymoveRequestDetail?.allSchemas?.tableFormColumns?.find(item => (item.field == 'itemCode'))?.tableForm?.searchCondition?.push({ |
|
|
|
key: 'warehouseCode', |
|
|
|
value: val[0]["code"], |
|
|
|
isMainValue: false |
|
|
|
}) |
|
|
|
} else { |
|
|
|
InventorymoveRequestDetail.allSchemas.tableFormColumns.find(item => (item.field == 'fromPackingNumber')).tableForm.searchCondition.find(item => { |
|
|
|
InventorymoveRequestDetail.allSchemas.tableFormColumns.find(item => (item.field == 'itemCode')).tableForm.searchCondition.find(item => { |
|
|
|
if (item.key == 'warehouseCode') { |
|
|
|
item.value = val[0]["code"] |
|
|
|
} |
|
|
@ -429,8 +429,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
|
nextTick(() => { |
|
|
|
const setV = {} |
|
|
|
if(formField == 'fromPackingNumber') { |
|
|
|
setV['fromPackingNumber'] = val[0]['packingNumber'] |
|
|
|
if(formField == 'itemCode') { |
|
|
|
setV['fromContainerNumber'] = val[0]['containerNumber'] |
|
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
|
|
setV['fromBatch'] = val[0]['batch'] |
|
|
@ -625,14 +624,14 @@ const detailOpenForm = (type, row) => { |
|
|
|
item.componentProps.disabled = routeName.value == "HoldtookRequestMain" |
|
|
|
} |
|
|
|
}) |
|
|
|
if(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.find(item => (item.key == 'warehouseCode')) == undefined){ |
|
|
|
InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.push({ |
|
|
|
if(InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'itemCode'))?.componentProps?.searchCondition.find(item => (item.key == 'warehouseCode')) == undefined){ |
|
|
|
InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'itemCode'))?.componentProps?.searchCondition.push({ |
|
|
|
key: 'warehouseCode', |
|
|
|
value: fromWarehouseCodeMain.value, |
|
|
|
isMainValue: false |
|
|
|
}) |
|
|
|
} else { |
|
|
|
InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'fromPackingNumber'))?.componentProps?.searchCondition.find(item => { |
|
|
|
InventorymoveRequestDetail.allSchemas.formSchema.find(item => (item.field == 'itemCode'))?.componentProps?.searchCondition.find(item => { |
|
|
|
if (item.key == 'warehouseCode') { |
|
|
|
item.value = fromWarehouseCodeMain.value |
|
|
|
} |
|
|
@ -741,7 +740,7 @@ const submitForm = async (formType, submitData) => { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
let isExist = false |
|
|
|
tableData.value.forEach(item => { |
|
|
|
let rs = tableData.value.filter(filterItem => (filterItem.fromPackingNumber&&filterItem.fromPackingNumber == item.fromPackingNumber) ) |
|
|
|
let rs = tableData.value.filter(filterItem => (filterItem.itemCode&&filterItem.itemCode == item.itemCode) ) |
|
|
|
console.log(rs,5666); |
|
|
|
if(rs.length > 1) isExist = true |
|
|
|
}) |
|
|
|