You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
136 lines
4.2 KiB
136 lines
4.2 KiB
![]()
2 weeks ago
|
<template>
|
||
|
<div>
|
||
|
<el-form :model="searchForm" inline>
|
||
|
<el-form-item>
|
||
|
<el-input v-model="searchForm.phone" placeholder="学员手机号" />
|
||
|
</el-form-item>
|
||
|
<el-form-item>
|
||
|
<el-select v-model="searchForm.cartype" placeholder="选择车型" clearable filterable>
|
||
|
<el-option label="小车" value="1001" />
|
||
|
<el-option label="摩托车" value="1002" />
|
||
|
</el-select>
|
||
|
</el-form-item>
|
||
|
<el-form-item>
|
||
|
<el-select v-model="searchForm.vipType" placeholder="选择会员类型" clearable filterable>
|
||
|
<el-option
|
||
|
v-for="item in vipTypeOptions"
|
||
|
:key="item.value"
|
||
|
:label="item.label"
|
||
|
:value="item.value"
|
||
|
/>
|
||
|
</el-select>
|
||
|
</el-form-item>
|
||
|
<el-form-item>
|
||
|
<el-button @click="searchList">查询</el-button>
|
||
|
<el-button type="primary" @click="addVipUser">赠送会员</el-button>
|
||
|
</el-form-item>
|
||
|
</el-form>
|
||
|
<el-table v-loading="loading" :data="tableList">
|
||
|
<el-table-column type="index" width="55" align="center" />
|
||
|
<el-table-column label="手机号" align="center" prop="phone" min-width="140" />
|
||
|
<el-table-column label="会员名" align="center" prop="memberName" min-width="140" />
|
||
|
<el-table-column label="车型" align="center" prop="carName" min-width="100" />
|
||
|
<el-table-column label="科目" align="center" prop="subjects" min-width="100" />
|
||
|
<el-table-column label="开始时间" align="center" prop="startDate" min-width="100" />
|
||
|
<el-table-column label="结束时间" align="center" prop="endDate" min-width="100" />
|
||
|
<el-table-column label="操作人" align="center" prop="" min-width="100" />
|
||
|
<el-table-column label="操作时间" align="center" prop="" min-width="100" />
|
||
|
</el-table>
|
||
|
<pagination
|
||
|
v-show="total > 0"
|
||
|
:total="total"
|
||
|
v-model:page="searchForm.pageNo"
|
||
|
v-model:limit="searchForm.pageSize"
|
||
|
@pagination="getList"
|
||
|
/>
|
||
|
|
||
|
<el-dialog title="赠送会员" v-model="showDialog" width="500px">
|
||
|
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||
|
<el-form-item label="手机号" prop="phone">
|
||
|
<el-input v-model="form.phone" maxlength="11" />
|
||
|
</el-form-item>
|
||
|
<el-form-item label="会员类型" prop="vipType">
|
||
|
<el-select v-model="form.vipType" clearable filterable style="width: 100%">
|
||
|
<el-option
|
||
|
v-for="item in vipTypeOptions"
|
||
|
:key="item.value"
|
||
|
:label="item.label"
|
||
|
:value="item.value"
|
||
|
/>
|
||
|
</el-select>
|
||
|
</el-form-item>
|
||
|
</el-form>
|
||
|
|
||
|
<template #footer>
|
||
|
<span>
|
||
|
<el-button @click="showDialog = false">取消</el-button>
|
||
|
<el-button type="primary" @click="sureAdd">确定</el-button>
|
||
|
</span>
|
||
|
</template>
|
||
|
</el-dialog>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script setup name="VipUser">
|
||
|
import { getUserMemberList } from '@/api/xjapplet/vip'
|
||
|
const message = useMessage()
|
||
|
const searchForm = ref({
|
||
|
phone: '',
|
||
|
pageNo: 1,
|
||
|
pageSize: 50
|
||
|
})
|
||
|
|
||
|
const loading = ref(false)
|
||
|
const tableList = ref([])
|
||
|
const total = ref(0)
|
||
|
|
||
|
const vipTypeOptions = ref([
|
||
|
{ label: '普通会员', value: '1' },
|
||
|
{ label: 'VIP会员', value: '2' }
|
||
|
])
|
||
|
|
||
|
function searchList() {
|
||
|
searchForm.value.pageNo = 1
|
||
|
getList()
|
||
|
}
|
||
|
|
||
|
function getList() {
|
||
|
loading.value = true
|
||
|
getUserMemberList(searchForm.value).then((response) => {
|
||
|
if (response.code === 200) {
|
||
|
tableList.value = response.data
|
||
|
total.value = response.total
|
||
|
loading.value = false
|
||
|
}
|
||
|
})
|
||
|
}
|
||
|
|
||
|
const showDialog = ref(false)
|
||
|
const form = ref({
|
||
|
phone: '',
|
||
|
vipType: ''
|
||
|
})
|
||
|
const rules = ref({
|
||
|
phone: [{ required: true, message: '请输入用户手机号', trigger: 'blur' }],
|
||
|
vipType: [{ required: true, message: '请选择会员类型', trigger: 'change' }]
|
||
|
})
|
||
|
|
||
|
function addVipUser() {
|
||
|
showDialog.value = true
|
||
|
}
|
||
|
|
||
|
const formRef = ref(null)
|
||
|
async function sureAdd() {
|
||
|
if (!formRef.value) return
|
||
|
const valid = await formRef.value.validate()
|
||
|
if (!valid) return
|
||
|
|
||
|
// 调用接口
|
||
|
showDialog.value = false
|
||
|
message.success('赠送成功')
|
||
|
searchList()
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss" scoped></style>
|