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