|
|
@ -407,7 +407,7 @@ const routeProcessUpdate = async (row: BaseRouteVO) => {
|
|
|
|
dialog.title = '维护工艺路线步骤';
|
|
|
|
dialog.title = '维护工艺路线步骤';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 修改rowProdBaseRouteProcessIndex方法,返回类名字符串
|
|
|
|
/** 修改rowProdBaseRouteProcessIndex方法,返回类名字符串 */
|
|
|
|
const rowProdBaseRouteProcessIndex = ({ row, rowIndex }: {
|
|
|
|
const rowProdBaseRouteProcessIndex = ({ row, rowIndex }: {
|
|
|
|
row: ProdBaseRouteProcess;
|
|
|
|
row: ProdBaseRouteProcess;
|
|
|
|
rowIndex: number
|
|
|
|
rowIndex: number
|
|
|
@ -422,11 +422,20 @@ const rowProdBaseRouteProcessIndex = ({ row, rowIndex }: {
|
|
|
|
// 返回一个空字符串表示不添加额外类名
|
|
|
|
// 返回一个空字符串表示不添加额外类名
|
|
|
|
return '';
|
|
|
|
return '';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** 工艺路线组成信息添加按钮操作 */
|
|
|
|
/** 工艺路线组成信息添加按钮操作 */
|
|
|
|
const handleAddProdBaseRouteProcess = () => {
|
|
|
|
const handleAddProdBaseRouteProcess = () => {
|
|
|
|
|
|
|
|
// 找到当前 routeProcessBoList 中的最大 processOrder 值
|
|
|
|
|
|
|
|
const maxProcessOrder = routeProcessBoList.value.reduce((max, item) => {
|
|
|
|
|
|
|
|
return Math.max(max, item.processOrder || 0);
|
|
|
|
|
|
|
|
}, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 新增的 processOrder 值为 maxProcessOrder + 10
|
|
|
|
|
|
|
|
const newProcessOrder = maxProcessOrder + 10;
|
|
|
|
|
|
|
|
|
|
|
|
routeProcessBoList.value.push({
|
|
|
|
routeProcessBoList.value.push({
|
|
|
|
processId: '',
|
|
|
|
processId: '', // 可以设置一个默认值或自增ID
|
|
|
|
processOrder: '',
|
|
|
|
processOrder: newProcessOrder,
|
|
|
|
remark: '',
|
|
|
|
remark: '',
|
|
|
|
createBy: '',
|
|
|
|
createBy: '',
|
|
|
|
createTime: '',
|
|
|
|
createTime: '',
|
|
|
@ -435,6 +444,7 @@ const handleAddProdBaseRouteProcess = () => {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 工艺路线组成信息删除按钮操作 */
|
|
|
|
/** 工艺路线组成信息删除按钮操作 */
|
|
|
|
const handleDeleteProdBaseRouteProcess = () => {
|
|
|
|
const handleDeleteProdBaseRouteProcess = () => {
|
|
|
|
// 检查是否有选中的工艺路线组成信息数据,如果没有则显示错误提示
|
|
|
|
// 检查是否有选中的工艺路线组成信息数据,如果没有则显示错误提示
|
|
|
@ -443,15 +453,23 @@ const handleDeleteProdBaseRouteProcess = () => {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// 过滤掉已选中的工艺路线组成信息数据
|
|
|
|
// 过滤掉已选中的工艺路线组成信息数据
|
|
|
|
routeProcessBoList.value = routeProcessBoList.value.filter(
|
|
|
|
routeProcessBoList.value = routeProcessBoList.value.filter(
|
|
|
|
item => !checkedProdBaseRouteProcess.value.includes(item.index)
|
|
|
|
item => !checkedProdBaseRouteProcess.value.includes(item.processId)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 重新排列 processOrder
|
|
|
|
|
|
|
|
routeProcessBoList.value.forEach((item, index) => {
|
|
|
|
|
|
|
|
item.processOrder = (index + 1) * 10;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 清空选中的项
|
|
|
|
|
|
|
|
checkedProdBaseRouteProcess.value = [];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** 复选框选中数据 */
|
|
|
|
/** 复选框选中数据 */
|
|
|
|
const handleProdBaseRouteProcessSelectionChange = (selection: any[]) => {
|
|
|
|
const handleProdBaseRouteProcessSelectionChange = (selection: any[]) => {
|
|
|
|
// 将选中的项的索引映射到checkedProdBaseRouteProcess.value数组中
|
|
|
|
// 将选中的项的 processId 映射到 checkedProdBaseRouteProcess.value 数组中
|
|
|
|
checkedProdBaseRouteProcess.value = selection.map(item => item.index);
|
|
|
|
checkedProdBaseRouteProcess.value = selection.map(item => item.processId);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const getProcessList = async () => {
|
|
|
|
const getProcessList = async () => {
|
|
|
|