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.
 
 
 

842 lines
18 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as getRequestsettingApi from '@/api/wms/requestsetting/index'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import {Warehouse} from "@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data";
import * as WarehouseApi from "@/api/wms/warehouse";
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 ItempackageApi from '@/api/wms/itempackage'
import { Itempackaging } from '@/views/wms/basicDataManage/itemManage/itempackage/itempackage.data'
import * as SupplieritemApi from '@/api/wms/supplieritem'
import { Supplieritem } from '@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data'
import * as ProductionitemcodeSpareitemcodeApi from '@/api/wms/productionitemcodeSpareitemcode'
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize:10,
pageNo:1,
code:'RelegateRequest'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData =data?.list[0]||{}
// 表单校验
export const RelegateRequestMainRules = reactive({
fromWarehouseCode: [required],
number: [required],
businessType: [required],
autoCommit: [required],
autoAgree: [required],
autoExecute: [required],
directCreateRecord: [required],
concurrencyStamp: [required],
fromAreaTypes: [required],
fromAreaCodes: [required],
})
export const RelegateRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 180
},
},
{
label: '从仓库代码',
field: 'fromWarehouseCode',
sort: 'custom',
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,
}], // 失去焦点校验参数
}
},
table: {
width: 180
},
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
isForm: false,
isTable: false
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isForm: false,
isTable: false
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
table: {
width: 180
},
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')]
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
isForm: false,
isTable: false
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isForm: false,
isTable: false
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isForm: false,
isTable: false
},
{
label: '申请时间',
field: 'requestTime',
sort: 'custom',
formatter: dateFormatter,
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')]
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
isForm: false,
isTable: false
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm:false,
isTableForm: false,
isTable:false,
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isForm: false,
isTable: true,
sort: 'custom',
table: {
width: 150
},
},
{
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
}
}
},
{
label: '自动通过',
field: 'autoAgree',
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
}
}
},
{
label: '自动执行',
field: 'autoExecute',
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
}
}
},
{
label: '直接生成记录',
field: 'directCreateRecord',
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
}
}
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm: false,
isTable: false,
isDetail:false
},
{
label: '权限所属人员id',
field: 'ruleUserId',
sort: 'custom',
isForm: false,
isTable: false,
isDetail:false
},
{
label: '工作流流水号',
field: 'serialNumber',
sort: 'custom',
isForm: false,
isTable: false,
isDetail:false
},
{
label: '原因',
field: 'reason',
sort: 'custom',
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 250,
fixed: 'right'
},
isDetail:false
}
]))
// 表单校验
export const RelegateRequestDetailRules = reactive({
itemCode: [required],
downItemCode: [required],
businessType: [required],
available: [required],
departmentCode: [required],
concurrencyStamp: [required],
packUnit: [required],
toLocationCode: [required]
})
export const RelegateRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
form: {
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择物料代码',
searchField: 'itemCode',
searchTitle: '库存余额信息',
searchAllSchemas: Balance.allSchemas,
searchPage: BalanceApi.getBalanceByBusinessCategoryByItemType,
searchCondition: []
}
},
tableForm:{
disabled:true,
multiple:true,
// isInpuFocusShow: true,
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '库存余额信息', // 查询弹窗标题
searchAllSchemas: Balance.allSchemas, // 查询弹窗所需类
searchPage: BalanceApi.getBalanceByBusinessCategoryByItemType, // 查询弹窗所需分页方法
searchCondition:[
// {
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }
{
message: '请选择从仓库代码!',
key: 'fromWarehouseCode',
value: 'fromWarehouseCode',
isMainValue: true
}]
},
table: {
width: 150
},
},
{
label: '物料变更代码',
field: 'downItemCode',
sort: 'custom',
form: {
componentProps: {
enterSearch: true,
isSearchList: true,
searchListPlaceholder: '请选择物料代码',
searchField: 'productionItemCode',
searchTitle: '物料基础信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ProductionitemcodeSpareitemcodeApi.getProductionitemcodeSpareitemcodeRelation,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'changeBeforeCode',
value: 'itemCode',
isTableRowValue: true,
isMainValue:false
}],
verificationParams: [{
key: 'changeBeforeCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
}
},
tableForm:{
isInpuFocusShow: true,
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'productionItemCode', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ProductionitemcodeSpareitemcodeApi.getProductionitemcodeSpareitemcodeRelation, // 查询弹窗所需分页方法
searchCondition:[
{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'changeBeforeCode',
value: 'itemCode',
isTableRowValue: true,
isMainValue:false
}]
},
table: {
width: 150
},
},
{
label: '包装号',
field: 'fromPackingNumber',
sort: 'custom',
form: {
componentProps: {
disabled: true,
}
},
tableForm: {
disabled: true
},
table: {
width: 120
},
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
table: {
width: 120
},
tableForm: {
disabled: true
},
},
{
label: '批次',
field: 'fromBatch',
sort: 'custom',
form: {
componentProps: {
disabled: true,
}
},
tableForm: {
disabled: true
},
table: {
width: 120
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
form: {
componentProps: {
disabled: true
}
},
tableForm: {
disabled: true
},
table: {
width: 80
},
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
sort: 'custom',
table: {
width: 100
},
tableForm: {
type: 'Select',
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '库位代码',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 100
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '到包装号',
field: 'toPackingNumber',
sort: 'custom',
isTable: false,
isForm: false,
isTableForm: false,
},
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
isTable: false,
isTableForm: false,
isForm: false,
},
{
label: '从库区类型',
field: 'fromAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
isForm: false,
isTableForm: false,
sort: 'custom',
},
{
label: '从库区代码',
field: 'fromAreaCodes',
sort: 'custom',
isForm:false,
isTableForm: false,
isTable: false,
},
{
label: '到批次',
field: 'toBatch',
sort: 'custom',
isTable: false,
isTableForm: false,
isForm: false,
},
{
label: '到库区类型',
field: 'toAreaTypes',
dictType: DICT_TYPE.AREA_TYPE,
dictClass: 'string',
isTable: false,
sort: 'custom',
isTableForm: false
},
{
label: '到库区代码',
field: 'toAreaCodes',
sort: 'custom',
isTableForm: false,
isTable: false,
isForm: false,
},
{
label: '到仓库代码',
field: 'toWarehouseCode',
sort: 'custom',
isTableForm: false,
isTable: false,
isForm: false,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isForm:false,
isTableForm: false,
isTable:false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isForm:false,
isTableForm: false,
isTable:false,
},
{
label: '部门',
field: 'departmentCode',
sort: 'custom',
isForm:false,
isTableForm: false,
isTable:false,
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isForm:false,
isTableForm: false,
isTable:false,
},
{
label: '创建人',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
isForm: false,
isTable: true
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
isSearch: true,
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm:false,
isTableForm: false,
isTable:true,
},
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isForm: false,
isTable: false,
sort: 'custom',
isTableForm: false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm:false,
form: {
component: 'InputNumber',
value: 0
},
isTableForm: false,
isTable:false,
},
{
label: '工作流流水号',
field: 'serialNumber',
isForm:false,
sort: 'custom',
isTableForm: false,
isTable:false,
},
{
label: '权限所属人员id',
field: 'ruleUserId',
sort: 'custom',
isForm:false,
isTableForm: false,
isTable:false,
},
{
label: '操作',
field: 'action',
isForm: false,
hiddenInMain:true,
table: {
width: 250,
fixed: 'right'
},
isTableForm: false
}
]))
/**
* @returns {Array} 物料变更申请子表创建标签
*/
export const RelegateRequestDetailLabel = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '物料代码',
field: 'downItemCode',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '批次',
field: 'toBatch',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true,
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '数量',
field: 'qty',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: true
},
form: {
componentProps: {
disabled: true
}
}
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
isTableForm: false,
form: {
componentProps: {
disabled: true
}
}
},
{
label: '包装规格',
field: 'packUnit',
sort: 'custom',
table: {
width: 150,
componentProps: {
disabled: true,
isSearchList: true,
searchListPlaceholder: '请选择包装',
searchField: 'packUnit',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItempackageApi.getItempackagingPageByProductreceipt,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
enterSearch:true,
disabled: true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装',
searchField: 'packUnit',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItempackageApi.getItempackagingPageByProductreceipt,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
},
{
label: '包装数量',
field: 'packQty',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm: {
disabled: true,
}
}
]))
//表单校验
export const RelegateRequestDetailLabelRules = reactive({
})