update update 生产订单、生产计划代码生成

master
yinq 1 week ago
parent 2e5fa1ab2a
commit 5e0a68a934

@ -0,0 +1,77 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { OrderInfoVO, OrderInfoForm, OrderInfoQuery } from '@/api/mes/orderInfo/types';
/**
*
* @param query
* @returns {*}
*/
export const listOrderInfo = (query?: OrderInfoQuery): AxiosPromise<OrderInfoVO[]> => {
return request({
url: '/mes/orderInfo/list',
method: 'get',
params: query
});
};
/**
*
* @param productOrderId
*/
export const getOrderInfo = (productOrderId: string | number): AxiosPromise<OrderInfoVO> => {
return request({
url: '/mes/orderInfo/' + productOrderId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addOrderInfo = (data: OrderInfoForm) => {
return request({
url: '/mes/orderInfo',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateOrderInfo = (data: OrderInfoForm) => {
return request({
url: '/mes/orderInfo',
method: 'put',
data: data
});
};
/**
*
* @param productOrderId
*/
export const delOrderInfo = (productOrderId: string | number | Array<string | number>) => {
return request({
url: '/mes/orderInfo/' + productOrderId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getOrderInfoList(query) {
return request({
url: '/mes/orderInfo/getOrderInfoList',
method: 'get',
params: query
});
};

@ -0,0 +1,431 @@
export interface OrderInfoVO {
/**
*
*/
productOrderId: string | number;
/**
*
*/
orderCode: string;
/**
* ID
*/
saleOrderId: string | number;
/**
*
*/
projectNo: string;
/**
* 1 2)
*/
orderType: string;
/**
* ID
*/
materialId: string | number;
/**
* BOM_ID;bom
*/
materialBomId: string | number;
/**
* (1线 2线 3)
*/
dispatchType: string;
/**
* ID;线线线线
*/
dispatchId: string | number;
/**
* ;
*/
saleAmount: number;
/**
*
*/
planDeliveryDate: string;
/**
*
*/
planAmount: number;
/**
* ;线线
*/
dispatchAmount: number;
/**
*
*/
completeAmount: number;
/**
*
*/
releaseTime: string;
/**
*
*/
planBeginTime: string;
/**
*
*/
planEndTime: string;
/**
*
*/
realBeginTime: string;
/**
*
*/
realEndTime: string;
/**
* 0 1 2 3 4 8 9
*/
orderStatus: string;
/**
* 1 0
*/
stockLockFlag: string;
/**
* ID
*/
preOrderId: string | number;
/**
*
*/
preOrderCode: string;
/**
* 0 1 2
*/
finishFlag: string;
/**
* 1 0
*/
releaseFlag: string;
/**
*
*/
orderVersion: string;
/**
* ID
*/
factoryId: string | number;
/**
*
*/
remark: string;
}
export interface OrderInfoForm extends BaseEntity {
/**
*
*/
productOrderId?: string | number;
/**
*
*/
orderCode?: string;
/**
* ID
*/
saleOrderId?: string | number;
/**
*
*/
projectNo?: string;
/**
* 1 2)
*/
orderType?: string;
/**
* ID
*/
materialId?: string | number;
/**
* BOM_ID;bom
*/
materialBomId?: string | number;
/**
* (1线 2线 3)
*/
dispatchType?: string;
/**
* ID;线线线线
*/
dispatchId?: string | number;
/**
* ;
*/
saleAmount?: number;
/**
*
*/
planDeliveryDate?: string;
/**
*
*/
planAmount?: number;
/**
* ;线线
*/
dispatchAmount?: number;
/**
*
*/
completeAmount?: number;
/**
*
*/
releaseTime?: string;
/**
*
*/
planBeginTime?: string;
/**
*
*/
planEndTime?: string;
/**
*
*/
realBeginTime?: string;
/**
*
*/
realEndTime?: string;
/**
* 0 1 2 3 4 8 9
*/
orderStatus?: string;
/**
* 1 0
*/
stockLockFlag?: string;
/**
* ID
*/
preOrderId?: string | number;
/**
*
*/
preOrderCode?: string;
/**
* 0 1 2
*/
finishFlag?: string;
/**
* 1 0
*/
releaseFlag?: string;
/**
*
*/
orderVersion?: string;
/**
* ID
*/
factoryId?: string | number;
/**
*
*/
remark?: string;
}
export interface OrderInfoQuery extends PageQuery {
/**
*
*/
productOrderId?: string | number;
/**
*
*/
orderCode?: string;
/**
* ID
*/
saleOrderId?: string | number;
/**
*
*/
projectNo?: string;
/**
* 1 2)
*/
orderType?: string;
/**
* ID
*/
materialId?: string | number;
/**
* BOM_ID;bom
*/
materialBomId?: string | number;
/**
* (1线 2线 3)
*/
dispatchType?: string;
/**
* ID;线线线线
*/
dispatchId?: string | number;
/**
* ;
*/
saleAmount?: number;
/**
*
*/
planDeliveryDate?: string;
/**
*
*/
planAmount?: number;
/**
* ;线线
*/
dispatchAmount?: number;
/**
*
*/
completeAmount?: number;
/**
*
*/
releaseTime?: string;
/**
*
*/
planBeginTime?: string;
/**
*
*/
planEndTime?: string;
/**
*
*/
realBeginTime?: string;
/**
*
*/
realEndTime?: string;
/**
* 0 1 2 3 4 8 9
*/
orderStatus?: string;
/**
* 1 0
*/
stockLockFlag?: string;
/**
* ID
*/
preOrderId?: string | number;
/**
*
*/
preOrderCode?: string;
/**
* 0 1 2
*/
finishFlag?: string;
/**
* 1 0
*/
releaseFlag?: string;
/**
*
*/
orderVersion?: string;
/**
* ID
*/
factoryId?: string | number;
/**
*
*/
params?: any;
}

@ -0,0 +1,77 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PlanInfoVO, PlanInfoForm, PlanInfoQuery } from '@/api/mes/planInfo/types';
/**
*
* @param query
* @returns {*}
*/
export const listPlanInfo = (query?: PlanInfoQuery): AxiosPromise<PlanInfoVO[]> => {
return request({
url: '/mes/planInfo/list',
method: 'get',
params: query
});
};
/**
*
* @param planId
*/
export const getPlanInfo = (planId: string | number): AxiosPromise<PlanInfoVO> => {
return request({
url: '/mes/planInfo/' + planId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addPlanInfo = (data: PlanInfoForm) => {
return request({
url: '/mes/planInfo',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updatePlanInfo = (data: PlanInfoForm) => {
return request({
url: '/mes/planInfo',
method: 'put',
data: data
});
};
/**
*
* @param planId
*/
export const delPlanInfo = (planId: string | number | Array<string | number>) => {
return request({
url: '/mes/planInfo/' + planId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getPlanInfoList (query) {
return request({
url: '/mes/planInfo/getPlanInfoList',
method: 'get',
params: query
});
};

@ -0,0 +1,476 @@
export interface PlanInfoVO {
/**
*
*/
planId: string | number;
/**
* ID
*/
productOrderId: string | number;
/**
* ID
*/
saleOrderId: string | number;
/**
*
*/
saleorderCode: string;
/**
*
*/
planCode: string;
/**
*
*/
dispatchCode: string;
/**
* ID;ID
*/
materialId: string | number;
/**
* BOM_ID
*/
materialBomId: string | number;
/**
* ID
*/
processId: string | number;
/**
* ;线
*/
processOrder: number;
/**
* ID
*/
lastProcessId: string | number;
/**
* (1 0)
*/
finalProcessFlag: string;
/**
* (1 2 3)
*/
releaseType: string;
/**
* ID;
*/
releaseId: string | number;
/**
* ()
*/
productionTime: number;
/**
*
*/
planAmount: number;
/**
*
*/
dispatchAmount: number;
/**
*
*/
completeAmount: number;
/**
*
*/
planBeginTime: string;
/**
*
*/
planEndTime: string;
/**
*
*/
realBeginTime: string;
/**
*
*/
realEndTime: string;
/**
* ;,
*/
attachId: string | number;
/**
* 0 1 2 3
*/
planStatus: string;
/**
* 0 1ERP
*/
importFlag: string;
/**
* 0 1 2
*/
finishFlag: string;
/**
*
*/
priority: number;
/**
* ID
*/
shiftId: string | number;
/**
* ID
*/
classTeamId: string | number;
/**
* 1 2
*/
modelCode: string;
/**
*
*/
remark: string;
}
export interface PlanInfoForm extends BaseEntity {
/**
*
*/
planId?: string | number;
/**
* ID
*/
productOrderId?: string | number;
/**
* ID
*/
saleOrderId?: string | number;
/**
*
*/
saleorderCode?: string;
/**
*
*/
planCode?: string;
/**
*
*/
dispatchCode?: string;
/**
* ID;ID
*/
materialId?: string | number;
/**
* BOM_ID
*/
materialBomId?: string | number;
/**
* ID
*/
processId?: string | number;
/**
* ;线
*/
processOrder?: number;
/**
* ID
*/
lastProcessId?: string | number;
/**
* (1 0)
*/
finalProcessFlag?: string;
/**
* (1 2 3)
*/
releaseType?: string;
/**
* ID;
*/
releaseId?: string | number;
/**
* ()
*/
productionTime?: number;
/**
*
*/
planAmount?: number;
/**
*
*/
dispatchAmount?: number;
/**
*
*/
completeAmount?: number;
/**
*
*/
planBeginTime?: string;
/**
*
*/
planEndTime?: string;
/**
*
*/
realBeginTime?: string;
/**
*
*/
realEndTime?: string;
/**
* ;,
*/
attachId?: string | number;
/**
* 0 1 2 3
*/
planStatus?: string;
/**
* 0 1ERP
*/
importFlag?: string;
/**
* 0 1 2
*/
finishFlag?: string;
/**
*
*/
priority?: number;
/**
* ID
*/
shiftId?: string | number;
/**
* ID
*/
classTeamId?: string | number;
/**
* 1 2
*/
modelCode?: string;
/**
*
*/
remark?: string;
}
export interface PlanInfoQuery extends PageQuery {
/**
*
*/
planId?: string | number;
/**
* ID
*/
productOrderId?: string | number;
/**
* ID
*/
saleOrderId?: string | number;
/**
*
*/
saleorderCode?: string;
/**
*
*/
planCode?: string;
/**
*
*/
dispatchCode?: string;
/**
* ID;ID
*/
materialId?: string | number;
/**
* BOM_ID
*/
materialBomId?: string | number;
/**
* ID
*/
processId?: string | number;
/**
* ;线
*/
processOrder?: number;
/**
* ID
*/
lastProcessId?: string | number;
/**
* (1 0)
*/
finalProcessFlag?: string;
/**
* (1 2 3)
*/
releaseType?: string;
/**
* ID;
*/
releaseId?: string | number;
/**
* ()
*/
productionTime?: number;
/**
*
*/
planAmount?: number;
/**
*
*/
dispatchAmount?: number;
/**
*
*/
completeAmount?: number;
/**
*
*/
planBeginTime?: string;
/**
*
*/
planEndTime?: string;
/**
*
*/
realBeginTime?: string;
/**
*
*/
realEndTime?: string;
/**
* ;,
*/
attachId?: string | number;
/**
* 0 1 2 3
*/
planStatus?: string;
/**
* 0 1ERP
*/
importFlag?: string;
/**
* 0 1 2
*/
finishFlag?: string;
/**
*
*/
priority?: number;
/**
* ID
*/
shiftId?: string | number;
/**
* ID
*/
classTeamId?: string | number;
/**
* 1 2
*/
modelCode?: string;
/**
*
*/
params?: any;
}

@ -0,0 +1,522 @@
<template>
<div class='p-2'>
<transition :enter-active-class='proxy?.animate.searchAnimate.enter'
:leave-active-class='proxy?.animate.searchAnimate.leave'>
<div v-show='showSearch' class='mb-[10px]'>
<el-card shadow='hover'>
<el-form ref='queryFormRef' :model='queryParams' :inline='true'>
<el-form-item label='主键标识' prop='productOrderId'>
<el-input v-model='queryParams.productOrderId' placeholder='请输入主键标识' clearable
@keyup.enter='handleQuery' />
</el-form-item>
<el-form-item label='订单编号' prop='orderCode'>
<el-input v-model='queryParams.orderCode' placeholder='请输入订单编号' clearable @keyup.enter='handleQuery' />
</el-form-item>
<!-- <el-form-item label='订单类型' prop='orderType'>-->
<!-- <el-select v-model='queryParams.orderType' placeholder='请选择订单类型' clearable>-->
<!-- <el-option v-for='dict in mes_order_type' :key='dict.value' :label='dict.label' :value='dict.value' />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label='计划开始时间' prop='planBeginTime'>-->
<!-- <el-date-picker clearable-->
<!-- v-model='queryParams.planBeginTime'-->
<!-- type='date'-->
<!-- value-format='YYYY-MM-DD'-->
<!-- placeholder='请选择计划开始时间'-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label='订单状态' prop='orderStatus'>
<el-select v-model='queryParams.orderStatus' placeholder='请选择订单状态' clearable>
<el-option v-for='dict in mes_order_status' :key='dict.value' :label='dict.label' :value='dict.value' />
</el-select>
</el-form-item>
<!-- <el-form-item label='库存锁定标识' prop='stockLockFlag'>-->
<!-- <el-select v-model='queryParams.stockLockFlag' placeholder='请选择库存锁定标识' clearable>-->
<!-- <el-option v-for='dict in mes_stock_lock_flag' :key='dict.value' :label='dict.label'-->
<!-- :value='dict.value' />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label='完成标识' prop='finishFlag'>-->
<!-- <el-select v-model='queryParams.finishFlag' placeholder='请选择完成标识' clearable>-->
<!-- <el-option v-for='dict in mes_finish_flag' :key='dict.value' :label='dict.label' :value='dict.value' />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label='是否已下达工单' prop='releaseFlag'>-->
<!-- <el-select v-model='queryParams.releaseFlag' placeholder='请选择是否已下达工单' clearable>-->
<!-- <el-option v-for='dict in mes_release_flag' :key='dict.value' :label='dict.label' :value='dict.value' />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type='primary' icon='Search' @click='handleQuery'>搜索</el-button>
<el-button icon='Refresh' @click='resetQuery'>重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow='never'>
<template #header>
<el-row :gutter='10' class='mb8'>
<el-col :span='1.5'>
<el-button type='primary' plain icon='Plus' @click='handleAdd' v-hasPermi="['mes:orderInfo:add']">
</el-button>
</el-col>
<el-col :span='1.5'>
<el-button type='success' plain icon='Edit' :disabled='single' @click='handleUpdate()'
v-hasPermi="['mes:orderInfo:edit']">修改
</el-button>
</el-col>
<el-col :span='1.5'>
<el-button type='danger' plain icon='Delete' :disabled='multiple' @click='handleDelete()'
v-hasPermi="['mes:orderInfo:remove']">删除
</el-button>
</el-col>
<el-col :span='1.5'>
<el-button type='warning' plain icon='Download' @click='handleExport' v-hasPermi="['mes:orderInfo:export']">
导出
</el-button>
</el-col>
<right-toolbar v-model:showSearch='showSearch' :columns='columns' :search='true'
@queryTable='getList'></right-toolbar>
</el-row>
</template>
<el-table v-loading='loading' :data='orderInfoList' @selection-change='handleSelectionChange'>
<el-table-column type='selection' width='55' align='center' />
<el-table-column label='主键标识' align='center' prop='productOrderId' v-if='columns[0].visible' />
<el-table-column label='订单编号' align='center' prop='orderCode' v-if='columns[2].visible' />
<el-table-column label='销售订单ID' align='center' prop='saleOrderId' v-if='columns[3].visible' />
<el-table-column label='项目编号' align='center' prop='projectNo' v-if='columns[4].visible' />
<el-table-column label='订单类型' align='center' prop='orderType' v-if='columns[5].visible'>
<template #default='scope'>
<dict-tag :options='mes_order_type' :value='scope.row.orderType' />
</template>
</el-table-column>
<el-table-column label='成品名称' align='center' prop='materialId' v-if='columns[6].visible' />
<el-table-column label='物料BOM' align='center' prop='materialBomId'
v-if='columns[7].visible' />
<el-table-column label='派工类型' align='center' prop='dispatchType' v-if='columns[8].visible'>
<template #default='scope'>
<dict-tag :options='mes_dispatch_type' :value='scope.row.dispatchType' />
</template>
</el-table-column>
<el-table-column label='派工ID' align='center' prop='dispatchId' v-if='columns[9].visible' />
<el-table-column label='销售数量' align='center' prop='saleAmount'
v-if='columns[10].visible' />
<el-table-column label='计划交货日期' align='center' prop='planDeliveryDate' width='180' v-if='columns[11].visible'>
<template #default='scope'>
<span>{{ parseTime(scope.row.planDeliveryDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label='计划数量' align='center' prop='planAmount' v-if='columns[12].visible' />
<el-table-column label='已派工数量' align='center' prop='dispatchAmount'
v-if='columns[13].visible' />
<el-table-column label='完成数量' align='center' prop='completeAmount' v-if='columns[14].visible' />
<el-table-column label='发布时间' align='center' prop='releaseTime' width='180' v-if='columns[15].visible'>
<template #default='scope'>
<span>{{ parseTime(scope.row.releaseTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label='计划开始时间' align='center' prop='planBeginTime' width='180' v-if='columns[16].visible'>
<template #default='scope'>
<span>{{ parseTime(scope.row.planBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label='计划结束时间' align='center' prop='planEndTime' width='180' v-if='columns[17].visible'>
<template #default='scope'>
<span>{{ parseTime(scope.row.planEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label='开始时间' align='center' prop='realBeginTime' width='180' v-if='columns[18].visible'>
<template #default='scope'>
<span>{{ parseTime(scope.row.realBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label='完成时间' align='center' prop='realEndTime' width='180' v-if='columns[19].visible'>
<template #default='scope'>
<span>{{ parseTime(scope.row.realEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label='订单状态' align='center' prop='orderStatus' v-if='columns[20].visible'>
<template #default='scope'>
<dict-tag :options='mes_order_status' :value='scope.row.orderStatus' />
</template>
</el-table-column>
<el-table-column label='库存锁定标识' align='center' prop='stockLockFlag' v-if='columns[21].visible'>
<template #default='scope'>
<dict-tag :options='mes_stock_lock_flag' :value='scope.row.stockLockFlag' />
</template>
</el-table-column>
<el-table-column label='前置生产订单ID' align='center' prop='preOrderId' v-if='columns[22].visible' />
<el-table-column label='前置订单编号' align='center' prop='preOrderCode' v-if='columns[23].visible' />
<el-table-column label='完成标识' align='center' prop='finishFlag' v-if='columns[24].visible'>
<template #default='scope'>
<dict-tag :options='mes_finish_flag' :value='scope.row.finishFlag' />
</template>
</el-table-column>
<el-table-column label='是否已下达工单' align='center' prop='releaseFlag' v-if='columns[25].visible'>
<template #default='scope'>
<dict-tag :options='mes_release_flag' :value='scope.row.releaseFlag' />
</template>
</el-table-column>
<el-table-column label='订单版本' align='center' prop='orderVersion' v-if='columns[26].visible' />
<el-table-column label='工厂ID' align='center' prop='factoryId' v-if='columns[27].visible' />
<el-table-column label='备注' align='center' prop='remark' v-if='columns[28].visible' />
<el-table-column label='操作' align='center' class-name='small-padding fixed-width'>
<template #default='scope'>
<el-tooltip content='修改' placement='top'>
<el-button link type='primary' icon='Edit' @click='handleUpdate(scope.row)'
v-hasPermi="['mes:orderInfo:edit']"></el-button>
</el-tooltip>
<el-tooltip content='删除' placement='top'>
<el-button link type='primary' icon='Delete' @click='handleDelete(scope.row)'
v-hasPermi="['mes:orderInfo:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show='total > 0' :total='total' v-model:page='queryParams.pageNum'
v-model:limit='queryParams.pageSize' @pagination='getList' />
</el-card>
<!-- 添加或修改生产订单信息对话框 -->
<el-dialog :title='dialog.title' v-model='dialog.visible' width='500px' append-to-body>
<el-form ref='orderInfoFormRef' :model='form' :rules='rules' label-width='100px'>
<el-form-item label='订单编号' prop='orderCode'>
<el-input v-model='form.orderCode' placeholder='请输入订单编号' />
</el-form-item>
<el-form-item label='订单版本' prop='orderVersion'>
<el-input v-model='form.orderVersion' placeholder='请输入订单版本' />
</el-form-item>
<!-- <el-form-item label='销售订单ID' prop='saleOrderId'>-->
<!-- <el-input v-model='form.saleOrderId' placeholder='请输入销售订单ID' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='项目编号' prop='projectNo'>-->
<!-- <el-input v-model='form.projectNo' placeholder='请输入项目编号' />-->
<!-- </el-form-item>-->
<el-form-item label='订单类型' prop='orderType'>
<el-radio-group v-model='form.orderType'>
<el-radio
v-for='dict in mes_order_type'
:key='dict.value'
:value='dict.value'
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label='成品名称' prop='materialId'>
<el-input v-model='form.materialId' placeholder='请输入成品名称' />
</el-form-item>
<el-form-item label='物料BOM' prop='materialBomId'>
<el-input v-model='form.materialBomId' placeholder='请输入物料BOM' />
</el-form-item>
<el-form-item label='派工类型' prop='dispatchType'>
<el-radio-group v-model='form.dispatchType'>
<el-radio
v-for='dict in mes_dispatch_type'
:key='dict.value'
:value='dict.value'
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label='派工ID' prop='dispatchId'>
<el-input v-model='form.dispatchId' placeholder='请输入派工ID' />
</el-form-item>
<!-- <el-form-item label='销售数量' prop='saleAmount'>-->
<!-- <el-input v-model='form.saleAmount' placeholder='请输入销售数量' />-->
<!-- </el-form-item>-->
<el-form-item label='计划交货日期' prop='planDeliveryDate'>
<el-date-picker clearable
v-model='form.planDeliveryDate'
type='datetime'
value-format='YYYY-MM-DD HH:mm:ss'
placeholder='请选择计划交货日期'>
</el-date-picker>
</el-form-item>
<el-form-item label='计划数量' prop='planAmount' >
<el-input-number v-model='form.planAmount' placeholder='请输入计划数量' style="width: 200px;"/>
</el-form-item>
<!-- <el-form-item label='已派工数量' prop='dispatchAmount'>-->
<!-- <el-input v-model='form.dispatchAmount' placeholder='请输入已派工数量' />-->
<!-- </el-form-item>-->
<el-form-item label='计划开始时间' prop='planBeginTime'>
<el-date-picker clearable
v-model='form.planBeginTime'
type='datetime'
value-format='YYYY-MM-DD HH:mm:ss'
placeholder='请选择计划开始时间'>
</el-date-picker>
</el-form-item>
<el-form-item label='计划结束时间' prop='planEndTime'>
<el-date-picker clearable
v-model='form.planEndTime'
type='datetime'
value-format='YYYY-MM-DD HH:mm:ss'
placeholder='请选择计划结束时间'>
</el-date-picker>
</el-form-item>
<!-- <el-form-item label='库存锁定标识' prop='stockLockFlag'>-->
<!-- <el-radio-group v-model='form.stockLockFlag'>-->
<!-- <el-radio-->
<!-- v-for='dict in mes_stock_lock_flag'-->
<!-- :key='dict.value'-->
<!-- :value='dict.value'-->
<!-- >{{ dict.label }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item label='备注' prop='remark'>
<el-input v-model='form.remark' placeholder='请输入备注' />
</el-form-item>
</el-form>
<template #footer>
<div class='dialog-footer'>
<el-button :loading='buttonLoading' type='primary' @click='submitForm'> </el-button>
<el-button @click='cancel'> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name='OrderInfo' lang='ts'>
import { listOrderInfo, getOrderInfo, delOrderInfo, addOrderInfo, updateOrderInfo } from '@/api/mes/orderInfo';
import { OrderInfoVO, OrderInfoQuery, OrderInfoForm } from '@/api/mes/orderInfo/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const {
mes_order_status,
mes_stock_lock_flag,
mes_dispatch_type,
mes_finish_flag,
mes_order_type,
mes_release_flag
} = toRefs<any>(proxy?.useDict('mes_order_status', 'mes_stock_lock_flag', 'mes_dispatch_type', 'mes_finish_flag', 'mes_order_type', 'mes_release_flag'));
const orderInfoList = ref<OrderInfoVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const orderInfoFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `租户编号`, visible: false },
{ key: 2, label: `订单编号`, visible: true },
{ key: 3, label: `销售订单ID`, visible: false },
{ key: 4, label: `项目编号`, visible: true },
{ key: 5, label: `订单类型`, visible: true },
{ key: 6, label: `成品名称`, visible: true },
{ key: 7, label: `物料BOM`, visible: true },
{ key: 8, label: `派工类型`, visible: true },
{ key: 9, label: `派工ID`, visible: true },
{ key: 10, label: `销售数量`, visible: true },
{ key: 11, label: `计划交货日期`, visible: true },
{ key: 12, label: `计划数量`, visible: true },
{ key: 13, label: `已派工数量`, visible: false },
{ key: 14, label: `完成数量`, visible: true },
{ key: 15, label: `发布时间`, visible: true },
{ key: 16, label: `计划开始时间`, visible: true },
{ key: 17, label: `计划结束时间`, visible: true },
{ key: 18, label: `开始时间`, visible: true },
{ key: 19, label: `完成时间`, visible: true },
{ key: 20, label: `订单状态`, visible: true },
{ key: 21, label: `库存锁定标识`, visible: false },
{ key: 22, label: `前置生产订单ID`, visible: false },
{ key: 23, label: `前置订单编号`, visible: false },
{ key: 24, label: `完成标识`, visible: true },
{ key: 25, label: `是否已下达工单`, visible: true },
{ key: 26, label: `订单版本`, visible: true },
{ key: 27, label: `工厂ID`, visible: true },
{ key: 28, label: `备注`, visible: false },
{ key: 29, label: `创建部门`, visible: false },
{ key: 30, label: `创建人`, visible: false },
{ key: 31, label: `创建时间`, visible: false },
{ key: 32, label: `更新人`, visible: false },
{ key: 33, label: `更新时间`, visible: false }
]);
const initFormData: OrderInfoForm = {
productOrderId: undefined,
orderCode: undefined,
saleOrderId: undefined,
projectNo: undefined,
orderType: '1',
materialId: undefined,
materialBomId: undefined,
dispatchType: '2',
dispatchId: undefined,
saleAmount: undefined,
planDeliveryDate: undefined,
planAmount: 1,
dispatchAmount: undefined,
completeAmount: undefined,
releaseTime: undefined,
planBeginTime: undefined,
planEndTime: undefined,
realBeginTime: undefined,
realEndTime: undefined,
orderStatus: undefined,
stockLockFlag: undefined,
preOrderId: undefined,
preOrderCode: undefined,
finishFlag: undefined,
releaseFlag: undefined,
orderVersion: undefined,
factoryId: undefined,
remark: undefined
};
const data = reactive<PageData<OrderInfoForm, OrderInfoQuery>>({
form: { ...initFormData },
queryParams: {
pageNum: 1,
pageSize: 10,
productOrderId: undefined,
orderCode: undefined,
saleOrderId: undefined,
projectNo: undefined,
orderType: undefined,
materialId: undefined,
materialBomId: undefined,
dispatchType: undefined,
dispatchId: undefined,
saleAmount: undefined,
planDeliveryDate: undefined,
planAmount: undefined,
dispatchAmount: undefined,
completeAmount: undefined,
releaseTime: undefined,
planBeginTime: undefined,
planEndTime: undefined,
realBeginTime: undefined,
realEndTime: undefined,
orderStatus: undefined,
stockLockFlag: undefined,
preOrderId: undefined,
preOrderCode: undefined,
finishFlag: undefined,
releaseFlag: undefined,
orderVersion: undefined,
factoryId: undefined,
params: {}
},
rules: {
orderCode: [
{ required: true, message: '订单编号不能为空', trigger: 'blur' }
],
planAmount: [
{ required: true, message: '计划数量不能为空', trigger: 'blur' }
],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询生产订单信息列表 */
const getList = async () => {
loading.value = true;
const res = await listOrderInfo(queryParams.value);
orderInfoList.value = res.rows;
total.value = res.total;
loading.value = false;
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
};
/** 表单重置 */
const reset = () => {
form.value = { ...initFormData };
orderInfoFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 多选框选中数据 */
const handleSelectionChange = (selection: OrderInfoVO[]) => {
ids.value = selection.map(item => item.productOrderId);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = '添加生产订单信息';
};
/** 修改按钮操作 */
const handleUpdate = async (row?: OrderInfoVO) => {
reset();
const _productOrderId = row?.productOrderId || ids.value[0];
const res = await getOrderInfo(_productOrderId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改生产订单信息';
};
/** 提交按钮 */
const submitForm = () => {
orderInfoFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.productOrderId) {
await updateOrderInfo(form.value).finally(() => buttonLoading.value = false);
} else {
await addOrderInfo(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
await getList();
}
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: OrderInfoVO) => {
const _productOrderIds = row?.productOrderId || ids.value;
await proxy?.$modal.confirm('是否确认删除生产订单信息编号为"' + _productOrderIds + '"的数据项?').finally(() => loading.value = false);
await delOrderInfo(_productOrderIds);
proxy?.$modal.msgSuccess('删除成功');
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('mes/orderInfo/export', {
...queryParams.value
}, `orderInfo_${new Date().getTime()}.xlsx`);
};
onMounted(() => {
getList();
});
</script>

@ -0,0 +1,530 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<!-- <el-form-item label="生产订单ID" prop="productOrderId">-->
<!-- <el-input v-model="queryParams.productOrderId" placeholder="请输入生产订单ID" clearable @keyup.enter="handleQuery" />-->
<!-- </el-form-item>-->
<el-form-item label="计划编号" prop="planCode">
<el-input v-model="queryParams.planCode" placeholder="请输入计划编号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<!-- <el-form-item label="物料ID" prop="materialId">-->
<!-- <el-input v-model="queryParams.materialId" placeholder="请输入物料ID" clearable @keyup.enter="handleQuery" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="物料BOM" prop="materialBomId">-->
<!-- <el-input v-model="queryParams.materialBomId" placeholder="请输入物料BOM" clearable @keyup.enter="handleQuery" />-->
<!-- </el-form-item>-->
<el-form-item label="工序ID" prop="processId">
<el-input v-model="queryParams.processId" placeholder="请输入工序ID" clearable @keyup.enter="handleQuery" />
</el-form-item>
<!-- <el-form-item label="下达ID" prop="releaseId">-->
<!-- <el-input v-model="queryParams.releaseId" placeholder="请输入下达ID" clearable @keyup.enter="handleQuery" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="计划开始时间" prop="planBeginTime">-->
<!-- <el-date-picker clearable-->
<!-- v-model="queryParams.planBeginTime"-->
<!-- type="date"-->
<!-- value-format="YYYY-MM-DD"-->
<!-- placeholder="请选择计划开始时间"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="计划状态" prop="planStatus">
<el-select v-model="queryParams.planStatus" placeholder="请选择计划状态" clearable >
<el-option v-for="dict in mes_plan_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<!-- <el-form-item label="班次ID" prop="shiftId">-->
<!-- <el-input v-model="queryParams.shiftId" placeholder="请输入班次ID" clearable @keyup.enter="handleQuery" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="班组ID" prop="classTeamId">-->
<!-- <el-input v-model="queryParams.classTeamId" placeholder="请输入班组ID" clearable @keyup.enter="handleQuery" />-->
<!-- </el-form-item>-->
<el-form-item label="模号" prop="modelCode">
<el-select v-model="queryParams.modelCode" placeholder="请选择模号" clearable >
<el-option v-for="dict in mes_model_code" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['mes:planInfo:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['mes:planInfo:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['mes:planInfo:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['mes:planInfo:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="planInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="planId" v-if="columns[0].visible"/>
<el-table-column label="生产订单ID" align="center" prop="productOrderId" v-if="columns[2].visible" width="100"/>
<el-table-column label="销售订单ID" align="center" prop="saleOrderId" v-if="columns[3].visible"/>
<el-table-column label="销售订单编号" align="center" prop="saleorderCode" v-if="columns[4].visible"/>
<el-table-column label="计划编号" align="center" prop="planCode" v-if="columns[5].visible" width="100"/>
<el-table-column label="派工单号" align="center" prop="dispatchCode" v-if="columns[6].visible"/>
<el-table-column label="物料ID" align="center" prop="materialId" v-if="columns[7].visible"/>
<el-table-column label="物料BOM" align="center" prop="materialBomId" v-if="columns[8].visible" width="100"/>
<el-table-column label="工序ID" align="center" prop="processId" v-if="columns[9].visible"/>
<el-table-column label="顺序" align="center" prop="processOrder" v-if="columns[10].visible"/>
<el-table-column label="上一工序ID" align="center" prop="lastProcessId" v-if="columns[11].visible" width="100"/>
<el-table-column label="最后工序标识" align="center" prop="finalProcessFlag" v-if="columns[12].visible" width="110">
<template #default="scope">
<dict-tag :options="active_flag" :value="scope.row.finalProcessFlag"/>
</template>
</el-table-column>
<el-table-column label="下达类型" align="center" prop="releaseType" v-if="columns[13].visible">
<template #default="scope">
<dict-tag :options="mes_release_type" :value="scope.row.releaseType"/>
</template>
</el-table-column>
<el-table-column label="下达ID" align="center" prop="releaseId" v-if="columns[14].visible"/>
<el-table-column label="单位生产时间(秒)" align="center" prop="productionTime" v-if="columns[15].visible"/>
<el-table-column label="计划数量" align="center" prop="planAmount" v-if="columns[16].visible"/>
<el-table-column label="派工数量" align="center" prop="dispatchAmount" v-if="columns[17].visible"/>
<el-table-column label="完成数量" align="center" prop="completeAmount" v-if="columns[18].visible"/>
<el-table-column label="计划开始时间" align="center" prop="planBeginTime" width="180" v-if="columns[19].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.planBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="计划结束时间" align="center" prop="planEndTime" width="180" v-if="columns[20].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.planEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="实际开始时间" align="center" prop="realBeginTime" width="180" v-if="columns[21].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.realBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="实际完成时间" align="center" prop="realEndTime" width="180" v-if="columns[22].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.realEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="附件信息" align="center" prop="attachId" v-if="columns[23].visible"/>
<el-table-column label="计划状态" align="center" prop="planStatus" v-if="columns[24].visible">
<template #default="scope">
<dict-tag :options="mes_plan_status" :value="scope.row.planStatus"/>
</template>
</el-table-column>
<el-table-column label="导入类型" align="center" prop="importFlag" v-if="columns[25].visible">
<template #default="scope">
<dict-tag :options="mes_import_flag" :value="scope.row.importFlag"/>
</template>
</el-table-column>
<el-table-column label="完成标识" align="center" prop="finishFlag" v-if="columns[26].visible">
<template #default="scope">
<dict-tag :options="mes_finish_flag" :value="scope.row.finishFlag ? scope.row.finishFlag.split(',') : []"/>
</template>
</el-table-column>
<el-table-column label="优先级" align="center" prop="priority" v-if="columns[27].visible"/>
<el-table-column label="班次ID" align="center" prop="shiftId" v-if="columns[28].visible"/>
<el-table-column label="班组ID" align="center" prop="classTeamId" v-if="columns[29].visible"/>
<el-table-column label="模号" align="center" prop="modelCode" v-if="columns[30].visible">
<template #default="scope">
<dict-tag :options="mes_model_code" :value="scope.row.modelCode"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" v-if="columns[31].visible"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['mes:planInfo:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['mes:planInfo:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改生产工单信息对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="planInfoFormRef" :model="form" :rules="rules" label-width="100px">
<el-form-item label="生产订单ID" prop="productOrderId">
<el-input v-model="form.productOrderId" placeholder="请输入生产订单ID" />
</el-form-item>
<!-- <el-form-item label="销售订单ID" prop="saleOrderId">-->
<!-- <el-input v-model="form.saleOrderId" placeholder="请输入销售订单ID" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="销售订单编号" prop="saleorderCode">-->
<!-- <el-input v-model="form.saleorderCode" placeholder="请输入销售订单编号" />-->
<!-- </el-form-item>-->
<el-form-item label="计划编号" prop="planCode">
<el-input v-model="form.planCode" placeholder="请输入计划编号" />
</el-form-item>
<el-form-item label="派工单号" prop="dispatchCode">
<el-input v-model="form.dispatchCode" placeholder="请输入派工单号" />
</el-form-item>
<el-form-item label="物料ID" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入物料ID" />
</el-form-item>
<el-form-item label="物料BOM" prop="materialBomId">
<el-input v-model="form.materialBomId" placeholder="请输入物料BOM" />
</el-form-item>
<el-form-item label="工序ID" prop="processId">
<el-input v-model="form.processId" placeholder="请输入工序ID" />
</el-form-item>
<el-form-item label="顺序" prop="processOrder">
<el-input-number v-model="form.processOrder" placeholder="请输入顺序" style="width: 200px;"/>
</el-form-item>
<!-- <el-form-item label="上一工序ID" prop="lastProcessId">-->
<!-- <el-input v-model="form.lastProcessId" placeholder="请输入上一工序ID" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="最后工序标识" prop="finalProcessFlag">-->
<!-- <el-radio-group v-model="form.finalProcessFlag">-->
<!-- <el-radio-->
<!-- v-for="dict in active_flag"-->
<!-- :key="dict.value"-->
<!-- :value="dict.value"-->
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item label="下达类型" prop="releaseType">
<el-radio-group v-model="form.releaseType">
<el-radio
v-for="dict in mes_release_type"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="下达ID" prop="releaseId">
<el-input v-model="form.releaseId" placeholder="请输入下达ID" />
</el-form-item>
<!-- <el-form-item label="单位生产时间(秒)" prop="productionTime">-->
<!-- <el-input v-model="form.productionTime" placeholder="请输入单位生产时间(秒)" />-->
<!-- </el-form-item>-->
<el-form-item label="计划数量" prop="planAmount">
<el-input-number v-model="form.planAmount" placeholder="请输入计划数量" style="width: 200px;" />
</el-form-item>
<el-form-item label="派工数量" prop="dispatchAmount">
<el-input-number v-model="form.dispatchAmount" placeholder="请输入派工数量" style="width: 200px;" />
</el-form-item>
<el-form-item label="计划开始时间" prop="planBeginTime">
<el-date-picker clearable
v-model="form.planBeginTime"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择计划开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="计划结束时间" prop="planEndTime">
<el-date-picker clearable
v-model="form.planEndTime"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择计划结束时间">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="附件信息" prop="attachId">-->
<!-- <el-input v-model="form.attachId" placeholder="请输入附件信息" />-->
<!-- </el-form-item>-->
<el-form-item label="优先级" prop="priority">
<el-input-number v-model="form.priority" placeholder="请输入优先级" style="width: 200px;" />
</el-form-item>
<el-form-item label="班次ID" prop="shiftId">
<el-input v-model="form.shiftId" placeholder="请输入班次ID" />
</el-form-item>
<el-form-item label="班组ID" prop="classTeamId">
<el-input v-model="form.classTeamId" placeholder="请输入班组ID" />
</el-form-item>
<el-form-item label="模号" prop="modelCode">
<el-radio-group v-model="form.modelCode">
<el-radio
v-for="dict in mes_model_code"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="PlanInfo" lang="ts">
import { listPlanInfo, getPlanInfo, delPlanInfo, addPlanInfo, updatePlanInfo } from '@/api/mes/planInfo';
import { PlanInfoVO, PlanInfoQuery, PlanInfoForm } from '@/api/mes/planInfo/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { mes_import_flag, active_flag, mes_plan_status, mes_release_type, mes_finish_flag, mes_model_code } = toRefs<any>(proxy?.useDict('mes_import_flag', 'active_flag', 'mes_plan_status', 'mes_release_type', 'mes_finish_flag', 'mes_model_code'));
const planInfoList = ref<PlanInfoVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const planInfoFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `租户编号`, visible: false },
{ key: 2, label: `生产订单ID`, visible: true },
{ key: 3, label: `销售订单ID`, visible: false },
{ key: 4, label: `销售订单编号`, visible: false },
{ key: 5, label: `计划编号`, visible: true },
{ key: 6, label: `派工单号`, visible: true },
{ key: 7, label: `物料ID`, visible: true },
{ key: 8, label: `物料BOM`, visible: true },
{ key: 9, label: `工序ID`, visible: true },
{ key: 10, label: `顺序`, visible: true },
{ key: 11, label: `上一工序ID`, visible: true },
{ key: 12, label: `最后工序标识`, visible: true },
{ key: 13, label: `下达类型`, visible: true },
{ key: 14, label: `下达ID`, visible: true },
{ key: 15, label: `单位生产时间(秒)`, visible: false },
{ key: 16, label: `计划数量`, visible: true },
{ key: 17, label: `派工数量`, visible: true },
{ key: 18, label: `完成数量`, visible: true },
{ key: 19, label: `计划开始时间`, visible: true },
{ key: 20, label: `计划结束时间`, visible: true },
{ key: 21, label: `实际开始时间`, visible: true },
{ key: 22, label: `实际完成时间`, visible: true },
{ key: 23, label: `附件信息`, visible: true },
{ key: 24, label: `计划状态`, visible: true },
{ key: 25, label: `导入类型`, visible: true },
{ key: 26, label: `完成标识`, visible: true },
{ key: 27, label: `优先级`, visible: true },
{ key: 28, label: `班次ID`, visible: true },
{ key: 29, label: `班组ID`, visible: true },
{ key: 30, label: `模号`, visible: true },
{ key: 31, label: `备注`, visible: false },
{ key: 32, label: `创建部门`, visible: false },
{ key: 33, label: `创建人`, visible: false },
{ key: 34, label: `创建时间`, visible: false },
{ key: 35, label: `更新人`, visible: false },
{ key: 36, label: `更新时间`, visible: false },
]);
const initFormData: PlanInfoForm = {
planId: undefined,
productOrderId: undefined,
saleOrderId: undefined,
saleorderCode: undefined,
planCode: undefined,
dispatchCode: undefined,
materialId: undefined,
materialBomId: undefined,
processId: undefined,
processOrder: undefined,
lastProcessId: undefined,
finalProcessFlag: undefined,
releaseType: undefined,
releaseId: undefined,
productionTime: undefined,
planAmount: undefined,
dispatchAmount: undefined,
completeAmount: undefined,
planBeginTime: undefined,
planEndTime: undefined,
realBeginTime: undefined,
realEndTime: undefined,
attachId: undefined,
planStatus: undefined,
importFlag: undefined,
finishFlag: [],
priority: undefined,
shiftId: undefined,
classTeamId: undefined,
modelCode: undefined,
remark: undefined,
}
const data = reactive<PageData<PlanInfoForm, PlanInfoQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
planId: undefined,
productOrderId: undefined,
saleOrderId: undefined,
saleorderCode: undefined,
planCode: undefined,
dispatchCode: undefined,
materialId: undefined,
materialBomId: undefined,
processId: undefined,
processOrder: undefined,
lastProcessId: undefined,
finalProcessFlag: undefined,
releaseType: undefined,
releaseId: undefined,
productionTime: undefined,
planAmount: undefined,
dispatchAmount: undefined,
completeAmount: undefined,
planBeginTime: undefined,
planEndTime: undefined,
realBeginTime: undefined,
realEndTime: undefined,
attachId: undefined,
planStatus: undefined,
importFlag: undefined,
finishFlag: undefined,
priority: undefined,
shiftId: undefined,
classTeamId: undefined,
modelCode: undefined,
params: {
}
},
rules: {
planCode: [
{ required: true, message: "计划编号不能为空", trigger: "blur" }
],
materialId: [
{ required: true, message: "物料ID不能为空", trigger: "blur" }
],
materialBomId: [
{ required: true, message: "物料BOM不能为空", trigger: "blur" }
],
planAmount: [
{ required: true, message: "计划数量不能为空", trigger: "blur" }
],
dispatchAmount: [
{ required: true, message: "派工数量不能为空", trigger: "blur" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询生产工单信息列表 */
const getList = async () => {
loading.value = true;
const res = await listPlanInfo(queryParams.value);
planInfoList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
planInfoFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: PlanInfoVO[]) => {
ids.value = selection.map(item => item.planId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加生产工单信息";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: PlanInfoVO) => {
reset();
const _planId = row?.planId || ids.value[0]
const res = await getPlanInfo(_planId);
Object.assign(form.value, res.data);
form.value.finishFlag = form.value.finishFlag.split(",");
dialog.visible = true;
dialog.title = "修改生产工单信息";
}
/** 提交按钮 */
const submitForm = () => {
planInfoFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
form.value.finishFlag = form.value.finishFlag.join(",");
if (form.value.planId) {
await updatePlanInfo(form.value).finally(() => buttonLoading.value = false);
} else {
await addPlanInfo(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: PlanInfoVO) => {
const _planIds = row?.planId || ids.value;
await proxy?.$modal.confirm('是否确认删除生产工单信息编号为"' + _planIds + '"的数据项?').finally(() => loading.value = false);
await delPlanInfo(_planIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('mes/planInfo/export', {
...queryParams.value
}, `planInfo_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getList();
});
</script>
Loading…
Cancel
Save