Commit 50416996 authored by houjn@hikoon.cn's avatar houjn@hikoon.cn

Merge branch 'release' of...

Merge branch 'release' of http://gitlab.jdshangmen.com/jiedao-app/jiedao-app-operator into release2.2new
parents ec6ca25b 35cd7e3a
...@@ -136,7 +136,8 @@ export default { ...@@ -136,7 +136,8 @@ export default {
border-top: 1px solid gray; border-top: 1px solid gray;
font-size: 14px; font-size: 14px;
line-height: 25px; line-height: 25px;
grid-template-columns: repeat(2, 1fr); word-wrap: break-word;
grid-template-columns: repeat(2, 100px);
> p:first-child { > p:first-child {
border-right: 1px solid gray; border-right: 1px solid gray;
} }
......
...@@ -310,7 +310,7 @@ ...@@ -310,7 +310,7 @@
<el-descriptions :column="5" border> <el-descriptions :column="5" border>
<el-descriptions-item :label="$t('保价费')"> <el-descriptions-item :label="$t('保价费')">
{{fee.insuranceFee || 0}} {{$t('美元')}} {{fee.insuranceFee || 0}} {{ selectedRouter ? currencyMap[selectedRouter.currencyUnit || 1] : '' }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="$t('总运费')"> <el-descriptions-item :label="$t('总运费')">
<template v-for="item in freightFeeList"> <template v-for="item in freightFeeList">
...@@ -730,8 +730,6 @@ export default { ...@@ -730,8 +730,6 @@ export default {
// 预计费用(原价 - 优惠金额 + 其他费用 + 保价费) // 预计费用(原价 - 优惠金额 + 其他费用 + 保价费)
estimatedCosts(){ estimatedCosts(){
let arr = [] let arr = []
let withInsuranceFee = false
let withOtherFee = false
this.originalFeeList.forEach(item => { this.originalFeeList.forEach(item => {
let it = { let it = {
currencyId: item.currencyId, currencyId: item.currencyId,
...@@ -741,50 +739,31 @@ export default { ...@@ -741,50 +739,31 @@ export default {
if(coupon){ if(coupon){
it.amount = it.amount.minus(coupon.reduceTotalAmount) it.amount = it.amount.minus(coupon.reduceTotalAmount)
} }
if(this.form.otherFee && this.form.otherFeeCurrencyId == item.currencyId){
it.amount = it.amount.plus(this.form.otherFee)
withOtherFee = true
}
// 保价费(美元)
if(item.currencyId == 1 && this.fee && this.fee.insuranceFee){
it.amount = it.amount.plus(this.fee.insuranceFee)
withInsuranceFee = true
}
arr.push(it) arr.push(it)
}) })
// 没有累加保价费(没有美元计价)但是有保价费则需要加上去 // 累加保价费
if(!withInsuranceFee && this.fee && this.fee.insuranceFee){ const insuranceFeeIndex = arr.findIndex(item => item.currencyId == this.insuranceFeeCurrency)
let fee = Decimal(this.fee.insuranceFee) if(insuranceFeeIndex > -1){
// 如果没有美元费用,且保价费和其他费用币种相同(都是美元) arr[insuranceFeeIndex].amount = arr[insuranceFeeIndex].amount.plus(this.fee.insuranceFee || 0)
if(this.form.otherFeeCurrencyId == 1 && this.form.otherFee){ }else{
withOtherFee = true
fee = fee.plus(new Decimal(this.form.otherFee || 0))
}
arr.push({ arr.push({
currencyId: 1, currencyId: this.insuranceFeeCurrency,
amount: fee amount: Decimal(this.fee.insuranceFee || 0)
}) })
} }
// 如果没有累加其他费用,则另外增加货币 // 累加其他费用
if(!withOtherFee && this.form.otherFee){ const otherFeeIndex = arr.findIndex(item => item.currencyId == this.form.otherFeeCurrencyId)
let fee = { if(otherFeeIndex > -1){
arr[otherFeeIndex].amount = arr[otherFeeIndex].amount.plus(this.form.otherFee || 0)
}else{
arr.push({
currencyId: this.form.otherFeeCurrencyId, currencyId: this.form.otherFeeCurrencyId,
amount: Decimal(this.form.otherFee) amount: Decimal(this.form.otherFee || 0)
} })
// 如果保价费跟其他费用是同一种货币(都是美元)
if(!withInsuranceFee && this.fee && this.fee.insuranceFee && this.form.otherFeeCurrencyId == 1){
fee.amount = fee.amount.plus(this.fee.insuranceFee)
}
arr.push(fee)
} }
return arr return arr
}, },
// 路线开通的服务 // 路线开通的服务
...@@ -792,6 +771,10 @@ export default { ...@@ -792,6 +771,10 @@ export default {
if(!this.selectedRouter || !this.selectedRouter.otherService) return [] if(!this.selectedRouter || !this.selectedRouter.otherService) return []
return this.selectedRouter.otherService.split(',') return this.selectedRouter.otherService.split(',')
}, },
// 保价费单位(路线里设置,默认美元)
insuranceFeeCurrency() {
return this.selectedRouter?.currencyUnit || 1;
},
// 是否可以添加商品 // 是否可以添加商品
canAddProduct(){ canAddProduct(){
if(!this.form.lineId){ if(!this.form.lineId){
......
...@@ -26,11 +26,9 @@ ...@@ -26,11 +26,9 @@
style="width: 80mm; margin: 0 auto;" :id="'order-print-tag' + item.num" style="width: 80mm; margin: 0 auto;" :id="'order-print-tag' + item.num"
:style="{display: index == 0 ? 'block':'none' }" :style="{display: index == 0 ? 'block':'none' }"
:key="item.num"> :key="item.num">
<div style="float: left; width: 28mm; border-bottom: 0.2mm solid #333; border-right: 0.2mm solid #333; " > <div style="float: left; text-align: center; width: 28mm; border-bottom: 0.2mm solid #333; border-right: 0.2mm solid #333; " >
<img :src="item.url" :alt="item.url" style="width: 26mm" /> <img class="qrcode" src="" :alt="item.url" style="width: 26mm" />
<p style=" text-align: center; height: 5mm; font-size: 3mm; -webkit-margin-before: 0em; -webkit-margin-after: 0em; margin-top: 0mm; " > <p class="tag" style=" text-align: center; height: 5mm; font-size: 3mm; -webkit-margin-before: 0em; -webkit-margin-after: 0em; margin-top: 0mm; " >{{item.tag}}</p>
{{item.tag}}
</p>
<p style="margin-top: -1mm; text-align: center"> <p style="margin-top: -1mm; text-align: center">
<span style="text-align: center; font-weight: 600; font-size: 6mm" >{{item.num}}</span> <span style="text-align: center; font-weight: 600; font-size: 6mm" >{{item.num}}</span>
</p> </p>
...@@ -73,6 +71,7 @@ ...@@ -73,6 +71,7 @@
import {printTag} from '@/api/ecw/order' import {printTag} from '@/api/ecw/order'
import {parseTime} from '@/utils/ruoyi' import {parseTime} from '@/utils/ruoyi'
import lodop from '@/utils/lodop' import lodop from '@/utils/lodop'
import QRCode from "qrcode";
export default { export default {
filters: {parseTime}, filters: {parseTime},
...@@ -136,12 +135,18 @@ export default { ...@@ -136,12 +135,18 @@ export default {
if(!this.printTags.length){ if(!this.printTags.length){
return this.$message.error(this.$t('指定区域无可打印标签')) return this.$message.error(this.$t('指定区域无可打印标签'))
} }
this.$refs["form"].validate(valid => { this.$refs["form"].validate((valid) => {
if (!valid) { if (!valid) {
return; return;
} }
this.currentNo = this.form.start this.currentNo = this.form.start
this.step = 'preview' this.step = 'preview'
this.$nextTick(async () => {
const first = document.getElementsByClassName('order-print-tag-item')[0]
const tag = first.getElementsByClassName('tag')[0].innerText
const qrcode = await QRCode.toDataURL(tag, {margin: 1})
first.getElementsByClassName('qrcode')[0].setAttribute("src", qrcode)
})
}) })
}, },
print(){ print(){
...@@ -152,18 +157,22 @@ export default { ...@@ -152,18 +157,22 @@ export default {
if(items.length > 1000){ if(items.length > 1000){
this.$alert(this.$t('标签超过1000需要耐心等候标签生成,请稍候')) this.$alert(this.$t('标签超过1000需要耐心等候标签生成,请稍候'))
} }
lodop().then(LODOP => { lodop().then(async(LODOP) => {
LODOP.PRINT_INIT(this.title); LODOP.PRINT_INIT(this.title);
LODOP.SET_PRINT_STYLE("FontSize",18); LODOP.SET_PRINT_STYLE("FontSize",18);
LODOP.SET_PRINT_STYLE("Bold",1); LODOP.SET_PRINT_STYLE("Bold",1);
// LODOP.ADD_PRINT_TEXT(50,231,260,39,"打印页面部分内容"); // LODOP.ADD_PRINT_TEXT(50,231,260,39,"打印页面部分内容");
LODOP.SET_PRINT_PAGESIZE(0, 800, 600, "TAG"); LODOP.SET_PRINT_PAGESIZE(0, 800, 600, "TAG");
for(let i in items){ let i = 0;
LODOP.ADD_PRINT_HTM("2mm",0,800,600, items[i].innerHTML); for(let item of items){
const tag = item.getElementsByClassName('tag')[0].innerText
const qrcode = await QRCode.toDataURL(tag, {margin: 1})
item.getElementsByClassName('qrcode')[0].setAttribute("src", qrcode)
LODOP.ADD_PRINT_HTM("2mm",0,800,600, item.innerHTML);
if(i < items.length){ if(i < items.length){
LODOP.NewPage() LODOP.NewPage()
} }
i++
} }
LODOP.PREVIEW(); LODOP.PREVIEW();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment