Browse Source

修改库存转移前端页面

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

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

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

Loading…
Cancel
Save