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.
328 lines
7.3 KiB
328 lines
7.3 KiB
1 year ago
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||
|
import { dateFormatter } from '@/utils/formatTime'
|
||
|
import * as ItembasicApi from '@/api/wms/itembasic'
|
||
|
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
|
||
|
import * as WorkshopApi from '@/api/wms/workshop'
|
||
|
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
|
||
|
import { on } from '@/utils/domUtils'
|
||
|
|
||
|
// 表单校验
|
||
|
export const OrderDayRules = reactive({
|
||
|
planNoDay: [
|
||
|
{ required: true, message: '请输入一个日计划编号', trigger: 'blur' }
|
||
|
],
|
||
|
planNoMonth: [
|
||
|
{ required: true, message: '请输入一个月计划编号', trigger: 'blur' }
|
||
|
],
|
||
|
productCode: [
|
||
|
{ required: true, message: '请选择一个产品', trigger: 'blur' }
|
||
|
],
|
||
|
workroomCode: [
|
||
|
{ required: true, message: '请选择一个车间', trigger: 'blur' }
|
||
|
],
|
||
|
lineCode: [
|
||
|
{ required: true, message: '请选择一个产线', trigger: 'blur' }
|
||
|
],
|
||
|
workMode: [
|
||
|
{ required: true, message: '请选择工单生成方式', trigger: 'blur' }
|
||
|
],
|
||
|
startTime: [
|
||
|
{ required: true, message: '请输入计划生产开始时间', trigger: 'blur' }
|
||
|
],
|
||
|
endTime: [
|
||
|
{ required: true, message: '请输入计划生产完成时间', trigger: 'blur' }
|
||
|
],
|
||
|
planDate: [
|
||
|
{ required: true, message: '请输入计划日期', trigger: 'blur' }
|
||
|
],
|
||
|
taskMode: [
|
||
|
{ required: true, message: '请选择一个生产方式', trigger: 'blur' }
|
||
|
],
|
||
|
})
|
||
|
|
||
|
export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
|
||
|
{
|
||
|
label: '主键',
|
||
|
field: 'id',
|
||
|
sort: 'custom',
|
||
|
isForm: false,
|
||
|
width: '60px',
|
||
|
},
|
||
|
{
|
||
|
label: '日计划单号',
|
||
|
field: 'planNoDay',
|
||
|
sort: 'custom',
|
||
|
isSearch: true,
|
||
|
required: true,
|
||
|
},
|
||
|
{
|
||
|
label: '月计划单号',
|
||
|
field: 'planNoMonth',
|
||
|
sort: 'custom',
|
||
|
isSearch: true,
|
||
|
required: false,
|
||
|
},
|
||
|
{
|
||
|
label: '状态',
|
||
|
field: 'status',
|
||
|
sort: 'custom',
|
||
|
isForm: false,
|
||
|
isTable: true,
|
||
|
isDetail:true,
|
||
|
isSearch: false,
|
||
|
width: '80px',
|
||
|
dictType: DICT_TYPE.MES_PLANDO_STATUS,
|
||
|
dictClass: 'string',
|
||
|
form: {
|
||
|
component: 'Select',
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '产品编号',
|
||
|
field: 'productCode',
|
||
|
sort: 'custom',
|
||
|
isSearch: true,
|
||
|
required: true,
|
||
|
form: {
|
||
|
// labelMessage: '信息提示说明!!!',
|
||
|
componentProps: {
|
||
|
isSearchList: true, // 开启查询弹窗
|
||
|
searchListPlaceholder: '产品编码', // 输入框占位文本
|
||
|
searchField: 'code', // 查询弹窗赋值字段
|
||
|
searchTitle: '产品信息', // 查询弹窗标题
|
||
|
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
|
||
|
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
|
||
|
isHideFilterButton:true,
|
||
|
searchCondition: [{
|
||
|
key: 'available',
|
||
|
value: 'TRUE',
|
||
|
isMainValue: false
|
||
|
},
|
||
|
{
|
||
|
key: 'type',
|
||
|
action: 'in', // 查询拼接条件
|
||
|
isSearch: true, // 使用自定义拼接条件
|
||
|
value: 'FG,SEMI',//,SEMI]
|
||
|
isMainValue: false
|
||
|
},
|
||
|
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '车间编码',
|
||
|
field: 'workroomCode',
|
||
|
sort: 'custom',
|
||
|
isSearch: true,
|
||
|
required: true,
|
||
|
form: {
|
||
|
// labelMessage: '信息提示说明!!!',
|
||
|
componentProps: {
|
||
|
isSearchList: true, // 开启查询弹窗
|
||
|
searchListPlaceholder: '车间', // 输入框占位文本
|
||
|
searchField: 'code', // 查询弹窗赋值字段
|
||
|
searchTitle: '车间信息', // 查询弹窗标题
|
||
|
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
|
||
|
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
|
||
|
searchCondition: [{
|
||
|
key: 'available',
|
||
|
value: 'TRUE',
|
||
|
isMainValue: false
|
||
|
}]
|
||
|
}
|
||
|
},
|
||
|
|
||
|
},
|
||
|
{
|
||
|
label: '产线编码',
|
||
|
field: 'lineCode',
|
||
|
sort: 'custom',
|
||
|
isSearch: true,
|
||
|
required: true,
|
||
|
form:{
|
||
|
component:'Select',
|
||
|
componentProps:{
|
||
|
options:[{lablel:'1',value:'1'}]
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '计划数量',
|
||
|
field: 'planCount',
|
||
|
sort: 'custom',
|
||
|
required: true,
|
||
|
form: {
|
||
|
component: 'InputNumber',
|
||
|
value: 1
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '工艺路线编码',
|
||
|
field: 'processrouteCode',
|
||
|
sort: 'custom',
|
||
|
form: {
|
||
|
component:'Select',
|
||
|
componentProps: {
|
||
|
options: []
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '临时工艺',
|
||
|
field: 'tempProcessroute',
|
||
|
sort: 'custom',
|
||
|
width: '80px',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: 'BOM编码',
|
||
|
field: 'standardBom',
|
||
|
sort: 'custom',
|
||
|
form: {
|
||
|
component:'Select',
|
||
|
componentProps: {
|
||
|
options: [{lablel:'bom',value:'bom'}]
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '替代BOM',
|
||
|
field: 'tempBom',
|
||
|
sort: 'custom',
|
||
|
width: '80px',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE',
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '工单模式',
|
||
|
field: 'workMode',
|
||
|
width: '80px',
|
||
|
sort: 'custom',
|
||
|
dictType: DICT_TYPE.MES_WORKBILL_MODEL,
|
||
|
dictClass: 'string',
|
||
|
form: {
|
||
|
component: 'Select',
|
||
|
value: 'BATCH',
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '计划日期',
|
||
|
field: 'planDate',
|
||
|
sort: 'custom',
|
||
|
formatter: dateFormatter,
|
||
|
isSearch: true,
|
||
|
search: {
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
type: 'date',
|
||
|
valueFormat: 'YYYY-MM-DD',
|
||
|
}
|
||
|
},
|
||
|
form: {
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
type: 'date',
|
||
|
valueFormat: 'x'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '开始时间',
|
||
|
field: 'startTime',
|
||
|
sort: 'custom',
|
||
|
formatter: dateFormatter,
|
||
|
required: true,
|
||
|
form: {
|
||
|
component: 'TimePicker',
|
||
|
componentProps: {
|
||
|
type: 'time',
|
||
|
dateFormat: 'HH:mm',
|
||
|
//valueFormat: 'x',
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '结束时间',
|
||
|
field: 'endTime',
|
||
|
sort: 'custom',
|
||
|
formatter: dateFormatter,
|
||
|
isReadonly:true,
|
||
|
form: {
|
||
|
component: 'TimePicker',
|
||
|
componentProps: {
|
||
|
type: 'time',
|
||
|
dateFormat: 'HH:mm',
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '生产模式',
|
||
|
field: 'taskMode',
|
||
|
width : '80px',
|
||
|
sort: 'custom',
|
||
|
dictType: DICT_TYPE.MES_TASK_MODE,
|
||
|
dictClass: 'string',
|
||
|
form: {
|
||
|
component: 'Select',
|
||
|
value:'ASSIGN'
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '创建时间',
|
||
|
field: 'createTime',
|
||
|
sort: 'custom',
|
||
|
formatter: dateFormatter,
|
||
|
isSearch: true,
|
||
|
search: {
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
type: 'datetime',
|
||
|
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
||
|
}
|
||
|
},
|
||
|
isForm: false,
|
||
|
},
|
||
|
{
|
||
|
label: '创建者',
|
||
|
field: 'creator',
|
||
|
sort: 'custom',
|
||
|
isSearch: false,
|
||
|
isForm: false,
|
||
|
},
|
||
|
{
|
||
|
label: '备注',
|
||
|
field: 'remark',
|
||
|
sort: 'custom',
|
||
|
isSearch: false,
|
||
|
isTable:false,
|
||
|
},
|
||
|
{
|
||
|
label: '操作',
|
||
|
field: 'action',
|
||
|
isForm: false,
|
||
|
table: {
|
||
|
width: 200,
|
||
|
fixed: 'right'
|
||
|
}
|
||
|
}
|
||
|
]))
|