批量修改到期时间完成

This commit is contained in:
caoqianming 2020-12-10 20:54:35 +08:00
parent 76adf5928b
commit 103f121523
3 changed files with 22 additions and 7 deletions

View File

@ -145,8 +145,8 @@ export function getConsumerPermAll(query) {
}
export function updateendConsumers(data) {
return request({
url: `/crm/consumer/updateends/`,
method: 'post',
url: `/crm/consumer/exceeddates/`,
method: 'put',
data
})
}

View File

@ -168,7 +168,7 @@
>批量删除</el-button>
<el-button
@click="handleUpdateends"
v-if="checkPermission(['consumer__updateends'])"
v-if="checkPermission(['consumer_exceeddates'])"
>批量修改到期</el-button>
<!-- <el-button
type="primary"
@ -203,9 +203,6 @@
<el-table-column label="手机号" sortable="custom" prop="username">
<template slot-scope="scope">{{ scope.row.username }}</template>
</el-table-column>
<el-table-column label="小程序OpenId" :show-overflow-tooltip="true">
<template slot-scope="scope">{{ scope.row.openid }}</template>
</el-table-column>
<el-table-column label="用户类型">
<template slot-scope="scope">{{ scope.row.role_name }}</template>
</el-table-column>
@ -231,6 +228,9 @@
<span>{{ scope.row.create_time.substring(0,10) }}</span>
</template>
</el-table-column>
<el-table-column label="过期日期">
<template slot-scope="scope">{{ scope.row.exceed_date }}</template>
</el-table-column>
<el-table-column align="left" label="操作" fixed="right" width="260">
<template slot-scope="scope">
<el-button-group>
@ -805,9 +805,13 @@ export default {
}
},
confirmupdateend(){
if(this.exceed_date.length()>0){
if(this.exceed_date.length>0){
updateendConsumers({ ids: this.selects,exceed_date:this.exceed_date }).then(res=>{
this.getList()
this.dateVisible = false
this.$message.success('成功')
}).catch(e=>{
this.dateVisible = false
})
}
}

View File

@ -244,6 +244,17 @@ class ConsumerViewSet(ModelViewSet):
Consumer.objects.filter(id__in = ids).delete()
return Response(status=status.HTTP_200_OK)
@action(methods=['put'], detail=False, url_name='consumer_exceeddates',perms_map=[{'*':'consumer_exceeddates'}])
def exceeddates(self, request):
"""
批量用户截至期限
"""
ids = request.data.get('ids', None)
exceed_date = request.data.get('exceed_date')
if ids:
Consumer.objects.filter(id__in = ids).update(exceed_date=exceed_date)
return Response(status=status.HTTP_200_OK)
@action(methods=['get'], detail=False,
url_path='subjectpaid', url_name='subject_paid',perms_map=[{'*':'my_subject'}])
def has_paid(self, request):