批量修改到期时间完成
This commit is contained in:
parent
76adf5928b
commit
103f121523
|
@ -145,8 +145,8 @@ export function getConsumerPermAll(query) {
|
||||||
}
|
}
|
||||||
export function updateendConsumers(data) {
|
export function updateendConsumers(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/crm/consumer/updateends/`,
|
url: `/crm/consumer/exceeddates/`,
|
||||||
method: 'post',
|
method: 'put',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
|
@ -168,7 +168,7 @@
|
||||||
>批量删除</el-button>
|
>批量删除</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
@click="handleUpdateends"
|
@click="handleUpdateends"
|
||||||
v-if="checkPermission(['consumer__updateends'])"
|
v-if="checkPermission(['consumer_exceeddates'])"
|
||||||
>批量修改到期</el-button>
|
>批量修改到期</el-button>
|
||||||
<!-- <el-button
|
<!-- <el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
|
@ -203,9 +203,6 @@
|
||||||
<el-table-column label="手机号" sortable="custom" prop="username">
|
<el-table-column label="手机号" sortable="custom" prop="username">
|
||||||
<template slot-scope="scope">{{ scope.row.username }}</template>
|
<template slot-scope="scope">{{ scope.row.username }}</template>
|
||||||
</el-table-column>
|
</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="用户类型">
|
<el-table-column label="用户类型">
|
||||||
<template slot-scope="scope">{{ scope.row.role_name }}</template>
|
<template slot-scope="scope">{{ scope.row.role_name }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -231,6 +228,9 @@
|
||||||
<span>{{ scope.row.create_time.substring(0,10) }}</span>
|
<span>{{ scope.row.create_time.substring(0,10) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<el-table-column align="left" label="操作" fixed="right" width="260">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
|
@ -805,9 +805,13 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
confirmupdateend(){
|
confirmupdateend(){
|
||||||
if(this.exceed_date.length()>0){
|
if(this.exceed_date.length>0){
|
||||||
updateendConsumers({ ids: this.selects,exceed_date:this.exceed_date }).then(res=>{
|
updateendConsumers({ ids: this.selects,exceed_date:this.exceed_date }).then(res=>{
|
||||||
|
this.getList()
|
||||||
|
this.dateVisible = false
|
||||||
this.$message.success('成功')
|
this.$message.success('成功')
|
||||||
|
}).catch(e=>{
|
||||||
|
this.dateVisible = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -244,6 +244,17 @@ class ConsumerViewSet(ModelViewSet):
|
||||||
Consumer.objects.filter(id__in = ids).delete()
|
Consumer.objects.filter(id__in = ids).delete()
|
||||||
return Response(status=status.HTTP_200_OK)
|
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,
|
@action(methods=['get'], detail=False,
|
||||||
url_path='subjectpaid', url_name='subject_paid',perms_map=[{'*':'my_subject'}])
|
url_path='subjectpaid', url_name='subject_paid',perms_map=[{'*':'my_subject'}])
|
||||||
def has_paid(self, request):
|
def has_paid(self, request):
|
||||||
|
|
Loading…
Reference in New Issue