md
This commit is contained in:
parent
c4b64a8abe
commit
88af779cad
@ -579,6 +579,12 @@ export default {
|
|||||||
immediate: true
|
immediate: true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
beforeMount() {
|
||||||
|
window.addEventListener('keydown', this.keyDown)
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
window.removeEventListener('keydown', this.keyDown)
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if(this.saveStorageName&&this.saveStorageName!=undefined&&this.saveStorageName!=''){
|
if(this.saveStorageName&&this.saveStorageName!=undefined&&this.saveStorageName!=''){
|
||||||
this.isNeedDbSaveTpl=true;
|
this.isNeedDbSaveTpl=true;
|
||||||
@ -602,16 +608,49 @@ export default {
|
|||||||
return Math.random().toString(36).substring(3,10);
|
return Math.random().toString(36).substring(3,10);
|
||||||
},
|
},
|
||||||
|
|
||||||
initKeyDown(){
|
// initKeyDown(){
|
||||||
|
// let that=this;
|
||||||
|
// document.addEventListener('keydown', function(e) {
|
||||||
|
// e = e||window.event;
|
||||||
|
// if(e.ctrlKey&&e.code=="KeyC"){
|
||||||
|
// that.handleCopySelect(e);
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
keyDown(e) {
|
||||||
let that=this;
|
let that=this;
|
||||||
document.addEventListener('keydown', function(e) {
|
if (e || window.e) {
|
||||||
e = e||window.event;
|
const { key, target } = e
|
||||||
if(e.ctrlKey&&e.code=="KeyC"){
|
const deleteKeyArr = ['Backspace', 'Delete']
|
||||||
that.handleCopySelect(e);
|
// 使用this.$el.querySelector('#efContainer')而不使用document.getElementById,是因为我们获取元素,尽量用this.$el去一级级获取,用document,单页面应用总会出些意外
|
||||||
return false;
|
// js的contains方法用来查看dom元素的包含关系-用来限定键盘事件只局限于当前dom范围内
|
||||||
|
const efContainerId = this.$el.querySelector('#'+this.tableId)
|
||||||
|
console.log("====>efContainerId==>",efContainerId);
|
||||||
|
if (e.ctrlKey&&e.code=="KeyC" && target.contains(efContainerId)) {
|
||||||
|
this.handleCopySelect(e)
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
// const efContainerId = this.$el.querySelector('#'+this.tableId)
|
||||||
|
// console.log("====>efContainerId==>",efContainerId);
|
||||||
|
// console.log("====>efContainerId==>",efContainerId);
|
||||||
|
// if(e.ctrlKey&&e.code=="KeyC"){
|
||||||
|
// that.handleCopySelect(e);
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// if (deleteKeyArr.includes(key) && !this.delBtnDisabled && this.clickedBackSpace && target.contains(efContainerId)) {
|
||||||
|
// this.deleteElement()
|
||||||
|
// }
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
keyDownOld(e) {
|
||||||
|
if(e.ctrlKey && e.keyCode==13) { //用户点击了ctrl+enter触发
|
||||||
|
|
||||||
|
}
|
||||||
|
// this.textarea += '\n';
|
||||||
|
// }else { //用户点击了enter触发
|
||||||
|
// this.sendMessage();
|
||||||
|
},
|
||||||
onTplSelectInputBlur(e) {
|
onTplSelectInputBlur(e) {
|
||||||
if (e.target.value.trim()!== '') {
|
if (e.target.value.trim()!== '') {
|
||||||
//e.target.value就是录入的内容
|
//e.target.value就是录入的内容
|
||||||
@ -1031,14 +1070,7 @@ export default {
|
|||||||
}))
|
}))
|
||||||
this.storageList = list
|
this.storageList = list
|
||||||
},
|
},
|
||||||
keyDown(e) {
|
|
||||||
if(e.ctrlKey && e.keyCode==13) { //用户点击了ctrl+enter触发
|
|
||||||
|
|
||||||
}
|
|
||||||
// this.textarea += '\n';
|
|
||||||
// }else { //用户点击了enter触发
|
|
||||||
// this.sendMessage();
|
|
||||||
},
|
|
||||||
// 根据缓存的数组进行渲染表格
|
// 根据缓存的数组进行渲染表格
|
||||||
updateTable() {
|
updateTable() {
|
||||||
// 特殊类型
|
// 特殊类型
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
from:this.from,
|
from:this.from,
|
||||||
to:this.to
|
to:this.to
|
||||||
};
|
};
|
||||||
getValidExchangeRate(this.queryParams).then(response => {
|
getValidExchangeRate(queryParams).then(response => {
|
||||||
this.value = response.data;
|
this.value = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@ -642,7 +642,6 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="realFee" :label="$t('实收')" align="center" width="50">
|
<el-table-column prop="realFee" :label="$t('实收')" align="center" width="50">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<el-input-number v-if="form.blSpecialQuote==1" v-model="scope.row.realFee" @input="(val)=>handleCalcFeeItem(scope.row)" size="mini" placeholder="" :min="0.00" :controls="false" :precision="2"></el-input-number>
|
<el-input-number v-if="form.blSpecialQuote==1" v-model="scope.row.realFee" @input="(val)=>handleCalcFeeItem(scope.row)" size="mini" placeholder="" :min="0.00" :controls="false" :precision="2"></el-input-number>
|
||||||
<div v-else> {{scope.row.realFee}} </div>
|
<div v-else> {{scope.row.realFee}} </div>
|
||||||
</template>
|
</template>
|
||||||
@ -688,9 +687,16 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item :label="$t('总运费')" prop="freight" label-width="70px">
|
<el-form-item :label="$t('总运费')" prop="freight" label-width="70px">
|
||||||
<el-input-number v-if="form.calcFeeType == 3" :min="0.00" v-model="form.freight" placeholder="" :controls="false" :precision="2"> </el-input-number>
|
<el-input-number v-if="form.calcFeeType == 3" :min="0.00" v-model="form.freight" placeholder="" :controls="false" :precision="2">
|
||||||
<el-input v-else v-model="form.freight" disabled placeholder="" > </el-input>
|
<span slot="suffix">(CNY)</span>
|
||||||
|
</el-input-number>
|
||||||
|
<el-input v-else v-model="form.freight" disabled placeholder="" >
|
||||||
|
<span slot="suffix">(CNY)</span>
|
||||||
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item :label="$t('汇率')" prop="exchangeRate" label-width="70px">
|
||||||
|
<ExchangeRatePanel from="USD" to="CNY" v-model="exchangeRate"></ExchangeRatePanel>
|
||||||
|
</el-form-item> -->
|
||||||
<el-form-item :label="$t('费用备注')" prop="feeRemark" label-width="70px">
|
<el-form-item :label="$t('费用备注')" prop="feeRemark" label-width="70px">
|
||||||
<el-input v-model="form.feeRemark" type="textarea" maxlength="150"
|
<el-input v-model="form.feeRemark" type="textarea" maxlength="150"
|
||||||
show-word-limit placeholder="" oninput="value=value.replace(/[\r|\n]/g,'')" >
|
show-word-limit placeholder="" oninput="value=value.replace(/[\r|\n]/g,'')" >
|
||||||
@ -746,6 +752,8 @@ import { checkWaybillIsExists,getWaybillDetail,realSubmitOrder,calcWaybillFee,ca
|
|||||||
import { parseTime } from "@/utils/custom";
|
import { parseTime } from "@/utils/custom";
|
||||||
import { debounce } from 'throttle-debounce'
|
import { debounce } from 'throttle-debounce'
|
||||||
import { getDestSite } from "@/api/emis/emisDestination";
|
import { getDestSite } from "@/api/emis/emisDestination";
|
||||||
|
import { getValidExchangeRate } from "@/api/emis/emisExchangeRate";
|
||||||
|
|
||||||
|
|
||||||
import DestinationPicker from '@/views/emis/EmisBaseTools/DestinationPicker.vue';
|
import DestinationPicker from '@/views/emis/EmisBaseTools/DestinationPicker.vue';
|
||||||
|
|
||||||
@ -783,6 +791,9 @@ import WarehouseInNoPicker from '@/views/emis/EmisBaseTools/WarehouseInNoPicker.
|
|||||||
|
|
||||||
import PayeePicker from '@/views/emis/EmisBaseTools/PayeePicker.vue';
|
import PayeePicker from '@/views/emis/EmisBaseTools/PayeePicker.vue';
|
||||||
import SalemanPicker from '@/views/emis/EmisBaseTools/SalemanPicker.vue';
|
import SalemanPicker from '@/views/emis/EmisBaseTools/SalemanPicker.vue';
|
||||||
|
import ExchangeRatePanel from '@/views/emis/EmisBaseTools/ExchangeRatePanel.vue';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import TransProductCasPicker from '@/views/emis/EmisBaseTools/TransProductCasPicker.vue';
|
import TransProductCasPicker from '@/views/emis/EmisBaseTools/TransProductCasPicker.vue';
|
||||||
|
|
||||||
@ -829,6 +840,7 @@ components: {
|
|||||||
ProvincePicker2,
|
ProvincePicker2,
|
||||||
CityPicker2,
|
CityPicker2,
|
||||||
DistrictPicker2,
|
DistrictPicker2,
|
||||||
|
ExchangeRatePanel
|
||||||
},
|
},
|
||||||
dicts: ['emis_qujian_fangshi','emis_declare_mode','emis_customs_clear',
|
dicts: ['emis_qujian_fangshi','emis_declare_mode','emis_customs_clear',
|
||||||
'emis_tab_packing_type','emis_tab_dispatch_mode','emis_payment_type',
|
'emis_tab_packing_type','emis_tab_dispatch_mode','emis_payment_type',
|
||||||
@ -836,6 +848,7 @@ dicts: ['emis_qujian_fangshi','emis_declare_mode','emis_customs_clear',
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeNames:['1','2','3','4'],
|
activeNames:['1','2','3','4'],
|
||||||
|
exchangeRate:null,
|
||||||
billCode:null,
|
billCode:null,
|
||||||
emisWaybillOptions: [],
|
emisWaybillOptions: [],
|
||||||
addressType:null,
|
addressType:null,
|
||||||
@ -1299,6 +1312,7 @@ methods: {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
let newList = this.form.feeItems.filter(item => item.feeCode !== row.feeCode);
|
let newList = this.form.feeItems.filter(item => item.feeCode !== row.feeCode);
|
||||||
this.form.feeItems=newList;
|
this.form.feeItems=newList;
|
||||||
|
this.handleCalcFeeItem();
|
||||||
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
})
|
})
|
||||||
@ -1735,31 +1749,37 @@ methods: {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleCalcFeeItem(row){
|
async handleCalcFeeItem(row){
|
||||||
|
|
||||||
console.log("===>handleCalcFeeItem==>",row);
|
|
||||||
if(row!=null){
|
if(row!=null){
|
||||||
if(row.calcExp){
|
if(row.calcExp){
|
||||||
let expr=row.calcExp;
|
let expr=row.calcExp;
|
||||||
expr=expr.replace("s",row.initialWeightFee);
|
expr=expr.replace("s",row.initialWeightFee);
|
||||||
expr=expr.replace("d",row.addWeightPrice);
|
expr=expr.replace("d",row.addWeightPrice);
|
||||||
expr=expr.replace("w",this.form.settlementWeight);
|
expr=expr.replace("w",this.form.settlementWeight);
|
||||||
|
|
||||||
console.log("===>eval(expr):",eval(expr));
|
|
||||||
row.realFee=parseFloat(eval(expr)).toFixed(2);
|
row.realFee=parseFloat(eval(expr)).toFixed(2);
|
||||||
|
|
||||||
console.log("===>row.calcExp==>expr==>row.realFee:",row.calcExp,expr,row.realFee);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let feeRemark="";
|
||||||
let totalFee=0;
|
let totalFee=0;
|
||||||
if(this.form.feeItems&&this.form.feeItems.length>0){
|
if(this.form.feeItems&&this.form.feeItems.length>0){
|
||||||
this.form.feeItems.forEach(item=>{
|
let len=this.form.feeItems.length;
|
||||||
|
for(let i=0;i<len;i++){
|
||||||
totalFee=parseFloat(totalFee)+parseFloat(item.realFee);
|
let item=this.form.feeItems[i];
|
||||||
console.log("===>totalFee==>:",totalFee);
|
let newFee=item.realFee;
|
||||||
});
|
if(item.currency&&item.currency !='CNY'){
|
||||||
|
let res= await getValidExchangeRate({from:item.currency,to:'CNY'});
|
||||||
|
if(res.code==200){
|
||||||
|
newFee=newFee*parseFloat(res.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
feeRemark= feeRemark+item.feeName+":" + newFee+",";
|
||||||
|
totalFee=parseFloat(totalFee)+parseFloat(newFee);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.form.feeRemark=feeRemark;
|
||||||
this.form.freight = totalFee;
|
this.form.freight = totalFee;
|
||||||
},
|
},
|
||||||
// 计算体积重量
|
// 计算体积重量
|
||||||
|
|||||||
@ -642,7 +642,6 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="realFee" :label="$t('实收')" align="center" width="50">
|
<el-table-column prop="realFee" :label="$t('实收')" align="center" width="50">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
||||||
<el-input-number v-if="form.blSpecialQuote==1" v-model="scope.row.realFee" @input="(val)=>handleCalcFeeItem(scope.row)" size="mini" placeholder="" :min="0.00" :controls="false" :precision="2"></el-input-number>
|
<el-input-number v-if="form.blSpecialQuote==1" v-model="scope.row.realFee" @input="(val)=>handleCalcFeeItem(scope.row)" size="mini" placeholder="" :min="0.00" :controls="false" :precision="2"></el-input-number>
|
||||||
<div v-else> {{scope.row.realFee}} </div>
|
<div v-else> {{scope.row.realFee}} </div>
|
||||||
</template>
|
</template>
|
||||||
@ -695,9 +694,9 @@
|
|||||||
<span slot="suffix">(CNY)</span>
|
<span slot="suffix">(CNY)</span>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('汇率')" prop="exchangeRate" label-width="70px">
|
<!-- <el-form-item :label="$t('汇率')" prop="exchangeRate" label-width="70px">
|
||||||
<ExchangeRatePanel from="USD" to="CNY" v-model="exchangeRate"></ExchangeRatePanel>
|
<ExchangeRatePanel from="USD" to="CNY" v-model="exchangeRate"></ExchangeRatePanel>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item :label="$t('费用备注')" prop="feeRemark" label-width="70px">
|
<el-form-item :label="$t('费用备注')" prop="feeRemark" label-width="70px">
|
||||||
<el-input v-model="form.feeRemark" type="textarea" maxlength="150"
|
<el-input v-model="form.feeRemark" type="textarea" maxlength="150"
|
||||||
show-word-limit placeholder="" oninput="value=value.replace(/[\r|\n]/g,'')" >
|
show-word-limit placeholder="" oninput="value=value.replace(/[\r|\n]/g,'')" >
|
||||||
@ -753,6 +752,8 @@ import { checkWaybillIsExists,getWaybillDetail,realSubmitOrder,calcWaybillFee,ca
|
|||||||
import { parseTime } from "@/utils/custom";
|
import { parseTime } from "@/utils/custom";
|
||||||
import { debounce } from 'throttle-debounce'
|
import { debounce } from 'throttle-debounce'
|
||||||
import { getDestSite } from "@/api/emis/emisDestination";
|
import { getDestSite } from "@/api/emis/emisDestination";
|
||||||
|
import { getValidExchangeRate } from "@/api/emis/emisExchangeRate";
|
||||||
|
|
||||||
|
|
||||||
import DestinationPicker from '@/views/emis/EmisBaseTools/DestinationPicker.vue';
|
import DestinationPicker from '@/views/emis/EmisBaseTools/DestinationPicker.vue';
|
||||||
|
|
||||||
@ -847,6 +848,7 @@ dicts: ['emis_qujian_fangshi','emis_declare_mode','emis_customs_clear',
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeNames:['1','2','3','4'],
|
activeNames:['1','2','3','4'],
|
||||||
|
exchangeRate:null,
|
||||||
billCode:null,
|
billCode:null,
|
||||||
emisWaybillOptions: [],
|
emisWaybillOptions: [],
|
||||||
addressType:null,
|
addressType:null,
|
||||||
@ -1310,6 +1312,7 @@ methods: {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
let newList = this.form.feeItems.filter(item => item.feeCode !== row.feeCode);
|
let newList = this.form.feeItems.filter(item => item.feeCode !== row.feeCode);
|
||||||
this.form.feeItems=newList;
|
this.form.feeItems=newList;
|
||||||
|
this.handleCalcFeeItem();
|
||||||
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
})
|
})
|
||||||
@ -1746,7 +1749,7 @@ methods: {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
handleCalcFeeItem(row){
|
async handleCalcFeeItem(row){
|
||||||
|
|
||||||
if(row!=null){
|
if(row!=null){
|
||||||
if(row.calcExp){
|
if(row.calcExp){
|
||||||
@ -1754,20 +1757,29 @@ methods: {
|
|||||||
expr=expr.replace("s",row.initialWeightFee);
|
expr=expr.replace("s",row.initialWeightFee);
|
||||||
expr=expr.replace("d",row.addWeightPrice);
|
expr=expr.replace("d",row.addWeightPrice);
|
||||||
expr=expr.replace("w",this.form.settlementWeight);
|
expr=expr.replace("w",this.form.settlementWeight);
|
||||||
|
|
||||||
// console.log("===>eval(expr):",eval(expr));
|
|
||||||
row.realFee=parseFloat(eval(expr)).toFixed(2);
|
row.realFee=parseFloat(eval(expr)).toFixed(2);
|
||||||
|
|
||||||
// console.log("===>row.calcExp==>expr==>row.realFee:",row.calcExp,expr,row.realFee);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let feeRemark="";
|
||||||
let totalFee=0;
|
let totalFee=0;
|
||||||
if(this.form.feeItems&&this.form.feeItems.length>0){
|
if(this.form.feeItems&&this.form.feeItems.length>0){
|
||||||
this.form.feeItems.forEach(item=>{
|
let len=this.form.feeItems.length;
|
||||||
totalFee=parseFloat(totalFee)+parseFloat(item.realFee);
|
for(let i=0;i<len;i++){
|
||||||
});
|
let item=this.form.feeItems[i];
|
||||||
|
let newFee=item.realFee;
|
||||||
|
if(item.currency&&item.currency !='CNY'){
|
||||||
|
let res= await getValidExchangeRate({from:item.currency,to:'CNY'});
|
||||||
|
if(res.code==200){
|
||||||
|
newFee=newFee*parseFloat(res.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
feeRemark= feeRemark+item.feeName+":" + newFee+",";
|
||||||
|
totalFee=parseFloat(totalFee)+parseFloat(newFee);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.form.feeRemark=feeRemark;
|
||||||
this.form.freight = totalFee;
|
this.form.freight = totalFee;
|
||||||
},
|
},
|
||||||
// 计算体积重量
|
// 计算体积重量
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user