批量删除功能调整
This commit is contained in:
parent
a667f9c8c8
commit
49c0f91ff0
|
|
@ -70,15 +70,15 @@
|
||||||
>
|
>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<el-button slot="reference">导入分子公司能力</el-button>
|
<el-button slot="reference">导入分子公司能力</el-button>
|
||||||
|
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
<el-button @click="delAll()" v-if="checkPermission(['cma_deletes'])">批量删除</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 20px">
|
|
||||||
|
|
||||||
<el-button @click="delAll()" type="danger" v-if="checkPermission(['cma_deletes'])">批量删除</el-button>
|
|
||||||
<el-button @click="toggleSelection()">取消选择</el-button>
|
|
||||||
</div>
|
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="listLoading"
|
v-loading="listLoading"
|
||||||
:data="cmaList.results"
|
:data="cmaList.results"
|
||||||
|
|
@ -375,9 +375,7 @@ export default {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
toggleSelection() {
|
|
||||||
this.$refs.filterTable.clearSelection();
|
|
||||||
},
|
|
||||||
delAll() {
|
delAll() {
|
||||||
this.$confirm("确认删除?", "警告", {
|
this.$confirm("确认删除?", "警告", {
|
||||||
confirmButtonText: "确认",
|
confirmButtonText: "确认",
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,13 @@ class CMAViewSet(ModelViewSet):
|
||||||
if i[group_by] and i['count']:
|
if i[group_by] and i['count']:
|
||||||
ret.append({'text':i[group_by]+'('+ str(i['count']) +')','value':i[group_by]})
|
ret.append({'text':i[group_by]+'('+ str(i['count']) +')','value':i[group_by]})
|
||||||
return Response(ret)
|
return Response(ret)
|
||||||
|
@action(methods=['post'], detail=False, url_path='deletes', url_name='cma_deletes', perms_map = {'post':'cma_deletes'})
|
||||||
|
def deletes(self, request):
|
||||||
|
|
||||||
|
array = request.data['ids']
|
||||||
|
CMA.objects.filter(pk__in=array).delete()
|
||||||
|
|
||||||
|
return Response(status = status.HTTP_200_OK)
|
||||||
@action(methods=['post'], detail=False, url_path='import', url_name='cma_import', perms_map = {'post':'cma_import'})
|
@action(methods=['post'], detail=False, url_path='import', url_name='cma_import', perms_map = {'post':'cma_import'})
|
||||||
def cma_import(self, request, pk=None):
|
def cma_import(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
|
@ -75,7 +81,6 @@ class CMAViewSet(ModelViewSet):
|
||||||
else:
|
else:
|
||||||
return Response('不支持非xlsx格式', status = status.HTTP_400_BAD_REQUEST)
|
return Response('不支持非xlsx格式', status = status.HTTP_400_BAD_REQUEST)
|
||||||
return Response(status = status.HTTP_200_OK)
|
return Response(status = status.HTTP_200_OK)
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, url_path='import2', url_name='cma_import2', perms_map = {'post':'cma_import2'})
|
@action(methods=['post'], detail=False, url_path='import2', url_name='cma_import2', perms_map = {'post':'cma_import2'})
|
||||||
def cma_import2(self, request, pk=None):
|
def cma_import2(self, request, pk=None):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue