|
|
|
import type {CrudSchema} from '@/hooks/web/useCrudSchemas'
|
|
|
|
import {dateFormatter} from '@/utils/formatTime'
|
|
|
|
import * as WorkstationApi from "@/api/mes/workstation";
|
|
|
|
import {Workshop} from "@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data";
|
|
|
|
import * as WorkshopApi from "@/api/wms/workshop";
|
|
|
|
import {
|
|
|
|
Productionline
|
|
|
|
} from "@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data";
|
|
|
|
import * as ProductionlineApi from "@/api/wms/productionline";
|
|
|
|
import * as ProcessApi from "@/api/mes/process";
|
|
|
|
import * as AbilityInfoApi from "@/api/mes/abilityInfo";
|
|
|
|
import {AbilityInfo} from "@/views/mes/abilityInfo/abilityInfo.data";
|
|
|
|
|
|
|
|
// 表单校验
|
|
|
|
export const WorkstationRules = reactive({
|
|
|
|
code: [required],
|
|
|
|
name: [required],
|
|
|
|
workshopCode:[required],
|
|
|
|
productionLineCode: [required],
|
|
|
|
processCode: [required]
|
|
|
|
})
|
|
|
|
export const TabsList = [{
|
|
|
|
label: "设备",
|
|
|
|
prop: 'Equipment',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: "操作步骤",
|
|
|
|
prop: 'Opersteps',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: "能力",
|
|
|
|
prop: 'Ability',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: "岗位",
|
|
|
|
prop: 'Post',
|
|
|
|
}
|
|
|
|
|
|
|
|
]
|
|
|
|
export const Workstation = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
|
|
|
|
{
|
|
|
|
label: '代码',
|
|
|
|
field: 'code',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '名称',
|
|
|
|
field: 'name',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '车间代码',
|
|
|
|
field: 'workshopCode',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: 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: 'productionLineCode',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
// labelMessage: '信息提示说明!!!',
|
|
|
|
componentProps: {
|
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '请选择生产线', // 输入框占位文本
|
|
|
|
searchField: 'code', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '生产线信息', // 查询弹窗标题
|
|
|
|
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [{
|
|
|
|
key:'workshopCode',
|
|
|
|
value:'workshopCode',
|
|
|
|
message: '请选择车间!',
|
|
|
|
isMainValue: true
|
|
|
|
},{
|
|
|
|
key: 'available',
|
|
|
|
value: 'TRUE',
|
|
|
|
isMainValue: false
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '工序代码',
|
|
|
|
field: 'processCode',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
// labelMessage: '信息提示说明!!!',
|
|
|
|
componentProps: {
|
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '请选择工序', // 输入框占位文本
|
|
|
|
searchField: 'code', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '工序信息', // 查询弹窗标题
|
|
|
|
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: ProcessApi.getProcessPage, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [{
|
|
|
|
key: 'available',
|
|
|
|
value: 'TRUE',
|
|
|
|
isMainValue: false
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '生效时间',
|
|
|
|
field: 'activeTime',
|
|
|
|
sort: 'custom',
|
|
|
|
formatter: dateFormatter,
|
|
|
|
detail: {
|
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
style: {width: '100%'},
|
|
|
|
type: 'datetime',
|
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
valueFormat: 'x',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '失效时间',
|
|
|
|
field: 'expireTime',
|
|
|
|
sort: 'custom',
|
|
|
|
formatter: dateFormatter,
|
|
|
|
detail: {
|
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
style: {width: '100%'},
|
|
|
|
type: 'datetime',
|
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
valueFormat: 'x',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '是否可用',
|
|
|
|
field: 'available',
|
|
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
|
|
dictClass: 'string',
|
|
|
|
isTable: true,
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 150
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'Switch',
|
|
|
|
value: 'TRUE',
|
|
|
|
componentProps: {
|
|
|
|
inactiveValue: 'FALSE',
|
|
|
|
activeValue: 'TRUE'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '操作',
|
|
|
|
field: 'action',
|
|
|
|
isForm: false,
|
|
|
|
isTable: true,
|
|
|
|
table: {
|
|
|
|
width: 150,
|
|
|
|
fixed: 'right'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]))
|
|
|
|
export const searchPop = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '代码',
|
|
|
|
field: 'code',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
isForm: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '名称',
|
|
|
|
field: 'name',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
isForm: false
|
|
|
|
}
|
|
|
|
]))
|
|
|
|
|
|
|
|
export const Equipment = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '代码',
|
|
|
|
field: 'code',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
isForm: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '名称',
|
|
|
|
field: 'name',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
isForm: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '操作',
|
|
|
|
field: 'action',
|
|
|
|
isDetail: false,
|
|
|
|
isForm: false ,
|
|
|
|
table: {
|
|
|
|
width: 150,
|
|
|
|
fixed: 'right'
|
|
|
|
},
|
|
|
|
isTableForm:true
|
|
|
|
}
|
|
|
|
]))
|
|
|
|
export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '代码',
|
|
|
|
field: 'code',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
isForm: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '名称',
|
|
|
|
field: 'name',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
isForm: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '操作',
|
|
|
|
field: 'action',
|
|
|
|
isDetail: false,
|
|
|
|
isForm: false ,
|
|
|
|
table: {
|
|
|
|
width: 150,
|
|
|
|
fixed: 'right'
|
|
|
|
},
|
|
|
|
isTableForm:true,
|
|
|
|
}
|
|
|
|
]))
|
|
|
|
export const Ability = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '代码',
|
|
|
|
field: 'code',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
isForm: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '名称',
|
|
|
|
field: 'name',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
isForm: false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '操作',
|
|
|
|
field: 'action',
|
|
|
|
isDetail: false,
|
|
|
|
isForm: false ,
|
|
|
|
table: {
|
|
|
|
width: 150,
|
|
|
|
fixed: 'right'
|
|
|
|
},
|
|
|
|
isTableForm:true,
|
|
|
|
}
|
|
|
|
]))
|
|
|
|
export const equipmentPopList = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '选择设备',
|
|
|
|
field: 'list',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
form: {
|
|
|
|
// labelMessage: '信息提示说明!!!',
|
|
|
|
componentProps: {
|
|
|
|
multiple:true,
|
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '选择设备', // 输入框占位文本
|
|
|
|
searchField: 'code', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '选择设备', // 查询弹窗标题
|
|
|
|
searchAllSchemas: searchPop.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: WorkstationApi.checkEquipmentPageList, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [{
|
|
|
|
key: 'available',
|
|
|
|
value: 'TRUE',
|
|
|
|
isMainValue: false
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]))
|
|
|
|
export const PostList = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '选择岗位',
|
|
|
|
field: 'list',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
form: {
|
|
|
|
// labelMessage: '信息提示说明!!!',
|
|
|
|
componentProps: {
|
|
|
|
multiple:true,
|
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '选择岗位', // 输入框占位文本
|
|
|
|
searchField: 'code', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '选择岗位', // 查询弹窗标题
|
|
|
|
searchAllSchemas: searchPop.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: WorkstationApi.checkProcessPageList, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [{
|
|
|
|
key: 'available',
|
|
|
|
value: 'TRUE',
|
|
|
|
isMainValue: false
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]))
|
|
|
|
export const stepPopList = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '选择操作步骤',
|
|
|
|
field: 'list',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
form: {
|
|
|
|
// labelMessage: '信息提示说明!!!',
|
|
|
|
componentProps: {
|
|
|
|
multiple:true,
|
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '选择操作步骤', // 输入框占位文本
|
|
|
|
searchField: 'code', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '选择操作步骤', // 查询弹窗标题
|
|
|
|
searchAllSchemas: searchPop.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: WorkstationApi.checkOperstepsPageList, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [{
|
|
|
|
key: 'available',
|
|
|
|
value: 'TRUE',
|
|
|
|
isMainValue: false
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]))
|
|
|
|
export const abilityPopList = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '选择能力',
|
|
|
|
field: 'list',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: false,
|
|
|
|
form: {
|
|
|
|
// labelMessage: '信息提示说明!!!',
|
|
|
|
componentProps: {
|
|
|
|
multiple:true,
|
|
|
|
isSearchList: true, // 开启查询弹窗
|
|
|
|
searchListPlaceholder: '选择能力', // 输入框占位文本
|
|
|
|
searchField: 'ablityCode', // 查询弹窗赋值字段
|
|
|
|
searchTitle: '选择能力', // 查询弹窗标题
|
|
|
|
searchAllSchemas: AbilityInfo.allSchemas, // 查询弹窗所需类
|
|
|
|
searchPage: AbilityInfoApi.getAbilityInfoPage, // 查询弹窗所需分页方法
|
|
|
|
searchCondition: [{
|
|
|
|
key: 'available',
|
|
|
|
value: 'TRUE',
|
|
|
|
isMainValue: false
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]))
|