@ -0,0 +1,23 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
|
||||
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "Eterlaze",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build"
|
||||
},
|
||||
"dependencies": {
|
||||
"ant-design-vue": "^1.7.4",
|
||||
"axios": "^0.21.1",
|
||||
"echarts": "^5.0.2",
|
||||
"element-ui": "^2.15.12",
|
||||
"nprogress": "^0.2.0",
|
||||
"vue": "^2.6.11",
|
||||
"vue-json-excel": "^0.3.0",
|
||||
"vue-router": "^3.2.0",
|
||||
"vuex": "^3.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-router": "~4.5.0",
|
||||
"@vue/cli-plugin-vuex": "~4.5.0",
|
||||
"@vue/cli-service": "~4.5.0",
|
||||
"vue-template-compiler": "^2.6.11"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not dead"
|
||||
],
|
||||
"main": "index.js",
|
||||
"license": "MIT"
|
||||
}
|
After Width: | Height: | Size: 17 KiB |
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title>圆桌物流管理系统</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
<router-view/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
||||
/*顶部进度条样式*/
|
||||
#nprogress .bar {
|
||||
background: #1890ff !important;
|
||||
}
|
||||
|
||||
body {
|
||||
letter-spacing: 1px;
|
||||
background: #f0f2f5 !important;
|
||||
}
|
||||
|
||||
</style>
|
@ -0,0 +1,54 @@
|
||||
import service from "../utils/request";
|
||||
|
||||
export function IsInit() {
|
||||
return service({
|
||||
url: '/admin/hasInit',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function Init(data) {
|
||||
return service({
|
||||
url: '/admin/init',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function DeleteAdmin(id) {
|
||||
return service({
|
||||
url: '/admin?id=' + id,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
export function FindAllAdmin() {
|
||||
return service({
|
||||
url: '/admin',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export function SaveAdmin(data) {
|
||||
return service({
|
||||
url: '/admin',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function AdminSendEmail(email) {
|
||||
return service({
|
||||
url: '/admin/sendEmail?email=' + email,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//管理员登录
|
||||
export function AdminLogin(type, data) {
|
||||
return service({
|
||||
url: '/admin/login?type=' + type,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
import service from "../utils/request";
|
||||
|
||||
export function FindAllDistribution() {
|
||||
return service({
|
||||
url: '/distribution',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function FindAllCanUse() {
|
||||
return service({
|
||||
url: '/distribution/can',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function SaveDistribution(data) {
|
||||
return service({
|
||||
url: '/distribution',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
import service from "../utils/request";
|
||||
|
||||
export function FindAllDriver(){
|
||||
return service({
|
||||
url: '/driver',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function SaveDriver(data) {
|
||||
return service({
|
||||
url: '/driver',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function DeleteDriverById(id){
|
||||
return service({
|
||||
url: '/driver?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
import service from "../utils/request";
|
||||
|
||||
export function FindAllEmployee(){
|
||||
return service({
|
||||
url: '/employee',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function SaveEmployee(data) {
|
||||
return service({
|
||||
url: '/employee',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function DeleteEmployeeById(id){
|
||||
return service({
|
||||
url: '/employee?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
import service from "../utils/request";
|
||||
|
||||
export function AnalyzeCommodity(type) {
|
||||
return service({
|
||||
url: '/inventory/analyze?type=' + type,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function FindAllInventory(id) {
|
||||
return service({
|
||||
url: '/inventory/warehouse/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function InAndOut(type, data) {
|
||||
return service({
|
||||
url: '/inventory/' + type,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function FindRecordByWarehouse(id) {
|
||||
return service({
|
||||
url: '/inventory/record/warehouse/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function DeleteInventoryById(id) {
|
||||
return service({
|
||||
url: '/inventory?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
日志管理请求模块
|
||||
*/
|
||||
import service from "../utils/request";
|
||||
|
||||
//查询全部登录日志
|
||||
export function FindAllLoginLog() {
|
||||
return service({
|
||||
url: '/loginlog',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//查询全部操作日志
|
||||
export function FindAllSystemLog() {
|
||||
return service({
|
||||
url: '/systemlog',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//根据条件查询操作日志
|
||||
export function querySystemLog(account,moudle) {
|
||||
return service({
|
||||
url: 'querySystemlog?account='+account+'&moudle='+moudle,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//删除操作日志
|
||||
export function DeleteSystemLogById(id) {
|
||||
return service({
|
||||
url: '/systemlog?id='+id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
//删除登录日志
|
||||
export function DeleteLoginLogById(id) {
|
||||
return service({
|
||||
url: '/loginlog?id='+id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,8 @@
|
||||
import service from "../utils/request";
|
||||
|
||||
export function FindAllRole(){
|
||||
return service({
|
||||
url: '/role',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
import service from "../utils/request";
|
||||
|
||||
export function FindAllSale() {
|
||||
console.log("FindAllSale")
|
||||
return service({
|
||||
url: '/sale',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function SearchCompany(name) {
|
||||
return service({
|
||||
url: '/sale/search/' + name,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function SaveSale(data) {
|
||||
return service({
|
||||
url: '/sale',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
import service from "../utils/request";
|
||||
|
||||
export function FindAllVehicle(){
|
||||
return service({
|
||||
url: '/vehicle',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function SaveVehicle(data) {
|
||||
return service({
|
||||
url: '/vehicle',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function DeleteVehicleById(id){
|
||||
return service({
|
||||
url: '/vehicle?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
import service from "../utils/request";
|
||||
|
||||
export function FindAllWarehouse() {
|
||||
return service({
|
||||
url: '/warehouse',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function SaveWarehouse(data) {
|
||||
return service({
|
||||
url: '/warehouse',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function DeleteWarehouseById(id) {
|
||||
return service({
|
||||
url: '/warehouse?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
After Width: | Height: | Size: 458 KiB |
After Width: | Height: | Size: 8.3 KiB |
After Width: | Height: | Size: 4.3 MiB |
After Width: | Height: | Size: 371 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 879 B |
After Width: | Height: | Size: 919 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 1.9 KiB |
@ -0,0 +1,94 @@
|
||||
<template>
|
||||
<div>
|
||||
<download-excel
|
||||
class="export-excel-wrapper"
|
||||
:data="data"
|
||||
:fields="json_fields"
|
||||
name="出入库记录.xls">
|
||||
<a-button class="btn" icon="download" type="primary">下载Excel表格</a-button>
|
||||
</download-excel>
|
||||
<a-table :columns="columns" :data-source="data" rowKey="id">
|
||||
<span slot="type" slot-scope="type">
|
||||
<a-tag :color="type === -1 ? 'green' : 'cyan'">{{ type === -1 ? '出库' : '入库' }}</a-tag>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {FindRecordByWarehouse} from "../api/inventory";
|
||||
|
||||
const columns = [
|
||||
{
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
title: '商品',
|
||||
},
|
||||
{
|
||||
title: '数量',
|
||||
dataIndex: 'count',
|
||||
key: 'count',
|
||||
},
|
||||
{
|
||||
title: '时间',
|
||||
dataIndex: 'createAt',
|
||||
key: 'createAt',
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
key: 'type',
|
||||
dataIndex: 'type',
|
||||
scopedSlots: {customRender: 'type'},
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'description',
|
||||
key: 'description',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
|
||||
components: {},
|
||||
|
||||
props: {
|
||||
warehouseId: {type: String, default: ''},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
data: [],
|
||||
columns,
|
||||
json_fields: {
|
||||
"商品ID": "cid",
|
||||
"商品名称": "name",
|
||||
"类型": {
|
||||
field: 'type',
|
||||
callback: (value) => {
|
||||
console.log(value)
|
||||
return value === -1 ? '出库' : '入库'
|
||||
}
|
||||
},
|
||||
"数量": "count",
|
||||
"备注": "description",
|
||||
"时间": "createAt",
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
FindRecordByWarehouse(this.warehouseId).then((res) => {
|
||||
this.data = res.data
|
||||
console.log(res.data[0])
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.btn {
|
||||
margin-bottom: 15px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<a-layout-sider
|
||||
:style="{ overflow: 'auto', height: '100vh', position: 'fixed', left: 0 }"
|
||||
width="220">
|
||||
<div class="logo">
|
||||
圆桌物流管理系统
|
||||
</div>
|
||||
<a-menu theme="dark" mode="inline">
|
||||
<a-sub-menu v-for="(item, index) in menus" :key="index">
|
||||
<span slot="title">
|
||||
<a-icon :type="item.icon"/>
|
||||
<span>{{ item.title }}</span>
|
||||
</span>
|
||||
<a-menu-item v-for="menu in item.children" :key="menu.title">
|
||||
<router-link :to="menu.path">
|
||||
{{ menu.title }}
|
||||
</router-link>
|
||||
</a-menu-item>
|
||||
</a-sub-menu>
|
||||
</a-menu>
|
||||
</a-layout-sider>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
menus: [
|
||||
{
|
||||
title: '基础管理',
|
||||
icon: 'home',
|
||||
children: [
|
||||
{title: '商品管理', path: '/commodity'},
|
||||
{title: '来往单位', path: '/company'},
|
||||
{title: '员工管理', path: '/employee'},
|
||||
{title: '仓库管理', path: '/warehouse'},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '销售管理',
|
||||
icon: 'pay-circle',
|
||||
children: [
|
||||
{title: '销售开票', path: '/sale/create'},
|
||||
{title: '销售记录', path: '/sale/record'},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '配送管理',
|
||||
icon: 'car',
|
||||
children: [
|
||||
{title: '申请配送', path: '/delivery/create'},
|
||||
{title: '配送列表', path: '/delivery/list'},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '运输管理',
|
||||
icon: 'rocket',
|
||||
children: [
|
||||
{title: '车辆资料', path: '/vehicle'},
|
||||
{title: '驾驶员资料', path: '/driver'},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '图表分析',
|
||||
icon: 'line-chart',
|
||||
children: [
|
||||
{title: '入库分析', path: '/analyze/in'},
|
||||
{title: '出库分析', path: '/analyze/out'},
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '系统管理',
|
||||
icon: 'tool',
|
||||
children: [
|
||||
{title: '安全设置', path: '/security'},
|
||||
{title: '操作员管理', path: '/admin'},
|
||||
{title: '权限列表', path: '/role'}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: '日志管理',
|
||||
icon: 'file',
|
||||
children: [
|
||||
{title: '登录日志', path: '/loginlog'},
|
||||
{title: '操作日志', path: '/systemlog'}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
#components-layout-demo-fixed-sider .logo {
|
||||
padding: 10px 15px;
|
||||
height: 50px;
|
||||
font-size: 15px;
|
||||
margin: 16px;
|
||||
color: #ffffff;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.ant-menu {
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.logo img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
</style>
|
@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<a-layout-footer :style="{ textAlign: 'center', letterSpacing: '1px' }">
|
||||
圆桌物流管理系统
|
||||
</a-layout-footer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "Footer"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<a-layout-header class="header" :style="{ background: '#fff', padding: 0}">
|
||||
<a-tooltip placement="bottom">
|
||||
<template slot="title">
|
||||
<span>刷新页面</span>
|
||||
</template>
|
||||
<!-- <a-button @click="clickReload" class="reload-btn" icon="reload" type="link">Reload</a-button> -->
|
||||
</a-tooltip>
|
||||
|
||||
<a-tooltip placement="bottom" class="question-btn">
|
||||
<template slot="title">
|
||||
<span>About</span>
|
||||
</template>
|
||||
<a-button class="reload-btn" icon="question-circle" type="link"/>
|
||||
</a-tooltip>
|
||||
|
||||
<a-dropdown>
|
||||
<a-button class="avatar-btn" type="link">
|
||||
<div class="avatar-btn-main">
|
||||
<a-avatar class="avatar"
|
||||
:size="26"
|
||||
src="https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png"/>
|
||||
<div class="avatar-btn-username">{{ details.email }}</div>
|
||||
</div>
|
||||
</a-button>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<router-link to="/security">
|
||||
<a-icon class="icon" type="smile"/>
|
||||
个人中心
|
||||
</router-link>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<router-link to="/role">
|
||||
<a-icon class="icon" type="setting"/>
|
||||
权限设置
|
||||
</router-link>
|
||||
</a-menu-item>
|
||||
<a-menu-divider/>
|
||||
<a-menu-item @click="handleLogout">
|
||||
<a-icon class="icon" type="logout"/>
|
||||
退出登录
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
|
||||
</a-layout-header>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
details: this.$store.state.user.details ? this.$store.state.user.details : {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickReload() {
|
||||
this.$router.go(0)
|
||||
},
|
||||
handleLogout() {
|
||||
let that = this
|
||||
this.$confirm({
|
||||
title: '你确定要注销你的登录信息吗?',
|
||||
content: '点击确定将删除你在网站保留的登录信息!',
|
||||
onOk() {
|
||||
that.$router.push('/login')
|
||||
that.$store.commit('user/userLogout')
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.reload-btn {
|
||||
font-size: 15px;
|
||||
margin-left: 10px;
|
||||
color: rgba(0, 0, 0, 0.65);
|
||||
}
|
||||
|
||||
.question-btn {
|
||||
float: right;
|
||||
margin: 15px 12px 0 0;
|
||||
}
|
||||
|
||||
.avatar-btn {
|
||||
float: right;
|
||||
font-size: 15px;
|
||||
color: rgba(0, 0, 0, 0.55);
|
||||
height: 64px;
|
||||
}
|
||||
|
||||
|
||||
.avatar-btn-main {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.avatar-btn-username {
|
||||
line-height: 62px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
margin-right: 12px;
|
||||
margin-top: 19px;
|
||||
}
|
||||
|
||||
</style>
|
@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<a-layout id="components-layout-demo-fixed-sider">
|
||||
<Aside/>
|
||||
<a-layout :style="{ marginLeft: '220px' }">
|
||||
<Header/>
|
||||
<Main/>
|
||||
<Footer/>
|
||||
</a-layout>
|
||||
</a-layout>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Aside from "@/layout/Aside";
|
||||
import Header from "@/layout/Header";
|
||||
import Main from "@/layout/Main";
|
||||
import Footer from "@/layout/Footer";
|
||||
|
||||
export default {
|
||||
components: {Aside, Header, Main, Footer},
|
||||
mounted() {
|
||||
this.$message.success(
|
||||
'欢迎管理员 ' + this.$store.state.user.details.email,6,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#components-layout-demo-fixed-sider .logo {
|
||||
padding: 10px 15px;
|
||||
height: 50px;
|
||||
font-size: 15px;
|
||||
margin: 16px;
|
||||
color: #ffffff;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.logo img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.header {
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1)
|
||||
}
|
||||
|
||||
</style>
|
@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<a-layout-content :style="{ margin: '24px', overflow: 'initial' }">
|
||||
<router-view/>
|
||||
</a-layout-content>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,19 @@
|
||||
import Vue from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import Antd from 'ant-design-vue'
|
||||
import 'ant-design-vue/dist/antd.css'
|
||||
import JsonExcel from 'vue-json-excel'
|
||||
import 'element-ui/lib/theme-chalk/index.css'; // 导入相关样式
|
||||
|
||||
Vue.component('downloadExcel', JsonExcel)
|
||||
Vue.config.productionTip = false
|
||||
|
||||
Vue.use(Antd)
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
render: function (h) { return h(App) }
|
||||
}).$mount('#app')
|
@ -0,0 +1,32 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import store from '../store'
|
||||
import routes from "@/router/routes"
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
|
||||
//顶部进度条样式
|
||||
NProgress.configure({
|
||||
showSpinner: false,
|
||||
speed: 800,
|
||||
});
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
const router = new VueRouter({
|
||||
mode: 'history',
|
||||
base: process.env.BASE_URL,
|
||||
routes
|
||||
})
|
||||
|
||||
//路由卫士
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start();
|
||||
to.meta.auth && !store.state.user.token ? next("/login") : next();
|
||||
})
|
||||
|
||||
router.afterEach(() => {
|
||||
NProgress.done()
|
||||
})
|
||||
|
||||
export default router
|
@ -0,0 +1,155 @@
|
||||
import Layout from '@/layout/Index'
|
||||
|
||||
const routes = [
|
||||
//公共布局下的路由
|
||||
{
|
||||
path: '/',
|
||||
component: Layout,
|
||||
children: [
|
||||
{
|
||||
path: "",
|
||||
redirect: "/commodity",
|
||||
meta: {auth: true}
|
||||
},
|
||||
{
|
||||
path: 'commodity',
|
||||
component: () => import('@/views/basics/Commodity'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
{
|
||||
path: 'company',
|
||||
component: () => import('@/views/basics/Company'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
{
|
||||
path: 'employee',
|
||||
component: () => import('@/views/basics/Employee'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
{
|
||||
path: 'warehouse',
|
||||
component: () => import('@/views/basics/Warehouse'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
{
|
||||
path: 'warehouse/:id',
|
||||
component: () => import('@/views/basics/Details'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
{
|
||||
path: 'driver',
|
||||
component: () => import('@/views/transport/Driver'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
{
|
||||
path: 'loginlog',
|
||||
component: () => import('@/views/logging/LoginLog'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
{
|
||||
path: 'systemlog',
|
||||
component: () => import('@/views/logging/SystemLog'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
{
|
||||
path: 'vehicle',
|
||||
component: () => import('@/views/transport/Vehicle'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
{
|
||||
path: 'sale/record',
|
||||
component: () => import('@/views/sale/Record'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
{
|
||||
path: 'sale/create',
|
||||
component: () => import('@/views/sale/Create'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
|
||||
{
|
||||
path: 'delivery/create',
|
||||
component: () => import('@/views/delivery/Create'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
{
|
||||
path: 'delivery/list',
|
||||
component: () => import('@/views/delivery/List'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
|
||||
{
|
||||
path: 'analyze/in',
|
||||
component: () => import('@/views/analyze/In'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
|
||||
{
|
||||
path: 'analyze/out',
|
||||
component: () => import('@/views/analyze/Out'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
|
||||
{
|
||||
path: 'security',
|
||||
component: () => import('@/views/system/Security'),
|
||||
meta: {auth: true},
|
||||
},
|
||||
{
|
||||
path: 'admin',
|
||||
component: () => import('@/views/system/Admin'),
|
||||
meta: {auth: true},
|
||||
},
|
||||
{
|
||||
path: 'role',
|
||||
component: () => import('@/views/system/Role'),
|
||||
meta: {auth: true},
|
||||
},
|
||||
|
||||
//403
|
||||
{
|
||||
path: '403',
|
||||
component: () => import('@/views/error/403'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
//404
|
||||
{
|
||||
path: '404',
|
||||
component: () => import('@/views/error/404'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
//500
|
||||
{
|
||||
path: '500',
|
||||
component: () => import('@/views/error/500'),
|
||||
meta: {auth: true}
|
||||
},
|
||||
|
||||
]
|
||||
},
|
||||
|
||||
//登录页
|
||||
{
|
||||
path: '/login',
|
||||
name: 'Login',
|
||||
component: () => import('@/views/Login'),
|
||||
meta: {auth: false}
|
||||
},
|
||||
|
||||
//初始化
|
||||
{
|
||||
path: '/init',
|
||||
name: 'Init',
|
||||
component: () => import('@/views/Init'),
|
||||
meta: {auth: false}
|
||||
},
|
||||
|
||||
//404
|
||||
{
|
||||
path: "*",
|
||||
redirect: '/404'
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
export default routes
|
@ -0,0 +1,11 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import user from './modules/user'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
export default new Vuex.Store({
|
||||
modules: {
|
||||
user
|
||||
}
|
||||
})
|
@ -0,0 +1,40 @@
|
||||
const state = {
|
||||
token: localStorage.getItem("token"),
|
||||
details: JSON.parse(localStorage.getItem("user"))
|
||||
}
|
||||
|
||||
const getters = {}
|
||||
|
||||
const mutations = {
|
||||
|
||||
saveToken(state, token) {
|
||||
state.token = token
|
||||
localStorage.setItem("token", token)
|
||||
console.log(localStorage.getItem("token"))
|
||||
console.log("执行saveToken")
|
||||
},
|
||||
|
||||
saveLoginUser(state, user) {
|
||||
state.details = user
|
||||
localStorage.setItem("user", JSON.stringify(user))
|
||||
console.log("saveLoginUser")
|
||||
},
|
||||
|
||||
userLogout(state) {
|
||||
state.details = null
|
||||
state.token = null
|
||||
localStorage.removeItem("token")
|
||||
localStorage.removeItem("user")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const actions = {}
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state,
|
||||
getters,
|
||||
mutations,
|
||||
actions
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
import request from "axios"
|
||||
import {message} from 'ant-design-vue'
|
||||
import router from '../router/index'
|
||||
|
||||
var token = localStorage.getItem("token")
|
||||
var service = request.create({
|
||||
baseURL: 'http://localhost:8088/api',
|
||||
timeout: 50000
|
||||
});
|
||||
|
||||
|
||||
service.interceptors.response.use(
|
||||
response => {
|
||||
const res = response.data;
|
||||
//判断response状态
|
||||
if (!res.status) message.error('请求错误: ' + res.msg)
|
||||
if (res.code === 403) router.push("/403")
|
||||
return res
|
||||
},
|
||||
error => {
|
||||
message.error(error)
|
||||
router.push('/500')
|
||||
return Promise.reject(error)
|
||||
}
|
||||
);
|
||||
console.log("执行request.js2");
|
||||
|
||||
export default service
|
@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form-model-item label="Activity name">
|
||||
<a-input v-model="form.name" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Activity zone">
|
||||
<a-select v-model="form.region" placeholder="please select your zone">
|
||||
<a-select-option value="shanghai">
|
||||
Zone one
|
||||
</a-select-option>
|
||||
<a-select-option value="beijing">
|
||||
Zone two
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Activity time">
|
||||
<a-date-picker
|
||||
v-model="form.date1"
|
||||
show-time
|
||||
type="date"
|
||||
placeholder="Pick a date"
|
||||
style="width: 100%;"
|
||||
/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Instant delivery">
|
||||
<a-switch v-model="form.delivery" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Activity type">
|
||||
<a-checkbox-group v-model="form.type">
|
||||
<a-checkbox value="1" name="type">
|
||||
Online
|
||||
</a-checkbox>
|
||||
<a-checkbox value="2" name="type">
|
||||
Promotion
|
||||
</a-checkbox>
|
||||
<a-checkbox value="3" name="type">
|
||||
Offline
|
||||
</a-checkbox>
|
||||
</a-checkbox-group>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Resources">
|
||||
<a-radio-group v-model="form.resource">
|
||||
<a-radio value="1">
|
||||
Sponsor
|
||||
</a-radio>
|
||||
<a-radio value="2">
|
||||
Venue
|
||||
</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Activity form">
|
||||
<a-input v-model="form.desc" type="textarea" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
|
||||
<a-button type="primary" @click="onSubmit">
|
||||
Create
|
||||
</a-button>
|
||||
<a-button style="margin-left: 10px;">
|
||||
Cancel
|
||||
</a-button>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
labelCol: { span: 4 },
|
||||
wrapperCol: { span: 14 },
|
||||
form: {
|
||||
name: '',
|
||||
region: undefined,
|
||||
date1: undefined,
|
||||
delivery: false,
|
||||
type: [],
|
||||
resource: '',
|
||||
desc: '',
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onSubmit() {
|
||||
console.log('submit!', this.form);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<div class="main" id="main">
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts/core';
|
||||
import {
|
||||
TitleComponent,
|
||||
TooltipComponent,
|
||||
LegendComponent
|
||||
} from 'echarts/components';
|
||||
import {
|
||||
PieChart
|
||||
} from 'echarts/charts';
|
||||
import {
|
||||
CanvasRenderer
|
||||
} from 'echarts/renderers';
|
||||
import {AnalyzeCommodity} from "../../api/inventory";
|
||||
|
||||
echarts.use(
|
||||
[TitleComponent, TooltipComponent, LegendComponent, PieChart, CanvasRenderer]
|
||||
);
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
commodityList: []
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
AnalyzeCommodity(1).then((res) => {
|
||||
if (res.status) {
|
||||
let commodityList = res.data
|
||||
let chartDom = document.getElementById('main');
|
||||
let myChart = echarts.init(chartDom);
|
||||
let option;
|
||||
|
||||
option = {
|
||||
title: {
|
||||
text: '商品入库排行分析',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '访问来源',
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
data: commodityList,
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
methods: {},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.main {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
background: #ffffff;
|
||||
padding: 50px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,89 @@
|
||||
<template>
|
||||
<div class="main" id="main">
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts/core';
|
||||
import {
|
||||
TitleComponent,
|
||||
TooltipComponent,
|
||||
LegendComponent
|
||||
} from 'echarts/components';
|
||||
import {
|
||||
PieChart
|
||||
} from 'echarts/charts';
|
||||
import {
|
||||
CanvasRenderer
|
||||
} from 'echarts/renderers';
|
||||
import {AnalyzeCommodity} from "../../api/inventory";
|
||||
|
||||
echarts.use(
|
||||
[TitleComponent, TooltipComponent, LegendComponent, PieChart, CanvasRenderer]
|
||||
);
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
commodityList: []
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
AnalyzeCommodity(-1).then((res) => {
|
||||
if (res.status) {
|
||||
let commodityList = res.data
|
||||
let chartDom = document.getElementById('main');
|
||||
let myChart = echarts.init(chartDom);
|
||||
let option;
|
||||
|
||||
option = {
|
||||
title: {
|
||||
text: '商品出库排行分析',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left',
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '访问来源',
|
||||
type: 'pie',
|
||||
radius: '50%',
|
||||
data: commodityList,
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
methods: {},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.main {
|
||||
width: 100%;
|
||||
height: 500px;
|
||||
background: #ffffff;
|
||||
padding: 50px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,200 @@
|
||||
<template>
|
||||
<div>
|
||||
<div style="display: flex">
|
||||
<a-button size="large" class="editable-add-btn" @click="commodityVisible = true">
|
||||
<a-icon type="plus"/>
|
||||
新增商品
|
||||
</a-button>
|
||||
<a-input-search
|
||||
placeholder="请输入商品名"
|
||||
enter-button="搜索商品"
|
||||
style="width: 400px;margin-left: 20px"
|
||||
size="large"
|
||||
@search="onSearch"
|
||||
/>
|
||||
<a-button style="margin-left: 10px" size="large" type="danger" @click="loadTableData">
|
||||
重置
|
||||
</a-button>
|
||||
</div>
|
||||
<a-table :loading="loading" :columns="columns" :data-source="data" :sortDirections="['ascend', 'descend']" rowKey="id">
|
||||
<a slot="name" slot-scope="text">{{ text }}</a>
|
||||
<span slot="customTitle"><a-icon type="smile-o"/> 商品名称</span>
|
||||
<span slot="action" slot-scope="text, record, index">
|
||||
<a-button @click="handleUpdate(record)" type="link"><a-icon type="edit"/> Update</a-button>
|
||||
<a-divider type="vertical"/>
|
||||
<a-button @click="handleDelete(record,index)" type="link"><a-icon type="delete"/> Delete</a-button>
|
||||
</span>
|
||||
</a-table>
|
||||
|
||||
<a-modal
|
||||
title="商品信息"
|
||||
:closable="false"
|
||||
:visible="commodityVisible"
|
||||
>
|
||||
<a-form-model ref="ruleForm" :model="commodity">
|
||||
<a-form-model-item ref="name" label="商品名称" prop="name">
|
||||
<a-input v-model="commodity.name"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="商品单价" prop="price">
|
||||
<a-input-number id="input" v-model="commodity.price" :min="1"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="描述信息" prop="description">
|
||||
<a-input v-model="commodity.description" type="textarea"/>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
<template slot="footer">
|
||||
<a-button key="back" @click="commodityVisible = false">
|
||||
Return
|
||||
</a-button>
|
||||
<a-button key="submit" type="primary" :loading="modalLoading" @click="submitCommodity">
|
||||
Submit
|
||||
</a-button>
|
||||
</template>
|
||||
</a-modal>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {DeleteCommodityById, FindAllCommodity, SaveCommodity} from "@/api/commodity";
|
||||
import {SearchCommodity} from "../../api/commodity";
|
||||
|
||||
const columns = [
|
||||
{
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
slots: {title: 'customTitle'},
|
||||
scopedSlots: {customRender: 'name'},
|
||||
},
|
||||
{
|
||||
title: '库存数量',
|
||||
dataIndex: 'count',
|
||||
key: 'age'
|
||||
// defaultSortOrder: 'descend', // 默认上到下为由大到小的顺序
|
||||
// sorter: (a, b) => { return a.count> b.count? 1 : -1 },
|
||||
// sortField: 'count'
|
||||
},
|
||||
{
|
||||
title: '描述信息',
|
||||
dataIndex: 'description',
|
||||
key: 'description',
|
||||
},
|
||||
{
|
||||
title: '入库时间',
|
||||
dataIndex: 'createAt',
|
||||
key: 'createAt',
|
||||
defaultSortOrder: 'descend', // 默认上到下为由大到小的顺序
|
||||
sorter: (a, b) => { return a.createAt> b.createAt? 1 : -1 },
|
||||
sortField: 'createAt'
|
||||
},
|
||||
{
|
||||
title: '商品单价',
|
||||
key: 'price',
|
||||
dataIndex: 'price',
|
||||
scopedSlots: {customRender: 'tags'},
|
||||
},
|
||||
{
|
||||
title: '更多操作',
|
||||
key: 'action',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
}
|
||||
];
|
||||
|
||||
const data = [];
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
commodity: {
|
||||
name: '',
|
||||
description: '商品简介',
|
||||
count: 0,
|
||||
price: 9.99,
|
||||
},
|
||||
loading: false,
|
||||
modalLoading: false,
|
||||
commodityVisible: false,
|
||||
commodityLoading: false,
|
||||
data: [],
|
||||
columns,
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.loadTableData()
|
||||
},
|
||||
|
||||
methods: {
|
||||
onSearch(value) {
|
||||
if (value){
|
||||
this.loading = true
|
||||
SearchCommodity(value).then((res) => {
|
||||
console.log(res)
|
||||
if (res.data.length === 0) {
|
||||
this.$message.warn("未搜索到任何数据")
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
this.data = res.data
|
||||
}, 600)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.$message.success("搜索到" + res.data.length + "个商品")
|
||||
this.loading = false
|
||||
this.data = res.data
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
}else {
|
||||
this.$message.warn("请输入搜索内容")
|
||||
}
|
||||
},
|
||||
|
||||
loadTableData() {
|
||||
this.loading = true
|
||||
FindAllCommodity().then((res) => {
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
this.data = res.data
|
||||
}, 600)
|
||||
})
|
||||
},
|
||||
submitCommodity() {
|
||||
this.modalLoading = true
|
||||
SaveCommodity(this.commodity).then((res) => {
|
||||
if (res.status) {
|
||||
setTimeout(() => {
|
||||
this.modalLoading = false
|
||||
this.commodityVisible = false
|
||||
this.$message.success('商品信息提交成功');
|
||||
this.loadTableData()
|
||||
}, 600)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.modalLoading = false
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
handleDelete(r, index) {
|
||||
DeleteCommodityById(r.id).then((res) => {
|
||||
if (res.status) this.$message.success('商品信息删除成功');
|
||||
this.loadTableData()
|
||||
})
|
||||
console.log(index)
|
||||
},
|
||||
|
||||
handleUpdate(r) {
|
||||
this.commodity = r
|
||||
this.commodityVisible = true
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.editable-add-btn {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-input-search
|
||||
placeholder="请输入公司名"
|
||||
enter-button="搜索来往公司"
|
||||
style="width: 400px;margin-bottom: 20px"
|
||||
size="large"
|
||||
@search="onSearch"
|
||||
/>
|
||||
<a-button style="margin-left: 10px" size="large" type="danger" @click="loadTableData">
|
||||
重置
|
||||
</a-button>
|
||||
<a-table :loading="loading" :columns="columns" :data-source="data" rowKey="id">
|
||||
<a slot="company" slot-scope="company">{{ company }}</a>
|
||||
<span slot="customTitle"><a-icon type="bank"/> 公司名称</span>
|
||||
</a-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {FindAllSale, SearchCompany} from "../../api/sale";
|
||||
|
||||
const columns = [
|
||||
{
|
||||
dataIndex: 'company',
|
||||
key: 'company',
|
||||
slots: {title: 'customTitle'},
|
||||
scopedSlots: {customRender: 'company'},
|
||||
},
|
||||
{
|
||||
title: '预留电话',
|
||||
key: 'phone',
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
{
|
||||
title: '时间',
|
||||
dataIndex: 'createAt',
|
||||
key: 'createAt',
|
||||
},
|
||||
];
|
||||
|
||||
const data = [];
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
data: [],
|
||||
columns,
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.loadTableData()
|
||||
},
|
||||
|
||||
methods: {
|
||||
onSearch(value) {
|
||||
if (value) {
|
||||
this.loading = true
|
||||
SearchCompany(value).then((res) => {
|
||||
if (res.data.length === 0) {
|
||||
this.$message.warn("未搜索到任何数据")
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
this.data = res.data
|
||||
}, 600)
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.$message.success("搜索到" + res.data.length + "个公司")
|
||||
this.loading = false
|
||||
this.data = res.data
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.warn("请输入搜索内容")
|
||||
}
|
||||
},
|
||||
loadTableData() {
|
||||
this.loading = true
|
||||
var that = this
|
||||
console.log("loadTableData")
|
||||
FindAllSale().then((res) => {
|
||||
console.log("FindAllSale返回")
|
||||
console.log(res)
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
this.data = res.data
|
||||
that.loading = false
|
||||
}, 600)
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.editable-add-btn {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-spin size="large" :spinning="spinning">
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="8" class="item">
|
||||
<a-card hoverable class="add-item" @click="visible = true">
|
||||
<a-icon type="plus"/>
|
||||
添加仓库
|
||||
</a-card>
|
||||
</a-col>
|
||||
<a-col :span="8" v-for="(item, index) in this.data" :key="index" class="item">
|
||||
<a-card hoverable>
|
||||
<template slot="actions" class="ant-card-actions">
|
||||
<span>负责人: {{ item.principle }}</span>
|
||||
<span>
|
||||
<router-link :to="'/warehouse/' + item.id">
|
||||
<a-icon type="bar-chart"/> 库存管理
|
||||
</router-link>
|
||||
</span>
|
||||
</template>
|
||||
<a-card-meta
|
||||
:title="item.name"
|
||||
:description="'ID: ' + item.id">
|
||||
<img class="image" slot="avatar" :src="imgList[Math.floor(Math.random() * 3)]"
|
||||
alt=""/>
|
||||
</a-card-meta>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-spin>
|
||||
|
||||
<a-modal
|
||||
title="新增仓库"
|
||||
:visible="visible"
|
||||
@ok="submit"
|
||||
@cancel="visible = false"
|
||||
>
|
||||
<a-input v-model="form.name" addon-before="仓库名称" style="width: 300px;margin-bottom: 20px"></a-input>
|
||||
<a-input v-model="form.principle" addon-before="仓库负责人" style="width: 300px"></a-input>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {FindAllWarehouse, SaveWarehouse} from "@/api/warehouse";
|
||||
|
||||
export default {
|
||||
name: "WareHouse",
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
form: {id: '', principle: '', name: ''},
|
||||
spinning: false,
|
||||
data: [],
|
||||
imgList: [
|
||||
require('../../assets/warehouse0.svg'),
|
||||
require('../../assets/warehouse1.svg'),
|
||||
require('../../assets/warehouse2.svg'),]
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.loadData()
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
loadData() {
|
||||
this.spinning = true
|
||||
FindAllWarehouse().then((res) => {
|
||||
if (res.status) this.data = res.data
|
||||
setTimeout(() => {
|
||||
this.spinning = false
|
||||
}, 600)
|
||||
})
|
||||
},
|
||||
|
||||
submit() {
|
||||
SaveWarehouse(this.form).then((res) => {
|
||||
if (res.status) this.$message.success("添加成功")
|
||||
this.visible = false
|
||||
this.loadData()
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.add-item {
|
||||
text-align: center;
|
||||
line-height: 120px;
|
||||
min-height: 120px;
|
||||
border: 1px dashed #91949c;
|
||||
}
|
||||
|
||||
.add-item:hover {
|
||||
border: 1px dashed #5a84fd;
|
||||
color: #5a84fd;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<a-result status="403" title="403" sub-title="Sorry, you are not authorized to access this page.">
|
||||
<template #extra>
|
||||
<a-button type="primary" @click="clickBtn" style="letter-spacing: 1px">
|
||||
<a-icon type="enter" />Return
|
||||
</a-button>
|
||||
</template>
|
||||
</a-result>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
clickBtn() {
|
||||
this.$router.go(-1)
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<a-result status="404" title="404" sub-title="Sorry, the page you visited does not exist.">
|
||||
<template #extra>
|
||||
<a-button type="primary" @click="clickBtn" style="letter-spacing: 1px">
|
||||
<a-icon type="enter" />Return
|
||||
</a-button>
|
||||
</template>
|
||||
</a-result>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
clickBtn() {
|
||||
this.$router.go(-1)
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<a-result status="500" title="500" sub-title="Sorry, the server is wrong.">
|
||||
<template #extra>
|
||||
<a-button type="primary" @click="clickBtn" style="letter-spacing: 1px">
|
||||
<a-icon type="enter" />Return
|
||||
</a-button>
|
||||
</template>
|
||||
</a-result>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
clickBtn() {
|
||||
this.$router.go(-1)
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <div style="display: flex">
|
||||
<a-button size="large" class="editable-add-btn" @click="commodityVisible = true">
|
||||
<a-icon type="plus"/>
|
||||
新增商品
|
||||
</a-button>
|
||||
<a-input-search
|
||||
placeholder="请输入商品名"
|
||||
enter-button="搜索商品"
|
||||
style="width: 400px;margin-left: 20px"
|
||||
size="large"
|
||||
@search="onSearch"
|
||||
/>
|
||||
<a-button style="margin-left: 10px" size="large" type="danger" @click="loadTableData">
|
||||
重置
|
||||
</a-button>
|
||||
</div> -->
|
||||
<a-table :loading="loading" :columns="columns" :data-source="data" :sortDirections="['ascend', 'descend']" rowKey="id" @change="tableChange" >
|
||||
<a slot="name" slot-scope="text">{{ text }}</a>
|
||||
<span slot="customTitle"><a-icon type="smile-o"/> 用户邮件</span>
|
||||
<span slot="status" slot-scope="status">
|
||||
<span v-show="status==1" style="color:#52c41a">成功</span>
|
||||
<span v-show="status==0" style="color:rgb(255, 77, 79)">失败</span>
|
||||
</span>
|
||||
<span slot="action" slot-scope="text, record, index">
|
||||
<a-divider type="vertical"/>
|
||||
<a-button @click="handleDelete(record,index)" type="link"><a-icon type="delete"/> Delete</a-button>
|
||||
</span>
|
||||
</a-table>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {FindAllLoginLog,DeleteLoginLogById} from "@/api/log";
|
||||
|
||||
const columns = [
|
||||
{
|
||||
dataIndex: 'email',
|
||||
key: 'name',
|
||||
slots: {title: 'customTitle'},
|
||||
scopedSlots: {customRender: 'name'}
|
||||
},
|
||||
{
|
||||
title: '浏览器类型',
|
||||
dataIndex: 'browser',
|
||||
key: 'description',
|
||||
},
|
||||
{
|
||||
title: 'IP',
|
||||
dataIndex: 'ip',
|
||||
key: 'address',
|
||||
},
|
||||
{
|
||||
title: '登录时间',
|
||||
key: 'date',
|
||||
dataIndex: 'date',
|
||||
defaultSortOrder: 'descend', // 默认上到下为由大到小的顺序
|
||||
sorter: (a, b) => { return a.date> b.date? 1 : -1 },
|
||||
sortField: 'date'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
key: 'status',
|
||||
dataIndex: 'status',
|
||||
scopedSlots: {customRender: 'status'},
|
||||
},
|
||||
{
|
||||
title: '更多操作',
|
||||
key: 'action',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
},
|
||||
];
|
||||
|
||||
const data = [];
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isorter:{
|
||||
column:'date',
|
||||
order:'desc'
|
||||
},
|
||||
loading: false,
|
||||
modalLoading: false,
|
||||
commodityVisible: false,
|
||||
commodityLoading: false,
|
||||
data: [],
|
||||
columns,
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.loadTableData()
|
||||
},
|
||||
|
||||
methods: {
|
||||
//获取表格数据
|
||||
loadTableData() {
|
||||
this.loading = true
|
||||
FindAllLoginLog().then(res=>{
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
this.data = res.data
|
||||
}, 600)
|
||||
})
|
||||
},
|
||||
//发生排序动作的处理函数
|
||||
tableChange(pagination, filters, sorter) {
|
||||
const { current, pageSize } = pagination;
|
||||
// this.pagination.pageSize = pageSize;
|
||||
console.log("tableChange执行了")
|
||||
if (sorter.order) {
|
||||
const { field, order } = sorter;
|
||||
this.sort = field; // 排序的数据
|
||||
this.sortType = order; // 排序方式
|
||||
} else {
|
||||
console.log("不做排序");
|
||||
}
|
||||
this.loadTableData()
|
||||
},
|
||||
submitCommodity() {
|
||||
this.modalLoading = true
|
||||
},
|
||||
//删除日志信息
|
||||
handleDelete(r, index) {
|
||||
DeleteLoginLogById(r.id).then((res) => {
|
||||
if (res.status) this.$message.success('日志信息删除成功');
|
||||
this.loadTableData()
|
||||
})
|
||||
console.log(index)
|
||||
},
|
||||
|
||||
handleUpdate(r) {
|
||||
this.commodity = r
|
||||
this.commodityVisible = true
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.editable-add-btn {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
|
@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-table :loading="loading" :columns="columns" :sortDirections="['ascend', 'descend']" :data-source="data" rowKey="id">
|
||||
<a slot="company" slot-scope="company">{{ company }}</a>
|
||||
<span slot="customTitle"><a-icon type="bank" /> 公司名称</span>
|
||||
<span slot="action" slot-scope="text, record, index">
|
||||
<a-tag color="red" v-if="!record.pay">等待结款</a-tag>
|
||||
<a-tag color="green" v-if="record.pay">结款完成</a-tag>
|
||||
<a-button v-if="!record.pay" type="link" @click="confirm(record, index)">结款</a-button>
|
||||
</span>
|
||||
</a-table>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {FindAllSale, SaveSale} from "../../api/sale";
|
||||
|
||||
const columns = [
|
||||
{
|
||||
dataIndex: 'company',
|
||||
key: 'company',
|
||||
slots: {title: 'customTitle'},
|
||||
scopedSlots: {customRender: 'company'},
|
||||
},
|
||||
{
|
||||
title: '打款帐号',
|
||||
dataIndex: 'number',
|
||||
key: 'number',
|
||||
},
|
||||
{
|
||||
title: '商品',
|
||||
dataIndex: 'commodity',
|
||||
key: 'commodity',
|
||||
},
|
||||
{
|
||||
title: '数量',
|
||||
dataIndex: 'count',
|
||||
key: 'count'
|
||||
},
|
||||
{
|
||||
title: '总计',
|
||||
dataIndex: 'price',
|
||||
key: 'price',
|
||||
},
|
||||
{
|
||||
title: '预留电话',
|
||||
key: 'phone',
|
||||
dataIndex: 'phone',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
dataIndex: 'description',
|
||||
key: 'description',
|
||||
},
|
||||
{
|
||||
title: '开票时间',
|
||||
dataIndex: 'createAt',
|
||||
key: 'createAt',
|
||||
},
|
||||
{
|
||||
title: '更多操作',
|
||||
key: 'action',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
},
|
||||
];
|
||||
|
||||
const data = [];
|
||||
|
||||
export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
data: [],
|
||||
columns,
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.loadTableData()
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
loadTableData() {
|
||||
this.loading = true
|
||||
FindAllSale().then((res) => {
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
this.data = res.data
|
||||
}, 600)
|
||||
})
|
||||
},
|
||||
|
||||
confirm(record, index) {
|
||||
let that = this
|
||||
this.$confirm({
|
||||
title: '销售结款',
|
||||
content: '我已确定' + record.company + '的销售金额 ¥' + record.price + '已经打入账户!',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
that.data[index].pay = true
|
||||
SaveSale(that.data[index]).then((res) => {
|
||||
if (res.status) that.$message.success("销售结款成功")
|
||||
})
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.editable-add-btn {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,234 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-button size="large" class="editable-add-btn" @click="addVisible = true">
|
||||
<a-icon type="plus"/>
|
||||
添加操作员
|
||||
</a-button>
|
||||
<a-table :columns="columns" :data-source="admins" rowKey="id" :loading="loading">
|
||||
<a slot="email" slot-scope="email">{{ email }}</a>
|
||||
<span slot="customTitle"><a-icon type="smile-o"/> 邮箱</span>
|
||||
<span slot="tags" slot-scope="tags">
|
||||
<a-tag
|
||||
v-for="tag in tags"
|
||||
:key="tag"
|
||||
:color="tag === 'loser' ? 'volcano' : tag.length > 5 ? 'geekblue' : 'green'"
|
||||
>
|
||||
{{ tag.toUpperCase() }}
|
||||
</a-tag>
|
||||
</span>
|
||||
<span slot="action" slot-scope="text, record, index">
|
||||
<a-dropdown>
|
||||
<a class="ant-dropdown-link" @click="e => e.preventDefault()">操作<a-icon type="down"/></a>
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item>
|
||||
<a-button type="link" @click="updateEmail(index)"><a-icon type="mail"/> 邮箱修改</a-button>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a-button type="link" @click="updatePassword(index)"><a-icon type="lock"/> 密码修改</a-button>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a-button type="link" @click="updateRoles(index)"><a-icon type="gateway"/> 权限修改</a-button>
|
||||
</a-menu-item>
|
||||
<a-menu-item>
|
||||
<a-button type="link" @click="remove(record.id)"><a-icon type="delete"/> 删除</a-button>
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</a-dropdown>
|
||||
</span>
|
||||
</a-table>
|
||||
|
||||
<a-modal
|
||||
title="添加操作员"
|
||||
:visible="addVisible"
|
||||
@ok="submit"
|
||||
@cancel="addVisible = false"
|
||||
>
|
||||
<a-form-model :model="selectAdmin">
|
||||
<a-form-model-item label="邮箱">
|
||||
<a-input v-model="selectAdmin.email"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="密码">
|
||||
<a-input v-model="selectAdmin.password"/>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</a-modal>
|
||||
|
||||
<a-modal
|
||||
title="密码修改"
|
||||
:visible="passwordVisible"
|
||||
@ok="submit"
|
||||
@cancel="passwordVisible = false"
|
||||
>
|
||||
<a-form-model :model="selectAdmin">
|
||||
<a-form-model-item label="密码">
|
||||
<a-input v-model="selectAdmin.password"/>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</a-modal>
|
||||
|
||||
<a-modal
|
||||
title="邮箱修改"
|
||||
:visible="emailVisible"
|
||||
@ok="submit"
|
||||
@cancel="emailVisible = false"
|
||||
>
|
||||
<a-form-model :model="selectAdmin">
|
||||
<a-form-model-item label="绑定邮箱">
|
||||
<a-input v-model="selectAdmin.email"/>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</a-modal>
|
||||
|
||||
<a-modal
|
||||
title="权限修改"
|
||||
width="500px"
|
||||
:visible="rolesVisible"
|
||||
@ok="submitRoles"
|
||||
@cancel="rolesVisible = false"
|
||||
>
|
||||
<a-select
|
||||
v-model="selectRoles"
|
||||
mode="multiple"
|
||||
style="width: 100%"
|
||||
placeholder="select one country"
|
||||
option-label-prop="label"
|
||||
>
|
||||
<a-select-option :value="item.value"
|
||||
:label="item.value"
|
||||
v-for="(item ,index) in roles"
|
||||
:key="index">
|
||||
<span role="img" :aria-label="item.value">🇨🇳</span>{{ item.value + ' (描述: ' + item.description + ')' }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-modal>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {DeleteAdmin, FindAllAdmin, SaveAdmin} from "../../api/admin";
|
||||
import {FindAllRole} from "../../api/role";
|
||||
|
||||
const columns = [
|
||||
{
|
||||
dataIndex: 'email',
|
||||
key: 'email',
|
||||
slots: {title: 'customTitle'},
|
||||
scopedSlots: {customRender: 'email'},
|
||||
},
|
||||
{
|
||||
title: '密码',
|
||||
dataIndex: 'password',
|
||||
key: 'password',
|
||||
},
|
||||
{
|
||||
title: '权限',
|
||||
dataIndex: 'roles',
|
||||
key: 'roles',
|
||||
},
|
||||
{
|
||||
title: '添加日期',
|
||||
key: 'createAt',
|
||||
dataIndex: 'createAt',
|
||||
scopedSlots: {customRender: 'createAt'},
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
roles: [],
|
||||
selectRoles: [],
|
||||
admins: [],
|
||||
loading: false,
|
||||
addVisible: false,
|
||||
emailVisible: false,
|
||||
passwordVisible: false,
|
||||
rolesVisible: false,
|
||||
columns,
|
||||
selectAdmin: {},
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.load()
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
load() {
|
||||
this.loading = true
|
||||
FindAllRole().then((res) => {
|
||||
if (res.status) this.roles = res.data
|
||||
})
|
||||
FindAllAdmin().then((res) => {
|
||||
setTimeout(() => {
|
||||
this.admins = res.data
|
||||
this.loading = false
|
||||
}, 600)
|
||||
})
|
||||
},
|
||||
|
||||
submit() {
|
||||
SaveAdmin(this.selectAdmin).then((res) => {
|
||||
if (res.status) this.$message.success("操作员信息更新成功")
|
||||
this.addVisible = false
|
||||
this.emailVisible = false
|
||||
this.rolesVisible = false
|
||||
this.passwordVisible = false
|
||||
this.load()
|
||||
})
|
||||
},
|
||||
|
||||
submitRoles() {
|
||||
let str = ''
|
||||
for (let i = 0; i < this.selectRoles.length; i++) {
|
||||
if (i === this.selectRoles.length - 1) {
|
||||
str += this.selectRoles[i]
|
||||
} else {
|
||||
str += this.selectRoles[i] + ";"
|
||||
}
|
||||
}
|
||||
this.selectAdmin.roles = str
|
||||
this.submit()
|
||||
},
|
||||
|
||||
updateEmail(index) {
|
||||
this.emailVisible = true
|
||||
this.selectAdmin = this.admins[index]
|
||||
},
|
||||
|
||||
updatePassword(index) {
|
||||
this.passwordVisible = true
|
||||
this.selectAdmin = this.admins[index]
|
||||
},
|
||||
|
||||
updateRoles(index) {
|
||||
this.rolesVisible = true
|
||||
this.selectAdmin = this.admins[index]
|
||||
this.selectRoles = this.selectAdmin.roles.split(";")
|
||||
console.log(this.selectRoles)
|
||||
},
|
||||
|
||||
remove(id) {
|
||||
DeleteAdmin(id).then((res) => {
|
||||
if (res.status) this.$message.success("操作员删除成功")
|
||||
this.load()
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.editable-add-btn {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-spin size="large" :spinning="spinning">
|
||||
<a-row :gutter="20">
|
||||
<a-col :span="8" class="item">
|
||||
<a-card hoverable class="add-item" @click="visible = true">
|
||||
<a-icon type="plus"/>
|
||||
添加车辆
|
||||
</a-card>
|
||||
</a-col>
|
||||
<a-col :span="8" v-for="(item, index) in this.data" :key="index" class="item">
|
||||
<a-card hoverable>
|
||||
<!-- <template slot="actions" class="ant-card-actions">-->
|
||||
<!-- <a-tag :color=" item.driving ? 'orange': 'green'">{{ item.driving ? '正在途中' : '正在休息' }}</a-tag>-->
|
||||
<!-- <span>使用记录</span>-->
|
||||
<!-- </template>-->
|
||||
<a-card-meta
|
||||
:title="'车牌号:' + item.number"
|
||||
:description="'ID: ' + item.id">
|
||||
<a-badge :number-style="{ backgroundColor: '#52c41a' }"
|
||||
slot="avatar"
|
||||
:count="item.type"
|
||||
:offset="[-80,10]">
|
||||
<img class="image" :src="require('../../assets/' +item.type+'.svg')" alt=""/>
|
||||
</a-badge>
|
||||
</a-card-meta>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-spin>
|
||||
<a-modal
|
||||
title="新增仓库"
|
||||
:visible="visible"
|
||||
@ok="submit"
|
||||
@cancel="visible = false"
|
||||
>
|
||||
<a-form-model :model="form">
|
||||
<a-form-model-item label="车牌号码">
|
||||
<a-input v-model="form.number"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="车辆类型">
|
||||
<a-select v-model="form.type">
|
||||
<a-select-option value="小型汽车">小型汽车</a-select-option>
|
||||
<a-select-option value="货车">货车</a-select-option>
|
||||
<a-select-option value="卡车">卡车</a-select-option>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {FindAllVehicle, SaveVehicle} from "@/api/vehicle";
|
||||
|
||||
export default {
|
||||
name: "WareHouse",
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
spinning: false,
|
||||
form: {
|
||||
number: '京A0000',
|
||||
type: '货车',
|
||||
driving: false,
|
||||
},
|
||||
data: [],
|
||||
imgList: [
|
||||
require('../../assets/warehouse0.svg'),
|
||||
require('../../assets/warehouse1.svg'),
|
||||
require('../../assets/warehouse2.svg'),]
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.loadData()
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
loadData() {
|
||||
this.spinning = true
|
||||
FindAllVehicle().then((res) => {
|
||||
if (res.status) this.data = res.data
|
||||
setTimeout(() => {
|
||||
this.spinning = false
|
||||
}, 600)
|
||||
})
|
||||
},
|
||||
|
||||
submit() {
|
||||
SaveVehicle(this.form).then((res) => {
|
||||
if (res.status) this.$message.success("添加成功")
|
||||
this.visible = false
|
||||
this.loadData()
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.add-item {
|
||||
text-align: center;
|
||||
line-height: 120px;
|
||||
min-height: 120px;
|
||||
border: 1px dashed #91949c;
|
||||
}
|
||||
|
||||
.add-item:hover {
|
||||
border: 1px dashed #5a84fd;
|
||||
color: #5a84fd;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin-left: 20px;
|
||||
}
|
||||
</style>
|