fix : 年度计划删除
This commit is contained in:
@@ -88,3 +88,4 @@ export const approvePlan= (data) => {
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ serveice.interceptors.response.use(response => {
|
||||
case 402:
|
||||
break;
|
||||
case 403:
|
||||
console.log(response)
|
||||
ElNotification({
|
||||
title: '系统提示',
|
||||
message: response.data.msg,
|
||||
|
||||
@@ -1,13 +1,27 @@
|
||||
<template>
|
||||
<baseTitle title="年度计划"></baseTitle>
|
||||
<!-- <fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>-->
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick" ></fvTable>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig" @headBtnClick="headBtnClick"></fvTable>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
import {deletePlan} from "@/api/project-demand/summary";
|
||||
import {ElNotification} from "element-plus";
|
||||
|
||||
const tableIns = ref()
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const searchConfig = ref([
|
||||
{
|
||||
label: '年度计划名称',
|
||||
prop: 'annualPlanName',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入',
|
||||
clearable: true
|
||||
},
|
||||
}
|
||||
])
|
||||
const tableConfig = reactive({
|
||||
columns: [
|
||||
// {
|
||||
@@ -31,22 +45,24 @@ const tableConfig = reactive({
|
||||
fixed: 'right',
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => {
|
||||
let btn = []
|
||||
btn.push({label: '详情', func: () => handleDetail(row), type: 'primary'})
|
||||
let perm = ['annual:plan:del']
|
||||
return (
|
||||
<div style={{width: '100%'}}>
|
||||
{
|
||||
btn.map(item => (
|
||||
<el-button
|
||||
type={item.type}
|
||||
// v-perm={item.prem}
|
||||
onClick={() => item.func()}
|
||||
link
|
||||
>
|
||||
{item.label}
|
||||
</el-button>
|
||||
))
|
||||
}
|
||||
<el-button
|
||||
type='primary'
|
||||
onClick={() => handleDetail(row)}
|
||||
link
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type='danger'
|
||||
v-perm={perm}
|
||||
onClick={() => handleDelete(row)}
|
||||
link
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -62,7 +78,13 @@ const headBtnClick = (key) => {
|
||||
break;
|
||||
}
|
||||
}
|
||||
const handleDetail=(row)=>{
|
||||
const search = (val) => {
|
||||
let obj = {...val}
|
||||
tableConfig.params = obj
|
||||
tableIns.value.refresh()
|
||||
}
|
||||
|
||||
const handleDetail = (row) => {
|
||||
router.push({
|
||||
name: 'Plan/detail',
|
||||
query: {
|
||||
@@ -70,6 +92,16 @@ const handleDetail=(row)=>{
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleDelete = (row) => {
|
||||
deletePlan(row.annualPlanId).then(res => {
|
||||
console.log(res)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user