pull/18/head
xiaozhiyong 1 year ago
parent a18cbf1b9f
commit 4a02c0fa6d
  1. 11
      src/api/order.js
  2. 16
      src/utils/index.js
  3. 26
      src/views/order/components/billOfLading.vue
  4. 18
      src/views/order/index.vue

@ -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
}

@ -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
}

@ -1,7 +1,7 @@
<template>
<el-drawer direction="ltr" size="40%" :visible="controlWindows.bill" @opened="openDrawer" :before-close="closeWindow" :show-close="false">
<div class="create" v-if="controlWindows.bill">
<el-form label-width="100px">
<el-form label-width="135px">
<div class="billTop">
<div class="billTop-top">
<div class="billTop-top-left">
@ -41,6 +41,17 @@
<span>{{ billData.orderInfo.surplusAmount }}</span>
</el-form-item>
</div>
<div
v-if="billData.orderInfo && billData.orderInfo.orderStatus && billData.orderInfo.orderStatus == 'DELIVERING'"
class="billTop-top-left"
>
<el-form-item label="炼厂余额:">
<span>{{ billData.refineryInfo.balance }}</span>
</el-form-item>
<el-form-item label="炼厂余额(预扣):">
<span>{{ balanceWithhold }}</span>
</el-form-item>
</div>
</div>
</div>
<div class="billBottom">
@ -222,6 +233,18 @@ export default {
}
},
created() {},
computed: {
balanceWithhold() {
let { refineryInfo, orderInfo } = this.billData
if (refineryInfo) {
let balance = refineryInfo.balance * 10000
let preAmount = orderInfo.preAmount * 10000
let total = this.$utils.fixedHandle((balance + preAmount) / 10000)
return total
}
return 0
}
},
methods: {
billdelivery() {
let percentage103 = (this.billAddData.preDeliveryQuantity * 10000 * 1.03) / 10000
@ -363,7 +386,6 @@ export default {
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo))
this.configAutocomplete.echoId = id
this.configAutocomplete.echoName = this.form.refineryName
console.log('this.form', this.form.floorPrice)
}
},
submit() {

@ -37,7 +37,7 @@
</div>
<div class="table">
<div class="operation">
<!-- <el-button icon="el-icon-upload2" @click="addition">炼厂入驻</el-button> -->
<el-button icon="el-icon-upload2" @click="exportData">导出</el-button>
</div>
<el-table v-if="tableHeight" ref="multipleTable" :height="tableHeight" :data="tableData" style="width: 100%">
<el-table-column prop="id" label="订单ID" show-overflow-tooltip minWidth="250"> </el-table-column>
@ -272,6 +272,17 @@ export default {
this.getByPage()
},
methods: {
exportData() {
order.exportRefineryOrders({}).then(res => {
let element = document.createElement('a')
let blob = new Blob([res], { type: 'application/vnd.ms-excel' })
element.href = URL.createObjectURL(blob)
let { y, M, d, h, m } = this.$utils.parseTime(new Date())
element.download = `订单列表 ${y}-${M}${d} ${h}${m}`
element.click()
URL.revokeObjectURL(element.href)
})
},
payTagType(val) {
switch (val) {
case 'PREPAID':
@ -369,6 +380,9 @@ export default {
await order.findByOrderId(row.id).then(res => {
this.billData.orderInfo = res.data
})
await order.get(row.refineryId).then(res => {
this.billData.refineryInfo = res.data
})
this.controlWindows.addInfo = row
this.controlWindows.bill = true
},
@ -483,7 +497,7 @@ export default {
border: 1px solid #e3e3e5;
> .operation {
box-sizing: content-box;
// padding: 15px;
padding: 15px;
}
.gray {
color: #999;

Loading…
Cancel
Save