This commit is contained in:
weipengfei 2024-06-20 14:11:16 +08:00
parent 6a428f94a6
commit d7c236debe
12 changed files with 370 additions and 56 deletions

View File

@ -46,3 +46,8 @@ export function apiUserDelete(params: any) {
export function apiUserDetail(params: any) { export function apiUserDetail(params: any) {
return request.get({ url: '/user/user/detail', params }) return request.get({ url: '/user/user/detail', params })
} }
// 用户采购款明细、余额明细、礼品券明细、返还金明细 type 1,2,3,4(用户采购款明细、余额明细、礼品券明细、返还金明细)
export function apiUserFoundList(params: any) {
return request.get({ url: '/user/user/fundList', params })
}

View File

@ -309,12 +309,13 @@ const getData = () => {
// echarts // echarts
visitorOption.xAxis.data = [] visitorOption.xAxis.data = []
visitorOption.series = [] visitorOption.series = []
console.log(res);
visitorOption.legend.data = res.series.map((item: any) => item.name); visitorOption.legend.data = Object.values(res.series).map((item: any) => item.name);
// //
visitorOption.xAxis.data = res.xAxis; visitorOption.xAxis.data = res.x;
visitorOption.series = res.series.map((item: any) => { visitorOption.series = Object.values(res.series).map((item: any) => {
return { return {
type: 'line', type: 'line',
smooth: true, smooth: true,

View File

@ -56,7 +56,7 @@
<v-charts style="height: 300px" :option="circleOption" :autoresize="true" /> <v-charts style="height: 300px" :option="circleOption" :autoresize="true" />
</el-card> </el-card>
</div> </div>
<el-card shadow="never" class="mt-4 !border-none"> <!-- <el-card shadow="never" class="mt-4 !border-none">
<span class="text-2xl">门店业绩</span> <span class="text-2xl">门店业绩</span>
<el-table :data="storeList" class="mt-4"> <el-table :data="storeList" class="mt-4">
<el-table-column prop="avatar" label="logo" min-width="55"> <el-table-column prop="avatar" label="logo" min-width="55">
@ -70,7 +70,7 @@
<el-table-column prop="store_product_count" label="门店商品销量" /> <el-table-column prop="store_product_count" label="门店商品销量" />
<el-table-column prop="store_user_count" label="门店新增用户数" /> <el-table-column prop="store_user_count" label="门店新增用户数" />
</el-table> </el-table>
</el-card> </el-card> -->
</div> </div>
</template> </template>
@ -301,11 +301,11 @@ const getData = () => {
circleOption.series[0].data = res.bing_data; circleOption.series[0].data = res.bing_data;
orderList.value = res.order_list; orderList.value = res.order_list;
}) })
apiSystemStoreStatisticsStore({ // apiSystemStoreStatisticsStore({
date: date // date: date
}).then(res => { // }).then(res => {
storeList.value = res; // storeList.value = res;
}) // })
} }

View File

@ -27,13 +27,17 @@
<el-input v-model="formDataInfo.password" clearable placeholder="请输入登录密码" :readonly="false" /> <el-input v-model="formDataInfo.password" clearable placeholder="请输入登录密码" :readonly="false" />
<div class="text-sm text-orange-400">不修改请留空</div> <div class="text-sm text-orange-400">不修改请留空</div>
</el-form-item> </el-form-item>
<el-form-item label="应缴保证金" prop="bank_code"> <el-form-item label="保证金" prop="security_deposit">
<el-input v-model="formDataInfo.bank_code" clearable placeholder="请输入银行卡号" /> <el-input v-model="formDataInfo.security_deposit" clearable placeholder="请输入应缴纳保证金" />
</el-form-item>
<el-form-item label="已缴纳" prop="paid_deposit" v-if="mode!='add'">
<el-input v-model="formDataInfo.paid_deposit" clearable placeholder="已缴纳保证金"
:readonly="true" />
</el-form-item> </el-form-item>
<el-form-item label="银行卡号" prop="bank_code"> <el-form-item label="银行卡号" prop="bank_code">
<el-input v-model="formDataInfo.bank_code" clearable placeholder="请输入银行卡号" /> <el-input v-model="formDataInfo.bank_code" clearable placeholder="请输入银行卡号" />
</el-form-item> </el-form-item>
<el-form-item label="银行名称" prop="bank_code"> <el-form-item label="银行名称" prop="bank">
<el-input v-model="formDataInfo.bank" clearable placeholder="请输入银行名称" /> <el-input v-model="formDataInfo.bank" clearable placeholder="请输入银行名称" />
</el-form-item> </el-form-item>
<el-form-item label="开户地址" prop="bank_address"> <el-form-item label="开户地址" prop="bank_address">
@ -117,6 +121,8 @@ const formData = reactive({
staff_name: "", staff_name: "",
is_store: 1, is_store: 1,
is_send: 0, is_send: 0,
security_deposit: "",
paid_deposit: "",
bank: "", bank: "",
bank_code: "", bank_code: "",
bank_address: "", bank_address: "",
@ -138,6 +144,8 @@ const formDataInfo = reactive({
coord: '', coord: '',
startEndTime: [], startEndTime: [],
selectedValues: [], selectedValues: [],
security_deposit: "",
paid_deposit: "",
bank: "", bank: "",
bank_code: "", bank_code: "",
bank_address: "", bank_address: "",
@ -172,6 +180,11 @@ const formRules = reactive<any>({
message: '请输入详细地址', message: '请输入详细地址',
trigger: ['blur'] trigger: ['blur']
}], }],
security_deposit: [{
required: true,
message: '请输入保证金',
trigger: ['blur', 'change']
}],
image: [{ image: [{
required: true, required: true,
message: '请输入门店logo', message: '请输入门店logo',
@ -244,6 +257,7 @@ const handleSubmit = async () => {
data.city_code = formDataInfo.selectedValues[1] data.city_code = formDataInfo.selectedValues[1]
data.area_code = formDataInfo.selectedValues[2] data.area_code = formDataInfo.selectedValues[2]
data.street_code = formDataInfo.selectedValues[3] data.street_code = formDataInfo.selectedValues[3]
delete data.paid_deposit;
mode.value == 'edit' mode.value == 'edit'
? await apiSystemStoreEdit(data) ? await apiSystemStoreEdit(data)
: await apiSystemStoreAdd(data) : await apiSystemStoreAdd(data)

View File

@ -41,8 +41,8 @@
<el-table-column label="手机号码" prop="phone" show-overflow-tooltip /> <el-table-column label="手机号码" prop="phone" show-overflow-tooltip />
<el-table-column label="保证金" prop="phone" > <el-table-column label="保证金" prop="phone" >
<template #default="{ row }"> <template #default="{ row }">
<div>应缴纳: 1000.00</div> <div>应缴纳: {{row.security_deposit||'-'}}</div>
<div>已缴纳: <span class="text-danger">1000.00</span></div> <div>已缴纳: <span class="text-danger">{{ row.paid_deposit || '-' }}</span></div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="营业时间" show-overflow-tooltip> <el-table-column label="营业时间" show-overflow-tooltip>

View File

@ -0,0 +1,49 @@
<template>
<div>
<el-table :data="pager.lists">
<el-table-column label="" prop="label_id" show-overflow-tooltip />
<el-table-column label="标签名称" prop="label_name" show-overflow-tooltip />
</el-table>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</div>
</template>
<script lang="ts" setup name="userLabelLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiUserFoundList } from '@/api/user'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
const props = defineProps({
user_id: {
type: [Number, String],
required: true
}
})
//
const queryParams = reactive({
id: props.user_id,
type: 2
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiUserFoundList,
params: queryParams
})
const getList = (e:any)=>{
queryParams.id = e.id;
getLists();
}
defineExpose({
getLists,
getList
})
</script>

View File

@ -0,0 +1,49 @@
<template>
<div>
<el-table :data="pager.lists">
<el-table-column label="" prop="label_id" show-overflow-tooltip />
<el-table-column label="标签名称" prop="label_name" show-overflow-tooltip />
</el-table>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</div>
</template>
<script lang="ts" setup name="userLabelLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiUserFoundList } from '@/api/user'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
const props = defineProps({
user_id: {
type: [Number, String],
required: true
}
})
//
const queryParams = reactive({
id: props.user_id,
type: 3
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiUserFoundList,
params: queryParams
})
const getList = (e:any)=>{
queryParams.id = e.id;
getLists();
}
defineExpose({
getLists,
getList
})
</script>

View File

@ -0,0 +1,49 @@
<template>
<div>
<el-table :data="pager.lists">
<el-table-column label="" prop="label_id" show-overflow-tooltip />
<el-table-column label="标签名称" prop="label_name" show-overflow-tooltip />
</el-table>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</div>
</template>
<script lang="ts" setup name="userLabelLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiUserFoundList } from '@/api/user'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
const props = defineProps({
user_id: {
type: [Number, String],
required: true
}
})
//
const queryParams = reactive({
id: props.user_id,
type: 1
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiUserFoundList,
params: queryParams
})
const getList = (e:any)=>{
queryParams.id = e.id;
getLists();
}
defineExpose({
getLists,
getList
})
</script>

View File

@ -0,0 +1,49 @@
<template>
<div>
<el-table :data="pager.lists">
<el-table-column label="ID" prop="id" min-width="55" />
<el-table-column label="标签名称" prop="label_name" show-overflow-tooltip />
</el-table>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</div>
</template>
<script lang="ts" setup name="userLabelLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiUserFoundList } from '@/api/user'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
const props = defineProps({
user_id: {
type: [Number, String],
required: true
}
})
//
const queryParams = reactive({
id: props.user_id,
type: 4
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiUserFoundList,
params: queryParams
})
const getList = (e:any)=>{
queryParams.id = e.id;
getLists();
}
defineExpose({
getLists,
getList
})
</script>

View File

@ -1,26 +1,76 @@
<template> <template>
<div class="edit-popup"> <div class="edit-popup">
<popup <el-drawer title="用户详情" :size="1200" v-model="isOpen">
ref="popupRef" <div class="flex mb-4">
title="详情" <el-avatar :src="formData.avatar" size="large"></el-avatar>
:async="true" <div class="ml-4 flex flex-col justify-around">
width="550px" <div>昵称: {{ formData.nickname }}</div>
:cancelButtonText="false" <div>电话: {{ formData.mobile }}</div>
:confirmButtonText="false" </div>
> <div class="ml-8 flex flex-col justify-around">
<el-form ref="formRef" :model="formData" label-width="90px"> <div>账号: {{ formData.account }}</div>
<div>ID: {{ formData.id }}</div>
</div>
</div>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="基础信息" name="first">
<el-descriptions class="margin-top" :column="2" border>
<el-descriptions-item label="真实姓名">
{{ formData.label_name }}
</el-descriptions-item>
<el-descriptions-item label="用户性别">
<dict-value :options="dictData.sex" :value="formData.sex" />
</el-descriptions-item>
<el-descriptions-item label="注册渠道">
{{formData.channel}}
</el-descriptions-item>
<el-descriptions-item label="用户类型">
{{ formData.vip_name }}
</el-descriptions-item>
<el-descriptions-item label="用户标签">{{ formData.label_name }}</el-descriptions-item>
<el-descriptions-item label="礼品券">{{ formData.integral }}</el-descriptions-item>
<el-descriptions-item label="返还金">{{ formData.return_money }}</el-descriptions-item>
<el-descriptions-item label="采购款">{{ formData.purchase_funds }}</el-descriptions-item>
<el-descriptions-item label="用户地址" :span="2">{{ formData.user_address }}</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="2">{{ formData.create_time }}</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<el-tab-pane label="采购款明细" name="second">
<purchase ref="purchaseRef" :user_id="formData.id" :key="key+'a'" />
</el-tab-pane>
<el-tab-pane label="余额明细" name="three">
<balance ref="balanceRef" :user_id="formData.id" :key="key+'b'" />
</el-tab-pane>
<el-tab-pane label="礼品券明细" name="four">
<merchandise ref="merchandiseRef" :user_id="formData.id" :key="key+'c'" />
</el-tab-pane>
<el-tab-pane label="返还金明细" name="five">
<returnMoney ref="returnMoneyRef" :user_id="formData.id" :key="key+'d'" />
</el-tab-pane>
</el-tabs>
</el-form> </el-drawer>
</popup>
</div> </div>
</template> </template>
<script lang="ts" setup name="userDETAILS"> <script lang="ts" setup name="storeProductDETAILS">
import type { FormInstance } from 'element-plus' import { usePaging } from '@/hooks/usePaging'
import Popup from '@/components/popup/index.vue' import { ElMessage, type FormInstance } from 'element-plus'
import { apiUserAdd, apiUserEdit, apiUserDetail } from '@/api/user' import { apiUserDetail } from '@/api/user'
import { timeFormat } from '@/utils/util' import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue' import type { PropType } from 'vue'
import feedback from '@/utils/feedback'
import purchase from './components/purchase.vue'
import balance from './components/balance.vue'
import merchandise from './components/merchandise.vue'
import returnMoney from './components/returnMoney.vue'
const purchaseRef = ref(null)
const balanceRef = ref(null)
const merchandiseRef = ref(null)
const returnMoneyRef = ref(null)
const key = ref(0);
defineProps({ defineProps({
dictData: { dictData: {
type: Object as PropType<Record<string, any[]>>, type: Object as PropType<Record<string, any[]>>,
@ -28,33 +78,56 @@ defineProps({
} }
}) })
const emit = defineEmits(['success', 'close']) const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>() const isOpen = ref(false);
const popupRef = shallowRef<InstanceType<typeof Popup>>() const activeName = ref('first');
const mode = ref('add') const handleClick = (tab: any) => {
if (tab.paneName == "second") purchaseRef.value?.getList({id:formData.id});
if (tab.paneName == "three") balanceRef.value?.getList({id:formData.id});
if (tab.paneName == "four") merchandiseRef.value?.getList({id:formData.id});
if (tab.paneName == "five") returnMoneyRef.value?.getList({id:formData.id});
};
// //
const formData = reactive({ const formData = reactive({
id: '', "id": "",
"nickname": "",
"real_name": "",
"sex": 0,
"avatar": "",
"account": "",
"mobile": "",
"channel": "",
"create_time": "",
"purchase_funds": "",
"label_id": 0,
"integral": "",
"vip_name": "",
"discount": 0,
"limit": 0,
"label_name": "",
"sex_text": "",
"user_address": "",
"return_money": 0
}) })
// //
const setFormData = async (data: Record<any, any>) => { const setFormData = async (data: Record<any, any>) => {
queryParams.product_id = data.id;
for (const key in formData) { for (const key in formData) {
if (data[key] != null && data[key] != undefined) { if (data[key] != null && data[key] != undefined) {
//@ts-ignore //@ts-ignore
formData[key] = data[key] formData[key] = data[key]
} }
} }
handleClick({
paneName: activeName.value
})
} }
const getDetail = async (row: Record<string, any>) => { const getDetail = async (row: Record<string, any>) => {
queryParams.product_id = row.id
const data = await apiUserDetail({ const data = await apiUserDetail({
id: row.id id: row.id
}) })
@ -63,7 +136,7 @@ const getDetail = async (row: Record<string, any>) => {
// //
const open = () => { const open = () => {
popupRef.value?.open() isOpen.value = true;
} }
// //
@ -71,6 +144,11 @@ const handleClose = () => {
emit('close') emit('close')
} }
//
const queryParams = reactive({
product_id: "",
})
defineExpose({ defineExpose({

View File

@ -9,7 +9,7 @@
@close="handleClose" @close="handleClose"
> >
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules"> <el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form-item label="用户" prop="username"> <el-form-item label="用户标签" prop="username">
<el-select class="flex-1" v-model="formData.label_id"> <el-select class="flex-1" v-model="formData.label_id">
<el-option <el-option
v-for="item in labelList" v-for="item in labelList"
@ -79,7 +79,7 @@ const setFormData = async (data: Record<any, any>) => {
formData[key] = data[key] formData[key] = data[key]
} }
} }
if(!formData.label_id) formData.label_id = ''
} }

View File

@ -31,32 +31,41 @@
删除 删除
</el-button> --> </el-button> -->
<div class="mt-4"> <div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange"> <el-table :data="pager.lists" @selection-change="handleSelectionChange" >
<el-table-column type="selection" width="55" /> <!-- <el-table-column type="selection" width="55" /> -->
<el-table-column label="ID" prop="id" show-overflow-tooltip /> <el-table-column label="ID" prop="id" min-width="55" />
<el-table-column label="头像" prop="avatar" show-overflow-tooltip> <el-table-column label="头像" prop="avatar" show-overflow-tooltip>
<template #default="{ row }"> <template #default="{ row }">
<el-image :src="row.avatar" /> <el-avatar :src="row.avatar" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="真实姓名" prop="real_name" show-overflow-tooltip /> <el-table-column label="真实姓名" prop="real_name" />
<el-table-column label="用户昵称" prop="nickname" show-overflow-tooltip /> <el-table-column label="用户昵称" prop="nickname" min-width="100" />
<el-table-column label="用户账号" prop="account" show-overflow-tooltip /> <el-table-column label="用户账号" prop="account" min-width="100" />
<!-- <el-table-column label="用户密码" prop="password" show-overflow-tooltip /> --> <!-- <el-table-column label="用户密码" prop="password" /> -->
<el-table-column label="用户电话" prop="mobile" show-overflow-tooltip /> <el-table-column label="用户电话" prop="mobile" min-width="100" />
<el-table-column label="用户性别" prop="sex"> <el-table-column label="用户性别" prop="sex">
<template #default="{ row }"> <template #default="{ row }">
<dict-value :options="dictData.sex" :value="row.sex" /> <dict-value :options="dictData.sex" :value="row.sex" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="注册渠道" prop="channel" show-overflow-tooltip /> <el-table-column label="注册渠道" prop="channel" />
<el-table-column label="用户余额" prop="user_money" show-overflow-tooltip /> <el-table-column label="用户类型" prop="vip_name" />
<el-table-column label="累计充值" prop="total_recharge_amount" show-overflow-tooltip /> <el-table-column label="用户标签" prop="label_name" />
<el-table-column label="礼品券" prop="integral" />
<el-table-column label="返还金" prop="return_money" />
<el-table-column label="采购款" prop="purchase_funds" />
<el-table-column label="用户余额" prop="user_money" />
<el-table-column label="累计充值" prop="total_recharge_amount" />
<el-table-column label="地址" prop="user_address" />
<el-table-column label="操作" width="120" fixed="right"> <el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
<el-button v-perms="['user.user/edit']" type="primary" link @click="handleEdit(row)"> <el-button v-perms="['user.user/edit']" type="primary" link @click="handleEdit(row)">
编辑 编辑
</el-button> </el-button>
<el-button v-perms="['user.user/detail']" type="primary" link @click="handleDetail(row)">
详情
</el-button>
<!-- <el-button v-perms="['user.user/delete']" type="danger" link @click="handleDelete(row.id)"> <!-- <el-button v-perms="['user.user/delete']" type="danger" link @click="handleDelete(row.id)">
删除 删除
</el-button> --> </el-button> -->
@ -68,6 +77,7 @@
<pagination v-model="pager" @change="getLists" /> <pagination v-model="pager" @change="getLists" />
</div> </div>
</el-card> </el-card>
<Details ref="detailsRef" :dict-data="dictData"></Details>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" /> <edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div> </div>
</template> </template>
@ -79,6 +89,9 @@ import { apiUserLists, apiUserDelete } from '@/api/user'
import { timeFormat } from '@/utils/util' import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback' import feedback from '@/utils/feedback'
import EditPopup from './edit.vue' import EditPopup from './edit.vue'
import Details from "./details.vue";
const detailsRef = ref(null);
const editRef = shallowRef<InstanceType<typeof EditPopup>>() const editRef = shallowRef<InstanceType<typeof EditPopup>>()
// //
@ -124,6 +137,13 @@ const handleEdit = async (data: any) => {
editRef.value?.setFormData(data) editRef.value?.setFormData(data)
} }
//
const handleDetail = async (data: any) => {
detailsRef.value?.open();
detailsRef.value?.setFormData(data);
};
// //
const handleDelete = async (id: number | any[]) => { const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?') await feedback.confirm('确定要删除?')