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.

307 lines
7.1 KiB

12 months ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import * as ProductionLineCodeApi from '@/api/wms/productionline'
import { Productionline } from './../../factoryModeling/productionline/productionline.data'
import * as LocationApi from '@/api/wms/location'
12 months ago
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from './../itembasic/itembasic.data'
import * as confgiApi from '@/api/infra/config'
const { t } = useI18n() // 国际化
const confgiData = await confgiApi.queryByKey("Productionlineitem")
9 months ago
const lineCodeData = await ProductionLineCodeApi.getProductionlinePage({
isSearch:false,
pageSize: 100,
pageNo: 1
})
12 months ago
/**
* @returns {Array} 线
*/
export const Productionlineitem = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '完工收货库位',
// field: 'fgLocationCode',
// isSearch: true,
// sort: 'custom',
// table: {
// width: 150,
// fixed: 'left'
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择库位代码',
// searchField: 'code',
// searchTitle: '库位信息',
// searchAllSchemas: Location.allSchemas,
// searchPage: LocationApi.getLocationPage,
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }]
// }
// }
// },
// {
// label: '原料库位',
// field: 'rawLocationCode',
// isSearch: true,
// sort: 'custom',
// table: {
// width: 150,
// fixed: 'left'
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true,
// searchListPlaceholder: '请选择库位代码',
// searchField: 'code',
// searchTitle: '库位信息',
// searchAllSchemas: Location.allSchemas,
// searchPage: LocationApi.getLocationPage
// }
// }
// },
{
label: '产线代码' ,
field: 'productionLineCode',
isSearch: true,
sort: 'custom',
table: {
width: 150,
fixed: 'left'
},
isForm:true,
12 months ago
form: {
show:true,
component: 'SelectV2',
// value:'undefined',
value:lineCodeData?.list.length>0?lineCodeData.list[0].code:'undefined',
12 months ago
// labelMessage: '信息提示说明!!!',
componentProps: {
// isSearchList: true,
9 months ago
filterable:true,
9 months ago
placeholder:'请选择产线代码',
12 months ago
searchField: 'code',
// searchTitle: '生产线信息',
// searchAllSchemas: Productionline.allSchemas,
// searchPage: ProductionLineCodeApi.getProductionlinePage
options:lineCodeData.list.map(item=>({
label:item.code,
value:item.code
}))
12 months ago
}
},
12 months ago
},
{
label: '物料代码',
field: 'itemCode',
isSearch: true,
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
12 months ago
isSearchList: true,
searchListPlaceholder: '请选择物料代码',
searchField: 'code',
searchTitle: '物料信息',
searchAllSchemas: Itembasic.allSchemas,
searchPage: ItembasicApi.getItembasicPage,
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
12 months ago
searchCondition: [
{
key:'enableMake',
value:'TRUE',
action: '==',
isSearch: true,
isMainValue: false
},
{
key:'type',
value:confgiData.itemType,
action: 'notin',
isSearch: true,
isMainValue: false
},
{
key:'available',
value:'TRUE',
action: '==',
isSearch: true,
isMainValue: false
}
]
}
}
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
sort: 'custom',
isSearch: false,
isTable: true,
table: {
width: 120
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '生效时间',
field: 'activeTime',
sort: 'custom',
formatter : dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
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'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
}
},
{
label:'备注',
field: 'remark',
isTable: false
},
{
label: '创建时间',
field: 'createTime',
isForm: false,
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: 'creator',
isForm: false,
isTable: true
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: false,
formatter: dateFormatter,
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: 'updater',
isDetail: true,
isForm: false,
isTable: false,
table: {
width: 150
}
12 months ago
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false ,
table: {
width: 150,
fixed: 'right'
}
}
]))
//表单校验
export const ProductionlineitemRules = reactive({
// fgLocationCode: [
// { required: true, message: '请输入完工收货库位', trigger: 'change' }
// ],
productionLineCode: [
{ required: true, message: '请输入产线代码', trigger: 'change' }
],
itemCode: [
{ required: true, message: '请输入物料代码', trigger: 'change' }
],
remark: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
],
available: [
{ required: true, message: '请选择是否可用', trigger: 'change' }
],
})