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.

894 lines
21 KiB

import type {CrudSchema} from '@/hooks/web/useCrudSchemas'
import {dateFormatter, dateFormatter2} from '@/utils/formatTime'
12 months ago
import * as ProductionMainApi from '@/api/wms/productionMain'
import {
ProductionMain
} from '@/views/wms/productionManage/productionplan/productionMain/productionMain.data'
12 months ago
import * as WorkshopApi from '@/api/wms/workshop'
import {Workshop} from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
12 months ago
import * as ProductionlineApi from '@/api/wms/productionline'
import {
Productionline
} from '@/views/wms/basicDataManage/factoryModeling/productionline/productionline.data'
12 months ago
import * as ShiftApi from '@/api/wms/shift'
import {Shift} from '@/views/wms/basicDataManage/orderManage/shift/shift.data'
12 months ago
import * as TeamApi from '@/api/wms/team'
import {Team} from '@/views/wms/basicDataManage/orderManage/team/team.data'
12 months ago
import * as ProductionlineitemApi from '@/api/wms/productionlineitem'
// import { Productionlineitem } from '@/views/wms/basicDataManage/itemManage/bom/bom.data'
// import * as BomApi from '@/api/wms/bom'
import {Bom} from '@/views/wms/basicDataManage/itemManage/bom/bom.data'
12 months ago
import * as WorkStationApi from '@/api/wms/workstation'
import {Workstation} from '@/views/wms/basicDataManage/factoryModeling/workstation/workstation.data'
12 months ago
import * as getPlansettingApi from '@/api/wms/plansetting/index'
12 months ago
const {t} = useI18n() // 国际化
12 months ago
// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值
const queryParams = {
pageSize: 10,
pageNo: 1,
code: 'PreparetoissuePlan'
12 months ago
}
const data = await getPlansettingApi.getPlansettingPage(queryParams)
const plansettingData = data?.list[0] || {}
12 months ago
/**
* @returns {Array}
*/
export const PreparetoissueMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180,
fixed: 'left'
},
isForm: false,
isSearch: true,
},
{
11 months ago
label: '状态',
field: 'status',
12 months ago
sort: 'custom',
table: {
11 months ago
width: 150
12 months ago
},
11 months ago
dictType: DICT_TYPE.PLAN_STATUS,
dictClass: 'string',
isSearch: true,
isForm: false,
12 months ago
form: {
11 months ago
value: '1',
12 months ago
componentProps: {
11 months ago
disabled: true
12 months ago
}
}
},
{
label: '车间',
field: 'workshop',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
12 months ago
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择车间代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '车间信息', // 查询弹窗标题
searchAllSchemas: Workshop.allSchemas, // 查询弹窗所需类
searchPage: WorkshopApi.getWorkshopPage, // 查询弹窗所需分页方法
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
12 months ago
}
}
},
{
label: '生产线',
field: 'prodLine',
sort: 'custom',
table: {
width: 150
},
form: {
labelMessage: '该生产线会影响明细中的物料代码,工位',
componentProps: {
enterSearch: true,
12 months ago
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产线', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '生产线信息', // 查询弹窗标题
searchAllSchemas: Productionline.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineApi.getProductionlinePage, // 查询弹窗所需分页方法
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
12 months ago
}
}
},
{
label: '班组',
field: 'team',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
12 months ago
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选班组', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '班组信息', // 查询弹窗标题
searchAllSchemas: Team.allSchemas, // 查询弹窗所需类
searchPage: TeamApi.getTeamPage, // 查询弹窗所需分页方法
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
12 months ago
}
}
},
{
11 months ago
label: '班次',
field: 'shift',
12 months ago
sort: 'custom',
table: {
width: 150
},
form: {
11 months ago
// labelMessage: '信息提示说明!!!',
12 months ago
componentProps: {
enterSearch: true,
11 months ago
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选班次', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '班次信息', // 查询弹窗标题
searchAllSchemas: Shift.allSchemas, // 查询弹窗所需类
searchPage: ShiftApi.getShiftPage, // 查询弹窗所需分页方法
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
12 months ago
}
}
},
{
label: '计划日期',
field: 'planDate',
formatter: dateFormatter2,
detail: {
dateFormat: 'YYYY-MM-DD'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'date',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
},
{
label: '开始时间',
field: 'beginTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
12 months ago
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: {
style: {width: '100%'},
12 months ago
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
11 months ago
{
label: '生产计划单号',
field: 'productionPlanNumber',
sort: 'custom',
table: {
width: 180
},
isTable: false,
form: {
labelMessage: '同时影响车间 生产线 班组 班次',
componentProps: {
enterSearch:true,
11 months ago
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择生产计划', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '生产计划信息', // 查询弹窗标题
searchAllSchemas: ProductionMain.allSchemas, // 查询弹窗所需类
searchPage: ProductionMainApi.getProductionMainPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'status',
value: '6',
isMainValue: false
},
{
key: 'available',
value: 'TRUE',
11 months ago
isMainValue: false
},
{//备料计划>新增 生产计划单号选择:page 和 senior 查询条件不一致 senior 生产计划信息 searchCondition 添加查询条件 planType = predict
key: 'planType',
value: 'predict',
11 months ago
isMainValue: false
}],
verificationParams: [{
key: 'number',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
11 months ago
}
}
},
12 months ago
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
isTable: false
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
11 months ago
isTable: false,
12 months ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '业务类型',
field: 'businessType',
sort: 'custom',
table: {
width: 150
},
11 months ago
isTable: false,
12 months ago
form: {
value: 'Issue',
componentProps: {
disabled: true
}
},
isForm: false,
},
{
label: '自动提交',
field: 'autoCommit',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
11 months ago
isTable: false,
isForm: false,
12 months ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: plansettingData.autoCommit,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '自动通过',
field: 'autoAgree',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
11 months ago
isTable: false,
isForm: false,
12 months ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: plansettingData.autoAgree,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '自动执行',
field: 'autoExecute',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
11 months ago
isTable: false,
isForm: false,
12 months ago
sort: 'custom',
table: {
width: 150
},
form: {
component: 'Switch',
value: plansettingData.autoExecute,
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
disabled: true
}
}
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
11 months ago
isTable: false,
12 months ago
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
12 months ago
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false,
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
11 months ago
isTable: false,
12 months ago
isForm: false,
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
11 months ago
isTable: false,
12 months ago
sort: 'custom',
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
12 months ago
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isForm: false,
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
11 months ago
isTable: false,
12 months ago
isForm: false,
},
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 220,
fixed: 'right'
},
}
]))
//表单校验
export const PreparetoissueMainRules = reactive({
workshop: [
{required: true, message: '请选择车间', trigger: 'change'}
12 months ago
],
prodLine: [
{required: true, message: '请选择生产线', trigger: 'change'}
12 months ago
],
// shift: [
// {required: true, message: '请选择班次', trigger: 'change'}
// ],
// team: [
// {required: true, message: '请选择班组', trigger: 'change'}
// ],
12 months ago
planDate: [
{required: true, message: '请输入计划日期', trigger: 'change'}
12 months ago
],
available: [
{required: true, message: '请选择是否可用', trigger: 'change'}
12 months ago
],
status: [
{required: true, message: '请选择状态', trigger: 'change'}
12 months ago
],
businessType: [
{required: true, message: '请输入业务类型', trigger: 'blur'}
12 months ago
],
remark: [
{max: 50, message: '不得超过50个字符', trigger: 'blur'}
12 months ago
],
})
/**
* @returns {Array}
*/
export const PreparetoissueDetail = useCrudSchemas(reactive<CrudSchema[]>([
11 months ago
{
label: '工位',
field: 'workStation',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: false, // 开启查询弹窗
11 months ago
searchListPlaceholder: '请选择工位', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '工位信息', // 查询弹窗标题
searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'productionLineCode',
value: 'prodLine',
11 months ago
message: '请填写生产线代码!',
isMainValue: true
}, {
key: 'workshopCode',
value: 'workshop',
11 months ago
message: '请填写车间代码!',
isMainValue: true
}, {
key: 'available',
value: 'TRUE',
11 months ago
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
11 months ago
}
},
tableForm: {
isShowTableFormSearch:true,
8 months ago
multiple: true,
disabled: true,
isInpuFocusShow: false,
11 months ago
searchListPlaceholder: '请选择工位', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '工位信息', // 查询弹窗标题
searchAllSchemas: Workstation.allSchemas, // 查询弹窗所需类
searchPage: WorkStationApi.getWorkstationPage, // 查询弹窗所需分页方法
verificationPage: WorkStationApi.getWorkstationByCodes,// 失去焦点校验输入框的数据内容存在
searchCondition: [{
key: 'productionLineCode',
value: 'prodLine',
message: '请填写生产线代码!',
isMainValue: true
}, {
key: 'workshopCode',
value: 'workshop',
message: '请填写车间代码!',
isMainValue: true
}, {
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
11 months ago
},
},
12 months ago
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
12 months ago
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '物料清单信息', // 查询弹窗标题
searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineitemApi.getProductionlineitemPageByItemtype, // 查询弹窗所需分页方法
searchCondition: [{
key: 'productionLineCode',
value: 'prodLine',
12 months ago
message: '请填写生产线代码!',
isMainValue: true
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
12 months ago
}
},
tableForm: {
enterSearch: true,
12 months ago
isInpuFocusShow: true,
searchListPlaceholder: '请选择物料代码', // 输入框占位文本
searchField: 'itemCode', // 查询弹窗赋值字段
searchTitle: '物料清单信息', // 查询弹窗标题
searchAllSchemas: Bom.allSchemas, // 查询弹窗所需类
searchPage: ProductionlineitemApi.getProductionlineitemPageByItemtype, // 查询弹窗所需分页方法
searchCondition: [{
key: 'productionLineCode',
value: 'prodLine',
12 months ago
message: '请填写生产线代码!',
isMainValue: true
}],
verificationParams: [{
key: 'componentItemCode',
action: '==',
value: '',
isMainValue: false,
isSearch: true,
isFormModel: true,
}], // 失去焦点校验参数
12 months ago
},
},
{
label: '计划数量',
field: 'planQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
},
tableForm: {
12 months ago
type: 'InputNumber',
min: 1,
precision: 6
}
},
{
label: '计量单位',
field: 'uom',
dictType: DICT_TYPE.UOM,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
10 months ago
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled: true
}
},
12 months ago
table: {
width: 150
},
tableForm: {
10 months ago
type: 'Select',
disabled: true
12 months ago
},
},
{
label: '目标库位',
field: 'toLocationCode',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
disabled: true
}
},
tableForm: {
12 months ago
disabled: true
},
},
12 months ago
{
label: '截止时间',
field: 'dueTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
11 months ago
hiddenInMain: true,
12 months ago
tableForm: {
type: 'FormDateTime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
12 months ago
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '单据号',
field: 'number',
sort: 'custom',
table: {
width: 180
},
11 months ago
hiddenInMain: true,
12 months ago
form: {
componentProps: {
disabled: true
}
},
isTableForm: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
11 months ago
hiddenInMain: true,
12 months ago
},
{
label: '创建时间',
field: 'createTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
11 months ago
hiddenInMain: true,
12 months ago
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
12 months ago
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
isTableForm: false,
isForm: false,
},
{
label: '创建者',
field: 'creator',
sort: 'custom',
table: {
width: 150
},
11 months ago
hiddenInMain: true,
12 months ago
isTableForm: false,
isForm: false,
},
{
label: '最后更新者',
field: 'updater',
sort: 'custom',
table: {
width: 150
},
11 months ago
hiddenInMain: true,
12 months ago
isTableForm: false,
isForm: false,
},
{
label: '最后更新时间',
field: 'updateTime',
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
sort: 'custom',
table: {
width: 180
},
11 months ago
hiddenInMain: true,
12 months ago
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
12 months ago
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: false,
isTable: false,
12 months ago
sort: 'custom',
table: {
width: 150
},
11 months ago
hiddenInMain: true,
tableForm: {
12 months ago
type: 'Select',
default: 'TRUE'
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
}
},
{
label: '操作',
hiddenInMain: true,
12 months ago
field: 'action',
isDetail: false,
isForm: false,
12 months ago
table: {
width: 150,
fixed: 'right'
},
isTableForm: false,
12 months ago
}
]))
//表单校验
export const PreparetoissueDetailRules = reactive({
available: [
{required: true, message: '请选择是否可用', trigger: 'blur'}
12 months ago
],
uom: [
{required: true, message: '请选择计量单位', trigger: 'change'}
12 months ago
],
planQty: [
{required: true, message: '请输入计划数量', trigger: 'blur'}
12 months ago
],
number: [
{required: true, message: '请输入单据号', trigger: 'blur'}
12 months ago
],
itemCode: [
{required: true, message: '请选择物料代码', trigger: 'change'}
12 months ago
],
workStation: [
{required: true, message: '请选择工位', trigger: 'change'}
12 months ago
],
remark: [
{max: 50, message: '不得超过50个字符', trigger: 'blur'}
12 months ago
],
dueTime: [
{required: true, message: '请选择截止时间', trigger: 'change'}
12 months ago
]
10 months ago
})