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.

878 lines
22 KiB

11 months ago
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import {dateFormatter, dateFormatter2} from '@/utils/formatTime'
11 months ago
import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/productionlineitem/productionlineitem.data'
11 months ago
import * as ProcessApi from '@/api/wms/process'
import { Process } from '@/views/wms/basicDataManage/factoryModeling/process/process.data'
import * as LocationApi from '@/api/wms/location'
import { Location } from '@/views/wms/basicDataManage/factoryModeling/location/location.data'
import {Bom} from "@/views/wms/basicDataManage/itemManage/bom/bom.data";
import * as BomApi from "@/api/wms/bom";
import * as BalanceApi from '@/api/wms/balance'
import * as ProcessproductionRequestMainApi from '@/api/wms/processproductionRequestMain'
import { Balance } from '@/views/wms/inventoryManage/balance/balance.data'
11 months ago
import { fa } from 'element-plus/es/locale'
11 months ago
export const ProcessproductionRequestMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
11 months ago
table: {
11 months ago
width: 200
11 months ago
},
11 months ago
isForm: false,
11 months ago
isSearch: true,
},
11 months ago
{
label: '状态',
field: 'status',
dictType: DICT_TYPE.REQUEST_STATUS,
dictClass: 'string',
isSearch: true,
isTable: true,
isForm: false,
sort: 'custom',
table: {
width: 150
},
form: {
value: '1',
componentProps: {
disabled: true
}
}
},
11 months ago
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
isSearch: true,
11 months ago
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch:true,
11 months ago
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '物料基础信息', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
11 months ago
}
}
11 months ago
},
{
label: '完工数量',
field: 'completedQuantity',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
form: {
component: 'InputNumber',
componentProps: {
11 months ago
min: 0,
11 months ago
precision: 6
},
},
11 months ago
},
{
label: '报废数量',
field: 'scrapQuantity',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
form: {
component: 'InputNumber',
componentProps: {
11 months ago
min: 0,
11 months ago
precision: 6
},
},
11 months ago
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
11 months ago
},
{
label: '备注',
field: 'remark',
sort: 'custom',
11 months ago
isTable:false,
11 months ago
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
11 months ago
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',
}
},
isTableForm: false,
isForm: false,
isTable: false
},
{
label: '创建者',
field: 'creator',
table: {
width: 130
},
isForm: false,
isTable: false
},
{
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
}
11 months ago
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable:false,
isForm:false,
11 months ago
isTableForm:false,
isDetail:false,
11 months ago
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除者ID',
field: 'deleterId',
sort: 'custom',
isSearch: false,
isTable:false,
11 months ago
isForm: false,
11 months ago
isDetail:false,
11 months ago
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isSearch: false,
isTable:false,
11 months ago
isForm: false,
11 months ago
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable:false,
11 months ago
isForm: false,
11 months ago
isDetail:false,
11 months ago
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
11 months ago
isForm: false,
11 months ago
isTable:false,
11 months ago
isDetail:false,
11 months ago
},
{
label: '操作',
field: 'action',
isForm: false,
11 months ago
isDetail:false,
11 months ago
table: {
11 months ago
width: 230,
11 months ago
fixed: 'right'
}
}
]))
10 months ago
// 完工数量校验
const validateCompletedQuantity= (rule: any, value: any, callback: any) => {
if (Number(value)>0) {
callback();
} else {
callback(new Error('完工数量不能为0'));
}
}
// 报废数量校验
const validateScrapQuantity= (rule: any, value: any, callback: any) => {
if (Number(value)>0) {
callback();
} else {
callback(new Error('完工数量不能为0'));
}
}
11 months ago
// 表单校验
export const ProcessproductionRequestMainRules = reactive({
11 months ago
itemCode: [{ required: true, message: '物料代码不能为空', trigger: 'change' }],
10 months ago
completedQuantity: [
{ required: true, message: '完工数量不能为空', trigger: 'change' },
{ validator: validateCompletedQuantity, trigger: 'change' }
],
scrapQuantity: [{ required: true, message: '报废数量不能为空', trigger: 'change' },
{ validator: validateScrapQuantity, trigger: 'change' }
],
11 months ago
})
export const ProcessproductionRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
11 months ago
11 months ago
{
label: '单据号',
field: 'number',
sort: 'custom',
11 months ago
isSearch: false,
isTable:false,
isTableForm:false,
11 months ago
table: {
width: 150
},
11 months ago
isForm:false,
11 months ago
hiddenInMain:true,
11 months ago
},
{
11 months ago
label: '生产线',
field: 'productionLine',
11 months ago
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
11 months ago
searchField: 'productionLineCode', // 查询弹窗赋值字段
11 months ago
searchTitle: '生产线物料关系信息', // 查询弹窗标题
searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'itemCode',
value:'itemCode',
message: '请选择物料代码!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'productionLine',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
11 months ago
}
},
tableForm:{
multiple:true,
disabled:true,
// isInpuFocusShow: true,
11 months ago
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
11 months ago
searchField: 'productionLineCode', // 查询弹窗赋值字段
11 months ago
searchTitle: '生产线物料关系信息', // 查询弹窗标题
searchAllSchemas: Productionlineitem.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineitemApi.getProductionlineitemPage, // 查询弹窗所需分页方法
searchCondition: [{
key:'itemCode',
value:'itemCode',
message: '请选择物料代码!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationPage: ProductionlineitemApi.getProductionLineCodelistByCodes, // 校验数去焦点输入是否正确的方法
isShowTableFormSearch: true,
verificationParams: [{
key: 'productionLineCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
11 months ago
},
11 months ago
},
{
11 months ago
label: '工序',
field: 'processCode',
11 months ago
sort: 'custom',
11 months ago
table: {
width: 150
},
tableForm: {
enterSearch:true,
11 months ago
isInpuFocusShow: true,
searchListPlaceholder: '请选择工序代码',
searchField: 'code',
searchTitle: '工序信息',
searchAllSchemas: Process.allSchemas,
searchPage: ProcessApi.getProcessPage,
searchCondition: [{
key: 'productionLineCode',
value: 'productionLine',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
11 months ago
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
11 months ago
isSearchList: true,
searchListPlaceholder: '请选择工序代码',
searchField: 'code',
searchTitle: '工序信息',
searchAllSchemas: Process.allSchemas,
searchPage: ProcessApi.getProcessPage,
searchCondition: [{
key: 'productionLineCode',
value: 'productionLine',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
11 months ago
}
}
11 months ago
},
{
label: '子物料代码',
field: 'componentItemCode',
sort: 'custom',
11 months ago
isSearch: false,
table: {
width: 150
},
tableForm:{
// enterSearch: true,
11 months ago
isInpuFocusShow: true,
searchListPlaceholder: '请选择子物料代码',
searchField: 'componentItemCode',
searchTitle: '库存余额物料清单信息',
searchAllSchemas: Balance.allSchemas,
searchPage: ProcessproductionRequestMainApi.getProcessproductionChildBomPage,
11 months ago
searchCondition: [{
key:'productItemCode',
value:'itemCode',
message: '请填写物料代码!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'componentItemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
11 months ago
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
11 months ago
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择子物料代码',
searchField: 'componentItemCode',
searchTitle: '库存余额物料清单信息',
searchAllSchemas: Balance.allSchemas,
searchPage: ProcessproductionRequestMainApi.getProcessproductionChildBomPage,
11 months ago
searchCondition: [{
key:'productItemCode',
value:'itemCode',
message: '请填写物料代码!',
isMainValue: true
},{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'componentItemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
11 months ago
}
}
// tableForm: {
// enterSearch: true,
// isInpuFocusShow: true,
// searchListPlaceholder: '请选择子物料代码版本', // 输入框占位文本
// searchField: 'componentItemCode', // 查询弹窗赋值字段
// searchTitle: '物料清单信息', // 查询弹窗标题
// searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
// searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key:'productItemCode',
// value:'itemCode',
// message: '请填写物料代码!',
// isMainValue: true
// },{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }],
// verificationParams: [{
// key: 'componentItemCode',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: true,
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择Bom版本', // 输入框占位文本
// searchField: 'componentItemCode', // 查询弹窗赋值字段
// searchTitle: '物料清单信息', // 查询弹窗标题
// searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
// searchPage: BomApi.getBomPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key:'productItemCode',
// value:'itemCode',
// message: '请填写物料代码!',
// isMainValue: true
// },{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }],
// verificationParams: [{
// key: 'componentItemCode',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// }
// },
},
{
label: '库位代码',
field: 'locationCode',
sort: 'custom',
table: {
width: 150
11 months ago
},
tableForm:{
disabled:true,
},
form: {
componentProps: {
disabled:true,
}
}
// tableForm: {
// enterSearch: true,
// multiple:true,//多选
// isInpuFocusShow: true, // 开启查询弹窗
// searchListPlaceholder: '请选择库位代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '库位基础信息', // 查询弹窗标题
// searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
// searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }],
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// enterSearch: true,
// isSearchList: true, // 开启查询弹窗
// multiple:true,//多选
// searchListPlaceholder: '请选择库位代码', // 输入框占位文本
// searchField: 'code', // 查询弹窗赋值字段
// searchTitle: '库位基础信息', // 查询弹窗标题
// searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
// searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
// searchCondition: [{
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }],
// verificationParams: [{
// key: 'code',
// action: '==',
// value: '',
// isMainValue: false,
// isSearch: true,
// isFormModel: true,
// }], // 失去焦点校验参数
// }
// }
11 months ago
},
{
label: '批次',
field: 'batch',
sort: 'custom',
11 months ago
table: {
width: 150
},
tableForm:{
disabled:true,
},
form: {
componentProps: {
disabled:true,
}
}
11 months ago
},
{
label: '子物料数量',
field: 'componentItemcodeQty',
sort: 'custom',
11 months ago
table: {
width: 150
},
11 months ago
form: {
component: 'InputNumber',
componentProps: {
min: 0,
precision: 6
}
},
tableForm: {
type: 'InputNumber',
min: 0,
precision: 6
},
11 months ago
},
{
label: '生效日期',
field: 'effectiveDate',
sort: 'custom',
formatter: dateFormatter2,
11 months ago
detail: {
dateFormat: 'YYYY-MM-DD'
},
table: {
width: 150
},
11 months ago
form: {
disabled:true,
11 months ago
component: 'DatePicker',
componentProps: {
11 months ago
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
11 months ago
}
},
11 months ago
tableForm:{
disabled:true,
11 months ago
type:'FormDate',
placeholder: '请选择生产日期',
valueFormat: 'x',
}
11 months ago
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
11 months ago
isTable:false,
11 months ago
isTableForm:false,
11 months ago
isForm:false,
11 months ago
table: {
width: 150
},
11 months ago
},
{
label: '备注',
field: 'remark',
sort: 'custom',
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
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',
}
},
11 months ago
isTableForm: false,
isForm: false
},
{
label: '创建者',
field: 'creator',
11 months ago
table: {
width: 130
11 months ago
},
isSearch: false,
isForm: false,
isTable: false,
isTableForm: false,
11 months ago
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
formatter: dateFormatter,
11 months ago
isSearch: false,
isTable:false,
11 months ago
isForm: false,
11 months ago
isTableForm: false,
11 months ago
table: {
width: 150
},
11 months ago
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除者ID',
field: 'deleterId',
sort: 'custom',
11 months ago
isSearch: false,
isTable:false,
11 months ago
isForm: false,
11 months ago
isTableForm: false,
11 months ago
table: {
width: 150
},
11 months ago
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
11 months ago
isSearch: false,
isTable:false,
11 months ago
isForm: false,
11 months ago
isTableForm: false,
11 months ago
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
11 months ago
isSearch: false,
isTable:false,
11 months ago
isForm: false,
11 months ago
isTableForm: false,
11 months ago
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '地点ID',
field: 'siteId',
sort: 'custom',
11 months ago
isSearch: false,
isTable:false,
11 months ago
isForm: false,
11 months ago
isTableForm: false,
},
{
label: '主表ID',
field: 'masterId',
sort: 'custom',
hiddenInMain:true,
isTable:false,
isTableForm:false,
11 months ago
isForm: false,
11 months ago
form: {
component: 'InputNumber',
value: 0
},
11 months ago
},
{
label: '操作',
field: 'action',
isForm: false,
11 months ago
isTable:false,
isTableForm:false,
11 months ago
hiddenInMain:true,
11 months ago
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const ProcessproductionRequestDetailRules = reactive({
11 months ago
productionLine: [
{ required: true, message: '请选择生产线代码', trigger: 'change' }
],
// processCode: [
// { required: true, message: '请选择工序代码', trigger: 'change' }
// ],
11 months ago
locationCode: [
{ required: true, message: '请选择库位代码', trigger: 'change' }
],
componentItemCode:[
{ required: true, message: '请选择子物料代码', trigger: 'change' }
],
componentItemcodeQty:[
{ required: true, message: '请输入子物料数量', trigger: 'change' }
],
batch:[
{ required: true, message: '请输入批次', trigger: 'change' }
],
effectiveDate:[
{ required: true, message: '请输入生效日期', trigger: 'change' }
],
})