This commit is contained in:
yj 2024-12-18 12:51:01 +08:00
parent 8dee5624a6
commit f791a9ff00
23 changed files with 1869 additions and 1019 deletions

View File

@ -1,8 +1,8 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 若依管理系统 VITE_APP_TITLE = 校园二手交易管理系统
# 开发环境配置 # 开发环境配置
VITE_APP_ENV = 'development' VITE_APP_ENV = 'development'
# 若依管理系统/开发环境 # 管理系统/开发环境
VITE_APP_BASE_API = '/dev-api' VITE_APP_BASE_API = '/dev-api'

View File

@ -1,10 +1,10 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 若依管理系统 VITE_APP_TITLE = 校园二手交易管理系统
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'production' VITE_APP_ENV = 'production'
# 若依管理系统/生产环境 # 校园二手交易管理系统/生产环境
VITE_APP_BASE_API = '/prod-api' VITE_APP_BASE_API = '/prod-api'
# 是否在打包时开启压缩,支持 gzip 和 brotli # 是否在打包时开启压缩,支持 gzip 和 brotli

View File

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VITE_APP_TITLE = 若依管理系统 VITE_APP_TITLE = 校园二手交易管理系统
# 生产环境配置 # 生产环境配置
VITE_APP_ENV = 'staging' VITE_APP_ENV = 'staging'

View File

@ -7,7 +7,7 @@
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="/favicon.ico"> <link rel="icon" href="/favicon.ico">
<title>若依管理系统</title> <title>校园二手交易管理系统</title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]--> <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style> <style>
html, html,

View File

@ -1,7 +1,7 @@
{ {
"name": "ruoyi", "name": "ruoyi",
"version": "3.8.8", "version": "3.8.8",
"description": "若依管理系统", "description": "校园二手交易管理系统",
"author": "若依", "author": "若依",
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",

44
src/api/system/address.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询地址列表
export function listAddress(query) {
return request({
url: '/system/address/list',
method: 'get',
params: query
})
}
// 查询地址详细
export function getAddress(id) {
return request({
url: '/system/address/' + id,
method: 'get'
})
}
// 新增地址
export function addAddress(data) {
return request({
url: '/system/address',
method: 'post',
data: data
})
}
// 修改地址
export function updateAddress(data) {
return request({
url: '/system/address',
method: 'put',
data: data
})
}
// 删除地址
export function delAddress(id) {
return request({
url: '/system/address/' + id,
method: 'delete'
})
}

44
src/api/system/order.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询订单列表
export function listOrder(query) {
return request({
url: '/system/order/list',
method: 'get',
params: query
})
}
// 查询订单详细
export function getOrder(id) {
return request({
url: '/system/order/' + id,
method: 'get'
})
}
// 新增订单
export function addOrder(data) {
return request({
url: '/system/order',
method: 'post',
data: data
})
}
// 修改订单
export function updateOrder(data) {
return request({
url: '/system/order',
method: 'put',
data: data
})
}
// 删除订单
export function delOrder(id) {
return request({
url: '/system/order/' + id,
method: 'delete'
})
}

44
src/api/system/person.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询买家列表
export function listPerson(query) {
return request({
url: '/system/person/list',
method: 'get',
params: query
})
}
// 查询买家详细
export function getPerson(id) {
return request({
url: '/system/person/' + id,
method: 'get'
})
}
// 新增买家
export function addPerson(data) {
return request({
url: '/system/person',
method: 'post',
data: data
})
}
// 修改买家
export function updatePerson(data) {
return request({
url: '/system/person',
method: 'put',
data: data
})
}
// 删除买家
export function delPerson(id) {
return request({
url: '/system/person/' + id,
method: 'delete'
})
}

44
src/api/system/salesid.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询卖家列表
export function listSalesid(query) {
return request({
url: '/system/salesid/list',
method: 'get',
params: query
})
}
// 查询卖家详细
export function getSalesid(id) {
return request({
url: '/system/salesid/' + id,
method: 'get'
})
}
// 新增卖家
export function addSalesid(data) {
return request({
url: '/system/salesid',
method: 'post',
data: data
})
}
// 修改卖家
export function updateSalesid(data) {
return request({
url: '/system/salesid',
method: 'put',
data: data
})
}
// 删除卖家
export function delSalesid(id) {
return request({
url: '/system/salesid/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询商品列表
export function listShangpin(query) {
return request({
url: '/system/shangpin/list',
method: 'get',
params: query
})
}
// 查询商品详细
export function getShangpin(id) {
return request({
url: '/system/shangpin/' + id,
method: 'get'
})
}
// 新增商品
export function addShangpin(data) {
return request({
url: '/system/shangpin',
method: 'post',
data: data
})
}
// 修改商品
export function updateShangpin(data) {
return request({
url: '/system/shangpin',
method: 'put',
data: data
})
}
// 删除商品
export function delShangpin(id) {
return request({
url: '/system/shangpin/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询收藏列表
export function listShoucang(query) {
return request({
url: '/system/shoucang/list',
method: 'get',
params: query
})
}
// 查询收藏详细
export function getShoucang(id) {
return request({
url: '/system/shoucang/' + id,
method: 'get'
})
}
// 新增收藏
export function addShoucang(data) {
return request({
url: '/system/shoucang',
method: 'post',
data: data
})
}
// 修改收藏
export function updateShoucang(data) {
return request({
url: '/system/shoucang',
method: 'put',
data: data
})
}
// 删除收藏
export function delShoucang(id) {
return request({
url: '/system/shoucang/' + id,
method: 'delete'
})
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 23 KiB

BIN
src/assets/logo/logo1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
src/assets/logo/logo2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="login"> <div class="login">
<el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form"> <el-form ref="loginRef" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">若依后台管理系统</h3> <h3 class="title">校园二手交易后台管理系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="loginForm.username" v-model="loginForm.username"

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="register"> <div class="register">
<el-form ref="registerRef" :model="registerForm" :rules="registerRules" class="register-form"> <el-form ref="registerRef" :model="registerForm" :rules="registerRules" class="register-form">
<h3 class="title">若依后台管理系统</h3> <h3 class="title">校园二手交易后台管理系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input <el-input
v-model="registerForm.username" v-model="registerForm.username"

View File

@ -0,0 +1,241 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="买家id" prop="personid">
<el-input
v-model="queryParams.personid"
placeholder="请输入买家id"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="地址" prop="place">
<el-input
v-model="queryParams.place"
placeholder="请输入地址"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @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="Plus"
@click="handleAdd"
v-hasPermi="['system:address:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:address:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:address:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['system:address:export']"
>导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="addressList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="买家id" align="center" prop="personid" />
<el-table-column label="地址" align="center" prop="place" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:address:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:address:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改地址对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="addressRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="买家id" prop="personid">
<el-input v-model="form.personid" placeholder="请输入买家id" />
</el-form-item>
<el-form-item label="地址" prop="place">
<el-input v-model="form.place" placeholder="请输入地址" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Address">
import { listAddress, getAddress, delAddress, addAddress, updateAddress } from "@/api/system/address";
const { proxy } = getCurrentInstance();
const addressList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
personid: null,
place: null
},
rules: {
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询地址列表 */
function getList() {
loading.value = true;
listAddress(queryParams.value).then(response => {
addressList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
id: null,
personid: null,
place: null
};
proxy.resetForm("addressRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加地址";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getAddress(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改地址";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["addressRef"].validate(valid => {
if (valid) {
if (form.value.id != null) {
updateAddress(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addAddress(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除地址编号为"' + _ids + '"的数据项?').then(function() {
return delAddress(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('system/address/export', {
...queryParams.value
}, `address_${new Date().getTime()}.xlsx`)
}
getList();
</script>

View File

@ -0,0 +1,264 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="商品id" prop="shangpinid">
<el-input
v-model="queryParams.shangpinid"
placeholder="请输入商品id"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="买家id" prop="personid">
<el-input
v-model="queryParams.personid"
placeholder="请输入买家id"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="购买日期" prop="purchasedate">
<el-date-picker clearable
v-model="queryParams.purchasedate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择购买日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @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="Plus"
@click="handleAdd"
v-hasPermi="['system:order:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:order:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:order:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['system:order:export']"
>导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="商品id" align="center" prop="shangpinid" />
<el-table-column label="买家id" align="center" prop="personid" />
<el-table-column label="购买日期" align="center" prop="purchasedate" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.purchasedate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:order:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:order:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改订单对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="orderRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="商品id" prop="shangpinid">
<el-input v-model="form.shangpinid" placeholder="请输入商品id" />
</el-form-item>
<el-form-item label="买家id" prop="personid">
<el-input v-model="form.personid" placeholder="请输入买家id" />
</el-form-item>
<el-form-item label="购买日期" prop="purchasedate">
<el-date-picker clearable
v-model="form.purchasedate"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择购买日期">
</el-date-picker>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Order">
import { listOrder, getOrder, delOrder, addOrder, updateOrder } from "@/api/system/order";
const { proxy } = getCurrentInstance();
const orderList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
shangpinid: null,
personid: null,
purchasedate: null
},
rules: {
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询订单列表 */
function getList() {
loading.value = true;
listOrder(queryParams.value).then(response => {
orderList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
id: null,
shangpinid: null,
personid: null,
purchasedate: null
};
proxy.resetForm("orderRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加订单";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getOrder(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改订单";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["orderRef"].validate(valid => {
if (valid) {
if (form.value.id != null) {
updateOrder(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addOrder(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除订单编号为"' + _ids + '"的数据项?').then(function() {
return delOrder(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('system/order/export', {
...queryParams.value
}, `order_${new Date().getTime()}.xlsx`)
}
getList();
</script>

View File

@ -0,0 +1,241 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="年龄" prop="age">
<el-input
v-model="queryParams.age"
placeholder="请输入年龄"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @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="Plus"
@click="handleAdd"
v-hasPermi="['system:person:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:person:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:person:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['system:person:export']"
>导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="personList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="年龄" align="center" prop="age" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:person:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:person:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改买家对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="personRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="年龄" prop="age">
<el-input v-model="form.age" placeholder="请输入年龄" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Person">
import { listPerson, getPerson, delPerson, addPerson, updatePerson } from "@/api/system/person";
const { proxy } = getCurrentInstance();
const personList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
age: null
},
rules: {
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询买家列表 */
function getList() {
loading.value = true;
listPerson(queryParams.value).then(response => {
personList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
id: null,
name: null,
age: null
};
proxy.resetForm("personRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加买家";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getPerson(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改买家";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["personRef"].validate(valid => {
if (valid) {
if (form.value.id != null) {
updatePerson(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addPerson(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除买家编号为"' + _ids + '"的数据项?').then(function() {
return delPerson(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('system/person/export', {
...queryParams.value
}, `person_${new Date().getTime()}.xlsx`)
}
getList();
</script>

View File

@ -0,0 +1,255 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="年龄" prop="age">
<el-input
v-model="queryParams.age"
placeholder="请输入年龄"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入地址"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @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="Plus"
@click="handleAdd"
v-hasPermi="['system:salesid:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:salesid:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:salesid:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['system:salesid:export']"
>导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="salesidList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="年龄" align="center" prop="age" />
<el-table-column label="地址" align="center" prop="address" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:salesid:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:salesid:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改卖家对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="salesidRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="年龄" prop="age">
<el-input v-model="form.age" placeholder="请输入年龄" />
</el-form-item>
<el-form-item label="地址" prop="address">
<el-input v-model="form.address" placeholder="请输入地址" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Salesid">
import { listSalesid, getSalesid, delSalesid, addSalesid, updateSalesid } from "@/api/system/salesid";
const { proxy } = getCurrentInstance();
const salesidList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
age: null,
address: null
},
rules: {
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询卖家列表 */
function getList() {
loading.value = true;
listSalesid(queryParams.value).then(response => {
salesidList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
id: null,
name: null,
age: null,
address: null
};
proxy.resetForm("salesidRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加卖家";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getSalesid(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改卖家";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["salesidRef"].validate(valid => {
if (valid) {
if (form.value.id != null) {
updateSalesid(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addSalesid(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除卖家编号为"' + _ids + '"的数据项?').then(function() {
return delSalesid(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('system/salesid/export', {
...queryParams.value
}, `salesid_${new Date().getTime()}.xlsx`)
}
getList();
</script>

View File

@ -0,0 +1,350 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="卖家id" prop="salesid">
<el-input
v-model="queryParams.salesid"
placeholder="请输入卖家id"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="价格" prop="price">
<el-input
v-model="queryParams.price"
placeholder="请输入价格"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="商品描述" prop="productdescription">
<el-input
v-model="queryParams.productdescription"
placeholder="请输入商品描述"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="日期" prop="date">
<el-date-picker clearable
v-model="queryParams.date"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="评价" prop="pingjia">
<el-input
v-model="queryParams.pingjia"
placeholder="请输入评价"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="点击量" prop="dianjiliang">
<el-input
v-model="queryParams.dianjiliang"
placeholder="请输入点击量"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="收藏量" prop="shoucang">
<el-input
v-model="queryParams.shoucang"
placeholder="请输入收藏量"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @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="Plus"
@click="handleAdd"
v-hasPermi="['system:shangpin:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:shangpin:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:shangpin:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['system:shangpin:export']"
>导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="shangpinList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="卖家id" align="center" prop="salesid" />
<el-table-column label="价格" align="center" prop="price" />
<el-table-column label="商品类型" align="center" prop="producttype" />
<el-table-column label="商品描述" align="center" prop="productdescription" />
<el-table-column label="商品图片" align="center" prop="productimage" width="100">
<template #default="scope">
<image-preview :src="scope.row.productimage" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="商品状态" align="center" prop="ProductStatus" />
<el-table-column label="日期" align="center" prop="date" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.date, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="评价" align="center" prop="pingjia" />
<el-table-column label="点击量" align="center" prop="dianjiliang" />
<el-table-column label="收藏量" align="center" prop="shoucang" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:shangpin:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:shangpin:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改商品对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="shangpinRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="卖家id" prop="salesid">
<el-input v-model="form.salesid" placeholder="请输入卖家id" />
</el-form-item>
<el-form-item label="价格" prop="price">
<el-input v-model="form.price" placeholder="请输入价格" />
</el-form-item>
<el-form-item label="商品描述" prop="productdescription">
<el-input v-model="form.productdescription" placeholder="请输入商品描述" />
</el-form-item>
<el-form-item label="商品图片" prop="productimage">
<image-upload v-model="form.productimage"/>
</el-form-item>
<el-form-item label="日期" prop="date">
<el-date-picker clearable
v-model="form.date"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择日期">
</el-date-picker>
</el-form-item>
<el-form-item label="评价" prop="pingjia">
<el-input v-model="form.pingjia" placeholder="请输入评价" />
</el-form-item>
<el-form-item label="点击量" prop="dianjiliang">
<el-input v-model="form.dianjiliang" placeholder="请输入点击量" />
</el-form-item>
<el-form-item label="收藏量" prop="shoucang">
<el-input v-model="form.shoucang" placeholder="请输入收藏量" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Shangpin">
import { listShangpin, getShangpin, delShangpin, addShangpin, updateShangpin } from "@/api/system/shangpin";
const { proxy } = getCurrentInstance();
const shangpinList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
salesid: null,
price: null,
producttype: null,
productdescription: null,
productimage: null,
ProductStatus: null,
date: null,
pingjia: null,
dianjiliang: null,
shoucang: null
},
rules: {
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询商品列表 */
function getList() {
loading.value = true;
listShangpin(queryParams.value).then(response => {
shangpinList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
id: null,
name: null,
salesid: null,
price: null,
producttype: null,
productdescription: null,
productimage: null,
ProductStatus: null,
date: null,
pingjia: null,
dianjiliang: null,
shoucang: null
};
proxy.resetForm("shangpinRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加商品";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getShangpin(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改商品";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["shangpinRef"].validate(valid => {
if (valid) {
if (form.value.id != null) {
updateShangpin(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addShangpin(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除商品编号为"' + _ids + '"的数据项?').then(function() {
return delShangpin(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('system/shangpin/export', {
...queryParams.value
}, `shangpin_${new Date().getTime()}.xlsx`)
}
getList();
</script>

View File

@ -0,0 +1,241 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="商品id" prop="shangpinid">
<el-input
v-model="queryParams.shangpinid"
placeholder="请输入商品id"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="买家id" prop="personid">
<el-input
v-model="queryParams.personid"
placeholder="请输入买家id"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @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="Plus"
@click="handleAdd"
v-hasPermi="['system:shoucang:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="Edit"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:shoucang:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:shoucang:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="Download"
@click="handleExport"
v-hasPermi="['system:shoucang:export']"
>导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="shoucangList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="商品id" align="center" prop="shangpinid" />
<el-table-column label="买家id" align="center" prop="personid" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:shoucang:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:shoucang:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改收藏对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
<el-form ref="shoucangRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="商品id" prop="shangpinid">
<el-input v-model="form.shangpinid" placeholder="请输入商品id" />
</el-form-item>
<el-form-item label="买家id" prop="personid">
<el-input v-model="form.personid" placeholder="请输入买家id" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Shoucang">
import { listShoucang, getShoucang, delShoucang, addShoucang, updateShoucang } from "@/api/system/shoucang";
const { proxy } = getCurrentInstance();
const shoucangList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
shangpinid: null,
personid: null
},
rules: {
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询收藏列表 */
function getList() {
loading.value = true;
listShoucang(queryParams.value).then(response => {
shoucangList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
id: null,
shangpinid: null,
personid: null
};
proxy.resetForm("shoucangRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加收藏";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _id = row.id || ids.value
getShoucang(_id).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改收藏";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["shoucangRef"].validate(valid => {
if (valid) {
if (form.value.id != null) {
updateShoucang(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addShoucang(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除收藏编号为"' + _ids + '"的数据项?').then(function() {
return delShoucang(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('system/shoucang/export', {
...queryParams.value
}, `shoucang_${new Date().getTime()}.xlsx`)
}
getList();
</script>