From 4a02c0fa6d70f9f81392717acd1738f2cf31baf0 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Wed, 7 Jun 2023 08:51:49 +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/order.js | 11 ++++++++- src/utils/index.js | 16 +++++++++++++ src/views/order/components/billOfLading.vue | 26 +++++++++++++++++++-- src/views/order/index.vue | 18 ++++++++++++-- 4 files changed, 66 insertions(+), 5 deletions(-) diff --git a/src/api/order.js b/src/api/order.js index ccc964d..bac3688 100644 --- a/src/api/order.js +++ b/src/api/order.js @@ -56,6 +56,13 @@ const getRefineryProduct = id => { return request.get(`oil-refinery/oilRefineryProduct/get/${id}`) } +const get = id => { + return request.get(`/oil-refinery/xoilRefineryAccount/getByRefineryId?refineryId=${id}`) +} +//导出 +const exportRefineryOrders = params => { + return request.postBlob('/oil-refinery/xoilRefineryOrder/exportRefineryOrders', params) +} export default { getByPage, findDeliveryByOrderId, @@ -70,5 +77,7 @@ export default { orderUpdate, getlnfoByld, getRecordsByActld, - getRefineryProduct + getRefineryProduct, + get, + exportRefineryOrders } diff --git a/src/utils/index.js b/src/utils/index.js index bf91135..8a97833 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -62,3 +62,19 @@ export function typeJudgment(object) { let type = /(?<= ).+(?=\])/.exec(res) return type.length ? type[0] : '' } + +// 油批项目专用 保留两位小数,第三位小数四舍五入 +export function fixedHandle(val) { + val = parseFloat(val) + if (!isNaN(val)) { + let fixedLength4 = val.toFixed(4) + let length = fixedLength4.length + let fixedLength3 = fixedLength4.slice(0, length - 1) + fixedLength3 *= 100 + fixedLength3 = Math.round(fixedLength3) + fixedLength3 /= 100 + let fixedLength2 = fixedLength3.toFixed(2) + return fixedLength2 + } + return 0 +} diff --git a/src/views/order/components/billOfLading.vue b/src/views/order/components/billOfLading.vue index 01d8216..c58c1b9 100644 --- a/src/views/order/components/billOfLading.vue +++ b/src/views/order/components/billOfLading.vue @@ -1,7 +1,7 @@