Browse Source

还原库存转移代码

linshi20240813
chenfang 3 months ago
parent
commit
fed46cbc7b
  1. 133
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue
  2. 321
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/inventorymoveRequestMain.data.ts

133
src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/index.vue

@ -182,7 +182,7 @@ else if( routeName.value == 'InventorymoveRequestMain'){
} }
console.log(99 , businessType.value) console.log(99 , businessType.value)
InventorymoveRequestMain.allSchemas.tableFormColumns.map(item =>{ InventorymoveRequestMain.allSchemas.tableFormColumns.map(item =>{
if(item.field == 'fromLocationCode') { if(item.field == 'fromWarehouseCode') {
if (fromInventoryStatus.value) { if (fromInventoryStatus.value) {
item.tableForm.searchCondition = [ item.tableForm.searchCondition = [
{ {
@ -249,16 +249,30 @@ InventorymoveRequestMain.allSchemas.tableFormColumns.map(item =>{
} else { } else {
delete item.tableForm.searchCondition delete item.tableForm.searchCondition
} }
}else if(item.field == "toLocationCode"){ }
if (toInventoryStatus.value) { })
// tableform
InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'fromPackingNumber') {
if (fromInventoryStatus.value) {
item.tableForm.searchCondition = [ item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value ,
isMainValue: false
}]
item.form.componentProps.searchCondition = [
{ {
key: 'businessType', key: 'businessType',
value: businessType.value, value: businessType.value,
isMainValue: false isMainValue: false
},{ }
key: 'isIn', ]
value: 'in', } else if (fromInventoryStatus.value == null) {
item.tableForm.searchCondition = [
{
key: 'businessType',
value: businessType.value ,
isMainValue: false isMainValue: false
}] }]
item.form.componentProps.searchCondition = [ item.form.componentProps.searchCondition = [
@ -266,21 +280,21 @@ InventorymoveRequestMain.allSchemas.tableFormColumns.map(item =>{
key: 'businessType', key: 'businessType',
value: businessType.value, value: businessType.value,
isMainValue: false isMainValue: false
},{
key: 'isIn',
value: 'in',
isMainValue: false
}] }]
}} } else {
}) delete item.tableForm.searchCondition
// tableform }
InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { }
if(item.field == 'fromPackingNumber') { if(item.field == "toLocationCode"){
if (fromInventoryStatus.value) { if (toInventoryStatus.value) {
item.tableForm.searchCondition = [ item.tableForm.searchCondition = [
{ {
key: 'businessType', key: 'businessType',
value: businessType.value , value: businessType.value,
isMainValue: false
},{
key: 'isIn',
value: 'in',
isMainValue: false isMainValue: false
}] }]
item.form.componentProps.searchCondition = [ item.form.componentProps.searchCondition = [
@ -288,70 +302,34 @@ InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => {
key: 'businessType', key: 'businessType',
value: businessType.value, value: businessType.value,
isMainValue: false isMainValue: false
} },{
] key: 'isIn',
} else if (fromInventoryStatus.value == null) { value: 'in',
isMainValue: false
}]
}else if (toInventoryStatus.value == null) {
item.tableForm.searchCondition = [ item.tableForm.searchCondition = [
{ {
key: 'businessType', key: 'businessType',
value: businessType.value , value: businessType.value ,
isMainValue: false isMainValue: false
},{
key: 'isIn',
value: 'in',
isMainValue: false
}] }]
item.form.componentProps.searchCondition = [ item.form.componentProps.searchCondition = [
{ {
key: 'businessType', key: 'businessType',
value: businessType.value, value: businessType.value,
isMainValue: false isMainValue: false
},{
key: 'isIn',
value: 'in',
isMainValue: false
}] }]
} else {
delete item.tableForm.searchCondition
} }
} }
// if(item.field == "toLocationCode"){
// if (toInventoryStatus.value) {
// item.tableForm.searchCondition = [
// {
// key: 'businessType',
// value: businessType.value,
// isMainValue: false
// },{
// key: 'isIn',
// value: 'in',
// isMainValue: false
// }]
// item.form.componentProps.searchCondition = [
// {
// key: 'businessType',
// value: businessType.value,
// isMainValue: false
// },{
// key: 'isIn',
// value: 'in',
// isMainValue: false
// }]
// }else if (toInventoryStatus.value == null) {
// item.tableForm.searchCondition = [
// {
// key: 'businessType',
// value: businessType.value ,
// isMainValue: false
// },{
// key: 'isIn',
// value: 'in',
// isMainValue: false
// }]
// item.form.componentProps.searchCondition = [
// {
// key: 'businessType',
// value: businessType.value,
// isMainValue: false
// },{
// key: 'isIn',
// value: 'in',
// isMainValue: false
// }]
// }
// }
}) })
// //
@ -373,7 +351,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
newRow['itemCode'] = item['itemCode'] newRow['itemCode'] = item['itemCode']
newRow['fromBatch'] = item['batch'] newRow['fromBatch'] = item['batch']
newRow['fromInventoryStatus'] = item['inventoryStatus'] newRow['fromInventoryStatus'] = item['inventoryStatus']
// newRow['fromLocationCode'] = item['locationCode'] newRow['fromLocationCode'] = item['locationCode']
newRow['uom'] = item['uom'] newRow['uom'] = item['uom']
newRow['qty'] = item['qty'] newRow['qty'] = item['qty']
if(routeName.value == 'OktoholdRequestMain'){ if(routeName.value == 'OktoholdRequestMain'){
@ -398,17 +376,16 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} }
} else { } else {
const setV = {} const setV = {}
if (formField == 'fromLocationCode') { if (formField == 'fromWarehouseCode') {
setV['fromWarehouseCode'] = val[0]['warehouseCode']//
if(InventorymoveRequestDetail.allSchemas.tableFormColumns.find(item => (item.field == 'fromPackingNumber')).tableForm.searchCondition.find(item => (item.key == 'warehouseCode')) == undefined){ 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({ InventorymoveRequestDetail.allSchemas.tableFormColumns.find(item => (item.field == 'fromPackingNumber')).tableForm.searchCondition.push({
key: 'locationCode', key: 'warehouseCode',
value: val[0]["code"], value: val[0]["code"],
isMainValue: false isMainValue: false
}) })
} else { } else {
InventorymoveRequestDetail.allSchemas.tableFormColumns.find(item => (item.field == 'fromPackingNumber')).tableForm.searchCondition.find(item => { InventorymoveRequestDetail.allSchemas.tableFormColumns.find(item => (item.field == 'fromPackingNumber')).tableForm.searchCondition.find(item => {
if (item.key == 'locationCode') { if (item.key == 'warehouseCode') {
item.value = val[0]["code"] item.value = val[0]["code"]
} }
}) })
@ -429,7 +406,7 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
setV['itemCode'] = val[0]['itemCode'] setV['itemCode'] = val[0]['itemCode']
setV['fromBatch'] = val[0]['batch'] setV['fromBatch'] = val[0]['batch']
setV['fromInventoryStatus'] = val[0]['inventoryStatus'] setV['fromInventoryStatus'] = val[0]['inventoryStatus']
// setV['fromLocationCode'] = val[0]['locationCode'] setV['fromLocationCode'] = val[0]['locationCode']
setV['uom'] = val[0]['uom'] setV['uom'] = val[0]['uom']
if(routeName.value == 'OktoholdRequestMain'){ if(routeName.value == 'OktoholdRequestMain'){
setV['toInventoryStatus'] = "HOLD" setV['toInventoryStatus'] = "HOLD"
@ -721,11 +698,16 @@ const submitForm = async (formType, submitData) => {
if(data.masterId){ if(data.masterId){
data.id = data.masterId data.id = data.masterId
} }
let findLocation = tableData.value.find(item=>item.fromLocationCode&&item.toLocationCode&&item.fromLocationCode==item.toLocationCode)
if(findLocation){
message.warning('从库位和到库位不能相同')
return
}
data.subList = tableData.value // data.subList = tableData.value //
let isExist = false let isExist = false
tableData.value.forEach(item => { tableData.value.forEach(item => {
let rs = tableData.value.filter(filterItem => (filterItem.fromPackingNumber == item.fromPackingNumber) ) let rs = tableData.value.filter(filterItem => (filterItem.fromPackingNumber&&filterItem.fromPackingNumber == item.fromPackingNumber) )
console.log(rs,5666); console.log(rs,5666);
if(rs.length > 1) isExist = true if(rs.length > 1) isExist = true
}) })
if (isExist) { if (isExist) {
@ -733,6 +715,7 @@ const submitForm = async (formType, submitData) => {
isExist = false isExist = false
return message.warning('包装号重复') return message.warning('包装号重复')
} }
flag.value = false
data.subList.forEach(item => { data.subList.forEach(item => {
console.log(556565,item); console.log(556565,item);
if(fromInventoryStatus.value){ if(fromInventoryStatus.value){

321
src/views/wms/moveManage/inventorymove/inventorymoveRequestMain/inventorymoveRequestMain.data.ts

@ -72,74 +72,14 @@ export const InventorymoveRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 150 width: 150
}, },
form: {
componentProps: {
disabled: true
}
}
// tableForm: {
// enterSearch: true,
// isInpuFocusShow: true, // 开启查询弹窗
// searchListPlaceholder: '请选择从仓库代码',
// searchField: 'code',
// searchTitle: '仓库基础信息',
// searchAllSchemas: Warehouse.allSchemas,
// searchPage: WarehouseApi.pageBusinessTypeToWarehouse,
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: true,
// isSearchList: true,
// searchListPlaceholder: '请选择从仓库代码',
// searchField: 'code',
// searchTitle: '仓库基础信息',
// searchAllSchemas: Warehouse.allSchemas,
// searchPage: WarehouseApi.pageBusinessTypeToWarehouse,
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// }
// }
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm: { tableForm: {
enterSearch: true, enterSearch: true,
isInpuFocusShow: true, // 开启查询弹窗 isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择从库代码', searchListPlaceholder: '请选择从仓库代码',
searchField: 'code', searchField: 'code',
searchTitle: '库位信息', searchTitle: '仓库基础信息',
searchAllSchemas: Location.allSchemas, searchAllSchemas: Warehouse.allSchemas,
searchPage: LocationApi.selectBusinessTypeToLocation, searchPage: WarehouseApi.pageBusinessTypeToWarehouse,
searchCondition: [
{
key: 'type',
value: 'businessType',
isMainValue: true
},{
key: 'isIn',
value: 'out',
isMainValue: false
}],
verificationParams: [{ verificationParams: [{
key: 'code', key: 'code',
action: '==', action: '==',
@ -153,87 +93,12 @@ export const InventorymoveRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
enterSearch: true, enterSearch: true,
isSearchList: true, // 开启查询弹窗 isSearchList: true,
searchListPlaceholder: '请选择到库位代码', searchListPlaceholder: '请选择从仓库代码',
searchField: 'code', searchField: 'code',
searchTitle: '库位信息', searchTitle: '仓库基础信息',
searchAllSchemas: Location.allSchemas, searchAllSchemas: Warehouse.allSchemas,
searchPage: LocationApi.selectBusinessTypeToLocation, searchPage: WarehouseApi.pageBusinessTypeToWarehouse,
searchCondition: [
{
key: 'type',
value: 'businessType',
isMainValue: true
},{
key: 'isIn',
value: 'out',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
enterSearch: true,
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.selectBusinessTypeToLocation,
searchCondition: [
{
key: 'type',
value: 'businessType',
isMainValue: true
},{
key: 'isIn',
value: 'in',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择到库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.selectBusinessTypeToLocation,
searchCondition: [
{
key: 'type',
value: 'businessType',
isMainValue: true
},{
key: 'isIn',
value: 'in',
isMainValue: false
}],
verificationParams: [{ verificationParams: [{
key: 'code', key: 'code',
action: '==', action: '==',
@ -268,7 +133,7 @@ export const InventorymoveRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
field: 'requestTime', field: 'requestTime',
formatter: dateFormatter, formatter: dateFormatter,
detail: { detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
sort: 'custom', sort: 'custom',
table: { table: {
@ -803,87 +668,88 @@ export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>(
} }
} }
}, },
// { {
// label: '从库位代码', label: '从库位代码',
// field: 'fromLocationCode', field: 'fromLocationCode',
// sort: 'custom', sort: 'custom',
// table: { table: {
// width: 150 width: 150
// }, },
// tableForm: { tableForm: {
// disabled: true disabled: true
// }, },
// form: { form: {
// componentProps: { componentProps: {
// disabled: true disabled: true
// } }
// } }
// }, },
// { {
// label: '到库位代码', label: '到库位代码',
// field: 'toLocationCode', field: 'toLocationCode',
// sort: 'custom', sort: 'custom',
// table: { table: {
// width: 150 width: 150
// }, },
// tableForm: { tableForm: {
// enterSearch: true, enterSearch: true,
// isInpuFocusShow: true, // 开启查询弹窗 isInpuFocusShow: true, // 开启查询弹窗
// searchListPlaceholder: '请选择到库位代码', searchListPlaceholder: '请选择到库位代码',
// searchField: 'code', searchField: 'code',
// searchTitle: '库位信息', searchTitle: '库位信息',
// searchAllSchemas: Location.allSchemas, searchAllSchemas: Location.allSchemas,
// searchPage: LocationApi.selectBusinessTypeToLocation, searchPage: LocationApi.selectBusinessTypeToLocation,
// searchCondition: [ searchCondition: [
// { {
// key: 'type', key: 'type',
// value: 'businessType', value: 'businessType',
// isMainValue: true isMainValue: true
// },{ },{
// key: 'isIn', key: 'isIn',
// value: 'in', value: 'in',
// isMainValue: false isMainValue: false
// }], }],
// verificationParams: [{ isRepeat:true,
// key: 'code', verificationParams: [{
// action: '==', key: 'code',
// value: '', action: '==',
// isMainValue: false, value: '',
// isSearch: true, isMainValue: false,
// isFormModel: true, isSearch: true,
// }], // 失去焦点校验参数 isFormModel: true,
// }, }], // 失去焦点校验参数
// form: { },
// // labelMessage: '信息提示说明!!!', form: {
// componentProps: { // labelMessage: '信息提示说明!!!',
// enterSearch: true, componentProps: {
// isSearchList: true, // 开启查询弹窗 enterSearch: true,
// searchListPlaceholder: '请选择到库位代码', isSearchList: true, // 开启查询弹窗
// searchField: 'code', searchListPlaceholder: '请选择到库位代码',
// searchTitle: '库位信息', searchField: 'code',
// searchAllSchemas: Location.allSchemas, searchTitle: '库位信息',
// searchPage: LocationApi.selectBusinessTypeToLocation, searchAllSchemas: Location.allSchemas,
// searchCondition: [ searchPage: LocationApi.selectBusinessTypeToLocation,
// { searchCondition: [
// key: 'type', {
// value: 'businessType', key: 'type',
// isMainValue: true value: 'businessType',
// },{ isMainValue: true
// key: 'isIn', },{
// value: 'in', key: 'isIn',
// isMainValue: false value: 'in',
// }], isMainValue: false
// verificationParams: [{ }],
// key: 'code', verificationParams: [{
// action: '==', key: 'code',
// value: '', action: '==',
// isMainValue: false, value: '',
// isSearch: true, isMainValue: false,
// isFormModel: true, isSearch: true,
// }], // 失去焦点校验参数 isFormModel: true,
// } }], // 失去焦点校验参数
// } }
// }, }
},
{ {
label: '从库存状态', label: '从库存状态',
field: 'fromInventoryStatus', field: 'fromInventoryStatus',
@ -1055,6 +921,9 @@ export const InventorymoveRequestDetailRules = reactive({
fromLocationCode: [ fromLocationCode: [
{ required: true, message: '请选择从库位代码', trigger: 'change' } { required: true, message: '请选择从库位代码', trigger: 'change' }
], ],
fromPackingNumber: [
{ required: true, message: '请选择从包装号', trigger: 'change' }
],
fromInventoryStatus: [ fromInventoryStatus: [
{ required: true, message: '请选择从库存状态', trigger: 'change' } { required: true, message: '请选择从库存状态', trigger: 'change' }
], ],

Loading…
Cancel
Save