Commit 7a1daeb2 authored by 祁正's avatar 祁正

ccap项目管理-抽屉列表修改删除

parent 134265bf
......@@ -103,8 +103,8 @@
<el-table-column label="操作" align="center">
<template #default="scope" align="center">
<div >
<el-button type="text" style="color: rgb(0,0,255)" @click="handleView(scope.row)">编辑</el-button>
<el-button type="text" style="color: rgb(244,93,93)" @click="handleView(scope.row)">删除</el-button>
<el-button type="text" style="color: rgb(0,0,255)" @click="handleDrawerEdit(scope.row)">编辑</el-button>
<el-button type="text" style="color: rgb(244,93,93)" @click="handleDrawerDel(scope.row)">删除</el-button>
</div>
</template>
</el-table-column>
......@@ -126,7 +126,7 @@
width="500"
>
<div style="width: 85%;margin-left: 7.5%">
<el-form v-model="dialogForm" ref="dialogQueryRef" >
<el-form :rules="dialogRules" :model="dialogForm" ref="dialogQueryRef" >
<el-form-item label="项目:" prop="project" >
<el-input v-model="dialogForm.project" placeholder="请输入"/>
</el-form-item>
......@@ -150,7 +150,7 @@
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogCencal">取消</el-button>
<el-button type="primary" @click="dialogSave">
<el-button type="primary" @click="dialogSave(dialogForm)">
保存
</el-button>
</div>
......@@ -166,7 +166,9 @@ import {
getDataList,
getAllBusinessUnitList,
getProjectListById,
inserTableData
inserTableData,
deleteBatch,
updateCcap
} from "@/api/CCAPProjectManagement/list";
const { proxy } = getCurrentInstance();
......@@ -192,7 +194,8 @@ const dialogRules = {
const dialogForm = ref({
projectStatusId: null,
project: null,
groupName: null
groupName: null,
id:null
});
const queryParams = ref({
......@@ -228,6 +231,15 @@ function getDataProjectListById() {
});
}
function handleDrawerEdit(row){
dialogVisible.value = true;
addTitle.value = '编辑';
dialogForm.value.projectStatusId = drawerQueryParams.value.id;
dialogForm.value.id = row.id
dialogForm.value.groupName = row.groupName
dialogForm.value.project = row.project
}
function getBusinessList() {
getAllBusinessUnitList().then(res => {
console.log(res);
......@@ -245,14 +257,32 @@ function handleAdd() {
//对话框里面的保存
function dialogSave() {
console.log(dialogForm.value);
inserTableData(dialogForm.value).then(res=>{
console.log(res)
if(res.code === 200) {
ElMessage.success("新增成功")
dialogCencal()
getDataProjectListById()
dialogQueryRef.value.validate((valid)=>{
if (valid) {
//判断是新增还是保存
if(addTitle.value === '新增'){
inserTableData(dialogForm.value).then(res=>{
console.log(res)
if(res.code === 200) {
ElMessage.success("新增成功")
dialogCencal()
getDataProjectListById()
}
})
}else{
updateCcap(dialogForm.value).then(res=>{
console.log(res)
if(res.code === 200) {
ElMessage.success("修改成功")
dialogCencal()
getDataProjectListById()
}
})
}
}
})
// dialogQueryRef.value.validate((valid) => {
// if (valid) {
// console.log(dialogForm.value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment