├── .gitignore ├── car_rental_system ├── .env.production ├── .browserslistrc ├── babel.config.js ├── public │ ├── favicon.ico │ └── index.html ├── src │ ├── assets │ │ ├── car2.jpg │ │ ├── logo.png │ │ ├── ccar1.jpg │ │ ├── ccar2.jpg │ │ ├── ccar3.jpg │ │ ├── ccar4.jpg │ │ ├── ccar5.jpg │ │ └── people.png │ ├── App.vue │ ├── views │ │ ├── rentalsystem.vue │ │ ├── book.vue │ │ ├── car │ │ │ └── system │ │ │ │ ├── Benz │ │ │ │ └── Benz.vue │ │ │ │ ├── BMW │ │ │ │ └── BMW.vue │ │ │ │ ├── FAW-VK │ │ │ │ └── FAW-VK.vue │ │ │ │ ├── Nissan │ │ │ │ └── Nissan.vue │ │ │ │ └── caozuoyixia │ │ │ │ ├── DeleteData.vue │ │ │ │ └── AddData.vue │ │ ├── login.vue │ │ ├── storesystem.vue │ │ ├── Usermsg.vue │ │ ├── rental │ │ │ ├── Rental.vue │ │ │ ├── Old.vue │ │ │ ├── Find.vue │ │ │ └── Add.vue │ │ ├── Addstore.vue │ │ ├── usersystem.vue │ │ ├── repair.vue │ │ ├── staff.vue │ │ └── membersystem.vue │ ├── main.js │ ├── api │ │ ├── staffdata.js │ │ ├── repairdata.js │ │ ├── member.js │ │ ├── staffmock.js │ │ ├── rentalmock.js │ │ └── repairmock.js │ ├── router │ │ ├── permission.js │ │ └── index.js │ ├── utils │ │ └── request.js │ ├── store │ │ └── index.js │ └── components │ │ ├── main.vue │ │ ├── AppMain.vue │ │ ├── AppHeader.vue │ │ └── AppNavbar.vue ├── .env.development ├── member.json ├── .gitignore ├── README.md ├── package.json └── vue.config.js ├── jsonserver └── 端口使用说明.txt └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /car_rental_system/.env.production: -------------------------------------------------------------------------------- 1 | VUE_APP_BASE_API='^/pro-api' -------------------------------------------------------------------------------- /car_rental_system/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | -------------------------------------------------------------------------------- /jsonserver/端口使用说明.txt: -------------------------------------------------------------------------------- 1 | cd到json文件的当前目录,再执行下列命令 2 | json-server --watch car.json 3 | 4 | -------------------------------------------------------------------------------- /car_rental_system/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /car_rental_system/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wxj-github/car_rental_system/HEAD/car_rental_system/public/favicon.ico -------------------------------------------------------------------------------- /car_rental_system/src/assets/car2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wxj-github/car_rental_system/HEAD/car_rental_system/src/assets/car2.jpg -------------------------------------------------------------------------------- /car_rental_system/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wxj-github/car_rental_system/HEAD/car_rental_system/src/assets/logo.png -------------------------------------------------------------------------------- /car_rental_system/src/assets/ccar1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wxj-github/car_rental_system/HEAD/car_rental_system/src/assets/ccar1.jpg -------------------------------------------------------------------------------- /car_rental_system/src/assets/ccar2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wxj-github/car_rental_system/HEAD/car_rental_system/src/assets/ccar2.jpg -------------------------------------------------------------------------------- /car_rental_system/src/assets/ccar3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wxj-github/car_rental_system/HEAD/car_rental_system/src/assets/ccar3.jpg -------------------------------------------------------------------------------- /car_rental_system/src/assets/ccar4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wxj-github/car_rental_system/HEAD/car_rental_system/src/assets/ccar4.jpg -------------------------------------------------------------------------------- /car_rental_system/src/assets/ccar5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wxj-github/car_rental_system/HEAD/car_rental_system/src/assets/ccar5.jpg -------------------------------------------------------------------------------- /car_rental_system/src/assets/people.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wxj-github/car_rental_system/HEAD/car_rental_system/src/assets/people.png -------------------------------------------------------------------------------- /car_rental_system/.env.development: -------------------------------------------------------------------------------- 1 | # 只有以VUE_APP_开头的变量会被webpack静态嵌入到客户端侧的包中 process_env.VUE_APP_XXX 2 | 3 | # 目标服务接口地址 4 | VUE_APP_SERVICE_URL='http://localhost:3000' 5 | 6 | # 开发环境的前缀 7 | VUE_APP_BASE_API='/dev-api' -------------------------------------------------------------------------------- /car_rental_system/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | -------------------------------------------------------------------------------- /car_rental_system/src/views/rentalsystem.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # car_rental_system 2 | 基于vue的汽车租赁信息管理系统 3 | 4 | 5 | cd car_rental_system //新终端 6 | npm install //安装依赖 7 | npm run serve //运行项目 8 | 9 | cd jsonserver //新终端 10 | json-server --watch car.json //开启数据接口 11 | 用户名密码:wxj 12 | -------------------------------------------------------------------------------- /car_rental_system/member.json: -------------------------------------------------------------------------------- 1 | { 2 | "posts": [ 3 | { 4 | "id": 1, 5 | "title": "json-server", 6 | "author": "typicode" 7 | } 8 | ], 9 | "comments": [ 10 | { 11 | "id": 1, 12 | "body": "some comment", 13 | "postId": 1 14 | } 15 | ], 16 | "profile": { 17 | "name": "typicode" 18 | } 19 | } -------------------------------------------------------------------------------- /car_rental_system/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /car_rental_system/README.md: -------------------------------------------------------------------------------- 1 | # car_rental_system 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Customize configuration 19 | See [Configuration Reference](https://cli.vuejs.org/config/). 20 | -------------------------------------------------------------------------------- /car_rental_system/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 汽车租赁信息管理系统 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /car_rental_system/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import router from './router' 4 | import store from './store' 5 | import ElementUI from 'element-ui' 6 | import 'element-ui/lib/theme-chalk/index.css' 7 | import VueResource from 'vue-resource'; 8 | import './router/permission' 9 | import '@/api/staffmock' 10 | Vue.use(ElementUI) 11 | Vue.use(VueResource) 12 | 13 | Vue.config.productionTip = false 14 | 15 | 16 | new Vue({ 17 | router, 18 | store, 19 | render: h => h(App) 20 | }).$mount('#app') 21 | -------------------------------------------------------------------------------- /car_rental_system/src/api/staffdata.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | export const getUserData = () => { 3 | return axios.request({ 4 | url: 'user', 5 | method: 'get', 6 | }) 7 | } 8 | export const getMenu = () => { 9 | return axios.request({ 10 | url: 'menu', 11 | method: 'get', 12 | }) 13 | } 14 | export const getman = () => { 15 | return axios.request({ 16 | url: 'man', 17 | method: 'get', 18 | }) 19 | } 20 | export const postman = () => { 21 | return axios.request({ 22 | url: 'post/man', 23 | method: 'post', 24 | }) 25 | } 26 | -------------------------------------------------------------------------------- /car_rental_system/src/api/repairdata.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | export const getUserData = () => { 3 | return axios.request({ 4 | url: 'user', 5 | method: 'get', 6 | }) 7 | } 8 | export const getMenu = () => { 9 | return axios.request({ 10 | url: 'menu', 11 | method: 'get', 12 | }) 13 | } 14 | export const getCar = () => { 15 | return axios.request({ 16 | url: 'car', 17 | method: 'get', 18 | }) 19 | } 20 | export const postCar = () => { 21 | return axios.request({ 22 | url: 'post/car', 23 | method: 'post', 24 | }) 25 | } 26 | -------------------------------------------------------------------------------- /car_rental_system/src/router/permission.js: -------------------------------------------------------------------------------- 1 | import router from './index' 2 | 3 | //from要离开的路由,to要前往的路由,next是一个方法,可以指定路由地址,进行跳转 4 | router.beforeEach((to, from, next) => { 5 | const token = sessionStorage.getItem('loginuser'); 6 | if (token==null) { //没有获取到用户信息 7 | if (to.path !== '/login') { //访问的是非登录页,因为没有登录,就让她去登录页 8 | next({ path: '/login' }) 9 | } 10 | else{ //访问的是登录页,让她去登录页 11 | next() 12 | } 13 | } 14 | else{ //获取到了用户信息 15 | if(to.path==='/login'){ 16 | next() 17 | } 18 | else{ //去非登录页 19 | next() 20 | } 21 | } 22 | }) -------------------------------------------------------------------------------- /car_rental_system/src/api/member.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | 4 | export default{ 5 | //获取会员数据 6 | getList(){ 7 | return request({ 8 | url: '/data', 9 | method:'get' 10 | }) 11 | }, 12 | //分页搜索,page,当前页码,size每页条数,searchmap搜索条件 13 | search(page,size,searchmap){ 14 | return request({ 15 | url:`/member/list/search/${page}/${size}`, 16 | method:'post', 17 | data: searchmap 18 | }) 19 | }, 20 | delete(id){ 21 | return request({ 22 | url:`/data/${id}`, 23 | method:'delete', 24 | data: id 25 | }) 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /car_rental_system/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "car_rental_system", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve", 7 | "build": "vue-cli-service build" 8 | }, 9 | "dependencies": { 10 | "axios": "^0.19.2", 11 | "core-js": "^3.6.5", 12 | "element-ui": "^2.13.2", 13 | "less-loader": "^6.2.0", 14 | "mockjs": "^1.1.0", 15 | "vue": "^2.6.11", 16 | "vue-resource": "^1.5.1", 17 | "vue-router": "^3.2.0", 18 | "vuex": "^3.4.0" 19 | }, 20 | "devDependencies": { 21 | "@vue/cli-plugin-babel": "~4.5.0", 22 | "@vue/cli-plugin-router": "~4.5.0", 23 | "@vue/cli-plugin-vuex": "~4.5.0", 24 | "@vue/cli-service": "~4.5.0", 25 | "sass": "^1.26.5", 26 | "sass-loader": "^8.0.2", 27 | "vue-template-compiler": "^2.6.11" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /car_rental_system/src/utils/request.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | 3 | 4 | const request = axios.create({ 5 | baseURL: process.env.VUE_APP_BASE_API, // /dev-api 6 | // baseURL:'^/dev-api', 7 | timeout:5000 //请求超时毫秒数 8 | }) 9 | 10 | //请求路经http://localhost:8080/db.json 11 | // request.get('/db.json').then(response => { 12 | // const data = response.data; 13 | // console.log(data); 14 | // }) 15 | 16 | //第一个request是上面定义的对象,自定义拦截器 17 | //请求拦截器 18 | request.interceptors.request.use(config=>{ 19 | //请求拦截 20 | return config 21 | },error =>{ 22 | //出现异常 23 | return Promise.reject(error) 24 | }) 25 | 26 | //响应拦截器 27 | request.interceptors.response.use(response => { 28 | //请求拦截 29 | return response 30 | }, error => { 31 | //出现异常 32 | return Promise.reject(error) 33 | }) 34 | 35 | 36 | export default request //导出自定义的axios对象 -------------------------------------------------------------------------------- /car_rental_system/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | Vue.use(Vuex) 5 | 6 | export default new Vuex.Store({ 7 | state: { //存放状态(共享属性) 8 | isCollapse:false, //侧边栏收缩状态,true为收起来,false为打开 9 | test:666 10 | }, 11 | mutations: { //改变state状态值 12 | changeisCollapse(state){ 13 | state.isCollapse=!state.isCollapse //改变收缩状态 14 | } 15 | }, 16 | actions: { 17 | // changemenu(context){ 18 | // context.commit('changeisCollapse'); //用action来触发commit 19 | // this.$store.dispatch('changemenu'); //这句是在需要使用的地方用来触发action的,里面的参数就是action名 20 | // } 21 | // test({commit,state}){ //也可以用这种方式commit,和直接获取state的值记得用{}包起来 22 | // commit('changeisCollapse'); 23 | // console.log(state.isCollapse); 24 | // } 25 | 26 | }, 27 | modules: { 28 | } 29 | }) 30 | -------------------------------------------------------------------------------- /car_rental_system/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | devServer:{ 3 | port:8080,//端口号,如果被占用,自增1 4 | host:"localhost",//主机名 5 | https:false, 6 | open:false, //启动服务时自动打开浏览器 7 | proxy:{ //开发环境代理配置,解决跨域问题 8 | // '/dev-api':{ 9 | [process.env.VUE_APP_BASE_API]:{ 10 | //目标服务器地址,代理访问 11 | target: process.env.VUE_APP_SERVICE_URL, 12 | // target:'http://localhost:8080', 13 | changeOrigin:true,//开启代理服务器 14 | pathRewrite:{ 15 | // /dev-api/db.json最终会发送target/db.json 16 | // 将请求地址前缀 /dev-api替换为空 17 | // '^dev-api':'', 18 | ['^' +process.env.VUE_APP_BASE_API]:'', 19 | 20 | } 21 | } 22 | } 23 | }, 24 | // // lineOnSave:false,//关闭格式检测 25 | // productionSourceMap:false,//打包时不会生成map文件,加快打包速度 26 | } -------------------------------------------------------------------------------- /car_rental_system/src/components/main.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 24 | 25 | -------------------------------------------------------------------------------- /car_rental_system/src/components/AppMain.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 65 | 66 | -------------------------------------------------------------------------------- /car_rental_system/src/components/AppHeader.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 86 | 87 | -------------------------------------------------------------------------------- /car_rental_system/src/api/staffmock.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs' 2 | 3 | Mock.setup({ 4 | timeout: 100, 5 | }) 6 | 7 | Mock.mock('/api/menu', { 8 | menulist: [ 9 | { 10 | id: 100, 11 | title: '员工信息', 12 | path: '/xinxi', 13 | sList: [ 14 | { id: 101, title: '员工信息管理', path: '/main' } 15 | ], 16 | }, 17 | ], 18 | }) 19 | 20 | const getQuery = (url, name) => { 21 | console.log(url, name) 22 | const index = url.indexOf('?') 23 | if (index !== -1) { 24 | const queryStr = url.substr(index + 1).split('&') 25 | for (let i = 0; i < queryStr.length; i++) { 26 | const itemArr = queryStr[i].split('=') 27 | if (itemArr[0] === name) { 28 | return itemArr[1] 29 | } 30 | } 31 | } 32 | return null 33 | } 34 | const { manlist } = Mock.mock({ 35 | 'manlist|50-90': [ 36 | { 37 | id: '@increment()', 38 | name: '@cname()', 39 | phone: '@integer(10000)', 40 | money: '@natural(3000, 1000000)', 41 | Address: '@county(true)', 42 | Email: '@email', 43 | }, 44 | ], 45 | }) 46 | 47 | Mock.mock(/\/api\/man/, 'get', (options) => { 48 | const pageNum = getQuery(options.url, 'pageNum') 49 | const pageSize = getQuery(options.url, 'pageSize') 50 | const start = (pageNum - 1) * pageSize 51 | const end = pageSize * pageNum 52 | const totalPage = Math.ceil(manlist.length / pageSize) 53 | const list = pageNum > totalPage ? [] : manlist.slice(start, end) 54 | return { list: list } //返回这个数组,也就是返回处理后的假数据 55 | }) 56 | Mock.mock('/api/post/man', () => { 57 | return manlist //返回这个数组,也就是返回处理后的假数据 58 | }) 59 | Mock.mock('/api/addman', 'post', (options) => { 60 | console.log(options) 61 | const body = JSON.parse(options.body) 62 | manlist.push( 63 | Mock.mock({ 64 | id: '@increment()', 65 | name: body.name, 66 | phone: body.phone, 67 | money: body.money, 68 | Address: body.Address, 69 | Email: body.Email, 70 | }) 71 | ) 72 | return { 73 | list: manlist, 74 | boo:true, 75 | } 76 | }) 77 | Mock.mock('/api/search', 'post', (options) => { 78 | console.log(options) 79 | const body = JSON.parse(options.body) 80 | console.log(body) 81 | let list = manlist.filter((item)=>{ 82 |     var reg= new RegExp(body.name,'i'); 83 |     return reg.test(item.name); 84 |   }); 85 | console.log(manlist) 86 | return { 87 | list: list, 88 | boo:true, 89 | } 90 | }) 91 | Mock.mock('/api/return', 'post', (options) => { 92 | console.log(options) 93 | const body = JSON.parse(options.body) 94 | console.log(body) 95 | let list = manlist.filter((item)=>{ 96 | return item.id==body.id; 97 |   }); 98 | console.log(list) 99 | return { 100 | list: list, 101 | 102 | } 103 | }) 104 | Mock.mock('/api/updata', 'post', (options) => { 105 | console.log(options) 106 | const body = JSON.parse(options.body) 107 | console.log(body) 108 | manlist.splice(body.id - 1,1,body) 109 | console.log(manlist) 110 | return { 111 | list: manlist, 112 | 113 | } 114 | }) 115 | Mock.mock('/api/delete', 'post', (options) => { 116 | console.log(options) 117 | let deleteObj = JSON.parse(options.body) 118 | let deleteId = deleteObj.id 119 | console.log(deleteId, 'deleteId') 120 | let List = manList.filter(val => val.id !== deleteId) 121 | return { 122 | code: '0', 123 | message: 'success', 124 | data: [] 125 | } 126 | }) 127 | -------------------------------------------------------------------------------- /car_rental_system/src/views/book.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | 100 | 101 | -------------------------------------------------------------------------------- /car_rental_system/src/views/car/system/Benz/Benz.vue: -------------------------------------------------------------------------------- 1 | 44 | 105 | 118 | -------------------------------------------------------------------------------- /car_rental_system/src/views/car/system/BMW/BMW.vue: -------------------------------------------------------------------------------- 1 | 43 | 105 | 118 | 119 | -------------------------------------------------------------------------------- /car_rental_system/src/views/car/system/FAW-VK/FAW-VK.vue: -------------------------------------------------------------------------------- 1 | 43 | 105 | -------------------------------------------------------------------------------- /car_rental_system/src/views/car/system/Nissan/Nissan.vue: -------------------------------------------------------------------------------- 1 | 43 | 105 | 118 | -------------------------------------------------------------------------------- /car_rental_system/src/views/login.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 117 | 118 | -------------------------------------------------------------------------------- /car_rental_system/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueRouter from 'vue-router' 3 | import Login from '../views/login' 4 | import Main from '../components/main' 5 | import MemberSystem from '../views/membersystem' 6 | import StoreSystem from '../views/storesystem' 7 | import UserSystem from '../views/usersystem' 8 | import Rental from '../views/rental/Rental.vue' 9 | import Add from '../views/rental/Add.vue' 10 | import Find from '../views/rental/Find.vue' 11 | import Old from '../views/rental/Old.vue' 12 | 13 | Vue.use(VueRouter) 14 | 15 | //避免重复点击的警告,报错 16 | const originalPush = VueRouter.prototype.push 17 | VueRouter.prototype.push = function push(location) { 18 | return originalPush.call(this, location).catch(err => err) 19 | } 20 | 21 | 22 | 23 | const routes = [ 24 | { 25 | path: '/', 26 | name: 'Main', 27 | component: Main, 28 | children: [ 29 | { 30 | path: '/member', 31 | name: "Membersystem", 32 | component: MemberSystem, 33 | meta: { title: '会员信息管理' } 34 | }, 35 | { 36 | path: '/store', 37 | name: "StoreSystem", 38 | component: StoreSystem, meta: { title: '门店信息管理' } 39 | }, 40 | { 41 | path: '/user', 42 | name: "UserSystem", 43 | component: UserSystem, meta: { title: '系统用户管理' } 44 | }, 45 | { 46 | path: '/benz', 47 | name: 'benz', 48 | component: () => import('@/views/car/system/Benz/Benz.vue'), 49 | meta: { title: '奔驰系列' } 50 | }, 51 | { 52 | path: '/bmw', 53 | name: 'bmw', 54 | component: () => import('@/views/car/system/BMW/BMW.vue'), 55 | meta: { title: '宝马系列' } 56 | }, 57 | { 58 | path: '/nissan', 59 | name: 'nissan', 60 | component: () => import('@/views/car/system/Nissan/Nissan.vue'), 61 | meta: { title: '日产系列' } 62 | }, 63 | { 64 | path: '/faw-vk', 65 | name: 'faw-vk', 66 | component: () => import('@/views/car/system/FAW-VK/FAW-VK.vue'), 67 | meta: { title: '大众系列' } 68 | }, 69 | { 70 | path: '/deletecar', 71 | name: 'deletecar', 72 | component: () => import('@/views/car/system/caozuoyixia/DeleteData.vue'), 73 | meta: { title: '删除汽车信息' } 74 | }, 75 | { 76 | path: '/addcar', 77 | name: 'addcar', 78 | component: () => import('@/views/car/system/caozuoyixia/AddData.vue'), 79 | meta: { title: '添加汽车信息' } 80 | }, 81 | { 82 | path: '/book', 83 | name: 'book', 84 | component: () => import('@/views/book.vue'), 85 | meta: { title: '维修预约' } 86 | }, 87 | { 88 | path: '/repair', 89 | name: 'repair', 90 | component: () => import('@/views/repair.vue'), 91 | meta: { title: '维修情况' } 92 | }, 93 | { 94 | path: '/staff', 95 | name: 'staff', 96 | component: () => import('@/views/staff.vue'), 97 | meta: { title: '员工信息管理' } 98 | }, 99 | { 100 | path: '/Addstore', 101 | name: 'Addstore', 102 | component: () => import('@/views/Addstore.vue'), 103 | meta: { title: '添加门店信息' } 104 | }, 105 | { 106 | path: '/Usermsg', 107 | name: 'Usermsg', 108 | component: () => import('@/views/Usermsg.vue'), 109 | meta: { title: '个人中心' } 110 | }, 111 | { 112 | path: '/rental', 113 | component: Rental, 114 | children: [ 115 | { path: '', redirect: 'add'}, 116 | { path: 'add', component: Add ,meta: { title: '生成订单' }}, 117 | { path: 'find', component: Find, meta: { title: '订单跟踪' } }, 118 | { path: 'old', component: Old, meta: { title: '历史订单' }}, 119 | ] 120 | }, 121 | ] 122 | }, 123 | { 124 | path: '/login', 125 | name: 'Login', 126 | component: Login 127 | }, 128 | ] 129 | 130 | const router = new VueRouter({ 131 | mode: 'history', 132 | base: process.env.BASE_URL, 133 | routes 134 | }) 135 | 136 | export default router 137 | -------------------------------------------------------------------------------- /car_rental_system/src/components/AppNavbar.vue: -------------------------------------------------------------------------------- 1 | 71 | 72 | 110 | 111 | -------------------------------------------------------------------------------- /car_rental_system/src/api/rentalmock.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs' 2 | 3 | let indentList = [ 4 | { 5 | user: "陈奕迅", 6 | name: "周杰伦", 7 | phone: "18026178094", 8 | address: "肇庆学院", 9 | type: "奥迪A6", 10 | num: "粤A·74MN4", 11 | date: ["2020/8/23", "2020/8/29"], 12 | rent: 160, 13 | sumrent: 960, 14 | }, 15 | { 16 | user: "陈奕迅", 17 | name: "李荣浩", 18 | phone: "17026171094", 19 | address: "肇庆学院", 20 | type: "雷克萨斯ES", 21 | num: "粤S·74MN4", 22 | date: ["2020/8/17", "2020/8/26"], 23 | rent: 160, 24 | sumrent: 2691, 25 | }, 26 | { 27 | user: "陈奕迅", 28 | name: "谢霆锋", 29 | phone: "16026171094", 30 | address: "肇庆学院", 31 | type: "宝马X5", 32 | num: "粤H·74MN4", 33 | date: ["2020/7/20", "2020/8/25"], 34 | rent: 160, 35 | sumrent: 4331, 36 | }, 37 | { 38 | user: "陈奕迅", 39 | name: "林忆莲", 40 | phone: "15026171094", 41 | address: "肇庆学院", 42 | type: "宝马X7", 43 | num: "粤S·74MN4", 44 | date: ["2020/8/23", "2020/8/29"], 45 | rent: 160, 46 | sumrent: 320, 47 | }, 48 | { 49 | user: "陈奕迅", 50 | name: "莫文蔚", 51 | phone: "14026171094", 52 | address: "肇庆学院", 53 | type: "奥迪A7", 54 | num: "粤S·74MN4", 55 | date: ["2020/6/23", "2020/8/25"], 56 | rent: 160, 57 | sumrent: 3200, 58 | }, 59 | { 60 | user: "陈奕迅", 61 | name: "刘德华", 62 | phone: "18526171094", 63 | address: "肇庆学院", 64 | type: "雷克萨斯ES", 65 | num: "粤S·74MN4", 66 | date: ["2020/8/17", "2020/8/24"], 67 | rent: 160, 68 | sumrent: 320, 69 | }, 70 | { 71 | user: "陈奕迅", 72 | name: "张学友", 73 | phone: "18096171094", 74 | address: "肇庆学院", 75 | type: "雷克萨斯LS", 76 | num: "粤S·74MN4", 77 | date: ["2020/7/30", "2020/8/28"], 78 | rent: 160, 79 | sumrent: 320, 80 | }, 81 | ]; 82 | 83 | let oldindents = [ 84 | { 85 | user: "陈奕迅", 86 | name: "周杰伦", 87 | phone: "18026178094", 88 | address: "肇庆学院", 89 | type: "奥迪A6", 90 | num: "粤A·74MN4", 91 | date: ["2020/8/23", "2020/8/24"], 92 | rent: 160, 93 | sumrent: 960, 94 | }, 95 | { 96 | user: "陈奕迅", 97 | name: "李荣浩", 98 | phone: "17026171094", 99 | address: "肇庆学院", 100 | type: "雷克萨斯ES", 101 | num: "粤S·74MN4", 102 | date: ["2020/8/17", "2020/8/25"], 103 | rent: 160, 104 | sumrent: 2691, 105 | }, 106 | { 107 | user: "陈奕迅", 108 | name: "谢霆锋", 109 | phone: "16026171094", 110 | address: "肇庆学院", 111 | type: "宝马X5", 112 | num: "粤H·74MN4", 113 | date: ["2020/7/20", "2020/8/25"], 114 | rent: 160, 115 | sumrent: 4331, 116 | }, 117 | { 118 | user: "陈奕迅", 119 | name: "林忆莲", 120 | phone: "15026171094", 121 | address: "肇庆学院", 122 | type: "宝马X7", 123 | num: "粤S·74MN4", 124 | date: ["2020/8/23", "2020/8/24"], 125 | rent: 160, 126 | sumrent: 320, 127 | }, 128 | { 129 | user: "陈奕迅", 130 | name: "莫文蔚", 131 | phone: "14026171094", 132 | address: "肇庆学院", 133 | type: "奥迪A7", 134 | num: "粤S·74MN4", 135 | date: ["2020/6/23", "2020/8/20"], 136 | rent: 160, 137 | sumrent: 3200, 138 | }, 139 | { 140 | user: "陈奕迅", 141 | name: "刘德华", 142 | phone: "18526171094", 143 | address: "肇庆学院", 144 | type: "雷克萨斯ES", 145 | num: "粤S·74MN4", 146 | date: ["2020/8/17", "2020/8/20"], 147 | rent: 160, 148 | sumrent: 320, 149 | }, 150 | { 151 | user: "陈奕迅", 152 | name: "张学友", 153 | phone: "18096171094", 154 | address: "肇庆学院", 155 | type: "雷克萨斯LS", 156 | num: "粤S·74MN4", 157 | date: ["2020/7/30", "2020/8/25"], 158 | rent: 160, 159 | sumrent: 320, 160 | }, 161 | ]; 162 | 163 | Mock.mock('/addindent', ops=>{ 164 | ops = JSON.parse(ops.body) 165 | indentList.push(ops) 166 | }) 167 | Mock.mock('/indents', indentList) 168 | Mock.mock("/deleteindent", (ops) => { 169 | ops = JSON.parse(ops.body); 170 | // alert(ops); 171 | indentList.splice(ops, 1); 172 | }); 173 | Mock.mock("/finishindent", (ops) => { 174 | ops = JSON.parse(ops.body); 175 | oldindents.push(ops); 176 | }); 177 | Mock.mock("/oldindents", oldindents); -------------------------------------------------------------------------------- /car_rental_system/src/views/storesystem.vue: -------------------------------------------------------------------------------- 1 | 81 | 82 | 175 | 176 | 190 | -------------------------------------------------------------------------------- /car_rental_system/src/views/Usermsg.vue: -------------------------------------------------------------------------------- 1 | 35 | 36 | 137 | 138 | -------------------------------------------------------------------------------- /car_rental_system/src/views/car/system/caozuoyixia/DeleteData.vue: -------------------------------------------------------------------------------- 1 | 40 | 186 | -------------------------------------------------------------------------------- /car_rental_system/src/views/rental/Rental.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 100 | 101 | 231 | -------------------------------------------------------------------------------- /car_rental_system/src/views/car/system/caozuoyixia/AddData.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 177 | 178 | -------------------------------------------------------------------------------- /car_rental_system/src/api/repairmock.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs' 2 | 3 | Mock.setup({ 4 | timeout: 100, 5 | }) 6 | 7 | Mock.mock('/api/user', { 8 | username: '老陈', 9 | password: '12345', 10 | state: '1', 11 | }) 12 | Mock.mock('/api/menu', { 13 | menulist: [ 14 | { 15 | id: 100, 16 | title: '维修平台', 17 | path: '/weixiu', 18 | sList: [ 19 | { id: 101, title: '维修情况', path: '/main' }, 20 | 21 | { 22 | id: 102, 23 | title: '维修预约', 24 | path: '/book', 25 | }, 26 | ], 27 | }, 28 | ], 29 | }) 30 | 31 | const getQuery = (url, name) => { 32 | console.log(url, name) 33 | const index = url.indexOf('?') 34 | if (index !== -1) { 35 | const queryStr = url.substr(index + 1).split('&') 36 | for (let i = 0; i < queryStr.length; i++) { 37 | const itemArr = queryStr[i].split('=') 38 | if (itemArr[0] === name) { 39 | return itemArr[1] 40 | } 41 | } 42 | } 43 | return null 44 | } 45 | const { carlist } = Mock.mock({ 46 | 'carlist|50-90': [ 47 | { 48 | id: '@increment()', 49 | carname: '@first()', 50 | hostname: '@cname()', 51 | phone: '@natural(13000000000, 13999999999)', 52 | money: '@natural(3000, 10000)', 53 | state: '@boolean()', 54 | name: '@cname()', 55 | Address: '@county(true)', 56 | Email: '@email', 57 | }, 58 | ], 59 | }) 60 | 61 | Mock.mock(/\/api\/car/, 'get', (options) => { 62 | const pageNum = getQuery(options.url, 'pageNum') 63 | const pageSize = getQuery(options.url, 'pageSize') 64 | const start = (pageNum - 1) * pageSize 65 | const end = pageSize * pageNum 66 | const totalPage = Math.ceil(carlist.length / pageSize) 67 | const list = pageNum > totalPage ? [] : carlist.slice(start, end) 68 | return { list: list } //返回这个数组,也就是返回处理后的假数据 69 | }) 70 | Mock.mock('/api/post/car', () => { 71 | return carlist //返回这个数组,也就是返回处理后的假数据 72 | }) 73 | Mock.mock('/api/addcar', 'post', (options) => { 74 | console.log(options) 75 | const body = JSON.parse(options.body) 76 | carlist.push( 77 | Mock.mock({ 78 | id: '@increment()', 79 | carname: body.carname, 80 | hostname: body.hostname, 81 | phone: body.phone, 82 | money: body.money, 83 | state: body.state, 84 | name: '@cname()', 85 | Address: '@county(true)', 86 | Email: '@email', 87 | }) 88 | ) 89 | return { 90 | list: carlist, 91 | boo: true, 92 | } 93 | }) 94 | Mock.mock('/api/search2', 'post', (options) => { 95 | console.log(options) 96 | const body = JSON.parse(options.body) 97 | console.log(body) 98 | let list = carlist.filter((item)=>{ 99 |     var reg= new RegExp(body.name,'i'); 100 |     return reg.test(item.name); 101 |   }); 102 | console.log(carlist) 103 | return { 104 | list: list, 105 | boo:true, 106 | } 107 | }) 108 | Mock.mock('/api/search', 'post', (options) => { 109 | console.log(options) 110 | const body = JSON.parse(options.body) 111 | console.log(body) 112 | let list = carlist.filter((item) => { 113 | var reg = new RegExp(body.hostname, 'i') 114 | return reg.test(item.hostname) 115 | }) 116 | /*let list = carlist.filter(item => { 117 | return item.hostname ==body.hostname 118 | } )*/ 119 | console.log(carlist) 120 | return { 121 | list: list, 122 | boo: true, 123 | } 124 | }) 125 | Mock.mock('/api/return', 'post', (options) => { 126 | console.log(options) 127 | const body = JSON.parse(options.body) 128 | console.log(body) 129 | let list = carlist.filter((item) => { 130 | return item.id == body.id 131 | }) 132 | /*let list = carlist.filter(item => { 133 | return item.hostname ==body.hostname 134 | } )*/ 135 | console.log(list) 136 | return { 137 | list: list, 138 | } 139 | }) 140 | Mock.mock('/api/updata', 'post', (options) => { 141 | //console.log(options) 142 | const body = JSON.parse(options.body) 143 | console.log(body) 144 | let list = carlist.filter((item) => { 145 | var reg = new RegExp(body.hostname, 'i') 146 | return reg.test(item.hostname) 147 | }) 148 | list[0].username = body.username 149 | list[0].hostname = body.hostname 150 | list[0].phone = body.phone 151 | list[0].money = body.money 152 | list[0].state = body.state 153 | 154 | 155 | console.log(list) 156 | carlist.splice(body.id - 1, 1, list[0]) 157 | /*let list = carlist.filter(item => { 158 | return item.hostname ==body.hostname 159 | } )*/ 160 | console.log(carlist) 161 | return { 162 | list: carlist, 163 | } 164 | }) 165 | Mock.mock('/api/updata2', 'post', (options) => { 166 | //console.log(options) 167 | const body = JSON.parse(options.body) 168 | console.log(body) 169 | let list = carlist.filter((item) => { 170 | var reg = new RegExp(body.name, 'i') 171 | return reg.test(item.name) 172 | }) 173 | //list[0].username = body.username 174 | //list[0].hostname = body.hostname 175 | list[0].phone = body.phone 176 | list[0].money = body.money 177 | list[0].name = body.name 178 | list[0].Address = body.Address 179 | list[0].Email = body.Email 180 | 181 | console.log(list) 182 | carlist.splice(body.id - 1, 1, list[0]) 183 | /*let list = carlist.filter(item => { 184 | return item.hostname ==body.hostname 185 | } )*/ 186 | console.log(carlist) 187 | return { 188 | list: carlist, 189 | } 190 | }) 191 | const { booklist } = Mock.mock({ 192 | 'booklist|10-30': [ 193 | { 194 | id: '@increment()', 195 | carname: '@first()', 196 | hostname: '@cname()', 197 | phone: '@natural(13000000000, 13999999999)', 198 | date: '@date', 199 | type: '大修', 200 | }, 201 | ], 202 | }) 203 | Mock.mock('/api/book', 'get', () => { 204 | console.log(booklist) 205 | return { 206 | list: booklist, 207 | } 208 | }) 209 | Mock.mock('/api/addbook', 'post', (options) => { 210 | //console.log(options) 211 | const body = JSON.parse(options.body) 212 | console.log(body) 213 | booklist.push( 214 | Mock.mock({ 215 | id: '@increment()', 216 | carname: body.carname, 217 | hostname: body.hostname, 218 | phone: body.phone, 219 | date: body.date, 220 | type: body.type, 221 | }) 222 | ) 223 | console.log(booklist) 224 | return { 225 | list: booklist, 226 | boo: true, 227 | } 228 | }) 229 | Mock.mock('/api/booktocar', 'post', (options) => { 230 | console.log(options) 231 | const body = JSON.parse(options.body) 232 | const index = booklist.findIndex((item) => item.id === body.id) 233 | booklist.splice(index, 1) 234 | carlist.push( 235 | Mock.mock({ 236 | id: '@increment()', 237 | carname: body.carname, 238 | hostname: body.hostname, 239 | phone: body.phone, 240 | money: '@natural(600, 10000)', 241 | state: 'false', 242 | name: '@cname()', 243 | Address: '@county(true)', 244 | Email: '@email', 245 | }) 246 | ) 247 | return { 248 | list: carlist, 249 | blist: booklist, 250 | boo: true, 251 | } 252 | }) 253 | -------------------------------------------------------------------------------- /car_rental_system/src/views/Addstore.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 202 | 203 | 205 | -------------------------------------------------------------------------------- /car_rental_system/src/views/rental/Old.vue: -------------------------------------------------------------------------------- 1 | 89 | 90 | 156 | 157 | 259 | -------------------------------------------------------------------------------- /car_rental_system/src/views/usersystem.vue: -------------------------------------------------------------------------------- 1 | 145 | 146 | 297 | 298 | -------------------------------------------------------------------------------- /car_rental_system/src/views/rental/Find.vue: -------------------------------------------------------------------------------- 1 | 115 | 116 | 278 | 279 | 432 | -------------------------------------------------------------------------------- /car_rental_system/src/views/repair.vue: -------------------------------------------------------------------------------- 1 | 119 | . 120 | 382 | 383 | 388 | -------------------------------------------------------------------------------- /car_rental_system/src/views/staff.vue: -------------------------------------------------------------------------------- 1 | 95 | . 96 | 309 | 310 | 316 | -------------------------------------------------------------------------------- /car_rental_system/src/views/membersystem.vue: -------------------------------------------------------------------------------- 1 | 123 | 124 | 374 | 375 | -------------------------------------------------------------------------------- /car_rental_system/src/views/rental/Add.vue: -------------------------------------------------------------------------------- 1 | 79 | 80 | 81 | 82 | 360 | 361 | --------------------------------------------------------------------------------