Browse Source

库存移动记录新增功能

linshi20240813
wangyufei 3 months ago
parent
commit
9466beabfe
  1. 29
      src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue
  2. 120
      src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordRequestMain.data.ts

29
src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/index.vue

@ -253,17 +253,17 @@ const submitForm = async (formType, submitData) => {
}
formRef.value.formLoading = true
console.log('data',data)
// try {
// if (formType === 'create') {
// await InventorymoveRecordMainApi.createInventorymoveRecordMain(data)
// message.success(t('common.createSuccess'))
// }
// formRef.value.dialogVisible = false
// //
// getList()
// } finally {
// formRef.value.formLoading = false
// }
try {
if (formType === 'create') {
await InventorymoveRecordMainApi.createInventorymoveRecordMain(data)
message.success(t('common.createSuccess'))
}
formRef.value.dialogVisible = false
//
getList()
} finally {
formRef.value.formLoading = false
}
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
@ -292,6 +292,13 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}
} else {
const setV = {}
if(formField=='fromLocationCode'){
//
setV['fromWarehouseCode'] = val[0]['warehouseCode']
}else if(formField=='toLocationCode'){
//
setV['toWarehouseCode'] = val[0]['warehouseCode']
}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}

120
src/views/wms/moveManage/inventorymove/inventorymoveRecordMainNew/inventorymoveRecordRequestMain.data.ts

@ -35,102 +35,6 @@ const queryParams = {
* @returns {Array}
*/
export const InventorymoveRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
enterSearch: true,
isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择从仓库代码',
searchField: 'code',
searchTitle: '仓库基础信息',
searchAllSchemas: Warehouse.allSchemas,
searchPage: WarehouseApi.pageBusinessTypeToWarehouse,
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'businessType',
value: 'Move',
isMainValue: false
},{
key: 'isIn',
value: 'out',
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: Warehouse.allSchemas,
searchPage: WarehouseApi.pageBusinessTypeToWarehouse,
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'businessType',
value: 'Move',
isMainValue: false
},{
key: 'isIn',
value: 'out',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
}
},
{
label: '截止时间',
field: 'dueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: { width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '从库位代码',
field: 'fromLocationCode',
@ -263,6 +167,27 @@ export const InventorymoveRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '截止时间',
field: 'dueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: { width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
]))
//表单校验
@ -270,6 +195,9 @@ export const InventorymoveRequestMainRules = reactive({
fromWarehouseCode: [
{ required: true, message: '请选择从仓库代码', trigger: 'blur' }
],
toWarehouseCode: [
{ required: true, message: '请选择到仓库代码', trigger: 'blur' }
],
fromLocationCode: [
{ required: true, message: '请选择从库位代码', trigger: 'change' }
],

Loading…
Cancel
Save