update 成型工艺信息复制功能

master
yinq 1 week ago
parent 550c4e6cc2
commit c47249278b

@ -62,16 +62,23 @@ export const delTechnologyInfo = (technologyId: string | number | Array<string |
});
};
/**
*
* @param query
* @returns {*}
*/
export function getProdTechnologyInfoList (query) {
return request({
url: '/mes/technologyInfo/getProdTechnologyInfoList',
method: 'get',
params: query
});
export function getProdTechnologyInfoList(query) {
return request({
url: '/mes/technologyInfo/getProdTechnologyInfoList',
method: 'get',
params: query
});
};
export const copyTechnologyInfo = (data: TechnologyInfoForm) => {
return request({
url: '/mes/technologyInfo/copyTechnologyInfo',
method: 'post',
data: data
});
};

@ -44,6 +44,8 @@ export interface TechnologyInfoVO {
*/
remark: string;
prodTechnologyStepInfoList?: [];
}
export interface TechnologyInfoForm extends BaseEntity {
@ -139,10 +141,12 @@ export interface TechnologyInfoQuery extends PageQuery {
*/
activeFlag?: string;
/**
*
*/
params?: any;
/**
*
*/
params?: any;
prodTechnologyStepInfoList?: [];
}

@ -85,6 +85,11 @@
v-hasPermi="['mes:technologyInfo:edit']">工艺参数
</el-button>
</el-tooltip>
<el-tooltip content='复制' placement='top'>
<el-button link type='primary' @click='handleCopy(scope.row)'
v-hasPermi="['mes:technologyInfo:add']">复制
</el-button>
</el-tooltip>
<!-- <el-tooltip content='删除' placement='top'>-->
<!-- <el-button link type='primary' icon='Delete' @click='handleDelete(scope.row)'-->
<!-- v-hasPermi="['mes:technologyInfo:remove']"></el-button>-->
@ -254,7 +259,7 @@
<el-input v-model='scope.row.stepCode' placeholder='请输入参数编号' />
</template>
</el-table-column>
<el-table-column align='center' label='参数名称' prop='stepName' width='130'>
<el-table-column align='center' label='参数名称' prop='stepName' width='260'>
<template #default='scope'>
<el-input v-model='scope.row.stepName' placeholder='请输入参数名称' />
</template>
@ -335,7 +340,7 @@ import {
getTechnologyInfo,
delTechnologyInfo,
addTechnologyInfo,
updateTechnologyInfo
updateTechnologyInfo, copyTechnologyInfo
} from '@/api/mes/technologyInfo';
import { TechnologyInfoVO, TechnologyInfoQuery, TechnologyInfoForm } from '@/api/mes/technologyInfo/types';
import { getProcessInfoList } from '@/api/mes/baseProcessInfo';
@ -377,6 +382,9 @@ const stepOpen = ref(false);
const prodTechnologyStepInfoList = ref([]);
const chekedProdLineList = ref([]);
//
const isCopy = ref(false);
/** 查询工位下拉树结构 */
const getProcessInfoListSelect = async () => {
let res = await getProcessInfoList(null);
@ -457,6 +465,7 @@ const getList = async () => {
const cancel = () => {
reset();
dialog.visible = false;
isCopy.value = false;
};
/** 表单重置 */
const reset = () => {
@ -506,6 +515,16 @@ const handleUpdate = async (row?: TechnologyInfoVO) => {
dialog.title = '修改成型工艺信息';
};
const handleCopy = (row: TechnologyInfoVO) => {
reset();
//
Object.assign(form.value, JSON.parse(JSON.stringify(row)));
// form.value.technologyId = undefined;
dialog.visible = true;
dialog.title = '复制成型工艺信息';
isCopy.value = true;
};
/** 工艺参数信息维护按钮操作 */
const handleStepUpdate = async (row?: TechnologyInfoVO) => {
reset();
@ -526,7 +545,10 @@ const submitForm = () => {
if (valid) {
buttonLoading.value = true;
convertToSeconds();
if (form.value.technologyId) {
if (isCopy.value) {
form.value.prodTechnologyStepInfoList = prodTechnologyStepInfoList;
await copyTechnologyInfo(form.value).finally(() => buttonLoading.value = false);
} else if (form.value.technologyId) {
form.value.prodTechnologyStepInfoList = prodTechnologyStepInfoList;
await updateTechnologyInfo(form.value).finally(() => buttonLoading.value = false);
} else {
@ -536,6 +558,7 @@ const submitForm = () => {
dialog.visible = false;
stepOpen.value = false;
form.value.prodTechnologyStepInfoList = [];
isCopy.value = false;
await getList();
}
});

@ -109,6 +109,11 @@
v-hasPermi="['mes:technologyInfo:edit']">工艺步序
</el-button>
</el-tooltip>
<el-tooltip content='复制' placement='top'>
<el-button link type='primary' @click='handleCopy(scope.row)'
v-hasPermi="['mes:technologyInfo:add']">复制
</el-button>
</el-tooltip>
<!-- <el-tooltip content='删除' placement='top'>-->
<!-- <el-button link type='primary' icon='Delete' @click='handleDelete(scope.row)'-->
<!-- v-hasPermi="['mes:technologyInfo:remove']"></el-button>-->
@ -326,7 +331,7 @@ import {
getTechnologyInfo,
delTechnologyInfo,
addTechnologyInfo,
updateTechnologyInfo
updateTechnologyInfo, copyTechnologyInfo
} from '@/api/mes/technologyInfo';
import { TechnologyInfoVO, TechnologyInfoQuery, TechnologyInfoForm } from '@/api/mes/technologyInfo/types';
import { getProcessInfoList } from '@/api/mes/baseProcessInfo';
@ -363,6 +368,9 @@ const materialSelectRef = ref();
const stepOpen = ref(false);
//
const isCopy = ref(false);
const prodTechnologyStepInfoList = ref([]);
const chekedProdLineList = ref([]);
@ -446,6 +454,7 @@ const getList = async () => {
const cancel = () => {
reset();
dialog.visible = false;
isCopy.value = false;
};
/** 表单重置 */
const reset = () => {
@ -515,7 +524,10 @@ const submitForm = () => {
if (valid) {
buttonLoading.value = true;
convertToSeconds();
if (form.value.technologyId) {
if (isCopy.value) {
form.value.prodTechnologyStepInfoList = prodTechnologyStepInfoList;
await copyTechnologyInfo(form.value).finally(() => buttonLoading.value = false);
} else if (form.value.technologyId) {
form.value.prodTechnologyStepInfoList = prodTechnologyStepInfoList;
await updateTechnologyInfo(form.value).finally(() => buttonLoading.value = false);
} else {
@ -525,6 +537,7 @@ const submitForm = () => {
dialog.visible = false;
stepOpen.value = false;
form.value.prodTechnologyStepInfoList = [];
isCopy.value = false;
await getList();
}
});
@ -588,6 +601,15 @@ const handleAddStep = () => {
});
};
const handleCopy = (row: TechnologyInfoVO) => {
reset();
//
Object.assign(form.value, JSON.parse(JSON.stringify(row)));
// form.value.technologyId = undefined;
dialog.visible = true;
dialog.title = '复制成型工艺信息';
isCopy.value = true;
};
const rowProdBaseProcessProdlineIndex = ({ row, rowIndex }: { row: any; rowIndex: number }): string => {
//
if (row.someCondition) {

Loading…
Cancel
Save