欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 养生 > DC00010基于springboot+vue汽车销售管理系统【前后端分离】

DC00010基于springboot+vue汽车销售管理系统【前后端分离】

2024/10/25 10:22:02 来源:https://blog.csdn.net/qq_30894299/article/details/142408744  浏览:    关键词:DC00010基于springboot+vue汽车销售管理系统【前后端分离】

1、项目功能演示

DC00010基于springboot+vue汽车销售管理系统前后端分离vue汽车销售系统springboot

2、项目功能描述

基于springboot+vue汽车销售管理系统分为销售人员以及经理两个角色

销售人员功能:
1、系统登录
2、销售管理:新订单、销售单订单、订单详情
3、客户管理:添加客户、客户信息
4、库存管理:车辆库存
5、个人月报表
6、我的信息
7、退出系统

销售经理功能:
1、系统登录
2、销售管理:新订单、销售单订单、订单详情
3、客户管理:添加客户、客户信息
4、库存管理:添加库存、车辆库存
5、财务管理:员工报表、销量报表、个人月报表
6、员工管理:添加员工、员工信息
7、退出系统

3、项目运行截图(部分)

4、项目核心代码 

 4.1 登录前端页面

<template><div class="login-container"><el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left"><div class="title-container"><h3 class="title">系统登录</h3><el-dropdown trigger="click" class="international set-roles" @command="handleSetRole"><div><svg-icon class-name="international-icon" icon-class="admin" /></div><el-dropdown-menu slot="dropdown"><el-dropdown-item :disabled="loginForm.roles==='经理'" command="经理">经理</el-dropdown-item><el-dropdown-item :disabled="loginForm.roles==='销售'" command="销售">销售</el-dropdown-item></el-dropdown-menu></el-dropdown></div><el-form-item prop="username"><span class="svg-container"><svg-icon icon-class="user" /></span><el-inputv-model="loginForm.username"placeholder="账号"name="username"type="text"auto-complete="on"required/></el-form-item><el-form-item prop="password"><span class="svg-container"><svg-icon icon-class="password" /></span><el-input:type="passwordType"v-model="loginForm.password"placeholder="密码"name="password"auto-complete="on"@keyup.enter.native="handleLogin" /><span class="show-pwd" @click="showPwd"><svg-icon icon-class="eye" /></span></el-form-item><el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">{{ loginForm.roles }}登录</el-button></el-form></div>
</template><script>
// import { isvalidUsername } from '@/utils/validate'export default {name: 'Login',data() {// const validateUsername = (rule, value, callback) => {//   if (!isvalidUsername(value)) {//     callback(new Error('Please enter the correct user name'))//   } else {//     callback()//   }// }const validatePassword = (rule, value, callback) => {if (value.length < 6) {callback(new Error('The password can not be less than 6 digits'))} else {callback()}}return {loginForm: {roles: '销售',username: '',password: ''},loginRules: {// username: [{ required: true, trigger: 'blur', validator: validateUsername }],password: [{ required: true, trigger: 'blur', validator: validatePassword }]},passwordType: 'password',loading: false,showDialog: false,redirect: undefined}},watch: {$route: {handler: function(route) {this.redirect = route.query && route.query.redirect},immediate: true}},methods: {showPwd() {if (this.passwordType === 'password') {this.passwordType = ''} else {this.passwordType = 'password'}},handleLogin() {this.$refs.loginForm.validate(valid => {if (valid) {this.loading = truethis.$store.dispatch('LoginByUsername', this.loginForm).then(() => {this.loading = falseif (this.$store.getters.code === 20000) {this.$router.push({ path: this.redirect || '/' })} else {this.$notify({title: '错误',message: this.$store.getters.message,type: 'error',duration: 2000})}}).catch(() => {this.loading = false})} else {console.log('error submit!!')return false}})},handleSetRole(lang) {this.loginForm.roles = langthis.$message({message: 'Switch roles Success',type: 'success'})}}
}
</script><style rel="stylesheet/scss" lang="scss">/* 修复input 背景不协调 和光标变色 *//* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */$bg:#283443;$light_gray:#eee;$cursor: #fff;@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {.login-container .el-input input{color: $cursor;&::first-line {color: $light_gray;}}}/* reset element-ui css */.login-container {.el-input {display: inline-block;height: 47px;width: 85%;input {background: transparent;border: 0px;-webkit-appearance: none;border-radius: 0px;padding: 12px 5px 12px 15px;color: $light_gray;height: 47px;caret-color: $cursor;&:-webkit-autofill {box-shadow: 0 0 0px 1000px $bg inset !important;-webkit-text-fill-color: $cursor !important;}}}.el-form-item {border: 1px solid rgba(255, 255, 255, 0.1);background: rgba(0, 0, 0, 0.1);border-radius: 5px;color: #454545;}}
</style><style rel="stylesheet/scss" lang="scss" scoped>
$bg:#2d3a4b;
$dark_gray:#889aa4;
$light_gray:#eee;.login-container {position: fixed;height: 100%;width: 100%;background-color: $bg;.login-form {position: absolute;left: 0;right: 0;width: 520px;max-width: 100%;padding: 35px 35px 15px 35px;margin: 120px auto;}.tips {font-size: 14px;color: #fff;margin-bottom: 10px;span {&:first-of-type {margin-right: 16px;}}}.svg-container {padding: 6px 5px 6px 15px;color: $dark_gray;vertical-align: middle;width: 30px;display: inline-block;}.title-container {position: relative;.title {font-size: 26px;color: $light_gray;margin: 0px auto 40px auto;text-align: center;font-weight: bold;}.set-roles {color: #fff;position: absolute;top: 5px;right: 0px;.international-icon {font-size: 20px;cursor: pointer;vertical-align: -5px!important;}}}.show-pwd {position: absolute;right: 10px;top: 7px;font-size: 16px;color: $dark_gray;cursor: pointer;user-select: none;}.thirdparty-button {position: absolute;right: 35px;bottom: 28px;}
}
</style>

 4.2 maven依赖

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.1.1.RELEASE</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com.gxyan</groupId><artifactId>carsale</artifactId><version>0.0.1-SNAPSHOT</version><name>carsale</name><!--<packaging>war</packaging>--><description>CarSale project for Spring Boot</description><properties><java.version>1.8</java.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>1.3.2</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.46</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency><dependency><groupId>org.apache.commons</groupId><artifactId>commons-lang3</artifactId><version>3.5</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>2.9.10.4</version></dependency><dependency><groupId>org.codehaus.jackson</groupId><artifactId>jackson-mapper-asl</artifactId><version>1.9.12</version></dependency><dependency><groupId>joda-time</groupId><artifactId>joda-time</artifactId><version>2.3</version></dependency><!--pagehelper--><dependency><groupId>com.github.pagehelper</groupId><artifactId>pagehelper-spring-boot-starter</artifactId><version>1.2.10</version></dependency></dependencies><build><plugins><plugin><groupId>org.mybatis.generator</groupId><artifactId>mybatis-generator-maven-plugin</artifactId><version>1.3.6</version><configuration><!--允许移动生成的文件--><verbose>true</verbose><!--允许覆盖生成的文件--><overwrite>true</overwrite></configuration><dependencies><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.46</version></dependency></dependencies></plugin><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build></project>

 4.3 用户请求action

package com.gxyan.controller;import com.gxyan.common.Const;
import com.gxyan.common.ServerResponse;
import com.gxyan.pojo.Employee;
import com.gxyan.service.IEmployeeService;
import com.gxyan.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;import javax.servlet.http.HttpSession;
import java.util.HashMap;
import java.util.Map;@Slf4j
@RestController
@RequestMapping("user")
public class UserController {@Autowiredprivate IUserService userService;@Autowiredprivate IEmployeeService employeeService;@RequestMapping(value = "login", method = RequestMethod.POST)public ServerResponse login( String employeeId, String password, HttpSession session) {ServerResponse response = userService.login(Integer.valueOf(employeeId), password);if (response.isSuccess()) {session.setAttribute(Const.CURRENT_USER, response.getData());Map<String, String> map = new HashMap <>(1);map.put("token", session.getId());response = ServerResponse.createBySuccess(map);}log.info("userId:{}, password:{}, data:{}", employeeId, password, response.getData());return response;}@RequestMapping(value = "logout", method = RequestMethod.GET)public ServerResponse logout(HttpSession session) {session.removeAttribute(Const.CURRENT_USER);return ServerResponse.createBySuccess();}@RequestMapping(value = "info", method = RequestMethod.POST)public ServerResponse<Employee> info(HttpSession session) {Employee employee = (Employee) session.getAttribute(Const.CURRENT_USER);if (employee == null) {return ServerResponse.createByErrorMessage("用户未登录,无法获取当前用户信息");}return ServerResponse.createBySuccess(employee);}@RequestMapping(value = "updateMessage", method = RequestMethod.POST)public ServerResponse updateMessage(Employee employee) {return employeeService.updateEmployee(employee);}@RequestMapping(value = "validPassword", method = RequestMethod.POST)public ServerResponse validPassword(HttpSession session, String validPass) {Employee employee = (Employee) session.getAttribute(Const.CURRENT_USER);return employeeService.validPassword(employee.getId(), validPass);}@RequestMapping(value = "updatePassword", method = RequestMethod.POST)public ServerResponse updatePassword(HttpSession session, String oldPass, String newPass) {Employee employee = (Employee) session.getAttribute(Const.CURRENT_USER);return employeeService.updatePassword(employee.getId(), oldPass, newPass);}
}

5、项目包含内容

6、项目获取

6.1 方式一:私信获取

私信或者扫描下方名片获取项目源码。

6.2 方式二:直接获取 

点击此处直接获取项目源码。 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com