(Update API paths, adjust configurations, and optimize user and order management functions)

This commit is contained in:
zmj 2024-06-04 17:59:05 +08:00
parent 818b3c27f7
commit 5e2a76a98a
28 changed files with 1351 additions and 342 deletions

View File

@ -2,21 +2,21 @@ import request from '@/utils/request'
// 商品列表
export function apiGoodsListLists(params: any) {
return request.get({ url: '/consult_target.consult_decision/lists', params })
return request.get({ url: '/store_product/storeProduct/lists', params })
}
// 库存管理
export function apiGoodsListDetail(params: any) {
return request.get({ url: '/consult_target.consult_decision/add', params })
return request.get({ url: '/consult_target.consult_decision/add12', params })
}
// 库存管理
export function apiGoodsTypeLists(params: any) {
return request.get({ url: '/consult_target.consult_decision/add', params })
return request.get({ url: '/consult_target.consult_decision/add54', params })
}
// 上架&下架
export function apiStatus(params: any) {
return request.post({ url: '/consult_target.consult_decision/add', params })
return request.post({ url: '/store_product/storeProduct/status', params })
}

View File

@ -2,28 +2,28 @@ import request from '@/utils/request'
// 管理员列表
export function adminLists(params: any) {
return request.get({ url: '/auth.admin/lists', params }, { ignoreCancelToken: true })
return request.get({ url: '/auth/admin/lists', params }, { ignoreCancelToken: true })
}
// 管理员列表全部
export function adminAll(params: any) {
return request.get({ url: '/auth.admin/all', params })
return request.get({ url: '/auth/admin/all', params })
}
// 管理员添加
export function adminAdd(params: any) {
return request.post({ url: '/auth.admin/add', params })
return request.post({ url: '/auth/admin/add', params })
}
// 管理员编辑
export function adminEdit(params: any) {
return request.post({ url: '/auth.admin/edit', params })
return request.post({ url: '/auth/admin/edit', params })
}
// 管理员删除
export function adminDelete(params: any) {
return request.post({ url: '/auth.admin/delete', params })
return request.post({ url: '/auth/admin/delete', params })
}
// 管理员详情
export function adminDetail(params: any) {
return request.get({ url: '/auth.admin/detail', params })
return request.get({ url: '/auth/admin/detail', params })
}

View File

@ -2,29 +2,29 @@ import request from '@/utils/request'
// 菜单列表
export function menuLists(params: Record<string, any>) {
return request.get({ url: '/auth.menu/lists', params })
return request.get({ url: '/auth/menu/lists', params })
}
// 菜单全部
export function menuAll(params?: Record<string, any>) {
return request.get({ url: '/auth.menu/all', params })
return request.get({ url: '/auth/menu/all', params })
}
// 添加菜单
export function menuAdd(params: Record<string, any>) {
return request.post({ url: '/auth.menu/add', params })
return request.post({ url: '/auth/menu/add', params })
}
// 编辑菜单
export function menuEdit(params: Record<string, any>) {
return request.post({ url: '/auth.menu/edit', params })
return request.post({ url: '/auth/menu/edit', params })
}
// 菜单删除
export function menuDelete(params: Record<string, any>) {
return request.post({ url: '/auth.menu/delete', params })
return request.post({ url: '/auth/menu/delete', params })
}
// 菜单详情
export function menuDetail(params: Record<string, any>) {
return request.get({ url: '/auth.menu/detail', params })
return request.get({ url: '/auth/menu/detail', params })
}

View File

@ -2,26 +2,26 @@ import request from '@/utils/request'
// 角色列表
export function roleLists(params: any) {
return request.get({ url: '/auth.role/lists', params })
return request.get({ url: '/auth/role/lists', params })
}
// 角色列表全部
export function roleAll(params: any) {
return request.get({ url: '/auth.role/all', params })
return request.get({ url: '/auth/role/all', params })
}
// 添加角色
export function roleAdd(params: any) {
return request.post({ url: '/auth.role/add', params })
return request.post({ url: '/auth/role/add', params })
}
// 编辑角色
export function roleEdit(params: any) {
return request.post({ url: '/auth.role/edit', params })
return request.post({ url: '/auth/role/edit', params })
}
// 删除角色
export function roleDelete(params: any) {
return request.post({ url: '/auth.role/delete', params })
return request.post({ url: '/auth/role/delete', params })
}
// 角色详情
export function roleDetail(params: any) {
return request.get({ url: '/auth.role/detail', params })
return request.get({ url: '/auth/role/detail', params })
}

16
src/api/store_extract.ts Normal file
View File

@ -0,0 +1,16 @@
import request from '@/utils/request'
// 门店提现列表
export function apiStoreExtractLists(params: any) {
return request.get({ url: '/consult_target.consult_decision/lists', params })
}
// 门店提现备注
export function apiStoreExtractRemarks(params: any) {
return request.post({ url: '/consult_target.consult_decision/lists', params })
}
// 申请提现
export function apiStoreExtractCashs(params: any) {
return request.post({ url: '/consult_target.consult_decision/lists', params })
}

View File

@ -0,0 +1,11 @@
import request from '@/utils/request'
// 门店流水列表
export function apiStorFinanceFlowLists(params: any) {
return request.get({ url: '/consult_target.consult_decision/lists', params })
}
// 门店流水备注
export function apiStorFinanceFlowRemarks(params: any) {
return request.post({ url: '/consult_target.consult_decision/lists', params })
}

View File

@ -13,10 +13,10 @@ export function logout() {
// 用户信息
export function getUserInfo() {
return request.get({ url: '/auth.admin/mySelf' })
return request.get({ url: '/auth/admin/mySelf' })
}
// 编辑管理员信息
export function setUserInfo(params: any) {
return request.post({ url: '/auth.admin/editSelf', params })
return request.post({ url: '/auth/admin/editSelf', params })
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -4,15 +4,8 @@
<!-- 触发弹窗 -->
<slot name="trigger"></slot>
</div>
<el-dialog
v-model="visible"
:custom-class="customClass"
:center="center"
:append-to-body="true"
:width="width"
:close-on-click-modal="clickModalClose"
@closed="close"
>
<el-dialog v-model="visible" :custom-class="customClass" :center="center" :append-to-body="true" :width="width"
:close-on-click-modal="clickModalClose" @closed="close">
<!-- 弹窗内容 -->
<template v-if="title" #header>{{ title }}</template>
@ -24,11 +17,7 @@
<el-button v-if="cancelButtonText" @click="handleEvent('cancel')">
{{ cancelButtonText }}
</el-button>
<el-button
v-if="confirmButtonText"
type="primary"
@click="handleEvent('confirm')"
>
<el-button v-if="confirmButtonText" type="primary" @click="handleEvent('confirm')">
{{ confirmButtonText }}
</el-button>
</div>
@ -78,7 +67,7 @@ export default defineComponent({
clickModalClose: {
//
type: Boolean,
default: false
default: true
},
center: {
//

View File

@ -3,7 +3,7 @@ const config = {
title: '后台管理系统', //网站默认标题
version: '1.8.0', //版本号
baseUrl: `${import.meta.env.VITE_APP_BASE_URL || ''}/`, //请求接口域名
urlPrefix: 'adminapi', //请求默认前缀
urlPrefix: 'store', //请求默认前缀
timeout: 10 * 1000 //请求超时时长
}

View File

@ -0,0 +1,165 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-form-item label="店员名称" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入店员名称" />
</el-form-item>
<el-form-item label="头像" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入店员名称" />
</el-form-item>
<el-form-item label="店员账号" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入店员账号" />
</el-form-item>
<el-form-item label="店员密码" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入店员账号" type="password" />
</el-form-item>
<el-form-item label="确认密码" prop="title">
<el-input v-model="formData.title" clearable placeholder="请确认账号密码" />
</el-form-item>
<el-form-item label="手机号码" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入手机号码" />
</el-form-item>
<el-form-item label="店员身份" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入手机号码" />
</el-form-item>
<el-form-item label="状态" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入手机号码" />
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="oaPlanEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
// import { apiOaPlanAdd, apiOaPlanEdit, apiOaPlanDetail } from '@/api/oa_plan'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑日程安排' : '新增日程安排'
})
//
const formData = reactive({
id: '',
title: '',
type: '',
start_time: '',
end_time: '',
remind_type: '',
remark: '',
})
const chekcDate = (rule: any, value: any, callback: any) => {
if (new Date(formData.end_time) < new Date(formData.start_time)) {
callback(new Error('结束时间不能早于开始时间'))
} else {
callback()
}
}
//
const formRules = reactive<any>({
title: [{
required: true,
message: '请输入工作安排主题',
trigger: ['blur']
}],
type: [{
required: true,
message: '请输入日程优先级',
trigger: ['blur']
}],
start_time: [{
required: true,
message: '请输入开始时间',
trigger: ['blur']
}],
end_time: [{
required: true,
message: '请输入结束时间',
trigger: ['blur']
},
{
validator: chekcDate,
trigger: ['blur']
}],
remind_type: [{
required: true,
message: '请输入提醒类型',
trigger: ['blur']
}],
remind_time: [{
required: true,
message: '请输入提醒时间',
trigger: ['blur']
}]
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiOaPlanDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
// mode.value == 'edit'
// ? await apiOaPlanEdit(data)
// : await apiOaPlanAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add', start_time = '') => {
mode.value = type
formData.start_time = start_time
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -53,9 +53,12 @@
</el-table-column>
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<!-- <el-button type="primary" link @click="handleEdit(row)">
<el-button type="primary" link @click="handleEdit(row)">
编辑
</el-button>
<el-button type="primary" link @click="handleDetail(row)">
详情
</el-button> -->
</el-button>
</template>
</el-table-column>
</el-table>
@ -64,7 +67,8 @@
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<!-- <detailPopup ref="editRef" /> -->
<edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
</div>
</template>
@ -72,11 +76,11 @@
import { ref, reactive } from "vue"
import { usePaging } from '@/hooks/usePaging'
import { apiGoodsListLists, apiStatus, apiGoodsTypeLists } from '@/api/goodsList'
// import detailPopup from './detail.vue'
import EditPopup from './edit.vue'
// const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
// const showDetail = ref(false)
const showEdit = ref(false)
//
@ -115,13 +119,21 @@ const { pager, getLists, resetParams, resetPage } = usePaging({
params: queryParams
})
//
//
const handleEdit = async (data: any) => {
// editRef.value?.open()
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleAdd = () => {
const handleDetail = () => {
}

View File

@ -1,38 +1,20 @@
<template>
<div>
<el-card class="!border-none" shadow="never">
<el-alert
type="warning"
title="温馨提示:用户账户变动记录"
:closable="false"
show-icon
></el-alert>
<el-alert type="warning" title="温馨提示:用户账户变动记录" :closable="false" show-icon></el-alert>
<el-form ref="formRef" class="mb-[-16px] mt-[16px]" :model="queryParams" :inline="true">
<el-form-item label="用户信息">
<el-input
class="w-[280px]"
v-model="queryParams.user_info"
placeholder="请输入用户账号/昵称/手机号"
clearable
@keyup.enter="resetPage"
/>
<el-input class="w-[280px]" v-model="queryParams.user_info" placeholder="请输入用户账号/昵称/手机号" clearable
@keyup.enter="resetPage" />
</el-form-item>
<el-form-item label="变动类型">
<el-select class="w-[280px]" v-model="queryParams.change_type">
<el-option label="全部" value />
<el-option
v-for="(value, key) in optionsData.change_type"
:key="key"
:label="value"
:value="key"
/>
<el-option v-for="(value, key) in optionsData.change_type" :key="key" :label="value" :value="key" />
</el-select>
</el-form-item>
<el-form-item label="记录时间">
<daterange-picker
v-model:startTime="queryParams.start_time"
v-model:endTime="queryParams.end_time"
/>
<daterange-picker v-model:startTime="queryParams.start_time" v-model:endTime="queryParams.end_time" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
@ -46,14 +28,8 @@
<el-table-column label="用户昵称" min-width="160">
<template #default="{ row }">
<div class="flex items-center">
<image-contain
class="flex-none mr-2"
:src="row.avatar"
:width="40"
:height="40"
preview-teleported
fit="contain"
/>
<image-contain class="flex-none mr-2" :src="row.avatar" :width="40" :height="40"
preview-teleported fit="contain" />
{{ row.nickname }}
</div>
</template>

View File

@ -1,30 +1,15 @@
<template>
<div>
<el-card class="!border-none" shadow="never">
<el-alert
type="warning"
title="温馨提示:用户充值记录"
:closable="false"
show-icon
></el-alert>
<el-alert type="warning" title="温馨提示:用户充值记录" :closable="false" show-icon></el-alert>
<el-form ref="formRef" class="mb-[-16px] mt-[16px]" :model="queryParams" :inline="true">
<el-form-item label="充值单号">
<el-input
class="w-[280px]"
v-model="queryParams.sn"
placeholder="请输入充值单号"
clearable
@keyup.enter="resetPage"
/>
<el-input class="w-[280px]" v-model="queryParams.sn" placeholder="请输入充值单号" clearable
@keyup.enter="resetPage" />
</el-form-item>
<el-form-item label="用户信息">
<el-input
class="w-[280px]"
v-model="queryParams.user_info"
placeholder="请输入用户账号/昵称/手机号"
clearable
@keyup.enter="resetPage"
/>
<el-input class="w-[280px]" v-model="queryParams.user_info" placeholder="请输入用户账号/昵称/手机号" clearable
@keyup.enter="resetPage" />
</el-form-item>
<el-form-item label="支付方式">
<el-select class="w-[280px]" v-model="queryParams.pay_way">
@ -40,20 +25,12 @@
</el-select>
</el-form-item>
<el-form-item label="下单时间">
<daterange-picker
v-model:startTime="queryParams.start_time"
v-model:endTime="queryParams.end_time"
/>
<daterange-picker v-model:startTime="queryParams.start_time" v-model:endTime="queryParams.end_time" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
<export-data
class="ml-2.5"
:fetch-fun="rechargeLists"
:params="queryParams"
:page-size="pager.size"
/>
<export-data class="ml-2.5" :fetch-fun="rechargeLists" :params="queryParams" :page-size="pager.size" />
</el-form-item>
</el-form>
</el-card>
@ -62,14 +39,8 @@
<el-table-column label="用户信息" min-width="160">
<template #default="{ row }">
<div class="flex items-center">
<image-contain
class="flex-none mr-2"
:src="row.avatar"
:width="40"
:height="40"
preview-teleported
fit="contain"
/>
<image-contain class="flex-none mr-2" :src="row.avatar" :width="40" :height="40"
preview-teleported fit="contain" />
{{ row.nickname }}
</div>
</template>
@ -80,11 +51,9 @@
<el-table-column label="支付方式" prop="pay_way_text" min-width="100" />
<el-table-column label="支付状态" prop="" min-width="100">
<template #default="{ row }">
<span
:class="{
<span :class="{
'text-error': row.pay_status == 0
}"
>
}">
{{ row.pay_status_text }}
</span>
</template>
@ -93,14 +62,8 @@
<el-table-column label="支付时间" prop="pay_time" min-width="180" />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<el-button
v-if="row.pay_status == 1"
v-perms="['recharge.recharge/refund']"
type="primary"
link
:disabled="row.refund_status == 1"
@click="handleRefund(row.id)"
>
<el-button v-if="row.pay_status == 1" v-perms="['recharge.recharge/refund']" type="primary" link
:disabled="row.refund_status == 1" @click="handleRefund(row.id)">
退款
</el-button>
</template>

View File

@ -23,31 +23,16 @@
<el-card class="!border-none" shadow="never">
<el-form ref="formRef" class="mb-[-16px] mt-[16px]" :model="queryParams" :inline="true">
<el-form-item label="退款单号">
<el-input
class="w-[280px]"
v-model="queryParams.sn"
placeholder="请输入退款单号"
clearable
@keyup.enter="resetPage"
/>
<el-input class="w-[280px]" v-model="queryParams.sn" placeholder="请输入退款单号" clearable
@keyup.enter="resetPage" />
</el-form-item>
<el-form-item label="来源单号">
<el-input
class="w-[280px]"
v-model="queryParams.order_sn"
placeholder="请输入来源单号"
clearable
@keyup.enter="resetPage"
/>
<el-input class="w-[280px]" v-model="queryParams.order_sn" placeholder="请输入来源单号" clearable
@keyup.enter="resetPage" />
</el-form-item>
<el-form-item label="用户信息">
<el-input
class="w-[280px]"
v-model="queryParams.user_info"
placeholder="请输入用户信息"
clearable
@keyup.enter="resetPage"
/>
<el-input class="w-[280px]" v-model="queryParams.user_info" placeholder="请输入用户信息" clearable
@keyup.enter="resetPage" />
</el-form-item>
<el-form-item label="退款类型">
<el-select class="w-[280px]" v-model="queryParams.refund_type">
@ -56,10 +41,7 @@
</el-select>
</el-form-item>
<el-form-item label="记录时间">
<daterange-picker
v-model:startTime="queryParams.start_time"
v-model:endTime="queryParams.end_time"
/>
<daterange-picker v-model:startTime="queryParams.start_time" v-model:endTime="queryParams.end_time" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
@ -75,25 +57,15 @@
</el-card>
<el-card class="!border-none mt-4" shadow="never">
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
<el-tab-pane
v-for="(item, index) in tabLists"
:label="`${item.name}(${pager.extend[item.numKey] ?? 0})`"
:name="index"
:key="index"
>
<el-tab-pane v-for="(item, index) in tabLists" :label="`${item.name}(${pager.extend[item.numKey] ?? 0})`"
:name="index" :key="index">
<el-table size="large" v-loading="pager.loading" :data="pager.lists">
<el-table-column label="退款单号" prop="sn" min-width="190" />
<el-table-column label="用户信息" min-width="160">
<template #default="{ row }">
<div class="flex items-center">
<image-contain
class="flex-none mr-2"
:src="row.avatar"
:width="40"
:height="40"
preview-teleported
fit="contain"
/>
<image-contain class="flex-none mr-2" :src="row.avatar" :width="40" :height="40"
preview-teleported fit="contain" />
{{ row.nickname }}
</div>
</template>
@ -120,21 +92,12 @@
<el-table-column label="记录时间" prop="create_time" min-width="180" />
<el-table-column label="操作" width="180" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['finance.refund/log']"
type="primary"
link
@click="handleShowRefundLog(row.id)"
>
<el-button v-perms="['finance.refund/log']" type="primary" link
@click="handleShowRefundLog(row.id)">
退款日志
</el-button>
<el-button
v-if="row.refund_status == 2"
v-perms="['recharge.recharge/refundAgain']"
type="primary"
link
@click="handleRefund(row.id)"
>
<el-button v-if="row.refund_status == 2" v-perms="['recharge.recharge/refundAgain']"
type="primary" link @click="handleRefund(row.id)">
重新退款
</el-button>
</template>

View File

@ -0,0 +1,85 @@
<template>
<popup ref="popupRef" title="账单详情" :async="true" width="60vw" @confirm="close" @close="close">
<el-form class="mb-[-16px]" :model="queryParams" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="选择店员">
<el-select class="flex-1" v-model="queryParams.types" clearable placeholder="请选择账单类型">
<el-option label="日账单" :value="0" />
<el-option label="周账单" :value="0" />
<el-option label="月账单" :value="0" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="订单搜索">
<el-input v-model="queryParams.order" clearable placeholder="请输入交易单号/交易人" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="mt-4">
<!-- <el-table :data="pager.lists"> -->
<el-table :data="[{}]">
<el-table-column label="交易单号" prop="id" show-overflow-tooltip />
<el-table-column label="关联订单" prop="progress" show-overflow-tooltip />
<el-table-column label="交易时间" prop="progress" show-overflow-tooltip />
<el-table-column label="交易金额" prop="progress" show-overflow-tooltip />
<el-table-column label="交易人" prop="progress" show-overflow-tooltip />
<el-table-column label="关联店员" prop="progress" show-overflow-tooltip />
<el-table-column label="交易类型" prop="progress" show-overflow-tooltip />
<el-table-column label="支付方式" prop="progress" show-overflow-tooltip />
<el-table-column label="备注" prop="progress" show-overflow-tooltip />
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</popup>
</template>
<script setup lang="ts">
import { usePaging } from '@/hooks/usePaging'
import { apiGoodsListLists, apiStatus, apiGoodsTypeLists } from '@/api/goodsList'
import { defineEmits, ref, defineExpose } from 'vue';
const popupRef = ref(null)
const emit = defineEmits(['close'])
const queryParams = reactive({
id: '4',
types: "",
order: ""
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiGoodsListLists,
params: queryParams
})
const open = () => {
// queryParams.id = 9
// getLists()
popupRef.value.open()
}
const close = () => {
popupRef.value.close()
emit('close')
}
defineExpose({
open,
close
})
</script>

View File

@ -0,0 +1,105 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="账单类型">
<el-select class="flex-1" v-model="queryParams.types" clearable placeholder="请选择账单类型">
<el-option label="日账单" :value="0" />
<el-option label="周账单" :value="0" />
<el-option label="月账单" :value="0" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="创建时间">
<el-date-picker v-model="queryParams.times" type="daterange" range-separator="-"
start-placeholder="开始时间" end-placeholder="结束时间" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<!-- <el-table :data="pager.lists"> -->
<el-table :data="[{}]">
<el-table-column label="id" prop="id" show-overflow-tooltip />
<el-table-column label="标题" prop="progress" show-overflow-tooltip />
<el-table-column label="日期" prop="progress" show-overflow-tooltip />
<el-table-column label="收入金额" prop="progress" show-overflow-tooltip />
<el-table-column label="支出金额" prop="progress" show-overflow-tooltip />
<el-table-column label="门店收入账金额" prop="progress" show-overflow-tooltip />
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button type="primary" link @click="handleDetail(row)">
账单详情
</el-button>
<el-button type="primary" link @click="handleDown(row)">
下载
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<detailPopup ref="detailRef" v-if="showDetail" @close="showDetail = false" />
</div>
</template>
<script lang="ts" setup name="manageProjectLists">
import { ref, reactive } from "vue"
import { usePaging } from '@/hooks/usePaging'
import { apiGoodsListLists, apiStatus, apiGoodsTypeLists } from '@/api/goodsList'
import detailPopup from './detail.vue'
// const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showDetail = ref(false)
const detailRef = ref(null)
//
const queryParams = reactive({
times: "",
types: ""
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiGoodsListLists,
params: queryParams
})
//
const handleDetail = async (data: any) => {
showDetail.value = true
await nextTick()
detailRef.value.open()
}
//
const handleDown = async (row) => {
const a = document.createElement('a')
// a.href = import.meta.env.VITE_APP_BASE_URL + res.url
a.click()
}
getLists()
</script>

View File

@ -1 +0,0 @@
<!-- 财务 -->

View File

@ -0,0 +1,83 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="60vw" @confirm="handleSubmit" @close="handleClose">
<el-table border :data="formData.detail">
<el-table-column label="图片" prop="build_area_text" show-overflow-tooltip>
<template #default="{ row }">
<!-- <el-image style="width: 50px; height: 50px" :src="url" /> -->
</template>
</el-table-column>
<el-table-column label="产品规格" prop="project_level_text" show-overflow-tooltip />
<el-table-column label="商品条形码" prop="total_investment" show-overflow-tooltip width="120" />
<el-table-column label="商品编码" prop="engineering_status_text" show-overflow-tooltip />
<el-table-column label="当前库存" prop="engineering_status_text" show-overflow-tooltip />
<el-table-column label="入/出库数量" prop="engineering_status_text" show-overflow-tooltip />
<!-- <el-table-column label="状态" prop="engineering_status_text" show-overflow-tooltip>
<template #default="{ row }">
</template>
</el-table-column> -->
</el-table>
</popup>
</div>
</template>
<script lang="ts" setup name="manageProjectEdit">
import Popup from '@/components/popup/index.vue'
const emit = defineEmits(['success', 'close'])
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const popupTitle = computed(() => {
return '库存管理'
})
//
const formData = reactive({
id: '',
detail: []
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
//
const handleSubmit = async () => {
emit('close')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
})
</script>

View File

@ -0,0 +1,130 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="商品状态">
<el-select class="flex-1" v-model="queryParams.status" clearable placeholder="请选择商品状态">
<el-option label="上架中" :value="1" />
<el-option label="下架中" :value="2" />
<el-option label="已售罄" :value="3" />
<el-option label="库存预警" :value="4" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商品分类" prop="project_code">
<!-- <el-select class="flex-1" v-model="queryParams.status" clearable placeholder="请选择商品分类">
<el-option v-for="(item, index) in typeLists" :key="index" :label="item.name"
:value="parseInt(item.value)" />
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商品搜索">
<el-input v-model="queryParams.store_name" clearable placeholder="请输入商品名称" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table :data="pager.lists">
<el-table-column label="商品id" prop="id" show-overflow-tooltip />
<el-table-column label="商品图" show-overflow-tooltip>
<template #default="{ row }">
<el-image style="width: 50px; height: 50px" :src="row.image" />
</template>
</el-table-column>
<el-table-column label="商品名称" prop="store_name" show-overflow-tooltip />
<el-table-column label="商品售价" prop="price" show-overflow-tooltip width="120" />
<el-table-column label="销量" prop="sales" show-overflow-tooltip />
<el-table-column label="库存" prop="stock" show-overflow-tooltip />
<el-table-column label="状态" prop="engineering_status_text" show-overflow-tooltip>
<template #default="{ row }">
<el-switch v-model="row.status" :active-value="1" :inactive-value="0"
@change="changeStatus(row)"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button type="primary" link @click="handleEdit(row)">
库存管理
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showDetail" ref="editRef" @close="showDetail = false" />
</div>
</template>
<script lang="ts" setup name="manageProjectLists">
import { usePaging } from '@/hooks/usePaging'
import { apiGoodsListLists, apiGoodsListDetail, apiStatus, apiGoodsTypeLists } from '@/api/goodsList'
import EditPopup from './detail.vue'
import { ref, reactive } from "vue"
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showDetail = ref(false)
//
const queryParams = reactive({
status: "",
store_name: "",
cate_id: ""
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiGoodsListLists,
params: queryParams
})
// &
const changeStatus = (data: any) => {
apiStatus({
id: data.id,
}).finally(() => {
getLists()
})
}
//
const handleEdit = async (data: any) => {
// let res = await apiGoodsListDetail({ id: data.id })
showDetail.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
const typeLists = reactive([])
const getTypeLists = async () => {
let res = await apiGoodsTypeLists()
typeLists.push(...res)
}
// getTypeLists()
getLists()
</script>

View File

@ -0,0 +1,118 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="120px" :rules="formRules">
<el-form-item label="申请金额" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入店员名称" />
</el-form-item>
<el-form-item label="收款方式" prop="title">
<el-select class="flex-1" v-model="formData.title" clearable placeholder="请选择收款方式">
<el-option label="全部" :value="0" />
<el-option label="待审核" :value="0" />
<el-option label="已通过" :value="0" />
<el-option label="未通过" :value="0" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="title">
<el-input v-model="formData.title" clearable placeholder="请输入备注" type="textarea" />
</el-form-item>
<span>最高转账50元最低转账10元</span>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="oaPlanEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiStoreExtractCashs } from '@/api/store_extract.ts'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const popupTitle = computed(() => {
return '新增提现'
})
//
const formData = reactive({
id: '',
title: '',
type: '',
start_time: '',
end_time: '',
remind_type: '',
remark: '',
})
const chekcDate = (rule: any, value: any, callback: any) => {
if (new Date(formData.end_time) < new Date(formData.start_time)) {
callback(new Error('结束时间不能早于开始时间'))
} else {
callback()
}
}
//
const formRules = reactive<any>({
title: [{
required: true,
message: '请输入工作安排主题',
trigger: ['blur']
}],
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
// mode.value == 'edit'
// ? await apiStoreExtractCashs(data)
// : await apiStoreExtractCashs(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add', start_time = '') => {
mode.value = type
formData.start_time = start_time
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData
})
</script>

View File

@ -0,0 +1,90 @@
<!-- 门店提现 -->
<!-- 门店提现 -->
<!-- 门店提现 -->
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="结算日期">
<el-date-picker v-model="queryParams.times" type="daterange" range-separator="-"
start-placeholder="开始时间" end-placeholder="结束时间" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<!-- <el-button type="primary" @click="handleAdd">申请提现</el-button> -->
<div class="mt-4">
<el-table :data="pager.lists">
<!-- <el-table-column label="id" prop="progress" show-overflow-tooltip /> -->
<el-table-column label="结算日期" prop="progress" show-overflow-tooltip />
<el-table-column label="结算类型" prop="progress" show-overflow-tooltip />
<el-table-column label="结算金额" prop="progress" show-overflow-tooltip />
<el-table-column label="结算方式" prop="progress" show-overflow-tooltip />
<el-table-column label="付款方信息" prop="progress" show-overflow-tooltip />
<el-table-column label="收款方信息" prop="progress" show-overflow-tooltip />
<el-table-column label="结算凭证" prop="progress" show-overflow-tooltip />
<el-table-column label="结算备注" prop="progress" show-overflow-tooltip />
<el-table-column label="经办人" prop="progress" show-overflow-tooltip />
<!-- <el-table-column label="头像" prop="build_area_text" show-overflow-tooltip>
<template #default="{ row }">
</template>
</el-table-column> -->
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
备注
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" @success="getLists" @close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="manageProjectLists">
import { ref, reactive } from "vue"
import { usePaging } from '@/hooks/usePaging'
import { apiStoreExtractLists, apiStoreExtractRemarks } from '@/api/store_extract.ts'
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
//
const queryParams = reactive({
times: '',
status: ""
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiStoreExtractLists,
params: queryParams
})
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
// getLists()
</script>

View File

@ -0,0 +1,99 @@
<!-- 门店流水 -->
<!-- 门店流水 -->
<!-- 门店流水 -->
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" label-width="80px">
<el-row>
<el-col :span="6">
<el-form-item label="创建时间">
<el-date-picker class="flex-1 !flex" v-model="queryParams.date" clearable
value-format="YYYY-MM-DD" placeholder="选择创建时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="订单搜索">
<el-input v-model="queryParams.order" clearable placeholder="请输入交易单号/交易人" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="选择店员">
<el-input v-model="queryParams.order" clearable placeholder="请选择店员" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
<el-button @click="showDialog = true">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table :data="pager.lists">
<el-table-column label="交易单号" prop="progress" show-overflow-tooltip />
<el-table-column label="关联订单" prop="progress" show-overflow-tooltip />
<el-table-column label="交易时间" prop="progress" show-overflow-tooltip />
<el-table-column label="交易金额" prop="progress" show-overflow-tooltip />
<el-table-column label="交易人" prop="progress" show-overflow-tooltip />
<el-table-column label="关联店员" prop="progress" show-overflow-tooltip />
<el-table-column label="交易类型" prop="progress" show-overflow-tooltip />
<el-table-column label="支付方式" prop="progress" show-overflow-tooltip />
<el-table-column label="备注" prop="progress" show-overflow-tooltip />
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }" @click="showDialog = true, rows = row">
备注
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
</div>
<el-dialog title="添加备注" v-model="showDialog" width="550px">
<el-form-item>
<el-input v-model="remarks" type="textarea" placeholder="请输入备注内容"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleRemarks">确定</el-button>
<el-button @click="showDialog = false">取消</el-button>
</el-form-item>
</el-dialog>
</template>
<script lang="ts" setup name="manageProjectLists">
import { ref, reactive } from "vue"
import { usePaging } from '@/hooks/usePaging'
import { apiStorFinanceFlowLists, apiStorFinanceFlowRemarks } from '@/api/store_finance_flow.ts'
//
const queryParams = reactive({
date: "",
order: ""
})
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiStorFinanceFlowLists,
params: queryParams
})
const showDialog = ref(false)
const remarks = ref('')
const rows = ref({})
const handleRemarks = async (row: any) => {
await apiStorFinanceFlowRemarks({ row })
showDialog.value = false
}
// getLists()
</script>

View File

@ -52,12 +52,6 @@
<el-tab-pane label="消费记录" name="second">
<shoping></shoping>
</el-tab-pane>
<!-- <el-tab-pane label="积分明细" name="third">
</el-tab-pane>
<el-tab-pane label="签到记录" name="four">
</el-tab-pane> -->
<el-tab-pane label="余额变动" name="five">
<money></money>
</el-tab-pane>

View File

@ -0,0 +1,29 @@
<template>
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column label="头像" prop="build_area_text" show-overflow-tooltip>
<template #default="{ row }">
<!-- <el-image style="width: 50px; height: 50px" :src="url" /> -->
</template>
</el-table-column>
<el-table-column label="用户名称" prop="project_level_text" show-overflow-tooltip />
<el-table-column label="订单号" prop="total_investment" show-overflow-tooltip width="120" />
<el-table-column label="交易金额" prop="total_investment" show-overflow-tooltip width="120" />
<el-table-column label="成交时间" prop="total_investment" show-overflow-tooltip width="120" />
</el-table>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</template>
<script lang="ts" setup name="manageProjectLists">
import { ref, reactive } from "vue"
import { usePaging } from '@/hooks/usePaging'
import { apiGoodsListLists, apiStatus, apiGoodsTypeLists } from '@/api/goodsList'
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiGoodsListLists,
})
// getLists()
</script>

View File

@ -1,144 +1,114 @@
<template>
<div class="workbench">
<div class="lg:flex">
<el-card class="!border-none mb-4 lg:mr-4 lg:w-[350px]" shadow="never">
<template #header>
<span class="card-title">版本信息</span>
</template>
<div>
<div class="flex leading-9">
<div class="w-20">平台名称</div>
<span> {{ workbenchData.version.name }}</span>
</div>
<div class="flex leading-9">
<div class="w-20">当前版本</div>
<span> {{ workbenchData.version.version }}</span>
</div>
<div class="flex leading-9">
<div class="w-20">获取渠道</div>
<div>
<a :href="workbenchData.version.channel.website" target="_blank">
<el-button type="success" size="small">官网</el-button>
</a>
<a
class="ml-3"
:href="workbenchData.version.channel.gitee"
target="_blank"
>
<el-button type="danger" size="small">Gitee</el-button>
</a>
</div>
</div>
</div>
<el-card>
<el-form class="mb-[-16px]" :model="queryParams" label-width="80px">
<el-col :span="6">
<el-form-item label="时间筛选">
<el-date-picker v-model="date" type="daterange" range-separator="-" start-placeholder="开始时间"
end-placeholder="结束时间" />
</el-form-item>
</el-col>
</el-form>
</el-card>
<el-card class="!border-none mb-4 flex-1" shadow="never">
<template #header>
<div>
<span class="card-title">今日数据</span>
<span class="text-tx-secondary text-xs ml-4">
更新时间{{ workbenchData.today.time }}
</span>
</div>
</template>
<div class="flex flex-wrap">
<div class="w-1/2 md:w-1/4">
<div class="leading-10">销售额</div>
<div class="text-6xl">{{ workbenchData.today.today_sales }}</div>
<div class="text-tx-secondary text-xs">
{{ workbenchData.today.total_sales }}
</div>
</div>
<div class="w-1/2 md:w-1/4">
<div class="leading-10">成交订单</div>
<div class="text-6xl">{{ workbenchData.today.order_num }}</div>
<div class="text-tx-secondary text-xs">
{{ workbenchData.today.order_sum }}
</div>
</div>
<div class="w-1/2 md:w-1/4">
<div class="leading-10">新增用户</div>
<div class="text-6xl">{{ workbenchData.today.today_new_user }}</div>
<div class="text-tx-secondary text-xs">
{{ workbenchData.today.total_new_user }}
</div>
</div>
<div class="w-1/2 md:w-1/4">
<div class="leading-10">新增访问量</div>
<div class="text-6xl">{{ workbenchData.today.today_visitor }}</div>
<div class="text-tx-secondary text-xs">
{{ workbenchData.today.total_visitor }}
</div>
</div>
</div>
<el-card>
<el-row>
<el-col :span="6" class='flex mb-7' v-for="(item, index) in statisticLists" :key="index">
<img class="w-[50px] h-[50px] mr-2" :src="item.src" />
<el-statistic :title="item.title" :value="item.value" />
</el-col>
</el-row>
</el-card>
</div>
<div class="function mb-4">
<el-card class="flex-1 !border-none" shadow="never">
<el-card>
<template #header>
<span>常用功能</span>
营业趋势
</template>
<div class="flex flex-wrap">
<div
v-for="item in workbenchData.menu"
class="md:w-[12.5%] w-1/4 flex flex-col items-center"
:key="item"
>
<router-link :to="item.url" class="mb-3 flex flex-col items-center">
<image-contain width="40px" height="40px" :src="item?.image" />
<div class="mt-2">{{ item.name }}</div>
</router-link>
</div>
</div>
<v-charts style="height: 350px" :option="visitorOption" :autoresize="true" />
</el-card>
</div>
<div class="md:flex">
<el-card class="flex-1 !border-none md:mr-4 mb-4" shadow="never">
<el-row>
<el-col :span="14">
<el-card class="h-[100%]">
<template #header>
<span>访问量趋势图</span>
交易数据
</template>
<div>
<v-charts
style="height: 350px"
:option="workbenchData.visitorOption"
:autoresize="true"
/>
</div>
<tradData></tradData>
</el-card>
</div>
</div>
</el-col>
<el-col :span="10">
<el-card>
<template #header>
交易类型
</template>
<v-charts style="height: 350px" :option="tradTypeOption" :autoresize="true" />
</el-card>
</el-col>
</el-row>
</template>
<script lang="ts" setup name="workbench">
<script lang="ts" setup name="manageProjectLists">
import { ref, reactive } from "vue"
import { getWorkbench } from '@/api/app'
import vCharts from 'vue-echarts'
//
const workbenchData: any = reactive({
version: {
version: '', //
website: '', //
based: '',
channel: {
gitee: '',
website: ''
}
},
support: [],
today: {}, //
menu: [], //
visitor: [], // 访
article: [], //
import tradData from "./components/tradData.vue"
visitorOption: {
const src = ref('https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg')
const date = ref("")
const statisticLists = reactive([
{
src: 'https://ceshi-engineering.lihaink.cn/uploads/files/20240604/20240604171701552002039.png',
title: "核销订单金额",
value: 1000
},
{
src: "https://ceshi-engineering.lihaink.cn/uploads/files/20240604/2024060417170150a511510.png",
title: "余额消费金额",
value: 1000
},
{
src: 'https://ceshi-engineering.lihaink.cn/uploads/files/20240604/20240604171701594ff8897.png',
title: "用户充值金额",
value: 1000
},
{
src: 'https://ceshi-engineering.lihaink.cn/uploads/files/20240604/202406041717018a22e1161.png',
title: "线下收银订单金额",
value: 1000
},
{
src: 'https://ceshi-engineering.lihaink.cn/uploads/files/20240604/202406041717013a08c6793.png',
title: "现金收银订单金额",
value: 1000
},
{
src: 'https://ceshi-engineering.lihaink.cn/uploads/files/20240604/2024060417170103b0a9686.png',
title: "门店新增用户数",
value: 1000
},
{
src: 'https://ceshi-engineering.lihaink.cn/uploads/files/20240604/20240604171701469b91377.png',
title: "门店成交用户数",
value: 1000
},
{
src: 'https://ceshi-engineering.lihaink.cn/uploads/files/20240604/20240604171701fbb680115.png',
title: "总订单金额",
value: 1000
},
])
const visitorOption = reactive({
xAxis: {
type: 'category',
data: [0]
data: []
},
yAxis: {
type: 'value'
},
legend: {
data: ['访问量']
data: ['营业额']
},
itemStyle: {
//
@ -149,35 +119,66 @@ const workbenchData: any = reactive({
},
series: [
{
name: '访问量',
name: '营业额',
data: [0],
type: 'line',
smooth: true
}
]
}
})
//
const tradTypeOption = reactive(
{
title: {
text: '交易类型',
subtext: 'Fake Data',
left: 'center'
},
tooltip: {
trigger: 'item'
},
legend: {
orient: 'vertical',
left: 'left'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: '50%',
data: [
{ value: 1048, name: '线上收银订单' },
{ value: 735, name: '现金收银订单' },
{ value: 580, name: '核销订单' },
{ value: 484, name: '充值订单' },
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
}
)
const getData = () => {
getWorkbench()
.then((res: any) => {
workbenchData.version = res.version
workbenchData.today = res.today
workbenchData.menu = res.menu
workbenchData.visitor = res.visitor
workbenchData.support = res.support
// echarts
workbenchData.visitorOption.xAxis.data = []
workbenchData.visitorOption.series[0].data = []
visitorOption.xAxis.data = []
visitorOption.series[0].data = []
//
res.visitor.date.reverse().forEach((item: any) => {
workbenchData.visitorOption.xAxis.data.push(item)
visitorOption.xAxis.data.push(item)
})
res.visitor.list[0].data.forEach((item: any) => {
workbenchData.visitorOption.series[0].data.push(item)
visitorOption.series[0].data.push(item)
})
})
.catch((err: any) => {
@ -188,6 +189,5 @@ const getData = () => {
onMounted(() => {
getData()
})
</script>
<style lang="scss" scoped></style>
</script>

View File

@ -0,0 +1,182 @@
<template>
<div class="workbench">
<div class="lg:flex">
<el-card class="!border-none mb-4 lg:mr-4 lg:w-[350px]" shadow="never">
<template #header>
<span class="card-title">版本信息</span>
</template>
<div>
<div class="flex leading-9">
<div class="w-20">平台名称</div>
<span> {{ workbenchData.version.name }}</span>
</div>
<div class="flex leading-9">
<div class="w-20">当前版本</div>
<span> {{ workbenchData.version.version }}</span>
</div>
<div class="flex leading-9">
<div class="w-20">获取渠道</div>
<div>
<a :href="workbenchData.version.channel.website" target="_blank">
<el-button type="success" size="small">官网</el-button>
</a>
<a class="ml-3" :href="workbenchData.version.channel.gitee" target="_blank">
<el-button type="danger" size="small">Gitee</el-button>
</a>
</div>
</div>
</div>
</el-card>
<el-card class="!border-none mb-4 flex-1" shadow="never">
<template #header>
<div>
<span class="card-title">今日数据</span>
<span class="text-tx-secondary text-xs ml-4">
更新时间{{ workbenchData.today.time }}
</span>
</div>
</template>
<div class="flex flex-wrap">
<div class="w-1/2 md:w-1/4">
<div class="leading-10">销售额</div>
<div class="text-6xl">{{ workbenchData.today.today_sales }}</div>
<div class="text-tx-secondary text-xs">
{{ workbenchData.today.total_sales }}
</div>
</div>
<div class="w-1/2 md:w-1/4">
<div class="leading-10">成交订单</div>
<div class="text-6xl">{{ workbenchData.today.order_num }}</div>
<div class="text-tx-secondary text-xs">
{{ workbenchData.today.order_sum }}
</div>
</div>
<div class="w-1/2 md:w-1/4">
<div class="leading-10">新增用户</div>
<div class="text-6xl">{{ workbenchData.today.today_new_user }}</div>
<div class="text-tx-secondary text-xs">
{{ workbenchData.today.total_new_user }}
</div>
</div>
<div class="w-1/2 md:w-1/4">
<div class="leading-10">新增访问量</div>
<div class="text-6xl">{{ workbenchData.today.today_visitor }}</div>
<div class="text-tx-secondary text-xs">
{{ workbenchData.today.total_visitor }}
</div>
</div>
</div>
</el-card>
</div>
<div class="function mb-4">
<el-card class="flex-1 !border-none" shadow="never">
<template #header>
<span>常用功能</span>
</template>
<div class="flex flex-wrap">
<div v-for="item in workbenchData.menu" class="md:w-[12.5%] w-1/4 flex flex-col items-center"
:key="item">
<router-link :to="item.url" class="mb-3 flex flex-col items-center">
<image-contain width="40px" height="40px" :src="item?.image" />
<div class="mt-2">{{ item.name }}</div>
</router-link>
</div>
</div>
</el-card>
</div>
<div class="md:flex">
<el-card class="flex-1 !border-none md:mr-4 mb-4" shadow="never">
<template #header>
<span>访问量趋势图</span>
</template>
<div>
<v-charts style="height: 350px" :option="workbenchData.visitorOption" :autoresize="true" />
</div>
</el-card>
</div>
</div>
</template>
<script lang="ts" setup name="workbench">
import { getWorkbench } from '@/api/app'
import vCharts from 'vue-echarts'
//
const workbenchData: any = reactive({
version: {
version: '', //
website: '', //
based: '',
channel: {
gitee: '',
website: ''
}
},
support: [],
today: {}, //
menu: [], //
visitor: [], // 访
article: [], //
visitorOption: {
xAxis: {
type: 'category',
data: [0]
},
yAxis: {
type: 'value'
},
legend: {
data: ['访问量']
},
itemStyle: {
//
color: 'red'
},
tooltip: {
trigger: 'axis'
},
series: [
{
name: '访问量',
data: [0],
type: 'line',
smooth: true
}
]
}
})
//
const getData = () => {
getWorkbench()
.then((res: any) => {
workbenchData.version = res.version
workbenchData.today = res.today
workbenchData.menu = res.menu
workbenchData.visitor = res.visitor
workbenchData.support = res.support
// echarts
workbenchData.visitorOption.xAxis.data = []
workbenchData.visitorOption.series[0].data = []
//
res.visitor.date.reverse().forEach((item: any) => {
workbenchData.visitorOption.xAxis.data.push(item)
})
res.visitor.list[0].data.forEach((item: any) => {
workbenchData.visitorOption.series[0].data.push(item)
})
})
.catch((err: any) => {
console.log('err', err)
})
}
onMounted(() => {
getData()
})
</script>
<style lang="scss" scoped></style>