提交 9905b5d2 authored 作者: lidongxu's avatar lidongxu

refactor(plan): 促销计划操作部分删除不做限制

改为促销任务可以删除了
上级 58230685
...@@ -207,7 +207,6 @@ ...@@ -207,7 +207,6 @@
编辑 编辑
</el-button> </el-button>
<el-button type="danger" <el-button type="danger"
v-if="deleteBtnShow(scope.row)"
link link
:disabled="!selectableFn(scope.row)" :disabled="!selectableFn(scope.row)"
@click="deletePlane(scope.row)"> @click="deletePlane(scope.row)">
...@@ -1147,16 +1146,6 @@ const deletePlane = (row) => { ...@@ -1147,16 +1146,6 @@ const deletePlane = (row) => {
handleDelete() handleDelete()
} }
const handleDelete = async () => { const handleDelete = async () => {
// 如果当前选中的任务中,包含非当月的任务则提示禁止删除
const isNotThisMonth = checkedRowList.value.some(item => {
const date = new Date(item.date)
const now = new Date()
return date.getFullYear() !== now.getFullYear() || date.getMonth() !== now.getMonth()
})
if (isNotThisMonth) {
ElMessage.error('只能删除当月的计划')
return
}
// 弹出确认框 // 弹出确认框
await ElMessageBox.confirm('确认删除吗?', '提示', { await ElMessageBox.confirm('确认删除吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -1253,15 +1242,6 @@ const init = async () => { ...@@ -1253,15 +1242,6 @@ const init = async () => {
}; };
init() init()
// 删除按钮显示隐藏,只显示活动日期是当月的能删除
const deleteBtnShow = (row) => {
const date = new Date()
const rowDate = new Date(row.date)
if (rowDate.getMonth() === date.getMonth()) {
return true
}
}
</script> </script>
<style scoped <style scoped
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论