|
|
@ -63,13 +63,6 @@ |
|
|
|
@click="handleAdd" |
|
|
|
>新增</el-button> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="success" |
|
|
|
icon="Edit" |
|
|
|
@click="handleUpdate" |
|
|
|
>修改</el-button> |
|
|
|
</el-col> |
|
|
|
<el-col :span="1.5"> |
|
|
|
<el-button |
|
|
|
type="success" |
|
|
@ -102,7 +95,7 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="备注" align="center" prop="note" /> |
|
|
|
<el-table-column label="主键" align="center" prop="id" /> |
|
|
|
<!-- <el-table-column label="主键" align="center" prop="id" /> --> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" :width="200" :fixed="fixedColumns?'right':false"> |
|
|
|
<template #header> |
|
|
|
<div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns"> |
|
|
@ -191,7 +184,7 @@ |
|
|
|
@import "@/assets/styles/self-defined.scss"; |
|
|
|
</style> |
|
|
|
<script setup name="Paramclass"> |
|
|
|
import { listParamclass, getParamclass, delParamclass, addParamclass, updateParamclass } from "@/api/model/paramclass"; |
|
|
|
import { listParamclass, getParamclass, delParamclass, addParamclass, updateParamclass,listParamclassForRepetition } from "@/api/model/paramclass"; |
|
|
|
import lock from "@/assets/icons/svg/lock.svg"; |
|
|
|
import { ElMessageBox } from 'element-plus'; |
|
|
|
const { proxy } = getCurrentInstance(); |
|
|
@ -335,17 +328,40 @@ function handleUpdate(row) { |
|
|
|
function submitForm() { |
|
|
|
proxy.$refs["paramclassRef"].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
const param = {"paramClassCode":form.value.paramClassCode}; |
|
|
|
if (form.value.id != null) { |
|
|
|
updateParamclass(form.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
|
open.value = false; |
|
|
|
getList(); |
|
|
|
listParamclassForRepetition(param).then(response => { |
|
|
|
const result = response.data; |
|
|
|
const newArray = result.filter(item => item.id !== form.value.id); |
|
|
|
if (newArray?.length > 0) { |
|
|
|
ElMessageBox.alert('该参数模版编号重复', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
center: true, |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
updateParamclass(form.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("修改成功"); |
|
|
|
open.value = false; |
|
|
|
getList(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
addParamclass(form.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
|
open.value = false; |
|
|
|
getList(); |
|
|
|
listParamclassForRepetition(param).then(response => { |
|
|
|
const result = response.data; |
|
|
|
const newArray = result.filter(item => item.id !== form.value.id); |
|
|
|
if (newArray?.length > 0) { |
|
|
|
ElMessageBox.alert('该参数模版编号重复', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
center: true, |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
addParamclass(form.value).then(response => { |
|
|
|
proxy.$modal.msgSuccess("新增成功"); |
|
|
|
open.value = false; |
|
|
|
getList(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|