Merge branch 'main' of http://114.215.207.150:3000/qiushanhe/ss-tiku-manage-web into dev-cl
This commit is contained in:
@@ -8,7 +8,7 @@ VITE_DEV=true
|
||||
|
||||
# VITE_BASE_URL='http://47.98.161.246:48080'
|
||||
# VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
# VITE_BASE_URL='http://114.215.207.150:48080'
|
||||
VITE_BASE_URL='http://114.215.207.150:48080'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'
|
||||
|
||||
@@ -30,3 +30,10 @@ export const getCustomerExamCarType = () => {
|
||||
export const importStudent = async (data) => {
|
||||
return await request.upload({ url: '/admin-api/applet/xunjia/user/import', data })
|
||||
}
|
||||
|
||||
export const getAppletUserList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/user/pageList',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -30,3 +30,10 @@ export const getResellDetail = async (id) => {
|
||||
url: '/admin-api/applet/xunjia/distribution/' + id
|
||||
})
|
||||
}
|
||||
|
||||
export const getResellSimpleList = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/distribution/simple-list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ export const updateVipType = async (data) => {
|
||||
|
||||
export const deleteVipType = async (id) => {
|
||||
return await request.delete({
|
||||
url: '/admin-api/applet/xunjia/member/memberId?id=' + id
|
||||
url: '/admin-api/applet/xunjia/member/delete?memberId=' + id
|
||||
})
|
||||
}
|
||||
|
||||
@@ -47,3 +47,10 @@ export const getVipTypeOptions = async (params) => {
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export const getRechargeRecords = async (params) => {
|
||||
return await request.get({
|
||||
url: '/admin-api/applet/xunjia/pay/list',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
@@ -34,9 +34,7 @@ router.beforeEach(async (to, from, next) => {
|
||||
// next({ path: '/' })
|
||||
if (to.query?.tenantId && to.query?.appId) {
|
||||
setApp(to.query.tenantId, to.query.appId)
|
||||
// setTimeout(() => {
|
||||
// next({ path: '/' })
|
||||
// }, 1500)
|
||||
await waitTime(1500)
|
||||
}
|
||||
next({ path: '/' })
|
||||
} else {
|
||||
@@ -80,6 +78,14 @@ router.beforeEach(async (to, from, next) => {
|
||||
}
|
||||
})
|
||||
|
||||
async function waitTime(seconds) {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve()
|
||||
}, seconds)
|
||||
})
|
||||
}
|
||||
|
||||
function setApp(tenantId, appId) {
|
||||
setTenantId(tenantId)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.resellMan"
|
||||
v-model="searchForm.distributionld"
|
||||
placeholder="选择分销人"
|
||||
clearable
|
||||
filterable
|
||||
@@ -30,6 +30,8 @@
|
||||
v-model="searchForm.createDate"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
start-placeholder="注册日期"
|
||||
end-placeholder="注册日期"
|
||||
/>
|
||||
@@ -43,8 +45,8 @@
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="手机号码" prop="phone" width="120" />
|
||||
<el-table-column label="分销人" prop="distributionName" min-width="120" />
|
||||
<el-table-column label="注册日期" prop="registerDate" min-width="120" />
|
||||
<el-table-column label="最近登陆日期" prop="lastLoginTime" min-width="120" />
|
||||
<el-table-column label="注册日期" prop="createTime" min-width="120" />
|
||||
<el-table-column label="最近登陆日期" prop="rencentlyLoginTime" min-width="120" />
|
||||
</el-table>
|
||||
<Pagination
|
||||
:total="total"
|
||||
@@ -56,11 +58,12 @@
|
||||
</template>
|
||||
|
||||
<script name="AppletUser" setup>
|
||||
// import { removeNullField } from '@/utils'
|
||||
// import * as CustomerApi from '@/api/customer/customer.js'
|
||||
import { removeNullField } from '@/utils'
|
||||
import * as CustomerApi from '@/api/customer/customer.js'
|
||||
import { getResellSimpleList } from '@/api/xjapplet/resell'
|
||||
|
||||
const searchForm = ref({
|
||||
resellMan: undefined,
|
||||
distributionld: undefined,
|
||||
phone: '',
|
||||
createDate: [],
|
||||
pageNo: 1,
|
||||
@@ -70,9 +73,9 @@ const searchForm = ref({
|
||||
const resellOptions = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
// CustomerApi.getCustomerExamCarType().then((res) => {
|
||||
// carTypeOptions.value = res
|
||||
// })
|
||||
getResellSimpleList().then((res) => {
|
||||
resellOptions.value = res
|
||||
})
|
||||
handleQuery()
|
||||
})
|
||||
|
||||
@@ -89,24 +92,14 @@ const total = ref(0)
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
// const data = await CustomerApi.getCustomerPage(removeNullField(searchForm.value))
|
||||
const data = {
|
||||
list: [
|
||||
{
|
||||
phone: '12345678901',
|
||||
distributionName: '分销人A',
|
||||
registerDate: '2023-10-01',
|
||||
lastLoginTime: '2023-10-02'
|
||||
},
|
||||
{
|
||||
phone: '12345678902',
|
||||
distributionName: '分销人B',
|
||||
registerDate: '2023-10-03',
|
||||
lastLoginTime: '2023-10-04'
|
||||
}
|
||||
],
|
||||
total: 2
|
||||
if (searchForm.value.createDate && searchForm.value.createDate.length > 0) {
|
||||
searchForm.value.createTimeBegin = searchForm.value.createDate[0] + ' 00:00:00'
|
||||
searchForm.value.createTimeEnd = searchForm.value.createDate[1] + ' 23:59:59'
|
||||
} else {
|
||||
searchForm.value.createTimeBegin = undefined
|
||||
searchForm.value.createTimeEnd = undefined
|
||||
}
|
||||
const data = await CustomerApi.getAppletUserList(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
|
||||
@@ -5,12 +5,17 @@
|
||||
<el-input v-model="searchForm.phone" placeholder="学员手机号" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.memberId" placeholder="选择分销人" clearable filterable>
|
||||
<el-select
|
||||
v-model="searchForm.distributionId"
|
||||
placeholder="选择分销人"
|
||||
clearable
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in vipOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
v-for="item in distributionOptions"
|
||||
:key="item.distributionId"
|
||||
:label="item.name"
|
||||
:value="item.distributionId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -19,6 +24,8 @@
|
||||
v-model="searchForm.createDate"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
value-format="YYYY-MM-DD"
|
||||
format="YYYY-MM-DD"
|
||||
start-placeholder="充值日期"
|
||||
end-placeholder="充值日期"
|
||||
/>
|
||||
@@ -31,16 +38,12 @@
|
||||
<el-table-column type="index" width="55" align="center" />
|
||||
<el-table-column label="手机号" align="left" prop="phone" width="140" />
|
||||
<el-table-column label="会员名" align="left" prop="memberName" min-width="140" />
|
||||
<el-table-column label="支付金额" align="left" prop="operUser" min-width="100" />
|
||||
<el-table-column label="车型" align="left" width="100">
|
||||
<template #default="{ row }">
|
||||
{{ row.carTypeId == 1001 ? '小车' : '摩托车' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付金额" align="left" prop="money" min-width="100" />
|
||||
<el-table-column label="车型" prop="carName" align="left" width="100" />
|
||||
<el-table-column label="科目" align="left" prop="subjects" width="100" />
|
||||
<el-table-column label="充值日期" align="left" prop="startDate" min-width="120" />
|
||||
<el-table-column label="充值日期" align="left" prop="payTime" min-width="120" />
|
||||
<el-table-column label="截止日期" align="left" prop="endDate" min-width="120" />
|
||||
<el-table-column label="分销人" align="left" prop="useTypeName" min-width="100" />
|
||||
<el-table-column label="分销人" align="left" prop="distributionName" min-width="100" />
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
@@ -49,44 +52,17 @@
|
||||
v-model:limit="searchForm.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-dialog title="赠送会员" v-model="showDialog" width="500px" :close-on-click-modal="false">
|
||||
<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="memberId">
|
||||
<el-select v-model="form.memberId" clearable filterable style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in vipOptions"
|
||||
:key="item.memberId"
|
||||
:label="item.memberName"
|
||||
:value="item.memberId"
|
||||
>
|
||||
<span style="float: left">{{ item.memberName }}</span>
|
||||
<span style="float: right; color: #aaa">{{ item.carName }}</span>
|
||||
</el-option>
|
||||
</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="Recharge">
|
||||
import { getUserMemberList, giveUserMember, getVipTypeOptions } from '@/api/xjapplet/vip'
|
||||
const message = useMessage()
|
||||
import { getRechargeRecords } from '@/api/xjapplet/vip'
|
||||
import { getResellSimpleList } from '@/api/xjapplet/resell'
|
||||
|
||||
const searchForm = ref({
|
||||
carTypeId: '1001',
|
||||
memberId: undefined,
|
||||
distributionId: undefined,
|
||||
phone: undefined,
|
||||
createDate: [],
|
||||
pageNo: 1,
|
||||
pageSize: 50
|
||||
})
|
||||
@@ -95,15 +71,15 @@ const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
const vipOptions = ref([])
|
||||
const distributionOptions = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
changeCarType()
|
||||
})
|
||||
|
||||
function changeCarType() {
|
||||
getVipTypeOptions({ carTypeId: searchForm.value.carTypeId }).then((response) => {
|
||||
vipOptions.value = response
|
||||
getResellSimpleList().then((response) => {
|
||||
distributionOptions.value = response
|
||||
})
|
||||
searchList()
|
||||
}
|
||||
@@ -115,43 +91,19 @@ function searchList() {
|
||||
|
||||
function getList() {
|
||||
loading.value = true
|
||||
getUserMemberList(searchForm.value).then((response) => {
|
||||
if (searchForm.value.createDate && searchForm.value.createDate.length > 0) {
|
||||
searchForm.value.payTimeBegin = searchForm.value.createDate[0] + ' 00:00:00'
|
||||
searchForm.value.payTimeEnd = searchForm.value.createDate[1] + ' 23:59:59'
|
||||
} else {
|
||||
searchForm.value.payTimeBegin = undefined
|
||||
searchForm.value.payTimeEnd = undefined
|
||||
}
|
||||
getRechargeRecords(searchForm.value).then((response) => {
|
||||
tableList.value = response.list
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
const showDialog = ref(false)
|
||||
const form = ref({
|
||||
phone: '',
|
||||
memberId: ''
|
||||
})
|
||||
const rules = ref({
|
||||
phone: [{ required: true, message: '请输入用户手机号', trigger: 'blur' }],
|
||||
memberId: [{ 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
|
||||
|
||||
giveUserMember(form.value).then((response) => {
|
||||
if (response) {
|
||||
message.success('赠送成功')
|
||||
showDialog.value = false
|
||||
searchList()
|
||||
} else {
|
||||
message.error('赠送失败')
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.carTypeId" @change="searchList">
|
||||
<el-radio label="1001">小车</el-radio>
|
||||
<el-radio label="1002">摩托车</el-radio>
|
||||
<el-radio value="1001">小车</el-radio>
|
||||
<el-radio value="1002">摩托车</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -32,20 +32,8 @@
|
||||
<el-table-column label="使用方式" align="center" prop="useTypeName" />
|
||||
<el-table-column label="操作" width="160">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="editVip(row)"
|
||||
v-hasPermi="['xj-applet:vip:vip-type:update']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleDelete(row.memberId)"
|
||||
v-hasPermi="['xj-applet:vip:vip-type:delete']"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button type="primary" link @click="editVip(row)">修改</el-button>
|
||||
<el-button type="primary" link @click="handleDelete(row.memberId)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -68,10 +56,10 @@
|
||||
<el-option label="摩托车" value="1002" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="科目" prop="subjects">
|
||||
<el-select v-model="form.subjects" placeholder="多选" multiple style="width: 100%">
|
||||
<el-option label="科一" value="4" />
|
||||
<el-option label="科四" value="1" />
|
||||
<el-form-item label="科目" prop="subjectList">
|
||||
<el-select v-model="form.subjectList" placeholder="多选" multiple style="width: 100%">
|
||||
<el-option label="科一" value="1" />
|
||||
<el-option label="科四" value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="原价" prop="price">
|
||||
@@ -142,7 +130,7 @@ const showDialog = ref(false)
|
||||
const form = ref({
|
||||
memberName: '',
|
||||
carTypeId: undefined,
|
||||
subjects: [],
|
||||
subjectList: [],
|
||||
price: '',
|
||||
discount: '',
|
||||
duration: '',
|
||||
@@ -152,7 +140,7 @@ const form = ref({
|
||||
const rules = ref({
|
||||
memberName: [{ required: true, message: '请输入会员名称', trigger: 'blur' }],
|
||||
carTypeId: [{ required: true, message: '请输入车型', trigger: 'change' }],
|
||||
subjects: [{ required: true, message: '请输入科目', trigger: 'blur' }],
|
||||
subjectList: [{ required: true, message: '请输入科目', trigger: 'blur' }],
|
||||
price: [{ required: true, message: '请输入价格', trigger: 'blur' }],
|
||||
discount: [{ required: true, message: '请输入折扣价', trigger: 'blur' }],
|
||||
duration: [{ required: true, message: '请输入有效期', trigger: 'blur' }]
|
||||
@@ -161,10 +149,10 @@ const rules = ref({
|
||||
function addVip() {
|
||||
showDialog.value = true
|
||||
|
||||
form.value.carTypeId = {
|
||||
form.value = {
|
||||
memberName: '',
|
||||
carTypeId: searchForm.value.carTypeId,
|
||||
subjects: [],
|
||||
subjectList: [],
|
||||
price: '',
|
||||
discount: '',
|
||||
duration: '',
|
||||
@@ -174,7 +162,7 @@ function addVip() {
|
||||
}
|
||||
|
||||
function editVip(row) {
|
||||
form.value = { ...row, subjects: row.subjects.split(','), unit: Number(row.unit) }
|
||||
form.value = { ...row, carTypeId: row.carTypeId + '', unit: Number(row.unit) }
|
||||
showDialog.value = true
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.carTypeId" @change="changeCarType">
|
||||
<el-radio label="1001">小车</el-radio>
|
||||
<el-radio label="1002">摩托车</el-radio>
|
||||
<el-radio value="1001">小车</el-radio>
|
||||
<el-radio value="1002">摩托车</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>
|
||||
|
||||
Reference in New Issue
Block a user