|
@ -22,7 +22,12 @@ |
|
|
<el-table-column prop="createTime" :formatter="changeDate" label="创建日期" sortable></el-table-column> |
|
|
<el-table-column prop="createTime" :formatter="changeDate" label="创建日期" sortable></el-table-column> |
|
|
<el-table-column label="操作" key="slot"> |
|
|
<el-table-column label="操作" key="slot"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<el-popconfirm title="确定删除这条业务吗?" confirm-button-text="确定" cancel-button-text="再想想" @confirm="deleteBusiness"> |
|
|
<el-popconfirm |
|
|
|
|
|
title="确定删除这条业务吗?" |
|
|
|
|
|
confirm-button-text="确定" |
|
|
|
|
|
cancel-button-text="再想想" |
|
|
|
|
|
@confirm="deleteBusiness(scope.row)" |
|
|
|
|
|
> |
|
|
<template #reference> |
|
|
<template #reference> |
|
|
<el-button type="text" size="small">删除</el-button> |
|
|
<el-button type="text" size="small">删除</el-button> |
|
|
</template> |
|
|
</template> |
|
@ -41,9 +46,11 @@ |
|
|
|
|
|
|
|
|
<script setup> |
|
|
<script setup> |
|
|
import { useRouter } from 'vue-router'; |
|
|
import { useRouter } from 'vue-router'; |
|
|
import { defineProps } from 'vue'; |
|
|
import { defineProps, defineEmits } from 'vue'; |
|
|
import { useStore } from 'vuex'; |
|
|
import { useStore } from 'vuex'; |
|
|
import time from 'utils/time'; |
|
|
import time from 'utils/time'; |
|
|
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
|
|
import { delBusiness } from '@/apis/business.js'; |
|
|
|
|
|
|
|
|
const router = useRouter(); |
|
|
const router = useRouter(); |
|
|
const store = useStore(); |
|
|
const store = useStore(); |
|
@ -55,6 +62,8 @@ defineProps({ |
|
|
showConfig: { default: false, type: Boolean }, |
|
|
showConfig: { default: false, type: Boolean }, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['handleQueryBusiness']); |
|
|
|
|
|
|
|
|
function change(row) { |
|
|
function change(row) { |
|
|
console.log('row: ', row); |
|
|
console.log('row: ', row); |
|
|
} |
|
|
} |
|
@ -73,10 +82,15 @@ function changeDate(row) { |
|
|
* 删除业务 |
|
|
* 删除业务 |
|
|
* @param {String} businessId |
|
|
* @param {String} businessId |
|
|
*/ |
|
|
*/ |
|
|
function deleteBusiness() { |
|
|
async function deleteBusiness(row) { |
|
|
try { |
|
|
try { |
|
|
// 这里写接口 记得加 async await |
|
|
// 这里写接口 记得加 async await |
|
|
|
|
|
const params = { param: { businessId: row.id } }; |
|
|
|
|
|
await delBusiness(params); |
|
|
|
|
|
emit('handleQueryBusiness'); |
|
|
|
|
|
ElMessage.success('删除成功'); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
|
|
|
ElMessage.error(error || '删除失败'); |
|
|
console.error('error: ', error); |
|
|
console.error('error: ', error); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|