From 308362a1439b443ed6b959adf1e1d93309ee766c Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Tue, 14 Feb 2023 13:35:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login.js | 21 +- src/api/refineryAccount.js | 22 ++ src/permission.js | 59 +--- src/utils/dataType.js | 12 + src/utils/index.js | 4 + src/views/login/index.vue | 119 ++++--- src/views/product/components/record.vue | 2 + src/views/product/index.vue | 39 +++ src/views/refineryAccount/components/add.vue | 146 +++++++++ src/views/refineryAccount/index.vue | 322 +++++++++++++++++++ src/views/refineryInfo/index.vue | 53 ++- 11 files changed, 679 insertions(+), 120 deletions(-) create mode 100644 src/api/refineryAccount.js create mode 100644 src/utils/dataType.js create mode 100644 src/views/refineryAccount/components/add.vue create mode 100644 src/views/refineryAccount/index.vue diff --git a/src/api/login.js b/src/api/login.js index 8eaa623..0a0e7ca 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -1,7 +1,18 @@ import request from "utils/axios.js"; //登录 -// const login = (params) => { -// return request.postJson("/oil-identity/operationUser/xlLoginPwd", params); -// }; - -export default {}; +const login = (params) => { + return request.postJson("/oil-identity/oilRefinery/loginOMSByPwd", params); +}; +//关联企业 +const getRefineryByCustomerId = (phone) => { + return request.get( + `/oil-user/oilCustomerRefineryRelation/getRefineryByCustomerId/${phone}` + ); +}; +//路由 +const getCustomerRouters = () => { + return request.get( + "/oil-identity/oilRefinery/getCustomerRouters/REFINERY_OMS_WEB" + ); +}; +export default { login, getRefineryByCustomerId, getCustomerRouters }; diff --git a/src/api/refineryAccount.js b/src/api/refineryAccount.js new file mode 100644 index 0000000..38b4f05 --- /dev/null +++ b/src/api/refineryAccount.js @@ -0,0 +1,22 @@ +import request from "utils/axios.js"; +// table +const getByPage = (params) => { + return request.postJson( + "/oil-refinery/xoilRefineryAccount/getByPage", + params + ); +}; +// 新增 +const save = (params) => { + return request.postJson("/oil-refinery/xoilRefineryAccount/save", params); +}; +// 修改 +const update = (params) => { + return request.postJson("/oil-refinery/xoilRefineryAccount/update", params); +}; + +export default { + getByPage, + save, + update, +}; diff --git a/src/permission.js b/src/permission.js index 5d4ef8f..758b924 100644 --- a/src/permission.js +++ b/src/permission.js @@ -12,66 +12,10 @@ NProgress.configure({ showSpinner: false }); // NProgress Configuration const whiteList = ["/login"]; // no redirect whitelist -const asyncRoutes = [ - { - component: "Layout", - hidden: false, - menuType: "C", - meta: { title: "", icon: "" }, - path: "/", - children: [ - { - component: "refineryInfo/index", - hidden: false, - menuType: "C", - meta: { title: "炼厂信息", icon: "iconfenpei3" }, - name: "refineryInfo", - path: "refineryInfo", - }, - ], - }, - { - component: "Layout", - hidden: false, - menuType: "C", - meta: { title: "", icon: "" }, - path: "/", - children: [ - { - component: "product/index", - hidden: false, - menuType: "C", - meta: { title: "产品列表", icon: "iconfenpei3" }, - name: "Product", - path: "product", - }, - ], - }, - { - component: "Layout", - hidden: false, - menuType: "C", - meta: { title: "", icon: "" }, - path: "/", - children: [ - { - component: "order/index", - hidden: false, - menuType: "C", - meta: { title: "订单管理", icon: "iconfenpei3" }, - name: "Order", - path: "order", - }, - ], - }, -]; - router.beforeEach(async (to, from, next) => { NProgress.start(); document.title = getPageTitle(to.meta.title); - const hasToken = localStorage.getItem("token"); - // const hasToken = 1; if (hasToken) { if (to.path === "/login") { next({ path: "/" }); @@ -91,8 +35,7 @@ router.beforeEach(async (to, from, next) => { }; store.dispatch("user/info", infoRes.data); - // let routerRes = await serve.getRouter(); - let routerRes = { data: asyncRoutes }; + let routerRes = await serve.getCustomerRouters(); let realRouter = filterAsyncRouter(routerRes.data); store.dispatch("permission/generateRoutes", realRouter); router.addRoutes(realRouter); diff --git a/src/utils/dataType.js b/src/utils/dataType.js new file mode 100644 index 0000000..8a56550 --- /dev/null +++ b/src/utils/dataType.js @@ -0,0 +1,12 @@ +export const refineryTypeEnum = [ + { + label: "普通炼厂", + value: "COMMON", + }, +]; +export const refineryAccountTypeEnum = [ + { + label: "普通炼厂", + value: "COMMON", + }, +]; diff --git a/src/utils/index.js b/src/utils/index.js index 09d2e74..4b6ed6c 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -51,3 +51,7 @@ export function isLicensePlate(no) { ); return instance.test(no); } + +export function cellStyle() { + return "text-align:center"; +} diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 1e82d77..8a8fbc5 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -62,55 +62,72 @@ password: any + + + + + + + + + + + + + + diff --git a/src/views/refineryAccount/index.vue b/src/views/refineryAccount/index.vue new file mode 100644 index 0000000..5a9310d --- /dev/null +++ b/src/views/refineryAccount/index.vue @@ -0,0 +1,322 @@ + + + + + diff --git a/src/views/refineryInfo/index.vue b/src/views/refineryInfo/index.vue index 9153c3b..68abe85 100644 --- a/src/views/refineryInfo/index.vue +++ b/src/views/refineryInfo/index.vue @@ -1,7 +1,12 @@