装备改价功能开发

This commit is contained in:
BianLzhaoMin 2024-12-09 14:10:58 +08:00
parent fc28dca8c4
commit 6e1893f596
5 changed files with 1195 additions and 1118 deletions

View File

@ -7,8 +7,9 @@
<script>
import ThemePicker from "@/components/ThemePicker";
import { mapActions } from 'vuex'
import { get } from '@/utils/config'
import { mapActions } from "vuex";
import { get } from "@/utils/config";
// import AlertNotification from "@/views/warning/AlertNotification.vue";
export default {
@ -19,12 +20,16 @@ export default {
},
metaInfo() {
return {
title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
titleTemplate: title => {
return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
}
}
}
title:
this.$store.state.settings.dynamicTitle &&
this.$store.state.settings.title,
titleTemplate: (title) => {
return title
? `${title} - ${process.env.VUE_APP_TITLE}`
: process.env.VUE_APP_TITLE;
},
};
},
};
</script>
<style scoped>

View File

@ -1,53 +1,57 @@
import request from '@/utils/request'
import request from "@/utils/request";
//获取机具类型列表
export function getListByMaType(query) {
return request({
url: '/material-mall/type/getListByMaType',
method: 'get',
url: "/material-mall/type/getListByMaType",
method: "get",
params: query,
})
});
}
//机具类型管理
export function getMaTypeList(query) {
return request({
url: '/material-mall/type/getMaTypeList',
method: 'get',
url: "/material-mall/type/getMaTypeList",
method: "get",
params: query,
})
});
}
//机具类型-详情
export function getMaType(typeId) {
return request({
url: '/material-mall/type/' + typeId,
method: 'get',
})
url: "/material-mall/type/" + typeId,
method: "get",
});
}
//机具类型--新增
export function addMaType(data) {
return request({
url: '/material-mall/type',
method: 'post',
url: "/material-mall/type",
method: "post",
data: data,
})
});
}
// 机具类型--修改
export function updateMaType(data) {
return request({
url: '/material-mall/type',
method: 'put',
url: "/material-mall/type",
method: "put",
data: data,
})
});
}
//供应商管理--删除
//供应商管理--删除
export function delMaType(typeId) {
return request({
url: '/material-mall/type/' + typeId,
method: 'delete',
})
url: "/material-mall/type/" + typeId,
method: "delete",
});
}
export function updateLeasePriceApi(data) {
return request({
url: "/material-mall/type/updateLeasePrice",
method: "post",
data,
});
}

View File

@ -1,61 +1,61 @@
import router from './router'
import store from './store'
import { Message } from 'element-ui'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { getToken } from '@/utils/auth'
import { isRelogin } from '@/utils/request'
import router from "./router";
import store from "./store";
import { Message } from "element-ui";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
import { getToken, setToken } from "@/utils/auth";
import { isRelogin } from "@/utils/request";
NProgress.configure({ showSpinner: false })
NProgress.configure({ showSpinner: false });
const whiteList = [
'/login', '/register',
'/qrCode/qrCodePage',
]
const whiteList = ["/login", "/register", "/qrCode/qrCodePage"];
router.beforeEach((to, from, next) => {
NProgress.start()
NProgress.start();
if (getToken()) {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
to.meta.title && store.dispatch("settings/setTitle", to.meta.title);
/* has token*/
if (to.path === '/login') {
next({ path: '/' })
NProgress.done()
if (to.path === "/login") {
next({ path: "/" });
NProgress.done();
} else if (whiteList.indexOf(to.path) !== -1) {
next()
next();
} else {
if (store.getters.roles.length === 0) {
isRelogin.show = true
isRelogin.show = true;
// 判断当前用户是否已拉取完user_info信息
store.dispatch('GetInfo').then(() => {
isRelogin.show = false
store.dispatch('GenerateRoutes').then(accessRoutes => {
store
.dispatch("GetInfo")
.then(() => {
isRelogin.show = false;
store.dispatch("GenerateRoutes").then((accessRoutes) => {
// 根据roles权限生成可访问的路由表
router.addRoutes(accessRoutes) // 动态添加可访问路由表
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
})
}).catch(err => {
store.dispatch('LogOut').then(() => {
Message.error(err)
next({ path: '/' })
})
router.addRoutes(accessRoutes); // 动态添加可访问路由表
next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
});
})
.catch((err) => {
store.dispatch("LogOut").then(() => {
Message.error(err);
next({ path: "/" });
});
});
} else {
next()
next();
}
}
} else {
// 没有token
if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入
next()
next();
} else {
next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页
NProgress.done()
next(`/login?redirect=${encodeURIComponent(to.fullPath)}`); // 否则全部重定向到登录页
NProgress.done();
}
}
})
});
router.afterEach(() => {
NProgress.done()
})
NProgress.done();
});

File diff suppressed because it is too large Load Diff

View File

@ -39,7 +39,7 @@ module.exports = {
// target: `http://192.168.2.246:18080`,//马
// target: `http://192.168.0.110:18080`,//洪
// target: `http://192.168.0.234:18080`,//阮
target: `http://192.168.0.244:28580`,//测试
target: `http://192.168.2.127:28080`, //测试
// target: `http://192.168.137.1:18080`,//
changeOrigin: true,
pathRewrite: {