You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1051 lines
25 KiB

1 year ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
1 year ago
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
1 year ago
import * as ItempackagingApi from '@/api/wms/itempackage'
import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data'
import * as BalanceApi from '@/api/wms/balance'
import { BalancePopWindow,BalancePopWindowPackageOver } from '@/views/wms/inventoryManage/balance/balance.data'
1 year ago
// 获取自动提交自动通过自动执行,跳过任务直接生成记录的默认值
const queryParams = {
pageSize: 10,
pageNo: 1,
code: 'PackageOverRequest'
1 year ago
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData = data?.list[0] || {}
1 year ago
// 获取当前操作人的部门
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]
1 year ago
export const PackageoverRequestMain = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isForm: false,
isSearch: true
},
3 months ago
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
isForm: false,
sort: 'custom',
table: {
width: 150
},
form: {
value: '1',
componentProps: {
disabled: true
}
}
},
{
label: '申请时间',
field: 'requestTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isTable: false,
isForm: false
},
{
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'
}
},
isTable: true
1 year ago
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
isForm: true,
isTable: true,
isSearch: true,
isDetail: true,
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择从库位代码',
searchField: 'code',
searchTitle: '库位信息',
searchAllSchemas: Location.allSchemas,
searchPage: LocationApi.selectBusinessTypeToLocation,
searchCondition: [
{
key: 'businessType',
value: 'OverPackage',
isMainValue: false
},
{
key: 'isIn',
value: 'out',
isMainValue: false
}
],
verificationParams: [
{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true
}
] // 失去焦点校验参数
1 year ago
}
}
},
{
label: '到库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
1 year ago
disabled: true
},
form: {
componentProps: {
disabled: true
}
1 year ago
}
},
// {
// label: '从仓库代码',
// field: 'fromWarehouseCode',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable: false,
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: true,
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '仓库信息', // 查询弹窗标题
// searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
// searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }],
// // 失去焦点校验参数
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: 'true',
// isFormModel: true,
// }]
// }
// }
// },
// {
// label: '到仓库代码',
// field: 'toWarehouseCode',
// sort: 'custom',
// table: {
// width: 150
// },
// isTable: false,
// form: {
// componentProps: {
// disabled: true
// }
// }
// },
{
label: '从库区类型范围',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isSearch: false,
isTable: false,
sort: 'custom',
table: {
width: 150
},
isForm: false
},
{
label: '到库区类型范围',
field: 'toAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
table: {
width: 150
},
isForm: false
},
{
label: '从库区代码范围',
field: 'fromAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '到库区代码范围',
field: 'toAreaCodes',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '入库库存状态范围',
field: 'inInventoryStatuses',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
sort: 'custom',
isForm:false,
isTable:false,
},
{
label: '出库库存状态范围',
field: 'outInventoryStatuses',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
sort: 'custom',
isForm:false,
isTable:false,
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm: false,
isTable: false,
table: {
width: 150
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name
},
form: {
value: userDept.id,
component: 'Select',
api: () => userDeptArray,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
1 year ago
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
isTable: false,
table: {
width: 150
},
form: {
value: 'OverPackage',
componentProps: {
disabled: true
}
},
isForm: false
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoCommit,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
1 year ago
}
},
{
label: '自动通过',
field: 'autoAgree',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: false,
isForm: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoAgree,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
1 year ago
}
},
{
label: '自动执行',
field: 'autoExecute',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isForm: false,
isTable: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.autoExecute,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
1 year ago
}
},
{
label: '直接生成记录',
field: 'directCreateRecord',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isForm: false,
isTable: false,
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: requestsettingData.directCreateRecord,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
isTable: false,
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isForm: false,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
1 year ago
}
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isForm: false
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
isTable: false,
isForm: false
},
3 months ago
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 180,
fixed: 'right'
}
}
])
)
1 year ago
// 表单校验
export const PackageoverRequestMainRules = reactive({
fromLocationCode: [{ required: true, message: '请选择从库位代码', trigger: 'change' }]
1 year ago
})
export const PackageoverRequestDetail = useCrudSchemas(
reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
isTable: false,
isTableForm: false,
form: {
componentProps: {
disabled: true
}
1 year ago
}
},
{
label: '品番',
field: 'itemCode',
sort: 'custom',
isSearch:true,
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择品番', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: BalancePopWindowPackageOver.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalancePage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'locationCode',
value: 'fromLocationCode',
message: '请填写从库位代码!',
isMainValue: true
},
{
key: 'inventoryStatus',
value: 'OK',
isMainValue: false
}
]
}
},
tableForm: {
multiple: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择品番', // 输入框占位文本
1 year ago
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: BalancePopWindowPackageOver.allSchemas, // 查询弹窗所需类
1 year ago
searchPage: BalanceApi.getBalancePage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'locationCode',
value: 'fromLocationCode',
message: '请填写从库位代码!',
isMainValue: true
},
{
key: 'inventoryStatus',
value: 'OK',
isMainValue: false
}
]
1 year ago
}
},
{
label: '品名',
field: 'itemName',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isSearch: true,
isForm: false
},
{
label: '背番',
3 months ago
field: 'backNumber',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isSearch: true,
isForm: false
},
{
label: '描述',
field: 'itemDesc2',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
// {
// label: '项目代码',
// field: 'projectCode',
// sort: 'custom',
// table: {
// width: 150
// },
// isTableForm: false,
// isForm: false
// },
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 100
},
tableForm: {
type: 'InputNumber',
1 year ago
min: 0,
precision: 6,
disabled:true
},
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6,
disabled: true
}
1 year ago
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 120
},
tableForm: {
type: 'Select',
1 year ago
disabled: true
},
form: {
componentProps: {
disabled: true
}
1 year ago
}
},
{
label: '从包装规格',
field: 'fromPackUnit',
sort: 'custom',
isSearch: false,
table: {
width: 120
},
tableForm: {
disabled:true,
enterSearch: false,
isInpuFocusShow: true,
1 year ago
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装规格', // 输入框占位文本
searchField: 'packUnit', // 查询弹窗赋值字段
searchTitle: '物料包装信息', // 查询弹窗标题
searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
searchPage: ItempackagingApi.getItempackagingPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'itemCode',
value: 'itemCode',
isMainValue: true
}
],
// 失去焦点校验参数
verificationParams: [
{
key: 'packUnit',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}
]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled: true,
isSearchList: false, // 开启查询弹窗
searchListPlaceholder: '请选择包装规格', // 输入框占位文本
searchField: 'packUnit', // 查询弹窗赋值字段
searchTitle: '物料包装信息', // 查询弹窗标题
searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
searchPage: ItempackagingApi.getItempackagingPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'itemCode',
value: 'itemCode',
message: '请先选择品番!', // 当前置条件为空时 弹出信息提示
isMainValue: true
}
],
// 失去焦点校验参数
verificationParams: [
{
key: 'packUnit',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}
]
}
1 year ago
}
},
{
label: '到包装规格',
field: 'toPackUnit',
sort: 'custom',
isSearch: false,
table: {
width: 120
},
tableForm: {
disabled: true,
enterSearch: false,
isInpuFocusShow: true,
1 year ago
searchListPlaceholder: '请选择包装规格', // 输入框占位文本
searchField: 'packUnit', // 查询弹窗赋值字段
searchTitle: '物料包装信息', // 查询弹窗标题
searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
searchPage: ItempackagingApi.getItempackagingPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'itemCode',
value: 'itemCode',
message: '请先选择品番!', // 当前置条件为空时 弹出信息提示
isMainValue: true
}
],
// 失去焦点校验参数
verificationParams: [
{
key: 'packUnit',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}
]
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled: true,
enterSearch: false,
isInpuFocusShow: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择包装规格', // 输入框占位文本
searchField: 'packUnit', // 查询弹窗赋值字段
searchTitle: '物料包装信息', // 查询弹窗标题
searchAllSchemas: Itempackaging.allSchemas, // 查询弹窗所需类
searchPage: ItempackagingApi.getItempackagingPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'itemCode',
value: 'itemCode',
isMainValue: true
}
],
// 失去焦点校验参数
verificationParams: [
{
key: 'packUnit',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}
]
}
1 year ago
}
},
{
label: '从标包数量',
field: 'fromPackQty',
sort: 'custom',
table: {
width: 120
},
tableForm: {
1 year ago
disabled: true
},
form: {
componentProps: {
disabled: true
}
1 year ago
}
},
{
label: '到标包数量',
field: 'toPackQty',
sort: 'custom',
table: {
width: 120
},
tableForm: {
// disabled: true
type:'InputNumber'
},
form: {
component:'InputNumber',
componentProps: {
// disabled: true
}
1 year ago
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 120
},
tableForm: {
1 year ago
disabled: true
},
form: {
componentProps: {
disabled: true
}
1 year ago
}
},
{
label: '从库位组代码',
field: 'fromLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
1 year ago
disabled: true
},
form: {
componentProps: {
disabled: true
}
1 year ago
}
},
{
label: '到库位组代码',
field: 'toLocationGroupCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
1 year ago
disabled: true
},
form: {
componentProps: {
disabled: true
}
1 year ago
}
},
{
label: '从库区代码',
field: 'fromAreaCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
1 year ago
disabled: true
},
form: {
componentProps: {
disabled: true
}
1 year ago
}
},
{
label: '到库区代码',
field: 'toAreaCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
1 year ago
disabled: true
},
form: {
componentProps: {
disabled: true
}
1 year ago
}
},
{
label: '库存状态',
field: 'inventoryStatus',
dictType: DICT_TYPE.INVENTORY_STATUS,
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 110
},
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
isTable: false,
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isForm: false,
isTableForm: false,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
}
},
{
label: '创建者',
field: 'creator',
isTable: true,
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isForm: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x'
}
},
isTableForm: false
},
{
label: '最后更新者',
field: 'updater',
isForm: false,
isTable: true,
table: {
width: 150
},
isTableForm: false
}
])
)
1 year ago
// 表单校验
export const PackageoverRequestDetailRules = reactive({
itemCode: [{ required: true, message: '请选择品番', trigger: 'change' }],
fromPackUnit: [{ required: true, message: '请选择从包装规格', trigger: 'change' }],
toPackUnit: [{ required: true, message: '请选择到包装规格', trigger: 'change' }],
toPackQty: [{ required: true, message: '请输入到标包数量', trigger: ['change','blur'] }],
})