wangyufei
3 months ago
2 changed files with 551 additions and 24 deletions
@ -0,0 +1,492 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import * as getRequestsettingApi from '@/api/wms/requestsetting/index' |
|||
|
|||
import * as BalanceApi from '@/api/wms/balance' |
|||
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' |
|||
|
|||
import * as LocationApi from '@/api/wms/location' |
|||
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data' |
|||
|
|||
import * as WarehouseApi from '@/api/wms/warehouse' |
|||
import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data' |
|||
|
|||
const { t } = useI18n() // 国际化
|
|||
|
|||
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
|
|||
const queryParams = { |
|||
pageSize:10, |
|||
pageNo:1, |
|||
code:'MoveRequest' |
|||
} |
|||
const data = await getRequestsettingApi.getRequestsettingPage(queryParams) |
|||
const requestsettingData =data?.list[0]||{} |
|||
|
|||
// 获取当前操作人的部门
|
|||
import { useUserStore } from '@/store/modules/user' |
|||
import { TableColumn } from '@/types/table' |
|||
const userStore = useUserStore() |
|||
const userDept = userStore.userSelfInfo.dept |
|||
// id 转str 否则form回显匹配不到
|
|||
userDept.id = userDept.id.toString() |
|||
const userDeptArray:any = [userDept] |
|||
|
|||
/** |
|||
* @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', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm: { |
|||
enterSearch: true, |
|||
isInpuFocusShow: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择从库位代码', |
|||
searchField: 'code', |
|||
searchTitle: '库位信息', |
|||
searchAllSchemas: Location.allSchemas, |
|||
searchPage: LocationApi.selectBusinessTypeToLocation, |
|||
searchCondition: [ |
|||
{ |
|||
key: 'businessType', |
|||
value: 'Move', |
|||
isMainValue: false |
|||
},{ |
|||
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: 'businessType', |
|||
value: 'Move', |
|||
isMainValue: false |
|||
},{ |
|||
key: 'isIn', |
|||
value: 'in', |
|||
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: 'businessType', |
|||
value: 'Move', |
|||
isMainValue: false |
|||
},{ |
|||
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: 'businessType', |
|||
value: 'Move', |
|||
isMainValue: false |
|||
},{ |
|||
key: 'isIn', |
|||
value: 'in', |
|||
isMainValue: false |
|||
}], |
|||
verificationParams: [{ |
|||
key: 'code', |
|||
action: '==', |
|||
value: '', |
|||
isMainValue: false, |
|||
isSearch: true, |
|||
isFormModel: true, |
|||
}], // 失去焦点校验参数
|
|||
} |
|||
} |
|||
}, |
|||
])) |
|||
|
|||
//表单校验
|
|||
export const InventorymoveRequestMainRules = reactive({ |
|||
fromWarehouseCode: [ |
|||
{ required: true, message: '请选择从仓库代码', trigger: 'blur' } |
|||
], |
|||
fromLocationCode: [ |
|||
{ required: true, message: '请选择从库位代码', trigger: 'change' } |
|||
], |
|||
toLocationCode: [ |
|||
{ required: true, message: '请选择到库位代码', trigger: 'change' } |
|||
] |
|||
}) |
|||
|
|||
/** |
|||
* @returns {Array} 库存转移申请子表 |
|||
*/ |
|||
export const InventorymoveRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '物料代码', |
|||
field: 'itemCode', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '批次', |
|||
field: 'fromBatch', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm: { |
|||
disabled: true |
|||
}, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '从包装号', |
|||
field: 'fromPackingNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm:{ |
|||
multiple:true, |
|||
disabled: true, |
|||
isInpuFocusShow: false, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择从包装号', |
|||
searchField: 'packingNumber', |
|||
searchTitle: '库存余额信息', |
|||
searchAllSchemas: Balance.allSchemas, |
|||
searchPage: BalanceApi.selectLocationTypeToBalance, |
|||
searchCondition: [{ |
|||
key: 'businessType', |
|||
value: 'Move', |
|||
isMainValue: false |
|||
}] |
|||
}, |
|||
form: { |
|||
// labelMessage: '信息提示说明!!!',
|
|||
componentProps: { |
|||
disabled: true, |
|||
isSearchList: false, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择从包装号', |
|||
searchField: 'packingNumber', |
|||
searchTitle: '库存余额信息', |
|||
searchAllSchemas: Balance.allSchemas, |
|||
searchPage: BalanceApi.selectLocationTypeToBalance, |
|||
searchCondition: [{ |
|||
key: 'businessType', |
|||
value: 'Move', |
|||
isMainValue: false |
|||
}] |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '到包装号', |
|||
field: 'toPackingNumber', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isTableForm: true, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '包装规格', |
|||
field: 'packUnit', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isTableForm: false, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '包装数量', |
|||
field: 'packQty', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
isTableForm: false, |
|||
isForm: false, |
|||
}, |
|||
|
|||
{ |
|||
label: '数量', |
|||
field: 'qty', |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
form: { |
|||
component: 'InputNumber', |
|||
componentProps: { |
|||
min: 0, |
|||
precision: 6 |
|||
} |
|||
}, |
|||
tableForm: { |
|||
disabled: true, |
|||
type: 'InputNumber', |
|||
min: 0, |
|||
precision: 6 |
|||
} |
|||
}, |
|||
{ |
|||
label: '计量单位', |
|||
field: 'uom', |
|||
dictType: DICT_TYPE.UOM, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm: { |
|||
type: 'Select', |
|||
disabled: true |
|||
}, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
|
|||
{ |
|||
label: '从库存状态', |
|||
field: 'fromInventoryStatus', |
|||
dictType: DICT_TYPE.INVENTORY_STATUS, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm: { |
|||
disabled: true, |
|||
type: 'Select' |
|||
}, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '到库存状态', |
|||
field: 'toInventoryStatus', |
|||
dictType: DICT_TYPE.INVENTORY_STATUS, |
|||
dictClass: 'string', |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm: { |
|||
disabled: false, |
|||
type: 'Select' |
|||
}, |
|||
form: { |
|||
componentProps: { |
|||
disabled: true |
|||
} |
|||
} |
|||
} |
|||
])) |
|||
|
|||
//表单校验
|
|||
export const InventorymoveRequestDetailRules = reactive({ |
|||
itemCode: [ |
|||
{ required: true, message: '请点击从包装号选择物料代码', trigger: 'change' } |
|||
], |
|||
fromLocationCode: [ |
|||
{ required: true, message: '请选择从库位代码', trigger: 'change' } |
|||
], |
|||
fromPackingNumber: [ |
|||
{ required: true, message: '请选择从包装号', trigger: 'change' } |
|||
], |
|||
fromInventoryStatus: [ |
|||
{ required: true, message: '请选择从库存状态', trigger: 'change' } |
|||
], |
|||
toLocationCode: [ |
|||
{ required: true, message: '请选择到库位代码', trigger: 'change' } |
|||
], |
|||
remark: [ |
|||
{ max: 50, message: '不得超过50个字符', trigger: 'blur' } |
|||
], |
|||
}) |
Loading…
Reference in new issue