装备改价功能开发

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

View File

@ -1,53 +1,57 @@
import request from '@/utils/request' import request from "@/utils/request";
//获取机具类型列表 //获取机具类型列表
export function getListByMaType(query) { export function getListByMaType(query) {
return request({ return request({
url: '/material-mall/type/getListByMaType', url: "/material-mall/type/getListByMaType",
method: 'get', method: "get",
params: query, params: query,
}) });
} }
//机具类型管理 //机具类型管理
export function getMaTypeList(query) { export function getMaTypeList(query) {
return request({ return request({
url: '/material-mall/type/getMaTypeList', url: "/material-mall/type/getMaTypeList",
method: 'get', method: "get",
params: query, params: query,
}) });
} }
//机具类型-详情 //机具类型-详情
export function getMaType(typeId) { export function getMaType(typeId) {
return request({ return request({
url: '/material-mall/type/' + typeId, url: "/material-mall/type/" + typeId,
method: 'get', method: "get",
}) });
} }
//机具类型--新增 //机具类型--新增
export function addMaType(data) { export function addMaType(data) {
return request({ return request({
url: '/material-mall/type', url: "/material-mall/type",
method: 'post', method: "post",
data: data, data: data,
}) });
} }
// 机具类型--修改 // 机具类型--修改
export function updateMaType(data) { export function updateMaType(data) {
return request({ return request({
url: '/material-mall/type', url: "/material-mall/type",
method: 'put', method: "put",
data: data, data: data,
}) });
} }
//供应商管理--删除 //供应商管理--删除
export function delMaType(typeId) { export function delMaType(typeId) {
return request({ return request({
url: '/material-mall/type/' + typeId, url: "/material-mall/type/" + typeId,
method: 'delete', 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 router from "./router";
import store from './store' import store from "./store";
import { Message } from 'element-ui' import { Message } from "element-ui";
import NProgress from 'nprogress' import NProgress from "nprogress";
import 'nprogress/nprogress.css' import "nprogress/nprogress.css";
import { getToken } from '@/utils/auth' import { getToken, setToken } from "@/utils/auth";
import { isRelogin } from '@/utils/request' import { isRelogin } from "@/utils/request";
NProgress.configure({ showSpinner: false }) NProgress.configure({ showSpinner: false });
const whiteList = [ const whiteList = ["/login", "/register", "/qrCode/qrCodePage"];
'/login', '/register',
'/qrCode/qrCodePage',
]
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
NProgress.start() NProgress.start();
if (getToken()) { if (getToken()) {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title) to.meta.title && store.dispatch("settings/setTitle", to.meta.title);
/* has token*/ /* has token*/
if (to.path === '/login') { if (to.path === "/login") {
next({ path: '/' }) next({ path: "/" });
NProgress.done() NProgress.done();
} else if (whiteList.indexOf(to.path) !== -1) { } else if (whiteList.indexOf(to.path) !== -1) {
next() next();
} else { } else {
if (store.getters.roles.length === 0) { if (store.getters.roles.length === 0) {
isRelogin.show = true isRelogin.show = true;
// 判断当前用户是否已拉取完user_info信息 // 判断当前用户是否已拉取完user_info信息
store.dispatch('GetInfo').then(() => { store
isRelogin.show = false .dispatch("GetInfo")
store.dispatch('GenerateRoutes').then(accessRoutes => { .then(() => {
// 根据roles权限生成可访问的路由表 isRelogin.show = false;
router.addRoutes(accessRoutes) // 动态添加可访问路由表 store.dispatch("GenerateRoutes").then((accessRoutes) => {
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 // 根据roles权限生成可访问的路由表
router.addRoutes(accessRoutes); // 动态添加可访问路由表
next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
});
}) })
}).catch(err => { .catch((err) => {
store.dispatch('LogOut').then(() => { store.dispatch("LogOut").then(() => {
Message.error(err) Message.error(err);
next({ path: '/' }) next({ path: "/" });
}) });
}) });
} else { } else {
next() next();
} }
} }
} else { } else {
// 没有token // 没有token
if (whiteList.indexOf(to.path) !== -1) { if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入 // 在免登录白名单,直接进入
next() next();
} else { } else {
next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页 next(`/login?redirect=${encodeURIComponent(to.fullPath)}`); // 否则全部重定向到登录页
NProgress.done() NProgress.done();
} }
} }
}) });
router.afterEach(() => { 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.2.246:18080`,//马
// target: `http://192.168.0.110:18080`,//洪 // target: `http://192.168.0.110:18080`,//洪
// target: `http://192.168.0.234: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`,// // target: `http://192.168.137.1:18080`,//
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {