This commit is contained in:
许允枞 2024-11-20 15:36:09 +08:00
parent 485565f112
commit 93d689853e
2 changed files with 28 additions and 4 deletions

View File

@ -178,4 +178,11 @@ export function delCustomerSource(id) {
method: 'post' method: 'post'
}) })
} }
export function delCustomerSourceBatch(data) {
return request({
url: '/partnerOwn/partner/delCustomerSourceBatch' ,
method: 'post',
data:data
})
}

View File

@ -25,6 +25,15 @@
@click="handleAdd" @click="handleAdd"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-minus"
size="mini"
@click="handleDelete"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -88,7 +97,7 @@
</template> </template>
<script> <script>
import { getCustomerSource,addCustomerSource,delCustomerSource} from "./api/index"; import {getCustomerSource, addCustomerSource, delCustomerSource, delCustomerSourceBatch} from "./api/index";
import { getData,updateData} from "@/api/system/dict/data"; import { getData,updateData} from "@/api/system/dict/data";
export default { export default {
@ -232,7 +241,7 @@
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.dictCode) this.ids = selection.map(item => item.id)
this.single = selection.length!=1 this.single = selection.length!=1
this.multiple = !selection.length this.multiple = !selection.length
}, },
@ -270,9 +279,17 @@
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const dictCodes = row.dictCode || this.ids; console.log('当前行',row)
let dictCodes = []
if (row.id) {
console.log('看看执行')
dictCodes.push(row.id)
} else if (this.ids) {
dictCodes = this.ids
console.log('看看执行ids')
}
this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() {
return delCustomerSource(dictCodes); return delCustomerSourceBatch(dictCodes);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");