maxw@mesnac.com 7 days ago
commit e4f7c91769

@ -61,3 +61,16 @@ export const delBaseClassTeamInfo = (classTeamId: string | number | Array<string
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getBaseClassTeamInfoList (query) {
return request({
url: '/mes/baseClassTeamInfo/getBaseClassTeamInfoList',
method: 'get',
params: query
});
};

@ -70,7 +70,7 @@ export const delBaseRoute = (routeId: string | number | Array<string | number>)
*/
export function getBaseRouteList(query) {
return request({
url: '/mes/baseRoute/getBaseRouteList',
url: '/mes/baseRoute/getProdBaseRouteList',
method: 'get',
params: query
});

@ -0,0 +1,77 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MasterDataVO, MasterDataForm, MasterDataQuery } from '@/api/system/masterData/types';
/**
*
* @param query
* @returns {*}
*/
export const listMasterData = (query?: MasterDataQuery): AxiosPromise<MasterDataVO[]> => {
return request({
url: '/system/masterData/list',
method: 'get',
params: query
});
};
/**
*
* @param masterDataId
*/
export const getMasterData = (masterDataId: string | number): AxiosPromise<MasterDataVO> => {
return request({
url: '/system/masterData/' + masterDataId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addMasterData = (data: MasterDataForm) => {
return request({
url: '/system/masterData',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateMasterData = (data: MasterDataForm) => {
return request({
url: '/system/masterData',
method: 'put',
data: data
});
};
/**
*
* @param masterDataId
*/
export const delMasterData = (masterDataId: string | number | Array<string | number>) => {
return request({
url: '/system/masterData/' + masterDataId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getSysMasterDataList (query) {
return request({
url: '/system/masterData/getSysMasterDataList',
method: 'get',
params: query
});
};

@ -0,0 +1,281 @@
export interface MasterDataVO {
/**
*
*/
masterDataId: string | number;
/**
* 1MES 2WMS 3DMS 4QMS 5EMS
*/
moduleType: string;
/**
* ;1 0
*/
parentFlag: string;
/**
* ID
*/
menuId: string | number;
/**
*
*/
queryParam: string;
/**
* ;
*/
masterDataTitle: string;
/**
* 1
*/
fieldName1: string;
/**
* 1;1 0
*/
displayFlag1: string;
/**
* 2
*/
fieldName2: string;
/**
* 2;1 0
*/
displayFlag2: string;
/**
* 3
*/
fieldName3: string;
/**
* 3;1 0
*/
displayFlag3: string;
/**
* 4
*/
fieldName4: string;
/**
* 4;1 0
*/
displayFlag4: string;
/**
* 5
*/
fieldName5: string;
/**
* 5;1 0
*/
displayFlag5: string;
/**
* (1 0)
*/
activeFlag: string;
/**
*
*/
remark: string;
}
export interface MasterDataForm extends BaseEntity {
/**
*
*/
masterDataId?: string | number;
/**
* 1MES 2WMS 3DMS 4QMS 5EMS
*/
moduleType?: string;
/**
* ;1 0
*/
parentFlag?: string;
/**
* ID
*/
menuId?: string | number;
/**
*
*/
queryParam?: string;
/**
* ;
*/
masterDataTitle?: string;
/**
* 1
*/
fieldName1?: string;
/**
* 1;1 0
*/
displayFlag1?: string;
/**
* 2
*/
fieldName2?: string;
/**
* 2;1 0
*/
displayFlag2?: string;
/**
* 3
*/
fieldName3?: string;
/**
* 3;1 0
*/
displayFlag3?: string;
/**
* 4
*/
fieldName4?: string;
/**
* 4;1 0
*/
displayFlag4?: string;
/**
* 5
*/
fieldName5?: string;
/**
* 5;1 0
*/
displayFlag5?: string;
/**
* (1 0)
*/
activeFlag?: string;
/**
*
*/
remark?: string;
}
export interface MasterDataQuery extends PageQuery {
/**
*
*/
masterDataId?: string | number;
/**
* 1MES 2WMS 3DMS 4QMS 5EMS
*/
moduleType?: string;
/**
* ;1 0
*/
parentFlag?: string;
/**
* ID
*/
menuId?: string | number;
/**
*
*/
queryParam?: string;
/**
* ;
*/
masterDataTitle?: string;
/**
* 1
*/
fieldName1?: string;
/**
* 1;1 0
*/
displayFlag1?: string;
/**
* 2
*/
fieldName2?: string;
/**
* 2;1 0
*/
displayFlag2?: string;
/**
* 3
*/
fieldName3?: string;
/**
* 3;1 0
*/
displayFlag3?: string;
/**
* 4
*/
fieldName4?: string;
/**
* 4;1 0
*/
displayFlag4?: string;
/**
* 5
*/
fieldName5?: string;
/**
* 5;1 0
*/
displayFlag5?: string;
/**
* (1 0)
*/
activeFlag?: string;
/**
*
*/
params?: any;
}

@ -0,0 +1,77 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MasterDataDetailVO, MasterDataDetailForm, MasterDataDetailQuery } from '@/api/system/masterDataDetail/types';
/**
*
* @param query
* @returns {*}
*/
export const listMasterDataDetail = (query?: MasterDataDetailQuery): AxiosPromise<MasterDataDetailVO[]> => {
return request({
url: '/system/masterDataDetail/list',
method: 'get',
params: query
});
};
/**
*
* @param masterDataDetailId
*/
export const getMasterDataDetail = (masterDataDetailId: string | number): AxiosPromise<MasterDataDetailVO> => {
return request({
url: '/system/masterDataDetail/' + masterDataDetailId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addMasterDataDetail = (data: MasterDataDetailForm) => {
return request({
url: '/system/masterDataDetail',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateMasterDataDetail = (data: MasterDataDetailForm) => {
return request({
url: '/system/masterDataDetail',
method: 'put',
data: data
});
};
/**
*
* @param masterDataDetailId
*/
export const delMasterDataDetail = (masterDataDetailId: string | number | Array<string | number>) => {
return request({
url: '/system/masterDataDetail/' + masterDataDetailId,
method: 'delete'
});
};
/**
*
* @param query
* @returns {*}
*/
export function getSysMasterDataDetailList(query) {
return request({
url: '/system/masterDataDetail/getSysMasterDataDetailList',
method: 'get',
params: query
});
};

@ -0,0 +1,221 @@
export interface MasterDataDetailVO {
/**
*
*/
masterDataDetailId: string | number;
/**
* ID
*/
masterDataId: string | number;
/**
*
*/
parentId: string | number;
/**
*
*/
ancestors: string;
/**
*
*/
dataDetailCode: string;
/**
*
*/
dataDetailName: string;
/**
* 1
*/
fieldData1: string;
/**
* 2
*/
fieldData2: string;
/**
* 3
*/
fieldData3: string;
/**
* 4
*/
fieldData4: string;
/**
* 5
*/
fieldData5: string;
/**
*
*/
displaySort: number;
/**
*
*/
remark: string;
/**
* (1 0)
*/
activeFlag: string;
}
export interface MasterDataDetailForm extends BaseEntity {
/**
*
*/
masterDataDetailId?: string | number;
/**
* ID
*/
masterDataId?: string | number;
/**
*
*/
parentId?: string | number;
/**
*
*/
ancestors?: string;
/**
*
*/
dataDetailCode?: string;
/**
*
*/
dataDetailName?: string;
/**
* 1
*/
fieldData1?: string;
/**
* 2
*/
fieldData2?: string;
/**
* 3
*/
fieldData3?: string;
/**
* 4
*/
fieldData4?: string;
/**
* 5
*/
fieldData5?: string;
/**
*
*/
displaySort?: number;
/**
*
*/
remark?: string;
/**
* (1 0)
*/
activeFlag?: string;
}
export interface MasterDataDetailQuery extends PageQuery {
/**
*
*/
masterDataDetailId?: string | number;
/**
* ID
*/
masterDataId?: string | number;
/**
*
*/
parentId?: string | number;
/**
*
*/
ancestors?: string;
/**
*
*/
dataDetailCode?: string;
/**
*
*/
dataDetailName?: string;
/**
* 1
*/
fieldData1?: string;
/**
* 2
*/
fieldData2?: string;
/**
* 3
*/
fieldData3?: string;
/**
* 4
*/
fieldData4?: string;
/**
* 5
*/
fieldData5?: string;
/**
*
*/
displaySort?: number;
/**
* (1 0)
*/
activeFlag?: string;
/**
*
*/
params?: any;
}

@ -218,7 +218,22 @@ export const dynamicRoutes: RouteRecordRaw[] = [
meta: { title: '请假申请', activeMenu: '/workflow/leave', noCache: true }
}
]
},
{
path: '/mes/product-plan',
component: Layout,
hidden: true,
permissions: ['mes:orderInfo:edit'],
children: [
{
path: 'index/:productOrderId(\\d+)',
component: () => import('@/views/mes/orderInfo/editProductPlan.vue'),
name: 'productPlanEdit',
meta: { title: '生产派工', activeMenu: '/mes/productplan', noCache: true }
}
]
},
];
/**

File diff suppressed because it is too large Load Diff

@ -5,10 +5,6 @@
<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>
@ -41,8 +37,8 @@
<!-- <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-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>-->
@ -93,25 +89,22 @@
<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='materialName' v-if='columns[6].visible' width='160' />
<el-table-column label='物料BOM' align='center' prop='materialBomId' v-if='columns[7].visible' width='100' />
<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='dispatchTypeName' 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='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'>
@ -128,12 +121,12 @@
<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'>
<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'>
<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>
@ -155,7 +148,7 @@
<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'>
<el-table-column label='下达工单' align='center' prop='releaseFlag' v-if='columns[25].visible' width='80'>
<template #default='scope'>
<dict-tag :options='mes_release_flag' :value='scope.row.releaseFlag' />
</template>
@ -163,16 +156,21 @@
<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'>
<el-table-column label='操作' align='center' class-name="small-padding fixed-width" fixed="right">
<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>
<el-button
size="mini"
type="text"
icon="el-icon-user-solid"
@click="handleDispatch(scope.row)"
v-if="1===1"
v-hasPermi="['mes:orderInfo:edit']"
>生产派工
</el-button>
<!-- <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>
@ -212,7 +210,7 @@
<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-group v-model='form.dispatchType' :disabled="true">
<el-radio
v-for='dict in mes_dispatch_type'
:key='dict.value'
@ -221,8 +219,15 @@
</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 :label='dispatchTypeName' prop='dispatchId'>
<el-select v-model="form.dispatchId" placeholder="请选择">
<el-option
v-for="item in dispatchTypeList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label='销售数量' prop='saleAmount'>-->
<!-- <el-input v-model='form.saleAmount' placeholder='请输入销售数量' />-->
@ -284,6 +289,9 @@
<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';
import { getProcessInfoList } from '@/api/mes/baseProcessInfo';
import { getBaseRouteList } from '@/api/mes/baseRoute';
import { getProdLineList } from '@/api/mes/baseProdLineInfo';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const {
@ -306,6 +314,9 @@ const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const orderInfoFormRef = ref<ElFormInstance>();
/** 下拉框查询派工类型信息列表 */
const dispatchTypeList = ref([])
const dispatchTypeName = ref("");
const dialog = reactive<DialogOption>({
visible: false,
@ -324,24 +335,24 @@ const columns = ref<FieldOption[]>([
{ key: 7, label: `物料BOM`, visible: true },
{ key: 8, label: `派工类型`, visible: true },
{ key: 9, label: `派工ID`, visible: true },
{ key: 10, label: `销售数量`, visible: true },
{ key: 10, label: `销售数量`, visible: false },
{ 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: 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: 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: 25, label: `下达工单`, visible: true },
{ key: 26, label: `订单版本`, visible: false },
{ key: 27, label: `工厂ID`, visible: false },
{ key: 28, label: `备注`, visible: false },
{ key: 29, label: `创建部门`, visible: false },
{ key: 30, label: `创建人`, visible: false },
@ -358,7 +369,7 @@ const initFormData: OrderInfoForm = {
orderType: '1',
materialId: undefined,
materialBomId: undefined,
dispatchType: '2',
dispatchType: undefined,
dispatchId: undefined,
saleAmount: undefined,
planDeliveryDate: undefined,
@ -518,5 +529,42 @@ const handleExport = () => {
onMounted(() => {
getList();
dispatchTypeFunction(); //(1线 2线 3)
});
const dispatchTypeFunction = async () => {
const dispatchTypeRes = await proxy?.getConfigKey('sys.orderInfo.dispatchType');
initFormData.dispatchType = dispatchTypeRes.data;
if (dispatchTypeRes.data === '1'){
dispatchTypeName.value = "产线";
const res = await getProdLineList(null);
dispatchTypeList.value = res.data.map(item => ({
id: item.prodLineId,
name: item.prodLineName
}));
} else if (dispatchTypeRes.data === '2'){
dispatchTypeName.value = "工艺路线";
const res = await getBaseRouteList(null);
dispatchTypeList.value = res.data.map(item => ({
id: item.routeId,
name: item.routeName
}));
} else if (dispatchTypeRes.data === '3'){
dispatchTypeName.value = "工序";
const res = await getProcessInfoList(null);
dispatchTypeList.value = res.data.map(item => ({
id: item.processId,
name: item.processName
}));
}
};
const handleDispatch = (row) => {
const productOrderId = row.productOrderId || this.ids[0];
const orderCode = row.orderCode;
const params = {queryParams: queryParams};
// this.$tab.closeOpenPage(router.currentRoute);
proxy?.$tab.openPage( '/mes/product-plan/index/' + productOrderId,"任务[" + orderCode + "]生产派工", params);
};
</script>

@ -16,9 +16,9 @@
<!-- <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="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>-->
@ -35,11 +35,11 @@
<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 label="班次" prop="shiftId">-->
<!-- <el-input v-model="queryParams.shiftId" placeholder="请输入班次" 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 label="班组" prop="classTeamId">-->
<!-- <el-input v-model="queryParams.classTeamId" placeholder="请输入班组" clearable @keyup.enter="handleQuery" />-->
<!-- </el-form-item>-->
<el-form-item label="模号" prop="modelCode">
<el-select v-model="queryParams.modelCode" placeholder="请选择模号" clearable >
@ -82,9 +82,9 @@
<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="物料名称" align="center" prop="materialName" v-if="columns[7].visible" width="160"/>
<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="processName" 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">
@ -139,8 +139,8 @@
</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="shiftName" v-if="columns[28].visible"/>
<el-table-column label="班组" align="center" prop="teamName" 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"/>
@ -179,18 +179,18 @@
<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 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="工序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 label="工序名称" prop="processId">
<el-input v-model="form.processId" placeholder="请输入工序名称" />
</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>-->
@ -246,11 +246,24 @@
<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 label="班次" prop="shiftId">
<el-radio-group v-model="form.shiftId">
<el-radio
v-for="dict in shiftList"
:key="dict.shiftId"
:value="dict.shiftId"
>{{dict.shiftName}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="班组ID" prop="classTeamId">
<el-input v-model="form.classTeamId" placeholder="请输入班组ID" />
<el-form-item label="班组" prop="classTeamId">
<el-select v-model="form.classTeamId" placeholder="请选择班组">
<el-option
v-for="item in classTeamList"
:key="item.classTeamId"
:label="item.teamName"
:value="item.classTeamId"
/>
</el-select>
</el-form-item>
<el-form-item label="模号" prop="modelCode">
<el-radio-group v-model="form.modelCode">
@ -278,6 +291,8 @@
<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';
import { getBaseShiftInfoList } from '@/api/mes/baseShiftInfo';
import { getBaseClassTeamInfoList } from '@/api/mes/baseClassTeamInfo';
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'));
@ -299,6 +314,22 @@ const dialog = reactive<DialogOption>({
title: ''
});
const shiftList = ref([]);
const classTeamList = ref([]);
/*获取班次下拉框*/
const getShiftSelect = async () => {
let res = await getBaseShiftInfoList(null);
shiftList.value = res.data;
};
/*获取班组下拉框*/
const getClassTeamSelect = async () => {
let res = await getBaseClassTeamInfoList(null);
classTeamList.value = res.data;
};
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `主键标识`, visible: false },
@ -308,9 +339,9 @@ const columns = ref<FieldOption[]>([
{ key: 4, label: `销售订单编号`, visible: false },
{ key: 5, label: `计划编号`, visible: true },
{ key: 6, label: `派工单号`, visible: true },
{ key: 7, label: `物料ID`, visible: true },
{ key: 7, label: `物料名称`, visible: true },
{ key: 8, label: `物料BOM`, visible: true },
{ key: 9, label: `工序ID`, visible: true },
{ key: 9, label: `工序名称`, visible: true },
{ key: 10, label: `顺序`, visible: true },
{ key: 11, label: `上一工序ID`, visible: true },
{ key: 12, label: `最后工序标识`, visible: true },
@ -326,11 +357,11 @@ const columns = ref<FieldOption[]>([
{ key: 22, label: `实际完成时间`, visible: true },
{ key: 23, label: `附件信息`, visible: true },
{ key: 24, label: `计划状态`, visible: true },
{ key: 25, label: `导入类型`, visible: true },
{ key: 25, label: `导入类型`, visible: false },
{ key: 26, label: `完成标识`, visible: true },
{ key: 27, label: `优先级`, visible: true },
{ key: 28, label: `班次ID`, visible: true },
{ key: 29, label: `班组ID`, visible: true },
{ key: 28, label: `班次`, visible: true },
{ key: 29, label: `班组`, visible: true },
{ key: 30, label: `模号`, visible: true },
{ key: 31, label: `备注`, visible: false },
{ key: 32, label: `创建部门`, visible: false },
@ -367,7 +398,7 @@ const initFormData: PlanInfoForm = {
planStatus: undefined,
importFlag: undefined,
finishFlag: [],
priority: undefined,
priority: 1,
shiftId: undefined,
classTeamId: undefined,
modelCode: undefined,
@ -416,7 +447,7 @@ const data = reactive<PageData<PlanInfoForm, PlanInfoQuery>>({
{ required: true, message: "计划编号不能为空", trigger: "blur" }
],
materialId: [
{ required: true, message: "物料ID不能为空", trigger: "blur" }
{ required: true, message: "物料名称不能为空", trigger: "blur" }
],
materialBomId: [
{ required: true, message: "物料BOM不能为空", trigger: "blur" }
@ -525,6 +556,8 @@ const handleExport = () => {
}
onMounted(() => {
getShiftSelect();
getClassTeamSelect();
getList();
});
</script>

@ -0,0 +1,477 @@
<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='moduleType'>
<el-select v-model='queryParams.moduleType' placeholder='请选择所属模块' clearable>
<el-option v-for='dict in sys_module_type' :key='dict.value' :label='dict.label' :value='dict.value' />
</el-select>
</el-form-item>
<el-form-item label='主数据标题' prop='masterDataTitle' label-width="90px">
<el-input v-model='queryParams.masterDataTitle' placeholder='请输入主数据标题' clearable
@keyup.enter='handleQuery' />
</el-form-item>
<el-form-item label='激活标识' prop='activeFlag'>
<el-select v-model='queryParams.activeFlag' placeholder='请选择激活标识' clearable>
<el-option v-for='dict in active_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="['system:masterData:add']">
</el-button>
</el-col>
<el-col :span='1.5'>
<el-button type='success' plain icon='Edit' :disabled='single' @click='handleUpdate()'
v-hasPermi="['system:masterData:edit']">修改
</el-button>
</el-col>
<el-col :span='1.5'>
<el-button type='danger' plain icon='Delete' :disabled='multiple' @click='handleDelete()'
v-hasPermi="['system:masterData:remove']">删除
</el-button>
</el-col>
<el-col :span='1.5'>
<el-button type='warning' plain icon='Download' @click='handleExport'
v-hasPermi="['system:masterData: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='masterDataList' @selection-change='handleSelectionChange'>
<el-table-column type='selection' width='55' align='center' />
<el-table-column label='主键标识' align='center' prop='masterDataId' v-if='columns[0].visible' />
<el-table-column label='所属模块' align='center' prop='moduleType' v-if='columns[2].visible'>
<template #default='scope'>
<dict-tag :options='sys_module_type' :value='scope.row.moduleType' />
</template>
</el-table-column>
<el-table-column label='父级标识' align='center' prop='parentFlag' v-if='columns[3].visible'>
<template #default='scope'>
<dict-tag :options='active_flag' :value='scope.row.parentFlag' />
</template>
</el-table-column>
<el-table-column label='菜单ID' align='center' prop='menuId' v-if='columns[4].visible' />
<el-table-column label='路由参数' align='center' prop='queryParam' v-if='columns[5].visible' />
<el-table-column label='主数据标题' align='center' prop='masterDataTitle' v-if='columns[6].visible' width="100"/>
<el-table-column label='预留字段1名称' align='center' prop='fieldName1' v-if='columns[7].visible' />
<el-table-column label='预留字段1显示标识' align='center' prop='displayFlag1' v-if='columns[8].visible' width="90">
<template #default='scope'>
<dict-tag :options='active_flag' :value='scope.row.displayFlag1' />
</template>
</el-table-column>
<el-table-column label='预留字段2名称' align='center' prop='fieldName2' v-if='columns[9].visible' />
<el-table-column label='预留字段2显示标识' align='center' prop='displayFlag2' v-if='columns[10].visible' width="90">
<template #default='scope'>
<dict-tag :options='active_flag' :value='scope.row.displayFlag2' />
</template>
</el-table-column>
<el-table-column label='预留字段3名称' align='center' prop='fieldName3' v-if='columns[11].visible' />
<el-table-column label='预留字段3显示标识' align='center' prop='displayFlag3' v-if='columns[12].visible' width="90">
<template #default='scope'>
<dict-tag :options='active_flag' :value='scope.row.displayFlag3' />
</template>
</el-table-column>
<el-table-column label='预留字段4名称' align='center' prop='fieldName4' v-if='columns[13].visible' />
<el-table-column label='预留字段4显示标识' align='center' prop='displayFlag4' v-if='columns[14].visible' width="90">
<template #default='scope'>
<dict-tag :options='active_flag' :value='scope.row.displayFlag4' />
</template>
</el-table-column>
<el-table-column label='预留字段5名称' align='center' prop='fieldName5' v-if='columns[15].visible' />
<el-table-column label='预留字段5显示标识' align='center' prop='displayFlag5' v-if='columns[16].visible' width="90">
<template #default='scope'>
<dict-tag :options='active_flag' :value='scope.row.displayFlag5' />
</template>
</el-table-column>
<el-table-column label='激活标识' align='center' prop='activeFlag' v-if='columns[17].visible'>
<template #default='scope'>
<dict-tag :options='active_flag' :value='scope.row.activeFlag' />
</template>
</el-table-column>
<el-table-column label='备注' align='center' prop='remark' v-if='columns[18].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="['system:masterData:edit']"></el-button>
</el-tooltip>
<el-tooltip content='删除' placement='top'>
<el-button link type='primary' icon='Delete' @click='handleDelete(scope.row)'
v-hasPermi="['system:masterData: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='600px' append-to-body>
<el-form ref='masterDataFormRef' :model='form' :rules='rules' label-width='150px'>
<el-form-item label='所属模块' prop='moduleType'>
<el-radio-group v-model='form.moduleType'>
<el-radio
v-for='dict in sys_module_type'
:key='dict.value'
:value='dict.value'
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label='父级标识' prop='parentFlag'>
<el-radio-group v-model='form.parentFlag'>
<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='菜单ID' prop='menuId'>
<el-input v-model='form.menuId' placeholder='请输入菜单ID' />
</el-form-item>
<el-form-item label='路由参数' prop='queryParam'>
<el-input v-model='form.queryParam' placeholder='请输入路由参数' />
</el-form-item>
<el-form-item label='主数据标题' prop='masterDataTitle'>
<el-input v-model='form.masterDataTitle' placeholder='请输入主数据标题' />
</el-form-item>
<el-form-item label='预留字段1名称' prop='fieldName1'>
<el-input v-model='form.fieldName1' placeholder='请输入预留字段1名称' />
</el-form-item>
<el-form-item label='预留字段1显示标识' prop='displayFlag1'>
<el-radio-group v-model='form.displayFlag1'>
<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='预留字段2名称' prop='fieldName2'>
<el-input v-model='form.fieldName2' placeholder='请输入预留字段2名称' />
</el-form-item>
<el-form-item label='预留字段2显示标识' prop='displayFlag2'>
<el-radio-group v-model='form.displayFlag2'>
<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='预留字段3名称' prop='fieldName3'>
<el-input v-model='form.fieldName3' placeholder='请输入预留字段3名称' />
</el-form-item>
<el-form-item label='预留字段3显示标识' prop='displayFlag3'>
<el-radio-group v-model='form.displayFlag3'>
<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='预留字段4名称' prop='fieldName4'>
<el-input v-model='form.fieldName4' placeholder='请输入预留字段4名称' />
</el-form-item>
<el-form-item label='预留字段4显示标识' prop='displayFlag4'>
<el-radio-group v-model='form.displayFlag4'>
<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='预留字段5名称' prop='fieldName5'>
<el-input v-model='form.fieldName5' placeholder='请输入预留字段5名称' />
</el-form-item>
<el-form-item label='预留字段5显示标识' prop='displayFlag5'>
<el-radio-group v-model='form.displayFlag5'>
<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='activeFlag'>
<el-radio-group v-model='form.activeFlag'>
<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='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='MasterData' lang='ts'>
import { listMasterData, getMasterData, delMasterData, addMasterData, updateMasterData } from '@/api/system/masterData';
import { MasterDataVO, MasterDataQuery, MasterDataForm } from '@/api/system/masterData/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const {
active_flag,
sys_yes_no,
sys_module_type
} = toRefs<any>(proxy?.useDict('active_flag', 'sys_yes_no', 'sys_module_type'));
const masterDataList = ref<MasterDataVO[]>([]);
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 masterDataFormRef = 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: `父级标识`, visible: true },
{ key: 4, label: `菜单ID`, visible: false },
{ key: 5, label: `路由参数`, visible: true },
{ key: 6, label: `主数据标题`, visible: true },
{ key: 7, label: `预留字段1名称`, visible: true },
{ key: 8, label: `预留字段1显示标识`, visible: true },
{ key: 9, label: `预留字段2名称`, visible: true },
{ key: 10, label: `预留字段2显示标识`, visible: true },
{ key: 11, label: `预留字段3名称`, visible: true },
{ key: 12, label: `预留字段3显示标识`, visible: true },
{ key: 13, label: `预留字段4名称`, visible: true },
{ key: 14, label: `预留字段4显示标识`, visible: true },
{ key: 15, label: `预留字段5名称`, visible: true },
{ key: 16, label: `预留字段5显示标识`, visible: true },
{ key: 17, label: `激活标识`, visible: true },
{ key: 18, label: `备注`, visible: true },
{ key: 19, label: `创建部门`, visible: false },
{ key: 20, label: `创建人`, visible: false },
{ key: 21, label: `创建时间`, visible: false },
{ key: 22, label: `更新人`, visible: false },
{ key: 23, label: `更新时间`, visible: false }
]);
const initFormData: MasterDataForm = {
masterDataId: undefined,
moduleType: undefined,
parentFlag: '0',
menuId: undefined,
queryParam: undefined,
masterDataTitle: undefined,
fieldName1: undefined,
displayFlag1: '0',
fieldName2: undefined,
displayFlag2: '0',
fieldName3: undefined,
displayFlag3: '0',
fieldName4: undefined,
displayFlag4: '0',
fieldName5: undefined,
displayFlag5: '0',
activeFlag: '1',
remark: undefined
};
const data = reactive<PageData<MasterDataForm, MasterDataQuery>>({
form: { ...initFormData },
queryParams: {
pageNum: 1,
pageSize: 10,
masterDataId: undefined,
moduleType: undefined,
parentFlag: undefined,
menuId: undefined,
queryParam: undefined,
masterDataTitle: undefined,
fieldName1: undefined,
displayFlag1: undefined,
fieldName2: undefined,
displayFlag2: undefined,
fieldName3: undefined,
displayFlag3: undefined,
fieldName4: undefined,
displayFlag4: undefined,
fieldName5: undefined,
displayFlag5: undefined,
activeFlag: undefined,
params: {}
},
rules: {
moduleType: [
{ required: true, message: '所属模块不能为空', trigger: 'change' }
],
parentFlag: [
{ required: true, message: '父级标识不能为空', trigger: 'change' }
],
queryParam: [
{ required: true, message: '路由参数不能为空', trigger: 'blur' }
],
masterDataTitle: [
{ required: true, message: '主数据标题不能为空', trigger: 'blur' }
],
displayFlag1: [
{ required: true, message: '预留字段1显示标识不能为空', trigger: 'change' }
],
displayFlag2: [
{ required: true, message: '预留字段2显示标识不能为空', trigger: 'change' }
],
displayFlag3: [
{ required: true, message: '预留字段3显示标识不能为空', trigger: 'change' }
],
displayFlag4: [
{ required: true, message: '预留字段4显示标识不能为空', trigger: 'change' }
],
displayFlag5: [
{ required: true, message: '预留字段5显示标识不能为空', trigger: 'change' }
],
activeFlag: [
{ required: true, message: '激活标识不能为空', trigger: 'change' }
]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询主数据维护列表 */
const getList = async () => {
loading.value = true;
const res = await listMasterData(queryParams.value);
masterDataList.value = res.rows;
total.value = res.total;
loading.value = false;
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
};
/** 表单重置 */
const reset = () => {
form.value = { ...initFormData };
masterDataFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 多选框选中数据 */
const handleSelectionChange = (selection: MasterDataVO[]) => {
ids.value = selection.map(item => item.masterDataId);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = '添加主数据维护';
};
/** 修改按钮操作 */
const handleUpdate = async (row?: MasterDataVO) => {
reset();
const _masterDataId = row?.masterDataId || ids.value[0];
const res = await getMasterData(_masterDataId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改主数据维护';
};
/** 提交按钮 */
const submitForm = () => {
masterDataFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.masterDataId) {
await updateMasterData(form.value).finally(() => buttonLoading.value = false);
} else {
await addMasterData(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
await getList();
}
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: MasterDataVO) => {
const _masterDataIds = row?.masterDataId || ids.value;
await proxy?.$modal.confirm('是否确认删除主数据维护编号为"' + _masterDataIds + '"的数据项?').finally(() => loading.value = false);
await delMasterData(_masterDataIds);
proxy?.$modal.msgSuccess('删除成功');
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('system/masterData/export', {
...queryParams.value
}, `masterData_${new Date().getTime()}.xlsx`);
};
onMounted(() => {
getList();
});
</script>

@ -0,0 +1,392 @@
<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='masterDataDetailId'>
<el-input v-model='queryParams.masterDataDetailId' placeholder='请输入主键标识' clearable
@keyup.enter='handleQuery' />
</el-form-item>
<el-form-item label='主数据ID' prop='masterDataId'>
<el-input v-model='queryParams.masterDataId' placeholder='请输入主数据ID' clearable
@keyup.enter='handleQuery' />
</el-form-item>
<!-- <el-form-item label='父级标识' prop='parentId'>-->
<!-- <el-input v-model='queryParams.parentId' placeholder='请输入父级标识' clearable @keyup.enter='handleQuery' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='祖级列表' prop='ancestors'>-->
<!-- <el-input v-model='queryParams.ancestors' placeholder='请输入祖级列表' clearable @keyup.enter='handleQuery' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='主数据明细编号' prop='dataDetailCode'>-->
<!-- <el-input v-model='queryParams.dataDetailCode' placeholder='请输入主数据明细编号' clearable-->
<!-- @keyup.enter='handleQuery' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='主数据明细名称' prop='dataDetailName'>-->
<!-- <el-input v-model='queryParams.dataDetailName' placeholder='请输入主数据明细名称' clearable-->
<!-- @keyup.enter='handleQuery' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='预留字段1数据' prop='fieldData1'>-->
<!-- <el-input v-model='queryParams.fieldData1' placeholder='请输入预留字段1数据' clearable-->
<!-- @keyup.enter='handleQuery' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='预留字段2数据' prop='fieldData2'>-->
<!-- <el-input v-model='queryParams.fieldData2' placeholder='请输入预留字段2数据' clearable-->
<!-- @keyup.enter='handleQuery' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='预留字段3数据' prop='fieldData3'>-->
<!-- <el-input v-model='queryParams.fieldData3' placeholder='请输入预留字段3数据' clearable-->
<!-- @keyup.enter='handleQuery' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='预留字段4数据' prop='fieldData4'>-->
<!-- <el-input v-model='queryParams.fieldData4' placeholder='请输入预留字段4数据' clearable-->
<!-- @keyup.enter='handleQuery' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='预留字段5数据' prop='fieldData5'>-->
<!-- <el-input v-model='queryParams.fieldData5' placeholder='请输入预留字段5数据' clearable-->
<!-- @keyup.enter='handleQuery' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='显示排序' prop='displaySort'>-->
<!-- <el-input v-model='queryParams.displaySort' placeholder='请输入显示排序' clearable @keyup.enter='handleQuery' />-->
<!-- </el-form-item>-->
<el-form-item label='激活标识' prop='activeFlag'>
<el-select v-model='queryParams.activeFlag' placeholder='请选择激活标识' clearable>
<el-option v-for='dict in active_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="['system:masterDataDetail:add']">
新增
</el-button>
</el-col>
<el-col :span='1.5'>
<el-button type='success' plain icon='Edit' :disabled='single' @click='handleUpdate()'
v-hasPermi="['system:masterDataDetail:edit']">修改
</el-button>
</el-col>
<el-col :span='1.5'>
<el-button type='danger' plain icon='Delete' :disabled='multiple' @click='handleDelete()'
v-hasPermi="['system:masterDataDetail:remove']">删除
</el-button>
</el-col>
<el-col :span='1.5'>
<el-button type='warning' plain icon='Download' @click='handleExport'
v-hasPermi="['system:masterDataDetail: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='masterDataDetailList' @selection-change='handleSelectionChange'>
<el-table-column type='selection' width='55' align='center' />
<el-table-column label='主键标识' align='center' prop='masterDataDetailId' v-if='columns[0].visible' />
<el-table-column label='主数据ID' align='center' prop='masterDataId' v-if='columns[1].visible' />
<el-table-column label='父级标识' align='center' prop='parentId' v-if='columns[2].visible' />
<el-table-column label='祖级列表' align='center' prop='ancestors' v-if='columns[3].visible' />
<el-table-column label='主数据明细编号' align='center' prop='dataDetailCode' v-if='columns[4].visible' />
<el-table-column label='主数据明细名称' align='center' prop='dataDetailName' v-if='columns[5].visible' />
<el-table-column label='预留字段1数据' align='center' prop='fieldData1' v-if='columns[6].visible' />
<el-table-column label='预留字段2数据' align='center' prop='fieldData2' v-if='columns[7].visible' />
<el-table-column label='预留字段3数据' align='center' prop='fieldData3' v-if='columns[8].visible' />
<el-table-column label='预留字段4数据' align='center' prop='fieldData4' v-if='columns[9].visible' />
<el-table-column label='预留字段5数据' align='center' prop='fieldData5' v-if='columns[10].visible' />
<el-table-column label='显示排序' align='center' prop='displaySort' v-if='columns[11].visible' />
<el-table-column label='备注' align='center' prop='remark' v-if='columns[12].visible' />
<el-table-column label='激活标识' align='center' prop='activeFlag' v-if='columns[13].visible'>
<template #default='scope'>
<dict-tag :options='active_flag' :value='scope.row.activeFlag' />
</template>
</el-table-column>
<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="['system:masterDataDetail:edit']"></el-button>
</el-tooltip>
<el-tooltip content='删除' placement='top'>
<el-button link type='primary' icon='Delete' @click='handleDelete(scope.row)'
v-hasPermi="['system:masterDataDetail: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='masterDataDetailFormRef' :model='form' :rules='rules' label-width='80px'>
<el-form-item label='主键标识' prop='masterDataDetailId'>
<el-input v-model='form.masterDataDetailId' placeholder='请输入主键标识' />
</el-form-item>
<el-form-item label='主数据ID' prop='masterDataId'>
<el-input v-model='form.masterDataId' placeholder='请输入主数据ID' />
</el-form-item>
<el-form-item label='父级标识' prop='parentId'>
<el-input v-model='form.parentId' placeholder='请输入父级标识' />
</el-form-item>
<el-form-item label='祖级列表' prop='ancestors'>
<el-input v-model='form.ancestors' placeholder='请输入祖级列表' />
</el-form-item>
<el-form-item label='主数据明细编号' prop='dataDetailCode'>
<el-input v-model='form.dataDetailCode' placeholder='请输入主数据明细编号' />
</el-form-item>
<el-form-item label='主数据明细名称' prop='dataDetailName'>
<el-input v-model='form.dataDetailName' placeholder='请输入主数据明细名称' />
</el-form-item>
<el-form-item label='预留字段1数据' prop='fieldData1'>
<el-input v-model='form.fieldData1' placeholder='请输入预留字段1数据' />
</el-form-item>
<el-form-item label='预留字段2数据' prop='fieldData2'>
<el-input v-model='form.fieldData2' placeholder='请输入预留字段2数据' />
</el-form-item>
<el-form-item label='预留字段3数据' prop='fieldData3'>
<el-input v-model='form.fieldData3' placeholder='请输入预留字段3数据' />
</el-form-item>
<el-form-item label='预留字段4数据' prop='fieldData4'>
<el-input v-model='form.fieldData4' placeholder='请输入预留字段4数据' />
</el-form-item>
<el-form-item label='预留字段5数据' prop='fieldData5'>
<el-input v-model='form.fieldData5' placeholder='请输入预留字段5数据' />
</el-form-item>
<el-form-item label='显示排序' prop='displaySort'>
<el-input v-model='form.displaySort' placeholder='请输入显示排序' />
</el-form-item>
<el-form-item label='备注' prop='remark'>
<el-input v-model='form.remark' placeholder='请输入备注' />
</el-form-item>
<el-form-item label='激活标识' prop='activeFlag'>
<el-radio-group v-model='form.activeFlag'>
<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>
<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='MasterDataDetail' lang='ts'>
import {
listMasterDataDetail,
getMasterDataDetail,
delMasterDataDetail,
addMasterDataDetail,
updateMasterDataDetail
} from '@/api/system/masterDataDetail';
import { MasterDataDetailVO, MasterDataDetailQuery, MasterDataDetailForm } from '@/api/system/masterDataDetail/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { active_flag } = toRefs<any>(proxy?.useDict('active_flag'));
const masterDataDetailList = ref<MasterDataDetailVO[]>([]);
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 masterDataDetailFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `主键标识`, visible: true },
{ key: 1, label: `主数据ID`, visible: true },
{ key: 2, label: `父级标识`, visible: true },
{ key: 3, label: `祖级列表`, visible: true },
{ key: 4, label: `主数据明细编号`, visible: true },
{ key: 5, label: `主数据明细名称`, visible: true },
{ key: 6, label: `预留字段1数据`, visible: true },
{ key: 7, label: `预留字段2数据`, visible: true },
{ key: 8, label: `预留字段3数据`, visible: true },
{ key: 9, label: `预留字段4数据`, visible: true },
{ key: 10, label: `预留字段5数据`, visible: true },
{ key: 11, label: `显示排序`, visible: true },
{ key: 12, label: `备注`, visible: true },
{ key: 13, label: `激活标识`, visible: true },
{ 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 }
]);
const initFormData: MasterDataDetailForm = {
masterDataDetailId: undefined,
masterDataId: undefined,
parentId: undefined,
ancestors: undefined,
dataDetailCode: undefined,
dataDetailName: undefined,
fieldData1: undefined,
fieldData2: undefined,
fieldData3: undefined,
fieldData4: undefined,
fieldData5: undefined,
displaySort: undefined,
remark: undefined,
activeFlag: undefined
};
const data = reactive<PageData<MasterDataDetailForm, MasterDataDetailQuery>>({
form: { ...initFormData },
queryParams: {
pageNum: 1,
pageSize: 10,
masterDataDetailId: undefined,
masterDataId: undefined,
parentId: undefined,
ancestors: undefined,
dataDetailCode: undefined,
dataDetailName: undefined,
fieldData1: undefined,
fieldData2: undefined,
fieldData3: undefined,
fieldData4: undefined,
fieldData5: undefined,
displaySort: undefined,
activeFlag: undefined,
params: {}
},
rules: {
dataDetailCode: [
{ required: true, message: '主数据明细编号不能为空', trigger: 'blur' }
],
dataDetailName: [
{ required: true, message: '主数据明细名称不能为空', trigger: 'blur' }
],
activeFlag: [
{ required: true, message: '激活标识不能为空', trigger: 'change' }
]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询主数据维护明细列表 */
const getList = async () => {
loading.value = true;
const res = await listMasterDataDetail(queryParams.value);
masterDataDetailList.value = res.rows;
total.value = res.total;
loading.value = false;
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
};
/** 表单重置 */
const reset = () => {
form.value = { ...initFormData };
masterDataDetailFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 多选框选中数据 */
const handleSelectionChange = (selection: MasterDataDetailVO[]) => {
ids.value = selection.map(item => item.masterDataDetailId);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = '添加主数据维护明细';
};
/** 修改按钮操作 */
const handleUpdate = async (row?: MasterDataDetailVO) => {
reset();
const _masterDataDetailId = row?.masterDataDetailId || ids.value[0];
const res = await getMasterDataDetail(_masterDataDetailId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改主数据维护明细';
};
/** 提交按钮 */
const submitForm = () => {
masterDataDetailFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.masterDataDetailId) {
await updateMasterDataDetail(form.value).finally(() => buttonLoading.value = false);
} else {
await addMasterDataDetail(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
await getList();
}
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: MasterDataDetailVO) => {
const _masterDataDetailIds = row?.masterDataDetailId || ids.value;
await proxy?.$modal.confirm('是否确认删除主数据维护明细编号为"' + _masterDataDetailIds + '"的数据项?').finally(() => loading.value = false);
await delMasterDataDetail(_masterDataDetailIds);
proxy?.$modal.msgSuccess('删除成功');
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('system/masterDataDetail/export', {
...queryParams.value
}, `masterDataDetail_${new Date().getTime()}.xlsx`);
};
onMounted(() => {
getList();
});
</script>

@ -0,0 +1,350 @@
<template>
<div class="p-2">
<el-card shadow="never">
<el-form label-width="120px" label-position="right" :inline="true" :model="queryForm" class="demo-form-inline">
<el-form-item label="字段1">
<el-input v-model="queryForm.user" placeholder="字段1" clearable/>
</el-form-item>
<el-form-item label="字段2">
<el-select
v-model="queryForm.region"
placeholder="字段2"
clearable
>
<el-option label="选项1" value="shanghai"/>
<el-option label="选项2" value="beijing"/>
</el-select>
</el-form-item>
<el-form-item label="字段3">
<el-date-picker
v-model="queryForm.date"
type="date"
placeholder="字段3"
clearable
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="query"></el-button>
</el-form-item>
</el-form>
</el-card>
<el-card style="margin-top: 8px" shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="parentTableAdd"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="ids.length !== 1" @click="parentTableUpdate()">
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="ids.length < 1" @click="parentTableDelete()">
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true"
@queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table :data="tableData" style="width: 100%" @cell-click="parentTableCellClick"
@selection-change="selectionChange" ref="parentTableRef">
<el-table-column type="selection" width="55"/>
<el-table-column label="Date" prop="date"/>
<el-table-column label="Date" prop="name"/>
<el-table-column label="Operations" fixed="right" width="200">
<template #default="scope">
<el-button size="small" @click.stop="viewDetails(scope.row)">
查看
</el-button>
<el-button size="small" @click.stop="parentTableUpdate(scope.row)">
修改
</el-button>
<el-button
size="small"
type="danger"
@click.stop="parentTableDelete(scope.row)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-card style="margin-top: 8px" shadow="never">
<el-table :data="tableData1" style="width: 100%">
<el-table-column label="Date" prop="date"/>
<el-table-column label="Date" prop="name"/>
<el-table-column label="Operations" fixed="right" width="200">
<template #default="scope">
<el-button size="small" @click="handleEdit(scope.$index, scope.row)">
查看
</el-button>
<el-button size="small" @click="handleEdit(scope.$index, scope.row)">
修改
</el-button>
<el-button
size="small"
type="danger"
@click="handleDelete(scope.$index, scope.row)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<el-dialog v-model="dialogVisible" :title="dialogTitle" width="100%" fullscreen>
<el-card shadow="never">
<el-form :model="dialogForm" :inline="true">
<el-form-item label="字段1" label-width="120px">
<el-input v-model="dialogForm.name" autocomplete="off"/>
</el-form-item>
<el-form-item label="字段2" label-width="120px">
<el-select v-model="dialogForm.region" placeholder="Please select a zone">
<el-option label="Zone No.1" value="shanghai"/>
<el-option label="Zone No.2" value="beijing"/>
</el-select>
</el-form-item>
</el-form>
</el-card>
<el-card style="margin-top: 8px" shadow="never">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="addDialogTableCell"></el-button>
</el-col>
</el-row>
<el-table :data="dialogtable" style="width: 100%">
<el-table-column label="字段1" prop="date">
<template #default="scope">
<el-select
v-model="scope.row.date"
placeholder="Select"
size="small"
>
<el-option
label="1"
value="1"
/>
<el-option
label="2"
value="2"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="字段2" prop="name">
<template #default="scope">
<el-input v-model="scope.row.name" style="width: 240px" placeholder="Please input" />
</template>
</el-table-column>
<el-table-column label="Operations" fixed="right" width="200">
<template #default="scope">
<el-button size="small" @click="handleEdit(scope.$index, scope.row)">
查看
</el-button>
<el-button size="small" @click="handleEdit(scope.$index, scope.row)">
修改
</el-button>
<el-button
size="small"
type="danger"
@click="handleDelete(scope.$index, scope.row)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
<el-button type="primary" @click="dialogSubmit">
确定
</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Linkage" lang="ts">
import {reactive} from 'vue'
import {ElMessage, ElMessageBox} from 'element-plus'
interface User {
date: string
name: string
address: string
}
const dialogVisible = ref(false)
const dialogTitle = ref('添加')
const dialogForm = reactive({})
const queryForm = reactive({
user: '',
region: '',
date: '',
})
const parentTableRef = ref()
const tableData = ref([
{
date: '2016-05-03',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-02',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-04',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-01',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
])
const ids = ref([])
const tableData1 = ref([
{
date: '2016-05-03',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-02',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-04',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-01',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
])
const dialogtable = ref([])
const onSubmit = () => {
console.log('submit!')
}
const handleEdit = (index: number, row: User) => {
console.log(index, row)
}
const handleDelete = (index: number, row: User) => {
console.log(index, row)
}
const query = () => {
console.log(queryForm)
ids.value = []
parentTableRef.value.clearSelection()
}
//
const parentTableCellClick = (e) => {
console.log(e.date)
tableData1.value = tableData1.value.map(v => {
return {
...v,
date: e.date
}
})
}
//
const selectionChange = (e) => {
ids.value = e.map(v => v.name)
console.log(ids.value)
}
//
const viewDetails = (e) => {
console.log(e)
}
//
const parentTableAdd = () => {
dialogVisible.value = true
}
//
const parentTableUpdate = (e) => {
let id = ref(null)
if (e) {
id.value = e.name
} else {
id.value = ids.value?.[0]
}
if (!id.value) return
dialogVisible.value = true
}
//
const parentTableDelete = (e) => {
const delList = ref([])
if (e) {
delList.value = [e.name]
} else {
delList.value = ids.value
}
console.log(delList.value)
ElMessageBox.confirm(
'确定要删除这些数据吗?',
'Warning',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
ElMessage({
type: 'success',
message: '删除完成',
})
})
.catch(() => {
ElMessage({
type: 'info',
message: '取消',
})
})
}
//
const addDialogTableCell = () => {
dialogtable.value.push({})
}
// dialog
const dialogSubmit = () => {
console.log(dialogForm)
console.log(dialogtable.value)
dialogVisible.value = false
}
</script>
<style>
.demo-form-inline .el-input {
--el-input-width: 220px;
}
.demo-form-inline .el-select {
--el-select-width: 220px;
}
</style>
Loading…
Cancel
Save