|
@@ -54,17 +54,18 @@ const handleSelect = index => {
|
|
|
active.value = index;
|
|
|
};
|
|
|
const tepName = ref();
|
|
|
+const tepNameForm = reactive({
|
|
|
+ tpName: "",
|
|
|
+ id: ""
|
|
|
+});
|
|
|
onMounted(() => {
|
|
|
- if (route.query.tpName) {
|
|
|
+ if (route.query.tpName && route.query.id) {
|
|
|
tepNameForm.tpName = route.query.tpName;
|
|
|
tepNameForm.id = route.query.id;
|
|
|
}
|
|
|
});
|
|
|
const tableData = ref([]);
|
|
|
-const tepNameForm = reactive({
|
|
|
- tpName: "",
|
|
|
- id: ""
|
|
|
-});
|
|
|
+
|
|
|
// 新建模板
|
|
|
const postAddTemplateApi = async () => {
|
|
|
const res = await postAddTemplate({ ...tepNameForm });
|
|
@@ -88,14 +89,11 @@ const postAddTemplateApi = async () => {
|
|
|
const eaxmCard = ref([]);
|
|
|
// 获取维度
|
|
|
const getListByApi = async () => {
|
|
|
+ console.log(tepNameForm.id, "触发getListByApi", tepNameForm);
|
|
|
const obj = {
|
|
|
tpId: tepNameForm.id
|
|
|
};
|
|
|
const { code, data, msg } = await getListBy(obj);
|
|
|
- Object.assign(tepNameForm, {
|
|
|
- tpName: "",
|
|
|
- id: ""
|
|
|
- });
|
|
|
if (code === 200) {
|
|
|
titleShow.value = true;
|
|
|
eaxmCard.value = data;
|
|
@@ -111,10 +109,6 @@ const getAddListByApi = async id => {
|
|
|
tpId: id
|
|
|
};
|
|
|
const { code, data, msg } = await getListBy(obj);
|
|
|
- Object.assign(tepNameForm, {
|
|
|
- tpName: "",
|
|
|
- id: ""
|
|
|
- });
|
|
|
if (code === 200) {
|
|
|
titleShow.value = true;
|
|
|
eaxmCard.value = data;
|
|
@@ -185,13 +179,15 @@ const backChange = () => {
|
|
|
};
|
|
|
const save = () => {
|
|
|
if (titleShow.value) {
|
|
|
+ console.log("触发");
|
|
|
+
|
|
|
router.back();
|
|
|
useAppStoreHook().toggleSideBar(true, "打开");
|
|
|
} else {
|
|
|
formRef.value.validate(valid => {
|
|
|
if (valid) {
|
|
|
if (tepNameForm.id) {
|
|
|
- getListByApi();
|
|
|
+ getAddListByApi(tepNameForm.id);
|
|
|
} else {
|
|
|
postAddTemplateApi();
|
|
|
}
|
|
@@ -234,7 +230,7 @@ const editPen = (item, order) => {
|
|
|
editDrawer.value.open(item, "编辑", order);
|
|
|
};
|
|
|
// 删除考核维度
|
|
|
-const deletePen = index => {
|
|
|
+const deletePen = item => {
|
|
|
ElMessageBox.confirm(
|
|
|
"该维度删除后不可恢复,请谨慎操作!",
|
|
|
"确定删除考核维度",
|
|
@@ -246,9 +242,10 @@ const deletePen = index => {
|
|
|
)
|
|
|
.then(async () => {
|
|
|
// eaxmCard.value.splice(index, 1);
|
|
|
- const { code, msg } = await getDimensionRemove(index);
|
|
|
+ const { code, msg } = await getDimensionRemove(item.id);
|
|
|
if (code === 200) {
|
|
|
getListByApi();
|
|
|
+ // getListByApi();
|
|
|
ElMessage({
|
|
|
type: "success",
|
|
|
message: "删除成功"
|
|
@@ -364,7 +361,7 @@ const postUpdateApi = async (dimId, indId, order) => {
|
|
|
<div class="w-[100%] flex justify-evenly">
|
|
|
<div class="left-box">
|
|
|
<el-text class="cursor-pointer" @click="backChange"
|
|
|
- ><el-icon><ArrowLeft /></el-icon>返回</el-text
|
|
|
+ ><el-icon> <ArrowLeft /> </el-icon>返回</el-text
|
|
|
>
|
|
|
</div>
|
|
|
<div class="center-box">
|
|
@@ -376,13 +373,15 @@ const postUpdateApi = async (dimId, indId, order) => {
|
|
|
:class="{ 'step-success': !titleShow, 'step-error': titleShow }"
|
|
|
class="w-[100px] flex justify-center items-center"
|
|
|
>
|
|
|
- <one v-if="titleShow" /><two2 v-else />基础信息
|
|
|
+ <one v-if="titleShow" />
|
|
|
+ <two2 v-else />基础信息
|
|
|
</div>
|
|
|
<div
|
|
|
:class="{ 'step-success': titleShow, 'step-error': !titleShow }"
|
|
|
class="w-[100px] flex justify-center items-center"
|
|
|
>
|
|
|
- <two v-if="titleShow" /><one1 v-else />考核指标
|
|
|
+ <two v-if="titleShow" />
|
|
|
+ <one1 v-else />考核指标
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -437,12 +436,12 @@ const postUpdateApi = async (dimId, indId, order) => {
|
|
|
<div class="card-header">
|
|
|
<span>{{ item.dimName }}({{ item.dimWeight }}%)</span>
|
|
|
<div class="float-right mr-7">
|
|
|
- <el-icon class="mr-3" @click="editPen(item, index + 1)"
|
|
|
- ><EditPen
|
|
|
- /></el-icon>
|
|
|
- <el-icon @click="deletePen(item.id)"
|
|
|
- ><Delete class="text-red-500"
|
|
|
- /></el-icon>
|
|
|
+ <el-icon class="mr-3" @click="editPen(item, index + 1)">
|
|
|
+ <EditPen />
|
|
|
+ </el-icon>
|
|
|
+ <el-icon @click="deletePen(item)">
|
|
|
+ <Delete class="text-red-500" />
|
|
|
+ </el-icon>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -512,9 +511,9 @@ const postUpdateApi = async (dimId, indId, order) => {
|
|
|
/>
|
|
|
<el-table-column fixed="right" label="操作">
|
|
|
<template #default="{ row }">
|
|
|
- <el-icon class="mr-3" @click="settingIndex(row)"
|
|
|
- ><Setting
|
|
|
- /></el-icon>
|
|
|
+ <el-icon class="mr-3" @click="settingIndex(row)">
|
|
|
+ <Setting />
|
|
|
+ </el-icon>
|
|
|
<el-icon @click="deleteRow(row)">
|
|
|
<Delete class="text-red-500" />
|
|
|
</el-icon>
|