增加批量操作
This commit is contained in:
@@ -38,6 +38,20 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 12, md: 12 } : { span: 12 }">
|
||||
<el-form-item label="解锁时间:">
|
||||
<el-date-picker
|
||||
unlink-panels
|
||||
v-model="where.dateRange"
|
||||
range-separator="-"
|
||||
type="daterange"
|
||||
end-placeholder="结束日期"
|
||||
start-placeholder="开始日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
class="ele-fluid"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
|
||||
<div class="ele-form-actions">
|
||||
<el-button
|
||||
@@ -62,7 +76,8 @@ export default {
|
||||
const defaultWhere = {
|
||||
username: '',
|
||||
type: '',
|
||||
ifSend: ''
|
||||
ifSend: '',
|
||||
dateRange: ''
|
||||
}
|
||||
return {
|
||||
// 表单数据
|
||||
|
||||
@@ -13,6 +13,15 @@
|
||||
>
|
||||
<!-- 表头工具栏 -->
|
||||
<template v-slot:toolbar>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
class="ele-btn-icon"
|
||||
@click="sendBatch"
|
||||
>
|
||||
批量标记发放
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@@ -51,6 +60,13 @@ export default {
|
||||
return {
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{
|
||||
columnKey: 'selection',
|
||||
type: 'selection',
|
||||
width: 50,
|
||||
align: 'center',
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
prop: 'mobile',
|
||||
label: '线索',
|
||||
@@ -155,7 +171,8 @@ export default {
|
||||
showEdit: false,
|
||||
// 是否显示导入弹窗
|
||||
showImport: false,
|
||||
title: '用户佣金'
|
||||
title: '用户佣金',
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -203,16 +220,46 @@ export default {
|
||||
})
|
||||
},
|
||||
setSend(row) {
|
||||
if (this.loading) {
|
||||
return
|
||||
}
|
||||
this.$confirm('确定要标记【' + row['mobile'] + '】已发放吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
updateCmmssnSend({ id: row.id }).then((res) => {
|
||||
this.loading = true
|
||||
updateCmmssnSend({ ids: [row.id] }).then((res) => {
|
||||
this.$message.success(res)
|
||||
this.reload()
|
||||
}).catch((e) => {
|
||||
this.$message.error(e.message)
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
sendBatch() {
|
||||
if (!this.selection.length) {
|
||||
this.$message.error('请至少选择一条数据')
|
||||
return
|
||||
}
|
||||
if (this.loading) {
|
||||
return
|
||||
}
|
||||
this.$confirm('确定要批量标记发放选中数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.loading = true
|
||||
updateCmmssnSend({ ids: this.selection.map((d) => d.id) }).then((res) => {
|
||||
this.$message.success(res)
|
||||
this.reload()
|
||||
}).catch((e) => {
|
||||
this.$message.error(e.message)
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user