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.

434 lines
9.1 KiB

11 months ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
11 months ago
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data'
import { fa } from 'element-plus/es/locale'
11 months ago
export const ProcessproductionRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isForm: false,
isTable:false,
isTableForm:false,
},
{
label: '单据号',
field: 'number',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
isForm: false,
11 months ago
isSearch: true,
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
isSearch: true,
11 months ago
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
11 months ago
},
{
label: '完工数量',
field: 'completedQuantity',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
},
},
11 months ago
},
{
label: '报废数量',
field: 'scrapQuantity',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
},
},
11 months ago
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
11 months ago
},
{
label: '备注',
field: 'remark',
sort: 'custom',
11 months ago
isTable:false,
11 months ago
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
11 months ago
isTable:false,
11 months ago
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable:false,
isForm: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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除者ID',
field: 'deleterId',
sort: 'custom',
isSearch: false,
isTable:false,
11 months ago
isForm: false,
11 months ago
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isSearch: false,
isTable:false,
11 months ago
isForm: false,
11 months ago
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable:false,
11 months ago
isForm: false,
11 months ago
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
11 months ago
isForm: false,
11 months ago
isTable:false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const ProcessproductionRequestMainRules = reactive({
11 months ago
itemCode: [{ required: true, message: '物料代码不能为空', trigger: 'change' }],
completedQuantity: [{ required: true, message: '完工数量不能为空', trigger: 'change' }],
scrapQuantity: [{ required: true, message: '报废数量不能为空', trigger: 'change' }],
11 months ago
available: [required],
concurrencyStamp: [required],
})
export const ProcessproductionRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
11 months ago
11 months ago
{
label: '单据号',
field: 'number',
sort: 'custom',
11 months ago
isSearch: false,
isTable:false,
isTableForm:false,
11 months ago
table: {
width: 150
},
hiddenInMain:true,
11 months ago
},
{
11 months ago
label: '生产线',
field: 'productionLine',
11 months ago
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '生产线物料关系信息', // 查询弹窗标题
searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'itemCode',
value:'itemCode',
message: '请选择物料代码!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
}
},
tableForm:{
multiple:true,
isInpuFocusShow: true,
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '生产线物料关系信息', // 查询弹窗标题
searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'itemCode',
value:'itemCode',
message: '请选择物料代码!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
},
11 months ago
},
{
11 months ago
label: '工序',
field: 'processCode',
11 months ago
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
},
{
label: '库位代码',
field: 'locationCode',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
},
{
label: '子物料代码',
field: 'componentItemCode',
sort: 'custom',
11 months ago
isSearch: false,
table: {
width: 150
},
11 months ago
},
{
label: '批次',
field: 'batch',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
},
{
label: '子物料数量',
field: 'componentItemcodeQty',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
},
{
label: '生效日期',
field: 'effectiveDate',
sort: 'custom',
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
11 months ago
table: {
width: 150
},
11 months ago
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
11 months ago
isTable:false,
11 months ago
isTableForm:false,
11 months ago
table: {
width: 150
},
11 months ago
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isForm: false,
11 months ago
isTableForm: false,
11 months ago
table: {
width: 150
},
11 months ago
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
11 months ago
isSearch: false,
isTable:false,
11 months ago
isTableForm: false,
11 months ago
table: {
width: 150
},
11 months ago
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')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除者ID',
field: 'deleterId',
sort: 'custom',
11 months ago
isSearch: false,
isTable:false,
11 months ago
isTableForm: false,
11 months ago
table: {
width: 150
},
11 months ago
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
11 months ago
isSearch: false,
isTable:false,
11 months ago
isTableForm: false,
11 months ago
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
11 months ago
isSearch: false,
isTable:false,
11 months ago
isTableForm: false,
11 months ago
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
11 months ago
isSearch: false,
isTable:false,
11 months ago
isTableForm: false,
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
hiddenInMain:true,
isTable:false,
isTableForm:false,
form: {
component: 'InputNumber',
value: 0
},
11 months ago
},
{
label: '操作',
field: 'action',
isForm: false,
11 months ago
hiddenInMain:true,
11 months ago
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const ProcessproductionRequestDetailRules = reactive({
})