From 038f919147c7a41a733687974a76e69f15abb292 Mon Sep 17 00:00:00 2001 From: lixuan Date: Thu, 23 Feb 2023 14:18:35 +0800 Subject: [PATCH] xiugai --- src/api/login.js | 5 +- src/api/order.js | 48 +++ src/api/refineryInfo.js | 31 ++ src/components/autocomplete/index.vue | 104 +++++ src/layout/components/Navbar.vue | 19 +- src/utils/axios.js | 7 + src/views/login/index.vue | 2 + src/views/order/components/billOfLading.vue | 449 ++++++++++++++++++++ src/views/order/index.vue | 436 +++++++++++++++++++ 9 files changed, 1095 insertions(+), 6 deletions(-) create mode 100644 src/api/order.js create mode 100644 src/api/refineryInfo.js create mode 100644 src/components/autocomplete/index.vue create mode 100644 src/views/order/components/billOfLading.vue create mode 100644 src/views/order/index.vue diff --git a/src/api/login.js b/src/api/login.js index 7786ac1..d601769 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -9,6 +9,9 @@ const getRefineryByCustomerId = (phone) => { `/oil-user/oilCustomerRefineryRelation/getRefineryByCustomerId/${phone}` ); }; +const loginOut = () => { + return request.get("/oil-identity/authorization/logout"); +}; //路由 const getCustomerRouters = () => { return request.get( @@ -16,4 +19,4 @@ const getCustomerRouters = () => { ); }; -export default { login, getRefineryByCustomerId, getCustomerRouters }; +export default { login, getRefineryByCustomerId, getCustomerRouters,loginOut }; diff --git a/src/api/order.js b/src/api/order.js new file mode 100644 index 0000000..5c9f211 --- /dev/null +++ b/src/api/order.js @@ -0,0 +1,48 @@ +import request from "utils/axios.js"; +// table +const getByPage = (params) => { + return request.postJson("/oil-refinery/xoilRefineryOrder/getByPage", params); +}; +//查看提货单信息 +const findDeliveryByOrderId = (id) => { + return request.get(`/oil-refinery/xoilRefineryDelivery/findDeliveryByOrderId/${id}`); +}; +//创建提货单 +const billSave = (params) => { + return request.postJson("/oil-refinery/xoilRefineryDelivery/save", params); +}; +//修改提货单 +const update = (params) => { + return request.putJson("/oil-refinery/xoilRefineryDelivery/update", params); +}; +//查看订单信息 +const findByOrderId = (id) => { + return request.get(`/oil-refinery/xoilRefineryDelivery/findByOrderId/${id}`); +}; +//修改提货单 +const deleteBill = (params) => { + return request.putJson("/oil-refinery/xoilRefineryDelivery/delete", params); +}; +//下单 +const orderSuccess = (params) => { + return request.postJson("/oil-refinery/xoilRefineryOrder/orderSuccess", params); +}; +//订单锁定 +const orderLock = (params) => { + return request.postJson("/oil-refinery/xoilRefineryOrder/orderLock", params); +}; + + + + + +export default { + getByPage, + findDeliveryByOrderId, + billSave, + findByOrderId, + update, + deleteBill, + orderSuccess, + orderLock +}; diff --git a/src/api/refineryInfo.js b/src/api/refineryInfo.js new file mode 100644 index 0000000..0bd5767 --- /dev/null +++ b/src/api/refineryInfo.js @@ -0,0 +1,31 @@ +import request from "utils/axios.js"; +// table +const getByPage = (params) => { + return request.postJson("/oil-refinery/xoilRefineryInfo/getByPage", params); +}; +// 新增 +const save = (params) => { + return request.postJson("/oil-refinery/xoilRefineryInfo/save", params); +}; +// 修改 +const update = (params) => { + return request.postJson("/oil-refinery/xoilRefineryInfo/update", params); +}; +// 删除 +const deleteRow = (params) => { + return request.postJson("/oil-refinery/xoilRefineryInfo/delete", params); +}; +//炼厂list +const findByEntity = (params = {}) => { + return request.postJson( + "/oil-refinery/xoilRefineryInfo/findByEntity", + params + ); +}; +export default { + getByPage, + save, + update, + deleteRow, + findByEntity, +}; diff --git a/src/components/autocomplete/index.vue b/src/components/autocomplete/index.vue new file mode 100644 index 0000000..1d3b1dd --- /dev/null +++ b/src/components/autocomplete/index.vue @@ -0,0 +1,104 @@ + + + + + diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 0ca5cf6..a33455a 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -23,7 +23,7 @@ Docs - Log Out + 注销登录 @@ -35,6 +35,7 @@ import { mapGetters } from 'vuex' import Breadcrumb from '@/components/Breadcrumb' import Hamburger from '@/components/Hamburger' +import serve from "api/login.js"; export default { components: { @@ -51,10 +52,18 @@ export default { toggleSideBar() { this.$store.dispatch('app/toggleSideBar') }, - async logout() { - await this.$store.dispatch('user/logout') - this.$router.push(`/login?redirect=${this.$route.fullPath}`) - } + // async logout() { + // await this.$store.dispatch('user/logout') + // this.$router.push(`/login?redirect=${this.$route.fullPath}`) + // } + logout() { + serve.loginOut().then((res) => { + if (res.code === 20000) { + localStorage.removeItem("token"); + this.$router.push("/login"); + } + }); + }, } } diff --git a/src/utils/axios.js b/src/utils/axios.js index b35ad86..3642e91 100644 --- a/src/utils/axios.js +++ b/src/utils/axios.js @@ -24,6 +24,13 @@ export default { data: data, }); }, + putJson(url, data) { + return axios({ + url: url, + method: "put", + data: data, + }); + }, postFromData(url, data) { return axios({ url: url, diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 69a5020..a1b5f59 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -159,6 +159,8 @@ export default { return; }); } + console.log + localStorage.setItem("companyIdData",this.loginForm.networkId); localStorage.setItem("token", res.data.accessToken); this.$router.replace("/"); }) diff --git a/src/views/order/components/billOfLading.vue b/src/views/order/components/billOfLading.vue new file mode 100644 index 0000000..a19915d --- /dev/null +++ b/src/views/order/components/billOfLading.vue @@ -0,0 +1,449 @@ + + + + + diff --git a/src/views/order/index.vue b/src/views/order/index.vue new file mode 100644 index 0000000..60f9bc0 --- /dev/null +++ b/src/views/order/index.vue @@ -0,0 +1,436 @@ + + + + +