|
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
|
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @returns {Array} 备料计划主表
|
|
|
|
*/
|
|
|
|
export const PreparetoissueMain = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '生产计划单号',
|
|
|
|
field: 'productionPlanNumber',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '车间',
|
|
|
|
field: 'workshop',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '生产线',
|
|
|
|
field: 'prodLine',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '班次',
|
|
|
|
field: 'shift',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '班组',
|
|
|
|
field: 'team',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '计划日期',
|
|
|
|
field: 'planDate',
|
|
|
|
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',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '单据号',
|
|
|
|
field: 'number',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150,
|
|
|
|
fixed: 'left'
|
|
|
|
},
|
|
|
|
isForm: false,
|
|
|
|
isSearch: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '业务类型',
|
|
|
|
field: 'businessType',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
value: 'Issue',
|
|
|
|
componentProps: {
|
|
|
|
disabled: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '开始时间',
|
|
|
|
field: 'beginTime',
|
|
|
|
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',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '结束时间',
|
|
|
|
field: 'endTime',
|
|
|
|
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',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '备注',
|
|
|
|
field: 'remark',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
isTable: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '创建时间',
|
|
|
|
field: 'createTime',
|
|
|
|
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',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
isForm: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '创建者',
|
|
|
|
field: 'creator',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
isForm: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '最后更新时间',
|
|
|
|
field: 'updateTime',
|
|
|
|
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',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
isForm: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '最后更新者',
|
|
|
|
field: 'updater',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
isForm: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '状态',
|
|
|
|
field: 'status',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
dictType: DICT_TYPE.PLAN_STATUS,
|
|
|
|
dictClass: 'string',
|
|
|
|
isSearch: true,
|
|
|
|
form: {
|
|
|
|
value: '1',
|
|
|
|
componentProps: {
|
|
|
|
disabled: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '是否可用',
|
|
|
|
field: 'available',
|
|
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
|
|
dictClass: 'string',
|
|
|
|
isSearch: true,
|
|
|
|
isTable: true,
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'Switch',
|
|
|
|
value: 'TRUE',
|
|
|
|
componentProps: {
|
|
|
|
inactiveValue: 'FALSE',
|
|
|
|
activeValue: 'TRUE'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '操作',
|
|
|
|
field: 'action',
|
|
|
|
isDetail: false,
|
|
|
|
isForm: false,
|
|
|
|
table: {
|
|
|
|
width: 300,
|
|
|
|
fixed: 'right'
|
|
|
|
},
|
|
|
|
}
|
|
|
|
]))
|
|
|
|
|
|
|
|
//表单校验
|
|
|
|
export const PreparetoissueMainRules = reactive({
|
|
|
|
workshop: [
|
|
|
|
{ required: true, message: '请选择车间', trigger: 'change' }
|
|
|
|
],
|
|
|
|
prodLine: [
|
|
|
|
{ required: true, message: '请选择生产线', trigger: 'change' }
|
|
|
|
],
|
|
|
|
shift: [
|
|
|
|
{ required: true, message: '请选择班次', trigger: 'change' }
|
|
|
|
],
|
|
|
|
team: [
|
|
|
|
{ required: true, message: '请选择班组', trigger: 'change' }
|
|
|
|
],
|
|
|
|
planDate: [
|
|
|
|
{ required: true, message: '请输入计划日期', trigger: 'change' }
|
|
|
|
],
|
|
|
|
available: [
|
|
|
|
{ required: true, message: '请选择是否可用', trigger: 'change' }
|
|
|
|
],
|
|
|
|
status: [
|
|
|
|
{ required: true, message: '请选择状态', trigger: 'change' }
|
|
|
|
],
|
|
|
|
businessType: [
|
|
|
|
{ required: true, message: '请输入业务类型', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
})
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @returns {Array} 备料计划子表
|
|
|
|
*/
|
|
|
|
export const PreparetoissueDetail = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '目标库位',
|
|
|
|
field: 'toLocationCode',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '工位',
|
|
|
|
field: 'workStation',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '截止时间',
|
|
|
|
field: 'dueTime',
|
|
|
|
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',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '单据号',
|
|
|
|
field: 'number',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
componentProps: {
|
|
|
|
disabled: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
isTableForm: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '物品代码',
|
|
|
|
field: 'itemCode',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '备注',
|
|
|
|
field: 'remark',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '创建时间',
|
|
|
|
field: 'createTime',
|
|
|
|
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',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
isTableForm: false,
|
|
|
|
isForm: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '创建者',
|
|
|
|
field: 'creator',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
isTableForm: false,
|
|
|
|
isForm: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '计划数量',
|
|
|
|
field: 'planQty',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'InputNumber',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '计量单位',
|
|
|
|
field: 'uom',
|
|
|
|
dictType: DICT_TYPE.UOM,
|
|
|
|
dictClass: 'string',
|
|
|
|
isSearch: true,
|
|
|
|
isTable: true,
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '最后更新者',
|
|
|
|
field: 'updater',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
isTableForm: false,
|
|
|
|
isForm: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '最后更新时间',
|
|
|
|
field: 'updateTime',
|
|
|
|
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',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
isTableForm: false,
|
|
|
|
isForm: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '是否可用',
|
|
|
|
field: 'available',
|
|
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
|
|
dictClass: 'string',
|
|
|
|
isSearch: true,
|
|
|
|
isTable: true,
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'Switch',
|
|
|
|
value: 'TRUE',
|
|
|
|
componentProps: {
|
|
|
|
inactiveValue: 'FALSE',
|
|
|
|
activeValue: 'TRUE'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '操作',
|
|
|
|
field: 'action',
|
|
|
|
isDetail: false,
|
|
|
|
isForm: false ,
|
|
|
|
table: {
|
|
|
|
width: 150,
|
|
|
|
fixed: 'right'
|
|
|
|
},
|
|
|
|
isTableForm:false,
|
|
|
|
}
|
|
|
|
]))
|
|
|
|
|
|
|
|
//表单校验
|
|
|
|
export const PreparetoissueDetailRules = reactive({
|
|
|
|
available: [
|
|
|
|
{ required: true, message: '请选择是否可用', trigger: 'change' }
|
|
|
|
],
|
|
|
|
uom: [
|
|
|
|
{ required: true, message: '请选择计量单位', trigger: 'change' }
|
|
|
|
],
|
|
|
|
planQty: [
|
|
|
|
{ required: true, message: '请输入计划数量', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
number: [
|
|
|
|
{ required: true, message: '请输入单据号', trigger: 'blur' }
|
|
|
|
],
|
|
|
|
itemCode: [
|
|
|
|
{ required: true, message: '请选择物品代码', trigger: 'change' }
|
|
|
|
],
|
|
|
|
})
|