From 62633a3dab1f6c4b5ac0cc8d9e4a3d120593a6f3 Mon Sep 17 00:00:00 2001 From: shj <1790240199@qq.com> Date: 星期二, 02 八月 2022 11:07:43 +0800 Subject: [PATCH] 对接 --- src/views/goalManagement/performanceAppraisal/component/DailogKh.vue | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/views/goalManagement/performanceAppraisal/component/DailogKh.vue b/src/views/goalManagement/performanceAppraisal/component/DailogKh.vue index c76c1fd..2c51d4a 100644 --- a/src/views/goalManagement/performanceAppraisal/component/DailogKh.vue +++ b/src/views/goalManagement/performanceAppraisal/component/DailogKh.vue @@ -63,7 +63,7 @@ </el-form> <el-tabs v-model="activeName" class="demo-tabs"> <el-tab-pane label="目标指标分解" name="1"> - <el-button type="primary" size="default" @click="daiAdd('新增', '')">新增</el-button> + <el-button type="primary" size="default" @click="daiAdd('新增','')">新增</el-button> </el-tab-pane> </el-tabs> <el-table :data="form.examineItemList" style="width: 100%"> @@ -75,6 +75,8 @@ <el-table-column align="center" label="操作"> <template #default="scope"> <el-button link type="primary" @click="daiAdd('查看', scope.row)">查看</el-button> + <el-button link type="primary" @click="daiAdd('修改', scope.row)">修改</el-button> + <el-button link type="primary" @click="deleteA(scope.row)">删除</el-button> </template> </el-table-column> </el-table> @@ -132,7 +134,15 @@ }; // 接受传值 const AddObj = (val: any) => { - form.value.examineItemList.push(val); + if (index.value == -1) { + form.value.examineItemList.push(val); + } else { + form.value.examineItemList[index.value] = val; + } + }; + // 删除 + const deleteA = (tag: any) => { + form.value.examineItemList.splice(form.value.examineItemList.indexOf(tag), 1); }; // 提交 const submitForm = () => { @@ -179,8 +189,10 @@ }; const activeName = ref('1'); // 新增弹窗 + const index = ref<any>(); const Show = ref(); const daiAdd = (title: string, data: any) => { + index.value = form.value.examineItemList.indexOf(data); Show.value.openDailog(title, data); }; // 安全目标指标弹窗 @@ -198,8 +210,10 @@ } }; return { + index, form, dialogVisible, + deleteA, AddObj, openDailog, activeName, -- Gitblit v1.9.2