1
This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 若依管理系统
|
VUE_APP_TITLE = Jarvis
|
||||||
|
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# 若依管理系统/开发环境
|
# Jarvis/开发环境
|
||||||
VUE_APP_BASE_API = '/dev-api'
|
VUE_APP_BASE_API = ''
|
||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|
||||||
|
VUE_APP_BASE_API = 'http://127.0.0.1:30313'
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 若依管理系统
|
VUE_APP_TITLE = Jarvis
|
||||||
|
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
||||||
# 若依管理系统/生产环境
|
# Jarvis/生产环境
|
||||||
VUE_APP_BASE_API = '/prod-api'
|
VUE_APP_BASE_API = ''
|
||||||
|
|
||||||
|
# VUE_APP_BASE_API = 'http://134.175.126.60:30313'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 若依管理系统
|
VUE_APP_TITLE = Jarvis
|
||||||
|
|
||||||
BABEL_ENV = production
|
BABEL_ENV = production
|
||||||
|
|
||||||
@@ -8,5 +8,5 @@ NODE_ENV = production
|
|||||||
# 测试环境配置
|
# 测试环境配置
|
||||||
ENV = 'staging'
|
ENV = 'staging'
|
||||||
|
|
||||||
# 若依管理系统/测试环境
|
# Jarvis/测试环境
|
||||||
VUE_APP_BASE_API = '/stage-api'
|
VUE_APP_BASE_API = '/stage-api'
|
||||||
|
|||||||
51
nginx-jarvis.conf
Normal file
51
nginx-jarvis.conf
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name jarvis.van333.cn;
|
||||||
|
|
||||||
|
# 设置根目录
|
||||||
|
root /www/sites/jarvis.van333.cn/index;
|
||||||
|
index index.html index.htm;
|
||||||
|
|
||||||
|
# 代理头设置
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $server_name;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection $http_connection;
|
||||||
|
|
||||||
|
# 日志配置
|
||||||
|
access_log /www/sites/jarvis.van333.cn/log/access.log main;
|
||||||
|
error_log /www/sites/jarvis.van333.cn/log/error.log;
|
||||||
|
|
||||||
|
# SSL证书验证
|
||||||
|
location ^~ /.well-known/acme-challenge {
|
||||||
|
allow all;
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
}
|
||||||
|
|
||||||
|
# 静态资源处理
|
||||||
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||||
|
expires 1y;
|
||||||
|
add_header Cache-Control "public, immutable";
|
||||||
|
try_files $uri =404;
|
||||||
|
}
|
||||||
|
|
||||||
|
# API代理 - 如果有后端API
|
||||||
|
location /api/ {
|
||||||
|
proxy_pass http://localhost:8080/; # 根据您的后端服务地址调整
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
# 处理Vue Router的History模式
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
# 404错误页面
|
||||||
|
error_page 404 /404.html;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ruoyi",
|
"name": "ruoyi",
|
||||||
"version": "3.9.0",
|
"version": "3.9.0",
|
||||||
"description": "若依管理系统",
|
"description": "Jarvis",
|
||||||
"author": "若依",
|
"author": "若依",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
52
src/api/system/orderrows.js
Normal file
52
src/api/system/orderrows.js
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询京粉订单列表
|
||||||
|
export function listOrderrows(query) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/orderrows/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询京粉订单详细
|
||||||
|
export function getOrderrows(orderId) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/orderrows/' + orderId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增京粉订单
|
||||||
|
export function addOrderrows(data) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/orderrows',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改京粉订单
|
||||||
|
export function updateOrderrows(data) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/orderrows',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除京粉订单
|
||||||
|
export function delOrderrows(orderId) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/orderrows/' + orderId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取订单状态下拉数据
|
||||||
|
export function getValidCodeSelectData() {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/orderrows/select/validCode',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
52
src/api/system/superadmin.js
Normal file
52
src/api/system/superadmin.js
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询超级管理员列表
|
||||||
|
export function listSuperadmin(query) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/superadmin/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询超级管理员详细
|
||||||
|
export function getSuperadmin(id) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/superadmin/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增超级管理员
|
||||||
|
export function addSuperadmin(data) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/superadmin',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改超级管理员
|
||||||
|
export function updateSuperadmin(data) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/superadmin',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除超级管理员
|
||||||
|
export function delSuperadmin(id) {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/superadmin/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取管理员下拉数据
|
||||||
|
export function getAdminSelectData() {
|
||||||
|
return request({
|
||||||
|
url: '/jarvis/superadmin/select/adminUnionId',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 146 KiB |
@@ -5,7 +5,7 @@
|
|||||||
:current-page.sync="currentPage"
|
:current-page.sync="currentPage"
|
||||||
:page-size.sync="pageSize"
|
:page-size.sync="pageSize"
|
||||||
:layout="layout"
|
:layout="layout"
|
||||||
:page-sizes="pageSizes"
|
:page-sizes="[10, 50, 100, 200]"
|
||||||
:pager-count="pagerCount"
|
:pager-count="pagerCount"
|
||||||
:total="total"
|
:total="total"
|
||||||
v-bind="$attrs"
|
v-bind="$attrs"
|
||||||
|
|||||||
@@ -64,13 +64,13 @@ export const constantRoutes = [
|
|||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: 'index',
|
redirect: 'order/list',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'index',
|
path: 'order/list',
|
||||||
component: () => import('@/views/index'),
|
component: () => import('@/views/system/orderrows/index'),
|
||||||
name: 'Index',
|
name: 'OrderList',
|
||||||
meta: { title: '首页', icon: 'dashboard', affix: true }
|
meta: { title: '京粉订单', icon: 'order', affix: true }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -87,6 +87,49 @@ export const constantRoutes = [
|
|||||||
meta: { title: '个人中心', icon: 'user' }
|
meta: { title: '个人中心', icon: 'user' }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
path: '/order',
|
||||||
|
component: Layout,
|
||||||
|
redirect: 'list',
|
||||||
|
name: 'Order',
|
||||||
|
meta: { title: '京粉订单', icon: 'shopping' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'list',
|
||||||
|
component: () => import('@/views/system/orderrows/index'),
|
||||||
|
name: 'OrderList',
|
||||||
|
meta: { title: '订单列表', icon: 'list' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'statistics',
|
||||||
|
component: () => import('@/views/system/orderrows/statistics'),
|
||||||
|
name: 'OrderStatistics',
|
||||||
|
meta: { title: '订单统计', icon: 'chart' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'settings',
|
||||||
|
component: () => import('@/views/system/orderrows/settings'),
|
||||||
|
name: 'OrderSettings',
|
||||||
|
meta: { title: '订单设置', icon: 'setting' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/system',
|
||||||
|
component: Layout,
|
||||||
|
redirect: 'noredirect',
|
||||||
|
name: 'System',
|
||||||
|
meta: { title: '系统管理', icon: 'system' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'superadmin',
|
||||||
|
component: () => import('@/views/system/superadmin/index'),
|
||||||
|
name: 'Superadmin',
|
||||||
|
meta: { title: '超级管理员', icon: 'user' }
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
1136
src/views/index.vue
1136
src/views/index.vue
File diff suppressed because it is too large
Load Diff
@@ -56,7 +56,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<!-- 底部 -->
|
<!-- 底部 -->
|
||||||
<div class="el-login-footer">
|
<div class="el-login-footer">
|
||||||
<span>Copyright © 2018-2025 ruoyi.vip All Rights Reserved.</span>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -142,7 +142,7 @@ export default {
|
|||||||
Cookies.remove('rememberMe')
|
Cookies.remove('rememberMe')
|
||||||
}
|
}
|
||||||
this.$store.dispatch("Login", this.loginForm).then(() => {
|
this.$store.dispatch("Login", this.loginForm).then(() => {
|
||||||
this.$router.push({ path: this.redirect || "/" }).catch(()=>{})
|
this.$router.push({ path: this.redirect || "/order/list" }).catch(()=>{})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
if (this.captchaEnabled) {
|
if (this.captchaEnabled) {
|
||||||
|
|||||||
536
src/views/system/orderrows/index.vue
Normal file
536
src/views/system/orderrows/index.vue
Normal file
@@ -0,0 +1,536 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="京粉账号" prop="unionId">
|
||||||
|
<el-select v-model="queryParams.unionId" placeholder="请选择京粉账号" clearable style="width: 240px">
|
||||||
|
<el-option
|
||||||
|
v-for="admin in adminList"
|
||||||
|
:key="admin.value || admin.id"
|
||||||
|
:label="admin.label || (admin.name + ' (' + admin.wxid + ')')"
|
||||||
|
:value="admin.value || admin.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订单号" prop="orderId">
|
||||||
|
<el-input v-model="queryParams.orderId" placeholder="请输入订单号" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品名称" prop="skuName">
|
||||||
|
<el-input v-model="queryParams.skuName" placeholder="请输入商品名称" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订单状态" prop="statusGroup">
|
||||||
|
<el-select v-model="queryParams.statusGroup" placeholder="订单状态" clearable style="width: 240px">
|
||||||
|
<el-option v-for="status in mergedStatusList" :key="status.value" :label="status.label" :value="status.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订单时间">
|
||||||
|
<el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:orderrows:add']">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:orderrows:edit']">修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:orderrows:remove']">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:orderrows:export']">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="orderrowsList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
|
<el-table-column label="账号" align="center" prop="unionId" width="50">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ getAdminName(scope.row.unionId) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="订单号" align="center" prop="orderId" width="120" />
|
||||||
|
<el-table-column label="商品名称" align="center" prop="skuName" :show-overflow-tooltip="true" min-width="200" />
|
||||||
|
<el-table-column label="商品价格" align="center" prop="price" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>¥{{ scope.row.price }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商品数量" align="center" prop="skuNum" width="80" />
|
||||||
|
<el-table-column label="订单状态" align="center" prop="validCode" width="240">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="getStatusType(scope.row.validCode)">
|
||||||
|
{{ getStatusText(scope.row.validCode) }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="佣金比例" align="center" prop="commissionRate" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.commissionRate }}%</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="预估佣金" align="center" prop="estimateFee" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>¥{{ scope.row.estimateFee }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="实际佣金" align="center" prop="actualFee" width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>¥{{ scope.row.actualFee }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="订单时间" align="center" prop="orderTime" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.orderTime) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="完成时间" align="center" prop="finishTime" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.finishTime ? parseTime(scope.row.finishTime) : '-' }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:orderrows:edit']">修改</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:orderrows:remove']">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
|
|
||||||
|
<!-- 查看订单详情对话框 -->
|
||||||
|
<el-dialog :title="'订单详情 - ' + currentOrder.orderId" :visible.sync="viewDialogVisible" width="900px" append-to-body>
|
||||||
|
<el-descriptions :column="2" border>
|
||||||
|
<!-- 基本信息 -->
|
||||||
|
<el-descriptions-item label="订单号">{{ currentOrder.orderId }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="主单号">{{ currentOrder.parentId || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="商品ID">{{ currentOrder.skuId }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="商品名称" :span="2">{{ currentOrder.skuName }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="商品价格">¥{{ currentOrder.price }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="商品数量">{{ currentOrder.skuNum }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="已退货数量">{{ currentOrder.skuReturnNum || 0 }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="售后中数量">{{ currentOrder.skuFrozenNum || 0 }}</el-descriptions-item>
|
||||||
|
|
||||||
|
<!-- 订单状态 -->
|
||||||
|
<el-descriptions-item label="订单状态">
|
||||||
|
<el-tag :type="getStatusType(currentOrder.validCode)">
|
||||||
|
{{ getStatusText(currentOrder.validCode) }}
|
||||||
|
</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="发货状态">
|
||||||
|
<el-tag :type="currentOrder.expressStatus === 10 ? 'warning' : 'success'">
|
||||||
|
{{ currentOrder.expressStatus === 10 ? '待发货' : '已发货' }}
|
||||||
|
</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<!-- 佣金信息 -->
|
||||||
|
<el-descriptions-item label="佣金比例">{{ currentOrder.commissionRate }}%</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="分成比例">{{ currentOrder.subSideRate }}%</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="补贴比例">{{ currentOrder.subsidyRate }}%</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="最终分佣比例">{{ currentOrder.finalRate }}%</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="预估计佣金额">¥{{ currentOrder.estimateCosPrice }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="预估佣金">¥{{ currentOrder.estimateFee }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="实际计佣金额">¥{{ currentOrder.actualCosPrice }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="实际佣金">¥{{ currentOrder.actualFee }}</el-descriptions-item>
|
||||||
|
|
||||||
|
<!-- 时间信息 -->
|
||||||
|
<el-descriptions-item label="下单时间">{{ parseTime(currentOrder.orderTime) }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="完成时间">{{ currentOrder.finishTime ? parseTime(currentOrder.finishTime) : '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="更新时间">{{ parseTime(currentOrder.modifyTime) }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="预估结算时间">{{ currentOrder.payMonth !== '0' ? currentOrder.payMonth : '-' }}</el-descriptions-item>
|
||||||
|
|
||||||
|
<!-- 推广信息 -->
|
||||||
|
<el-descriptions-item label="推客ID">{{ currentOrder.unionId }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="推广位ID">{{ currentOrder.positionId }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="应用ID">{{ currentOrder.siteId }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="商家ID">{{ currentOrder.popId }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="PID">{{ currentOrder.pid || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="子渠道标识">{{ currentOrder.subUnionId || '-' }}</el-descriptions-item>
|
||||||
|
|
||||||
|
<!-- 商品分类 -->
|
||||||
|
<el-descriptions-item label="商品分类" :span="2">
|
||||||
|
{{ currentOrder.cid1 }} > {{ currentOrder.cid2 }} > {{ currentOrder.cid3 }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<!-- 订单属性 -->
|
||||||
|
<el-descriptions-item label="下单设备">
|
||||||
|
<el-tag :type="currentOrder.orderEmt === 1 ? 'primary' : 'success'">
|
||||||
|
{{ currentOrder.orderEmt === 1 ? 'PC' : '无线' }}
|
||||||
|
</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="PLUS会员">
|
||||||
|
<el-tag :type="currentOrder.plus === 1 ? 'warning' : 'info'">
|
||||||
|
{{ currentOrder.plus === 1 ? '是' : '否' }}
|
||||||
|
</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="同跨店">
|
||||||
|
<el-tag :type="currentOrder.traceType === 2 ? 'success' : 'warning'">
|
||||||
|
{{ currentOrder.traceType === 2 ? '同店' : '跨店' }}
|
||||||
|
</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="站长角色">
|
||||||
|
<el-tag :type="getRoleType(currentOrder.unionRole)">
|
||||||
|
{{ getRoleText(currentOrder.unionRole) }}
|
||||||
|
</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<!-- 扩展信息 -->
|
||||||
|
<el-descriptions-item label="扩展字段">{{ currentOrder.ext1 || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="礼金分摊金额">¥{{ currentOrder.giftCouponOcsAmount || 0 }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="礼金批次ID">{{ currentOrder.giftCouponKey || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="计佣扩展信息">{{ currentOrder.balanceExt || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="价保赔付金额">¥{{ currentOrder.proPriceAmount || 0 }}</el-descriptions-item>
|
||||||
|
|
||||||
|
<!-- 商品信息 -->
|
||||||
|
<el-descriptions-item label="商品主图" :span="2" v-if="currentOrder.goodsInfo">
|
||||||
|
<img :src="currentOrder.goodsInfo.imageUrl" style="max-width: 200px; max-height: 200px;" v-if="currentOrder.goodsInfo.imageUrl" />
|
||||||
|
<span v-else>-</span>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="店铺名称" v-if="currentOrder.goodsInfo">{{ currentOrder.goodsInfo.shopName || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="店铺ID" v-if="currentOrder.goodsInfo">{{ currentOrder.goodsInfo.shopId || '-' }}</el-descriptions-item>
|
||||||
|
|
||||||
|
<!-- 类目信息 -->
|
||||||
|
<el-descriptions-item label="类目信息" :span="2" v-if="currentOrder.categoryInfo">
|
||||||
|
{{ currentOrder.categoryInfo.cid1Name }} > {{ currentOrder.categoryInfo.cid2Name }} > {{ currentOrder.categoryInfo.cid3Name }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
|
||||||
|
<!-- 其他信息 -->
|
||||||
|
<el-descriptions-item label="联盟商品ID">{{ currentOrder.itemId || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="工具商联盟商品ID">{{ currentOrder.callerItemId || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="渠道关系ID">{{ currentOrder.channelId || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="团长渠道ID">{{ currentOrder.rid || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="招商团活动ID">{{ currentOrder.cpActId || '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="账户ID">{{ currentOrder.account || '-' }}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="viewDialogVisible = false">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listOrderrows, getOrderrows, delOrderrows, addOrderrows, updateOrderrows, getValidCodeSelectData } from "@/api/system/orderrows";
|
||||||
|
import { getAdminSelectData } from "@/api/system/superadmin";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Orderrows",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 京粉订单表格数据
|
||||||
|
orderrowsList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 日期范围
|
||||||
|
dateRange: [],
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
unionId: null,
|
||||||
|
orderId: null,
|
||||||
|
skuName: null,
|
||||||
|
validCode: null,
|
||||||
|
statusGroup: null // 新增
|
||||||
|
},
|
||||||
|
// 管理员列表
|
||||||
|
adminList: [],
|
||||||
|
// 状态列表
|
||||||
|
statusList: [], // 原始状态列表
|
||||||
|
mergedStatusList: [], // 合并后下拉
|
||||||
|
statusValueMap: {}, // 合并项到原始code数组
|
||||||
|
// 查看详情对话框
|
||||||
|
viewDialogVisible: false,
|
||||||
|
// 当前查看的订单
|
||||||
|
currentOrder: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
this.getAdminList();
|
||||||
|
this.getStatusList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询京粉订单列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listOrderrows(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
|
this.orderrowsList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('获取订单列表失败:', error);
|
||||||
|
this.loading = false;
|
||||||
|
this.$message.error('获取订单列表失败');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 获取管理员列表 */
|
||||||
|
getAdminList() {
|
||||||
|
getAdminSelectData().then(response => {
|
||||||
|
this.adminList = response.data || response;
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('获取管理员列表失败:', error);
|
||||||
|
this.$message.error('获取管理员列表失败');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 获取状态列表 */
|
||||||
|
getStatusList() {
|
||||||
|
getValidCodeSelectData().then(response => {
|
||||||
|
const raw = response.data || response;
|
||||||
|
// 合并分组
|
||||||
|
const groupMap = [
|
||||||
|
{ label: '取消', value: 'cancel', codes: ['3'] },
|
||||||
|
{ label: '无效', value: 'invalid', codes: ['2','4','5','6','7','8','9','10','11','14','19','20','21','22','23','29','30','31','32','33','34'] },
|
||||||
|
{ label: '待付款', value: 'pending', codes: ['15'] },
|
||||||
|
{ label: '已付款', value: 'paid', codes: ['16'] },
|
||||||
|
{ label: '已完成', value: 'finished', codes: ['17'] },
|
||||||
|
{ label: '已付定金', value: 'deposit', codes: ['24'] },
|
||||||
|
{ label: '违规', value: 'illegal', codes: ['25','26','27','28'] }
|
||||||
|
];
|
||||||
|
// 兼容后端返回的code为数字或字符串
|
||||||
|
const allCodes = raw.map(i => String(i.value || i.code));
|
||||||
|
// 处理无效分组codes
|
||||||
|
groupMap[1].codes = ['2','4','5','6','7','8','9','11','14','19','20','21','22','23','29','30','31','33','34'];
|
||||||
|
// 违规codes
|
||||||
|
groupMap[6].codes = ['25','26','27','28'];
|
||||||
|
// 生成下拉和映射
|
||||||
|
this.mergedStatusList = groupMap.map(g => ({ label: g.label, value: g.value }));
|
||||||
|
this.statusValueMap = {};
|
||||||
|
groupMap.forEach(g => { this.statusValueMap[g.value] = g.codes; });
|
||||||
|
this.statusList = raw;
|
||||||
|
}).catch(error => {
|
||||||
|
this.$message.error('获取状态列表失败');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取状态类型
|
||||||
|
getStatusType(validCode) {
|
||||||
|
const statusMap = {
|
||||||
|
'-100': 'info', // 无变化
|
||||||
|
'-1': 'info', // 未知
|
||||||
|
'2': 'danger', // 无效-拆单
|
||||||
|
'3': 'danger', // 无效-取消
|
||||||
|
'4': 'danger', // 无效-京东帮帮主订单
|
||||||
|
'5': 'danger', // 无效-账号异常
|
||||||
|
'6': 'danger', // 无效-赠品类目不返佣
|
||||||
|
'7': 'danger', // 无效-校园订单
|
||||||
|
'8': 'danger', // 无效-企业订单
|
||||||
|
'9': 'danger', // 无效-团购订单
|
||||||
|
'11': 'danger', // 无效-乡村推广员下单
|
||||||
|
'13': 'danger', // 违规订单-其他
|
||||||
|
'14': 'danger', // 无效-来源与备案网址不符
|
||||||
|
'15': 'warning', // 待付款
|
||||||
|
'16': 'primary', // 已付款
|
||||||
|
'17': 'success', // 已完成(购买用户确认收货)
|
||||||
|
'19': 'danger', // 无效-佣金比例为0
|
||||||
|
'20': 'danger', // 无效-此复购订单对应的首购订单无效
|
||||||
|
'21': 'danger', // 无效-云店订单
|
||||||
|
'22': 'danger', // 无效-PLUS会员佣金比例为0
|
||||||
|
'23': 'danger', // 无效-支付有礼
|
||||||
|
'24': 'warning', // 已付定金
|
||||||
|
'25': 'danger', // 违规订单-流量劫持
|
||||||
|
'26': 'danger', // 违规订单-流量异常
|
||||||
|
'27': 'danger', // 违规订单-违反京东平台规则
|
||||||
|
'28': 'danger', // 违规订单-多笔交易异常
|
||||||
|
'29': 'danger', // 无效-跨屏跨店
|
||||||
|
'30': 'danger', // 无效-累计件数超出类目上限
|
||||||
|
'31': 'danger', // 无效-黑名单sku
|
||||||
|
'33': 'info', // 超市卡充值订单
|
||||||
|
'34': 'danger' // 无效-推卡订单无效
|
||||||
|
};
|
||||||
|
return statusMap[validCode] || 'info';
|
||||||
|
},
|
||||||
|
// 获取状态文本
|
||||||
|
getStatusText(validCode) {
|
||||||
|
const statusMap = {
|
||||||
|
'-100': '无变化',
|
||||||
|
'-1': '未知',
|
||||||
|
'2': '无效-拆单',
|
||||||
|
'3': '无效-取消',
|
||||||
|
'4': '无效-京东帮帮主订单',
|
||||||
|
'5': '无效-账号异常',
|
||||||
|
'6': '无效-赠品类目不返佣',
|
||||||
|
'7': '无效-校园订单',
|
||||||
|
'8': '无效-企业订单',
|
||||||
|
'9': '无效-团购订单',
|
||||||
|
'11': '无效-乡村推广员下单',
|
||||||
|
'13': '违规订单-其他',
|
||||||
|
'14': '无效-来源与备案网址不符',
|
||||||
|
'15': '待付款',
|
||||||
|
'16': '已付款',
|
||||||
|
'17': '已完成',
|
||||||
|
'19': '无效-佣金比例为0',
|
||||||
|
'20': '无效-此复购订单对应的首购订单无效',
|
||||||
|
'21': '无效-云店订单',
|
||||||
|
'22': '无效-PLUS会员佣金比例为0',
|
||||||
|
'23': '无效-支付有礼',
|
||||||
|
'24': '已付定金',
|
||||||
|
'25': '违规订单-流量劫持',
|
||||||
|
'26': '违规订单-流量异常',
|
||||||
|
'27': '违规订单-违反京东平台规则',
|
||||||
|
'28': '违规订单-多笔交易异常',
|
||||||
|
'29': '无效-跨屏跨店',
|
||||||
|
'30': '无效-累计件数超出类目上限',
|
||||||
|
'31': '无效-黑名单sku',
|
||||||
|
'33': '超市卡充值订单',
|
||||||
|
'34': '无效-推卡订单无效'
|
||||||
|
};
|
||||||
|
return statusMap[validCode] || '代码描述未定义';
|
||||||
|
},
|
||||||
|
// 获取站长角色类型
|
||||||
|
getRoleType(unionRole) {
|
||||||
|
const roleMap = {
|
||||||
|
1: 'primary', // 推客
|
||||||
|
2: 'success', // 团长
|
||||||
|
3: 'warning' // 内容服务商
|
||||||
|
};
|
||||||
|
return roleMap[unionRole] || 'info';
|
||||||
|
},
|
||||||
|
// 获取站长角色文本
|
||||||
|
getRoleText(unionRole) {
|
||||||
|
const roleMap = {
|
||||||
|
1: '推客',
|
||||||
|
2: '团长',
|
||||||
|
3: '内容服务商'
|
||||||
|
};
|
||||||
|
return roleMap[unionRole] || '未知';
|
||||||
|
},
|
||||||
|
// 根据unionId获取管理员名称
|
||||||
|
getAdminName(unionId) {
|
||||||
|
if (!unionId) return '-';
|
||||||
|
const admin = this.adminList.find(item => {
|
||||||
|
const itemValue = item.value || item.id;
|
||||||
|
return itemValue == unionId;
|
||||||
|
});
|
||||||
|
if (admin) {
|
||||||
|
return admin.label || (admin.name + ' (' + admin.wxid + ')');
|
||||||
|
}
|
||||||
|
return unionId; // 如果找不到对应的管理员,返回原始unionId
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
orderId: null,
|
||||||
|
skuName: null,
|
||||||
|
price: null,
|
||||||
|
validCode: "1"
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
console.log(this.queryParams.validCode);
|
||||||
|
// 合并项转为原始code数组
|
||||||
|
if (this.queryParams.statusGroup) {
|
||||||
|
this.queryParams.validCodes = this.statusValueMap[this.queryParams.statusGroup].map(code => Number(code));
|
||||||
|
} else if (this.queryParams.validCodes && Array.isArray(this.queryParams.validCodes)) {
|
||||||
|
this.queryParams.validCodes = this.queryParams.validCodes.map(code => Number(code));
|
||||||
|
} else {
|
||||||
|
this.queryParams.validCodes = null;
|
||||||
|
}
|
||||||
|
// 打印类型检查
|
||||||
|
if (this.queryParams.validCode) {
|
||||||
|
this.queryParams.validCode = this.queryParams.validCode.map(item => Number(item));
|
||||||
|
console.log('validCode值:', this.queryParams.validCodes);
|
||||||
|
console.log('validCode类型:', this.queryParams.validCodes.map(item => typeof item));
|
||||||
|
}
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.dateRange = [];
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 查看订单详情 */
|
||||||
|
handleView(row) {
|
||||||
|
this.currentOrder = row;
|
||||||
|
this.viewDialogVisible = true;
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加京粉订单";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getOrderrows(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改京粉订单";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateOrderrows(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addOrderrows(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除京粉订单编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delOrderrows(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('/jarvis/orderrows/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `京粉订单数据_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
187
src/views/system/orderrows/settings.vue
Normal file
187
src/views/system/orderrows/settings.vue
Normal file
@@ -0,0 +1,187 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-card>
|
||||||
|
<div slot="header">
|
||||||
|
<span>京粉订单设置</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-form :model="settings" :rules="rules" ref="settingsForm" label-width="120px">
|
||||||
|
<el-form-item label="自动同步" prop="autoSync">
|
||||||
|
<el-switch v-model="settings.autoSync" active-text="开启" inactive-text="关闭"></el-switch>
|
||||||
|
<span style="margin-left: 10px; color: #666;">自动同步京东订单数据</span>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="同步频率" prop="syncInterval" v-if="settings.autoSync">
|
||||||
|
<el-select v-model="settings.syncInterval" placeholder="请选择同步频率">
|
||||||
|
<el-option label="每5分钟" value="5"></el-option>
|
||||||
|
<el-option label="每10分钟" value="10"></el-option>
|
||||||
|
<el-option label="每30分钟" value="30"></el-option>
|
||||||
|
<el-option label="每小时" value="60"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="佣金计算" prop="commissionType">
|
||||||
|
<el-radio-group v-model="settings.commissionType">
|
||||||
|
<el-radio label="estimate">预估佣金</el-radio>
|
||||||
|
<el-radio label="actual">实际佣金</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="订单状态" prop="orderStatus">
|
||||||
|
<el-checkbox-group v-model="settings.orderStatus">
|
||||||
|
<el-checkbox label="1">待确认</el-checkbox>
|
||||||
|
<el-checkbox label="2">已确认</el-checkbox>
|
||||||
|
<el-checkbox label="17">已完成</el-checkbox>
|
||||||
|
<el-checkbox label="27">已结算</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="数据保留" prop="dataRetention">
|
||||||
|
<el-input-number v-model="settings.dataRetention" :min="1" :max="365" label="数据保留天数"></el-input-number>
|
||||||
|
<span style="margin-left: 10px; color: #666;">天(超过天数的数据将被清理)</span>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="导出格式" prop="exportFormat">
|
||||||
|
<el-radio-group v-model="settings.exportFormat">
|
||||||
|
<el-radio label="excel">Excel</el-radio>
|
||||||
|
<el-radio label="csv">CSV</el-radio>
|
||||||
|
<el-radio label="json">JSON</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="通知设置" prop="notifications">
|
||||||
|
<el-checkbox-group v-model="settings.notifications">
|
||||||
|
<el-checkbox label="newOrder">新订单通知</el-checkbox>
|
||||||
|
<el-checkbox label="commission">佣金到账通知</el-checkbox>
|
||||||
|
<el-checkbox label="error">错误通知</el-checkbox>
|
||||||
|
</el-checkbox-group>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="API配置" prop="apiConfig">
|
||||||
|
<el-input v-model="settings.apiConfig.url" placeholder="API接口地址" style="margin-bottom: 10px;"></el-input>
|
||||||
|
<el-input v-model="settings.apiConfig.key" placeholder="API密钥" show-password></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="saveSettings">保存设置</el-button>
|
||||||
|
<el-button @click="resetSettings">重置</el-button>
|
||||||
|
<el-button @click="testConnection">测试连接</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card style="margin-top: 20px;">
|
||||||
|
<div slot="header">
|
||||||
|
<span>系统信息</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-descriptions :column="2" border>
|
||||||
|
<el-descriptions-item label="最后同步时间">{{ systemInfo.lastSyncTime }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="同步状态">
|
||||||
|
<el-tag :type="systemInfo.syncStatus === 'success' ? 'success' : 'danger'">
|
||||||
|
{{ systemInfo.syncStatus === 'success' ? '成功' : '失败' }}
|
||||||
|
</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="数据总量">{{ systemInfo.totalRecords }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="今日新增">{{ systemInfo.todayRecords }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="系统版本">{{ systemInfo.version }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="运行时间">{{ systemInfo.uptime }}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "OrderSettings",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
settings: {
|
||||||
|
autoSync: true,
|
||||||
|
syncInterval: '30',
|
||||||
|
commissionType: 'actual',
|
||||||
|
orderStatus: ['1', '2', '17', '27'],
|
||||||
|
dataRetention: 90,
|
||||||
|
exportFormat: 'excel',
|
||||||
|
notifications: ['newOrder', 'commission'],
|
||||||
|
apiConfig: {
|
||||||
|
url: '/jarvis/orderrows/list',
|
||||||
|
key: 'your-api-key'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
syncInterval: [
|
||||||
|
{ required: true, message: '请选择同步频率', trigger: 'change' }
|
||||||
|
],
|
||||||
|
commissionType: [
|
||||||
|
{ required: true, message: '请选择佣金计算方式', trigger: 'change' }
|
||||||
|
],
|
||||||
|
orderStatus: [
|
||||||
|
{ required: true, message: '请选择订单状态', trigger: 'change' }
|
||||||
|
],
|
||||||
|
dataRetention: [
|
||||||
|
{ required: true, message: '请输入数据保留天数', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
exportFormat: [
|
||||||
|
{ required: true, message: '请选择导出格式', trigger: 'change' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
systemInfo: {
|
||||||
|
lastSyncTime: '2025-01-27 15:30:25',
|
||||||
|
syncStatus: 'success',
|
||||||
|
totalRecords: 4307,
|
||||||
|
todayRecords: 45,
|
||||||
|
version: 'v1.0.0',
|
||||||
|
uptime: '15天 8小时 32分钟'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
saveSettings() {
|
||||||
|
this.$refs.settingsForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.$message.success('设置保存成功')
|
||||||
|
console.log('保存的设置:', this.settings)
|
||||||
|
} else {
|
||||||
|
this.$message.error('请检查表单填写')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
resetSettings() {
|
||||||
|
this.$confirm('确定要重置所有设置吗?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.settings = {
|
||||||
|
autoSync: true,
|
||||||
|
syncInterval: '30',
|
||||||
|
commissionType: 'actual',
|
||||||
|
orderStatus: ['1', '2', '17', '27'],
|
||||||
|
dataRetention: 90,
|
||||||
|
exportFormat: 'excel',
|
||||||
|
notifications: ['newOrder', 'commission'],
|
||||||
|
apiConfig: {
|
||||||
|
url: '/jarvis/orderrows/list',
|
||||||
|
key: 'your-api-key'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$message.success('设置已重置')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
testConnection() {
|
||||||
|
this.$message.info('正在测试API连接...')
|
||||||
|
// 这里可以添加实际的API连接测试逻辑
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$message.success('API连接测试成功')
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-form-item {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
271
src/views/system/orderrows/statistics.vue
Normal file
271
src/views/system/orderrows/statistics.vue
Normal file
@@ -0,0 +1,271 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-card>
|
||||||
|
<div slot="header">
|
||||||
|
<span>总订单数</span>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<h2>{{ statistics.totalOrders }}</h2>
|
||||||
|
<p>累计订单数量</p>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-card>
|
||||||
|
<div slot="header">
|
||||||
|
<span>总佣金</span>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<h2>¥{{ statistics.totalCommission }}</h2>
|
||||||
|
<p>累计佣金收入</p>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-card>
|
||||||
|
<div slot="header">
|
||||||
|
<span>今日订单</span>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<h2>{{ statistics.todayOrders }}</h2>
|
||||||
|
<p>今日新增订单</p>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-card>
|
||||||
|
<div slot="header">
|
||||||
|
<span>今日佣金</span>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<h2>¥{{ statistics.todayCommission }}</h2>
|
||||||
|
<p>今日佣金收入</p>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="20" style="margin-top: 20px;">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-card>
|
||||||
|
<div slot="header">
|
||||||
|
<span>订单状态分布</span>
|
||||||
|
</div>
|
||||||
|
<div class="chart-container">
|
||||||
|
<div ref="statusChart" style="height: 300px;"></div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-card>
|
||||||
|
<div slot="header">
|
||||||
|
<span>佣金趋势</span>
|
||||||
|
</div>
|
||||||
|
<div class="chart-container">
|
||||||
|
<div ref="trendChart" style="height: 300px;"></div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row :gutter="20" style="margin-top: 20px;">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-card>
|
||||||
|
<div slot="header">
|
||||||
|
<span>热门商品排行</span>
|
||||||
|
</div>
|
||||||
|
<el-table :data="hotProducts" style="width: 100%">
|
||||||
|
<el-table-column prop="rank" label="排名" width="80" align="center" />
|
||||||
|
<el-table-column prop="skuName" label="商品名称" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="orderCount" label="订单数量" width="120" align="center" />
|
||||||
|
<el-table-column prop="totalAmount" label="总金额" width="120" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
¥{{ scope.row.totalAmount }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="totalCommission" label="总佣金" width="120" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
¥{{ scope.row.totalCommission }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as echarts from 'echarts'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "OrderStatistics",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
statistics: {
|
||||||
|
totalOrders: 4307,
|
||||||
|
totalCommission: 125680.50,
|
||||||
|
todayOrders: 45,
|
||||||
|
todayCommission: 2340.80
|
||||||
|
},
|
||||||
|
hotProducts: [
|
||||||
|
{
|
||||||
|
rank: 1,
|
||||||
|
skuName: "海尔【小红花套系】消毒柜EB150十口之家150L",
|
||||||
|
orderCount: 156,
|
||||||
|
totalAmount: 358944,
|
||||||
|
totalCommission: 21536.64
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rank: 2,
|
||||||
|
skuName: "京东京造 快调哑铃可调节 男士家用 运动锻炼健身器材",
|
||||||
|
orderCount: 89,
|
||||||
|
totalAmount: 53311,
|
||||||
|
totalCommission: 1599.33
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rank: 3,
|
||||||
|
skuName: "惠普HP 暗影精灵11台式电脑 游戏台式机主机",
|
||||||
|
orderCount: 67,
|
||||||
|
totalAmount: 428733,
|
||||||
|
totalCommission: 3429.86
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rank: 4,
|
||||||
|
skuName: "梦龙 【王嘉尔推荐】柚子山茶花蜜口味冰淇淋",
|
||||||
|
orderCount: 234,
|
||||||
|
totalAmount: 13314.6,
|
||||||
|
totalCommission: 931.02
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rank: 5,
|
||||||
|
skuName: "海尔彩屏家用麦浪消毒碗柜嵌入式 130L大容量",
|
||||||
|
orderCount: 45,
|
||||||
|
totalAmount: 85455,
|
||||||
|
totalCommission: 5127.3
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.initCharts()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initCharts() {
|
||||||
|
this.initStatusChart()
|
||||||
|
this.initTrendChart()
|
||||||
|
},
|
||||||
|
initStatusChart() {
|
||||||
|
const chartDom = this.$refs.statusChart
|
||||||
|
const myChart = echarts.init(chartDom)
|
||||||
|
|
||||||
|
const option = {
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item',
|
||||||
|
formatter: '{a} <br/>{b}: {c} ({d}%)'
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
orient: 'vertical',
|
||||||
|
left: 'left'
|
||||||
|
},
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '订单状态',
|
||||||
|
type: 'pie',
|
||||||
|
radius: ['40%', '70%'],
|
||||||
|
avoidLabelOverlap: false,
|
||||||
|
label: {
|
||||||
|
show: false,
|
||||||
|
position: 'center'
|
||||||
|
},
|
||||||
|
emphasis: {
|
||||||
|
label: {
|
||||||
|
show: true,
|
||||||
|
fontSize: '18',
|
||||||
|
fontWeight: 'bold'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
labelLine: {
|
||||||
|
show: false
|
||||||
|
},
|
||||||
|
data: [
|
||||||
|
{ value: 2153, name: '已完成' },
|
||||||
|
{ value: 1076, name: '已确认' },
|
||||||
|
{ value: 861, name: '待确认' },
|
||||||
|
{ value: 217, name: '已取消' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
myChart.setOption(option)
|
||||||
|
},
|
||||||
|
initTrendChart() {
|
||||||
|
const chartDom = this.$refs.trendChart
|
||||||
|
const myChart = echarts.init(chartDom)
|
||||||
|
|
||||||
|
const option = {
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'axis'
|
||||||
|
},
|
||||||
|
legend: {
|
||||||
|
data: ['订单数量', '佣金收入']
|
||||||
|
},
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
|
||||||
|
},
|
||||||
|
yAxis: [
|
||||||
|
{
|
||||||
|
type: 'value',
|
||||||
|
name: '订单数量'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'value',
|
||||||
|
name: '佣金(元)',
|
||||||
|
position: 'right'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
name: '订单数量',
|
||||||
|
type: 'line',
|
||||||
|
data: [120, 132, 101, 134, 90, 230, 210]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '佣金收入',
|
||||||
|
type: 'line',
|
||||||
|
yAxisIndex: 1,
|
||||||
|
data: [220, 182, 191, 234, 290, 330, 310]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
myChart.setOption(option)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.card-body {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body h2 {
|
||||||
|
color: #409EFF;
|
||||||
|
margin: 10px 0;
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body p {
|
||||||
|
color: #666;
|
||||||
|
margin: 5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-container {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
305
src/views/system/superadmin/index.vue
Normal file
305
src/views/system/superadmin/index.vue
Normal file
@@ -0,0 +1,305 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="微信ID" prop="wxid">
|
||||||
|
<el-input v-model="queryParams.wxid" placeholder="请输入微信ID" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="姓名" prop="name">
|
||||||
|
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联盟ID" prop="unionId">
|
||||||
|
<el-input v-model="queryParams.unionId" placeholder="请输入联盟ID" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="激活状态" prop="isActive">
|
||||||
|
<el-select v-model="queryParams.isActive" placeholder="激活状态" clearable style="width: 240px">
|
||||||
|
<el-option label="已激活" value="1" />
|
||||||
|
<el-option label="未激活" value="0" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:superadmin:add']">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" v-hasPermi="['system:superadmin:edit']">修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['system:superadmin:remove']">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:superadmin:export']">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="superadminList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
|
<el-table-column label="微信ID" align="center" prop="wxid" min-width="120" />
|
||||||
|
<el-table-column label="姓名" align="center" prop="name" min-width="100" />
|
||||||
|
<el-table-column label="联盟ID" align="center" prop="unionId" min-width="120" />
|
||||||
|
<el-table-column label="应用密钥" align="center" prop="appKey" min-width="200" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column label="秘密密钥" align="center" prop="secretKey" min-width="200" :show-overflow-tooltip="true">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.secretKey ? '***' + scope.row.secretKey.substring(scope.row.secretKey.length - 4) : '-' }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="激活状态" align="center" prop="isActive" min-width="100">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag :type="scope.row.isActive === 1 ? 'success' : 'info'">
|
||||||
|
{{ scope.row.isActive === 1 ? '已激活' : '未激活' }}
|
||||||
|
</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createdAt" min-width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.createdAt) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="更新时间" align="center" prop="updatedAt" min-width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.updatedAt) }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" min-width="180" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:superadmin:edit']">修改</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:superadmin:remove']">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
|
|
||||||
|
<!-- 添加或修改超级管理员对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="微信ID" prop="wxid">
|
||||||
|
<el-input v-model="form.wxid" placeholder="请输入微信ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="姓名" prop="name">
|
||||||
|
<el-input v-model="form.name" placeholder="请输入姓名" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="联盟ID" prop="unionId">
|
||||||
|
<el-input v-model="form.unionId" placeholder="请输入联盟ID" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="应用密钥" prop="appKey">
|
||||||
|
<el-input v-model="form.appKey" placeholder="请输入应用密钥" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="秘密密钥" prop="secretKey">
|
||||||
|
<el-input v-model="form.secretKey" placeholder="请输入秘密密钥" show-password />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="激活状态" prop="isActive">
|
||||||
|
<el-radio-group v-model="form.isActive">
|
||||||
|
<el-radio :label="1">激活</el-radio>
|
||||||
|
<el-radio :label="0">未激活</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 查看超级管理员详情对话框 -->
|
||||||
|
<el-dialog :title="'超级管理员详情 - ' + currentAdmin.name" :visible.sync="viewDialogVisible" width="600px" append-to-body>
|
||||||
|
<el-descriptions :column="2" border>
|
||||||
|
<el-descriptions-item label="ID">{{ currentAdmin.id }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="微信ID">{{ currentAdmin.wxid }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="姓名">{{ currentAdmin.name }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="联盟ID">{{ currentAdmin.unionId }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="应用密钥" :span="2">{{ currentAdmin.appKey }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="秘密密钥" :span="2">{{ currentAdmin.secretKey ? '***' + currentAdmin.secretKey.substring(currentAdmin.secretKey.length - 4) : '-' }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="激活状态">
|
||||||
|
<el-tag :type="currentAdmin.isActive === 1 ? 'success' : 'info'">
|
||||||
|
{{ currentAdmin.isActive === 1 ? '已激活' : '未激活' }}
|
||||||
|
</el-tag>
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="创建时间">{{ parseTime(currentAdmin.createdAt) }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="更新时间">{{ parseTime(currentAdmin.updatedAt) }}</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="viewDialogVisible = false">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listSuperadmin, getSuperadmin, delSuperadmin, addSuperadmin, updateSuperadmin } from "@/api/system/superadmin";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Superadmin",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 超级管理员表格数据
|
||||||
|
superadminList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
wxid: null,
|
||||||
|
name: null,
|
||||||
|
unionId: null,
|
||||||
|
isActive: null
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
wxid: [
|
||||||
|
{ required: true, message: "微信ID不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
name: [
|
||||||
|
{ required: true, message: "姓名不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
unionId: [
|
||||||
|
{ required: true, message: "联盟ID不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
appKey: [
|
||||||
|
{ required: true, message: "应用密钥不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
secretKey: [
|
||||||
|
{ required: true, message: "秘密密钥不能为空", trigger: "blur" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// 查看详情对话框
|
||||||
|
viewDialogVisible: false,
|
||||||
|
// 当前查看的管理员
|
||||||
|
currentAdmin: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询超级管理员列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listSuperadmin(this.queryParams).then(response => {
|
||||||
|
this.superadminList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
}).catch(error => {
|
||||||
|
console.error('获取超级管理员列表失败:', error);
|
||||||
|
this.loading = false;
|
||||||
|
this.$message.error('获取超级管理员列表失败');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
wxid: null,
|
||||||
|
name: null,
|
||||||
|
unionId: null,
|
||||||
|
appKey: null,
|
||||||
|
secretKey: null,
|
||||||
|
isActive: 1
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 查看超级管理员详情 */
|
||||||
|
handleView(row) {
|
||||||
|
this.currentAdmin = row;
|
||||||
|
this.viewDialogVisible = true;
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加超级管理员";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getSuperadmin(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改超级管理员";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateSuperadmin(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addSuperadmin(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除超级管理员编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delSuperadmin(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('jarvis/superadmin/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `superadmin_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -7,9 +7,9 @@ function resolve(dir) {
|
|||||||
|
|
||||||
const CompressionPlugin = require('compression-webpack-plugin')
|
const CompressionPlugin = require('compression-webpack-plugin')
|
||||||
|
|
||||||
const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题
|
const name = process.env.VUE_APP_TITLE || 'Jarvis' // 网页标题
|
||||||
|
|
||||||
const baseUrl = 'http://localhost:8080' // 后端接口
|
const baseUrl = process.env.VUE_APP_BASE_API || 'http://127.0.0.1:30313' // 后端接口
|
||||||
|
|
||||||
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user