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.
 
 
 

186 lines
3.9 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {workscheduling} from "@/views/mes/productionPlan/productionPlan.data";
import * as ProductOfflineApi from "@/api/mes/productOffline";
// 表单校验
export const ProductOfflineRules = reactive({
checkPersonCode: [
{ required: true, message: '请输入质检人员', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
offlineReson: [
{ required: true, message: '请输入离线原因', trigger: 'blur' },
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
productCode: [
{ required: true, message: '请选择产品编码', trigger: 'change' },
],
})
export const ProductOffline = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '离线编码',
field: 'offlineCode',
sort: 'custom',
isForm: false,
fixed: 'left'
},
{
label: '产品编码',
field: 'productCode',
sort: 'custom',
isSearch: true,
table: {
width: 120,
fixed: 'left'
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择 产品编码', // 输入框占位文本
searchField: 'productCode', // 查询弹窗赋值字段
searchTitle: '生产任务信息表', // 查询弹窗标题
searchAllSchemas: workscheduling.allSchemas, // 查询弹窗所需类
searchPage: ProductOfflineApi.getworkSchedulingPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'status',
value: '1',
action: '==',
isSearch: true,
isMainValue: false
}]
}
}
},
{
label: '工单编码',
field: 'workBillno',
sort: 'custom',
isSearch: true,
disabled:true,
table: {
width: 120
},
form: {
componentProps: {
disabled:true,
}
}
},
{
label: '计划编码',
field: 'planCode',
sort: 'custom',
isSearch: true,
table: {
width: 120
},
form: {
componentProps: {
disabled:true,
}
}
},
{
label: '工序编码',
field: 'processCode',
sort: 'custom',
isSearch: true,
table: {
width: 120
},
form: {
componentProps: {
disabled:true,
}
}
},
{
label: '工位编码',
field: 'stationCode',
sort: 'custom',
isSearch: true,
table: {
width: 120
},
form: {
componentProps: {
disabled:true,
}
}
},
{
label: '产品去向',
field: 'productDestination',
sort: 'custom',
isSearch: false,
table: {
width: 120
}
},
{
label: '离线原因',
field: 'offlineReson',
sort: 'custom',
// dictType: DICT_TYPE.BASIC_TEAM_TYPE,
// dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 120
}
},
{
label: '质检人员',
field: 'checkPersonCode',
sort: 'custom',
isSearch: false,
isSearch: true,
table: {
width: 120
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
isTable: true,
formatter: dateFormatter,
isForm: false,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))