|
@@ -3,12 +3,17 @@ defineOptions({
|
|
|
name: "evaluateNewAdd"
|
|
|
});
|
|
|
import { ref, reactive, onMounted } from "vue";
|
|
|
+import one from "@/assets/svg/2.svg";
|
|
|
+import two from "@/assets/svg/1.svg";
|
|
|
+import one1 from "@/assets/svg/2-2.svg";
|
|
|
+import two2 from "@/assets/svg/1-1.svg";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
import { Edit } from "@element-plus/icons-vue";
|
|
|
import { ElMessageBox, ElMessage } from "element-plus";
|
|
|
import { postAddDimension, getDimensionRemove } from "@/api/dimension";
|
|
|
import editMould from "./editMould.vue";
|
|
|
import settingIndexDrawer from "./settingIndexDrawer.vue";
|
|
|
+import { postAddTemplate, getInfoRelation } from "@/api/templateInfo";
|
|
|
import importIndex from "./importIndex.vue";
|
|
|
import { useNav } from "@/layout/hooks/useNav";
|
|
|
const { toggleSideBar } = useNav();
|
|
@@ -18,6 +23,7 @@ const formRef = ref();
|
|
|
const active = ref(0);
|
|
|
const editDrawer = ref();
|
|
|
const editDrawerShow = ref(false);
|
|
|
+const titleShow = ref(false);
|
|
|
// 指标设置
|
|
|
const settingIndexDrawerRef = ref();
|
|
|
const settingIndexDrawerShow = ref(false);
|
|
@@ -32,18 +38,40 @@ const tepName = ref();
|
|
|
onMounted(() => {
|
|
|
if (route.query.tpName) {
|
|
|
tepNameForm.tpName = route.query.tpName;
|
|
|
+ tepNameForm.id = route.query.id;
|
|
|
}
|
|
|
});
|
|
|
const tepNameForm = reactive({
|
|
|
- tpName: ""
|
|
|
+ tpName: "",
|
|
|
+ id: ""
|
|
|
});
|
|
|
+const postAddTemplateApi = async () => {
|
|
|
+ const res = await postAddTemplate({ ...tepNameForm });
|
|
|
+ if (res.code === 200) {
|
|
|
+ ElMessage({
|
|
|
+ message: "创建成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ console.log("res", res.data);
|
|
|
+ tepNameForm.tpName = res.data.tpName;
|
|
|
+ tepNameForm.id = res.data.id;
|
|
|
+ titleShow.value = true;
|
|
|
+ } else {
|
|
|
+ ElMessage.error(res.msg);
|
|
|
+ }
|
|
|
+};
|
|
|
// 考核维度卡片
|
|
|
-const eaxmCard = ref([
|
|
|
- { name: "工作量", value: 1 }
|
|
|
- // { name: "效率", value: 2 },
|
|
|
- // { name: "考核维度", value: 3 },
|
|
|
- // { name: "维度", value: 4 }
|
|
|
-]);
|
|
|
+const eaxmCard = ref([{ name: "工作量", value: 1 }]);
|
|
|
+// 获取指标信息
|
|
|
+const getInfoRelationApi = async () => {
|
|
|
+ const { code, data, msg } = await getInfoRelation(tepNameForm.id);
|
|
|
+ console.log("data", data);
|
|
|
+ if (code === 200) {
|
|
|
+ titleShow.value = true;
|
|
|
+ } else {
|
|
|
+ ElMessage.error(msg);
|
|
|
+ }
|
|
|
+};
|
|
|
const addDimension = reactive({
|
|
|
list: [
|
|
|
{
|
|
@@ -90,10 +118,11 @@ const tableData = ref([
|
|
|
]);
|
|
|
const save = () => {
|
|
|
formRef.value.validate(valid => {
|
|
|
- console.log(valid);
|
|
|
if (valid) {
|
|
|
- if (active.value++ > 2) {
|
|
|
- active.value = 0;
|
|
|
+ if (tepNameForm.id) {
|
|
|
+ getInfoRelationApi();
|
|
|
+ } else {
|
|
|
+ postAddTemplateApi();
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -184,34 +213,30 @@ const importIndexDialog = row => {
|
|
|
>
|
|
|
</div>
|
|
|
<div class="center-box">
|
|
|
- <!-- <el-menu
|
|
|
- default-active="1"
|
|
|
- class="el-menu-demo flex justify-evenly"
|
|
|
- mode="horizontal"
|
|
|
- @select="handleSelect"
|
|
|
- >
|
|
|
- <el-menu-item index="1">基础信息</el-menu-item>
|
|
|
- <el-menu-item index="2">考核指标</el-menu-item>
|
|
|
- <el-menu-item index="3">考核流程</el-menu-item>
|
|
|
- </el-menu> -->
|
|
|
- <el-steps
|
|
|
- style="max-width: 600px"
|
|
|
- :active="active"
|
|
|
- finish-status="success"
|
|
|
- class="m-auto"
|
|
|
- simple
|
|
|
+ <div
|
|
|
+ style="max-width: 220px"
|
|
|
+ class="m-auto flex justify-between items-center"
|
|
|
>
|
|
|
- <el-step title="基础信息" :icon="Edit" />
|
|
|
- <el-step title="考核指标" :icon="Edit" />
|
|
|
- <!-- <el-step title="考核流程" :icon="Edit" /> -->
|
|
|
- </el-steps>
|
|
|
+ <div
|
|
|
+ :class="{ 'step-success': !titleShow, 'step-error': titleShow }"
|
|
|
+ class="w-[100px] flex justify-center items-center"
|
|
|
+ >
|
|
|
+ <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 />考核指标
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="right-box">
|
|
|
<el-button type="primary" class="mr-2" @click="save()">保存</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="mt-2">
|
|
|
- <div v-if="active == 0" class="w-[40%] m-auto mt-10">
|
|
|
+ <div v-if="!titleShow" class="w-[40%] m-auto mt-10">
|
|
|
<el-form
|
|
|
ref="formRef"
|
|
|
:model="tepNameForm"
|
|
@@ -236,7 +261,7 @@ const importIndexDialog = row => {
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
- <div v-if="active == 1" class="w-[90%] m-auto mt-4">
|
|
|
+ <div v-else class="w-[90%] m-auto mt-4">
|
|
|
<div class="relative h-10">
|
|
|
<el-button class="float-right" type="primary" plain @click="createAdd"
|
|
|
>创建考核维度</el-button
|
|
@@ -308,4 +333,27 @@ const importIndexDialog = row => {
|
|
|
justify-content: center;
|
|
|
margin: auto;
|
|
|
}
|
|
|
+
|
|
|
+.step-success {
|
|
|
+ height: 24px;
|
|
|
+ padding-bottom: 5px;
|
|
|
+ font-size: 16px;
|
|
|
+ // font-family: PingFangSC-SNaNpxibold;
|
|
|
+ font-weight: 600;
|
|
|
+ line-height: 24px;
|
|
|
+ color: black;
|
|
|
+ color: #000000e6;
|
|
|
+ border-bottom: 2px solid #022bbd;
|
|
|
+}
|
|
|
+
|
|
|
+.step-error {
|
|
|
+ height: 24px;
|
|
|
+ padding-bottom: 5px;
|
|
|
+ font-size: 16px;
|
|
|
+ // font-family: PingFangSC-SNaNpxibold;
|
|
|
+ font-weight: 600;
|
|
|
+ line-height: 24px;
|
|
|
+ color: #0006;
|
|
|
+ letter-spacing: 0;
|
|
|
+}
|
|
|
</style>
|