This commit is contained in:
linfso 2024-08-03 09:50:09 +08:00
parent e9958dd2ce
commit 527af0c160
6 changed files with 213 additions and 165 deletions

View File

@ -115,9 +115,8 @@
<el-col :span="8">
<el-form-item label="账单名称" prop="settleBillNo">
<span slot="label">
<span style="color: red">结算编号</span>
<span style="color: red">账单名称</span>
</span>
<SettleBillPicker v-model="form.settleBillNo" @onChange="onSelectBill"> </SettleBillPicker>
<!-- <el-input v-model="form.settleBillNo" placeholder="单号输入后按回车" @keyup.enter.native="handleScanInput" >
<i slot="suffix" class="iconfont">&#xe656;</i>

View File

@ -140,7 +140,7 @@
ref="refTable"
row-key="id"
:storageName="storageName"
storageName="SubBillConfirmByMonthList_main"
:data="emisSettleSubBillList"
:showSearch.sync="showSearch"
@ -817,6 +817,7 @@ export default {
},
created() {
this.queryParams.blConfirmCenter='0';
this.queryParams.blConfirmSite='1';
this.actionType=this.$route.query.actionType;
this.initData();
@ -825,31 +826,35 @@ export default {
methods: {
initData(){
if(this.actionType==1){
this.storageName="SubBillConfirmByMoneyList_main";
this.queryParams.blConfirmCenter=0;
}
else if(this.actionType==2){
this.storageName="SubBillConfirmByMonthList_main";
this.queryParams.blConfirmCenter=0;
}
else if(this.actionType==3){
this.storageName="SubBillConfirmBySitehList_main";
this.queryParams.blConfirmSite=0;
}
else if(this.actionType==4){
var date = new Date();
var year = date.getFullYear();
var month = date.getMonth();
var toMonth = year + "-" + this.lpadZero(month + 1,2);
this.billMonth = toMonth;
this.storageName="SubBillConfirmByMonthList_main";
this.queryParams.blConfirmCenter=0;
},
initData_old(){
// if(this.actionType==1){
// this.storageName="SubBillConfirmByMoneyList_main";
// this.queryParams.blConfirmCenter=0;
// }
// else if(this.actionType==2){
// this.storageName="SubBillConfirmByMonthList_main";
// this.queryParams.blConfirmCenter=0;
// }
// else if(this.actionType==3){
// this.storageName="SubBillConfirmBySitehList_main";
// this.queryParams.blConfirmSite=0;
// }
// else if(this.actionType==4){
// var date = new Date();
// var year = date.getFullYear();
// var month = date.getMonth();
// var toMonth = year + "-" + this.lpadZero(month + 1,2);
// this.billMonth = toMonth;
this.queryParams.blConfirmCenter=1;
this.queryParams.blConfirmSite=1;
// this.queryParams.blConfirmCenter=1;
// this.queryParams.blConfirmSite=1;
this.storageName="subBillMergeMgnt_main";
this.activeTab='waitMerge';
}
// this.storageName="subBillMergeMgnt_main";
// this.activeTab='waitMerge';
// }
},
handleClick(tab, event) {
// console.log(tab, event);

View File

@ -649,7 +649,7 @@ export default {
titleView:"",
openView: false,
origBillCode:null,
// 时间搜索
dateRange:[],

View File

@ -475,7 +475,6 @@ export default {
end.setHours(23,59,59,0)
this.dateTimeRange=[timeFormat(start), timeFormat(end)]
},
methods: {
@ -519,36 +518,45 @@ export default {
getList() {
this.loading = true;
this.queryParams.params = {};
let newQueryParams = {
pageNum:this.queryParams.pageNum,
pageSize:this.queryParams.pageSize,
billCode:null,
orderSn:null
};
if(this.queryParams.billCode){
if(this.queryOrderType != "1"){
this.queryParams.orderSn=formatSearchStr(this.queryParams.billCode);
this.queryParams.billCode=null;
}else{
// 处理子单号
let qBillCode=formatSearchStr(this.queryParams.billCode);
let billArr = qBillCode.split(",");
let newBillCodeStr="";
billArr.forEach(item=>{
if(item.startsWith("T")){
let mainBillCode=item.substr(0,14);
newBillCodeStr=newBillCodeStr+mainBillCode+",";
}else{
newBillCodeStr=newBillCodeStr+item+",";
}
});
this.queryParams.billCode=newBillCodeStr;
if(this.queryOrderType != "1"){
newQueryParams.orderSn=this.queryParams.billCode;
// this.queryParams.orderSn=formatSearchStr(this.queryParams.billCode);
// this.queryParams.billCode=null;
}else{
newQueryParams.billCode=formatSearchStr(this.queryParams.billCode);
// 处理子单号
// let qBillCode=formatSearchStr(this.queryParams.billCode);
// let billArr = qBillCode.split(",");
// let newBillCodeStr="";
// billArr.forEach(item=>{
// if(item.startsWith("T")){
// let mainBillCode=item.substr(0,14);
// newBillCodeStr=newBillCodeStr+mainBillCode+",";
// }else{
// newBillCodeStr=newBillCodeStr+item+",";
// }
// });
// this.queryParams.billCode=newBillCodeStr;
}
this.queryParams=newQueryParams;
}
}else{
this.queryParams=this.addDateRange(this.queryParams, this.dateTimeRange,"Date");
newQueryParams=this.queryParams;
}
// this.queryParams=this.addDateRange(this.queryParams, this.dateTimeRange,"sendDate");
queryPrintListSimple(this.queryParams).then(response => {
queryPrintListSimple(newQueryParams).then(response => {
this.emisWaybillList = response.rows;
this.total = response.total;
this.loading = false;

View File

@ -393,27 +393,32 @@
</el-table-column>
<el-table-column prop="length" :label="$t('长(cm)')" align="center" width="60">
<template slot-scope="scope">
<el-input-number v-model="scope.row.length" @input="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+(scope.$index+1)" @keyup.native.enter="focusNextInput('input_'+(scope.$index+2)+'')" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
<!-- @input="(val)=>handleCalcVolumeDebounce(scope.row)" -->
<el-input-number v-model="scope.row.length" @blur="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+scope.$index+'_1'" @keyup.enter.native="focusNextInput('input_'+scope.$index+'_2')" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="width" :label="$t('宽(cm)')" align="center" width="60">
<template slot-scope="scope">
<el-input-number v-model="scope.row.width" @input="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+(scope.$index+2)" @keyup.native.enter="focusNextInput('input_'+(scope.$index+3)+'')" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
<!-- @input="(val)=>handleCalcVolumeDebounce(scope.row)" -->
<el-input-number v-model="scope.row.width" @blur="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+scope.$index+'_2'" @keyup.enter.native="focusNextInput('input_'+scope.$index+'_3')" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="height" :label="$t('高(cm)')" align="center" width="60">
<template slot-scope="scope">
<el-input-number v-model="scope.row.height" @input="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+(scope.$index+3)" @keyup.native.enter="focusNextInput('input_'+(scope.$index+4)+'')" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
<!-- @input="(val)=>handleCalcVolumeDebounce(scope.row)" -->
<el-input-number v-model="scope.row.height" @blur="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+scope.$index+'_3'" @keyup.enter.native="focusNextInput('input_'+scope.$index+'_4')" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="cargoQty" :label="$t('件数')" align="center" width="60">
<template slot-scope="scope">
<el-input-number v-model="scope.row.cargoQty" @blur="(val)=>handleCargoQtyChangeDebounce(scope.row)" :ref="'input_'+(scope.$index+4)" @keyup.enter.native="(val)=>handleCargoQtyChange(scope.row)" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
<!-- -->
<el-input-number v-model="scope.row.cargoQty" @blur="(val)=>handleCargoQtyChangeDebounce(scope.row)" :ref="'input_'+scope.$index+'_4'" @keyup.enter.native="(val)=>{ handleCargoQtyChangeDebounce(scope.row); focusNextInput('input_'+(scope.$index+1)+'_1')}" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="volume" :label="$t('体积(m³)')" align="center" width="80">
<template slot-scope="scope">
<el-input-number v-model="scope.row.volume" size="mini" placeholder="" disabled :min="0" :controls="false" :precision="5"></el-input-number>
<span > {{scope.row.volume}}</span>
<!-- <el-input-number v-model="scope.row.volume" size="mini" placeholder="" disabled :min="0" :controls="false" :precision="5"></el-input-number> -->
</template>
</el-table-column>
@ -636,21 +641,21 @@
<el-table-column prop="initialWeightFee" :label="$t('首重费')" align="center" width="60">
<template slot-scope="scope">
<el-input-number v-if="form.blSpecialQuote==1" v-model="scope.row.initialWeightFee" @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.initialWeightFee" @blur="(val)=>handleCalcFeeItem(scope.row)" @keyup.enter.native="handleCalcFeeItem(scope.row)" size="mini" placeholder="" :min="0.00" :controls="false" :precision="2"></el-input-number>
<div v-else> {{scope.row.initialWeightFee}} </div>
</template>
</el-table-column>
<el-table-column prop="addWeightPrice" :label="$t('续重单价')" align="center" width="70">
<template slot-scope="scope">
<el-input-number v-if="form.blSpecialQuote==1" v-model="scope.row.addWeightPrice" @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.addWeightPrice" @blur="(val)=>handleCalcFeeItem(scope.row)" @keyup.enter.native="handleCalcFeeItem(scope.row)" size="mini" placeholder="" :min="0.00" :controls="false" :precision="2"></el-input-number>
<div v-else> {{scope.row.addWeightPrice}} </div>
</template>
</el-table-column>
<el-table-column prop="realFee" :label="$t('实收')" align="center" width="50">
<template slot-scope="scope">
<el-input-number v-if="form.blSpecialQuote==1 && scope.row.addWeightPrice==0 && scope.row.initialWeightFee==0" 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 && scope.row.addWeightPrice==0 && scope.row.initialWeightFee==0" v-model="scope.row.realFee" @blur="(val)=>handleCalcFeeItem(scope.row)" @keyup.enter.native="handleCalcFeeItem(scope.row)" size="mini" placeholder="" :min="0.00" :controls="false" :precision="2" ></el-input-number>
<div v-else> {{scope.row.realFee}} </div>
</template>
</el-table-column>
@ -863,7 +868,6 @@ data() {
addressType:null,
// 遮罩层
loading: true,
isNeedSave:false,
triggerCount:0,
action:null,
addFrom:null,
@ -876,6 +880,8 @@ data() {
openSelectAddress:false,
printerStatus:0,
origBillCode:null,
// 可用面单数
totalAvailablePag:{
mainHasCnt:0,
@ -1125,12 +1131,12 @@ methods: {
// printDataList.push(customerItem);
// 主单
// let mainBillItem ={
// "tplCode":"TAN-GM-130",
// "printerName":this.$refs.tanexPrinter.getDefaultPrinter(),
// "orderList":orderList.toString()
// }
// printDataList.push(mainBillItem);
let mainBillItem ={
"tplCode":"TAN-GM-130",
"printerName":this.$refs.tanexPrinter.getDefaultPrinter(),
"orderList":orderList.toString()
}
printDataList.push(mainBillItem);
@ -1275,8 +1281,51 @@ methods: {
onDestCountryChange(item){
if(item){
this.form.reciever.country=item.code;
this.autoAjustBillCode();
}
},
// 如果目的国为孟加拉,自动调整运单号
autoAjustBillCode(){
if(this.action != "add"){
return;
}
if(!this.form.reciever.country){
return
}
if(this.form.reciever.country!='0880'){
return;
}
if(!this.form.billCode){
return;
}
if(this.form.billCode.length!=14){
return;
}
// 记住历史单号
this.origBillCode=this.form.billCode;
this.$confirm("注意:根据要求孟加拉单号自动调整为12位", "提示", {
confirmButtonText: "确定",
type: "warning",
distinguishCancelAndClose: true,
closeOnClickModal: false,
showCancelButton: false,
showClose: false
}).then(() => {
// 去除第7,8个字符
// T7080300001796
let str =this.form.billCode;
let prefix=str.substring(0,6);
let other = str.substring(8);
this.form.billCode=prefix+other;
});
},
onPaymentTypeChange(){
// 非月结清空月结客户选择
if(this.form.paymentType == '1' ||
@ -1358,31 +1407,14 @@ methods: {
if(this.billCode && this.billCode!=undefined) {
this.loading = true;
getWaybillDetail(this.billCode).then(response => {
this.form = response.data;
if(this.$store.getters.ownerSiteCode!='88888'&&this.addFrom!='userOrder'){
if(this.$store.getters.ownerSiteCode!=this.form.sendSiteCode){
if(this.$store.getters.ownerSiteCode!=response.data.sendSiteCode){
this.$message.error('此单归属不允许修改');
return;
}
}
this.form.productTypeSelArr=[this.form.transLine,this.form.productType];
this.loading = false;
this.isNeedSave=true;
this.form.printTypeCheckList=[0,1,5]
this.form.destinationCountry=this.form.reciever.country;
if(this.form.packType&&this.form.packType!=''){
this.form.packType=this.form.packType.split(",");
}
if(!this.form.attachmentList){
this.form.attachmentList=[];
}
this.form = response.data;
if(this.form.lockFlag=="T"&&this.addFrom!='userOrder'){
this.$confirm(this.form.lockReason, '提示', {
confirmButtonText: '确认',
@ -1395,9 +1427,22 @@ methods: {
})
}
this.form.productTypeSelArr=[this.form.transLine,this.form.productType];
this.loading = false;
this.form.printTypeCheckList=[0,1,5]
this.form.destinationCountry=this.form.reciever.country;
if(this.form.packType&&this.form.packType!=''){
this.form.packType=this.form.packType.split(",");
}
if(!this.form.attachmentList){
this.form.attachmentList=[];
}
// 接单处理
if(this.addFrom=="userOrder"){
if(!this.form.feeItems){
this.form.feeItems=[];
@ -1405,18 +1450,17 @@ methods: {
if(!this.form.cargoList){
this.form.cargoList=[];
this.handleInitGenGoods();
}
// 获取可用运单数
this.initGetTotalAvailablePag(this.form.sendSiteCode);
this.startTimer();
}
});
}else{
// this.startTimer();
// this.form.sendDate = parseTime(new Date());
this.form.sendSiteCode=this.$store.getters.ownerSiteCode;
@ -1437,7 +1481,7 @@ methods: {
this.form.calcFeeType='1';
this.form.blMessage='1'
this.form.blAcceptMessage='1'
this.isNeedSave=true;
//
this.form.printTypeCheckList=[0,1,5],
// 获取可用运单数
@ -1446,6 +1490,8 @@ methods: {
this.handleInitGenGoods();
this.startTimer();
}
@ -1767,17 +1813,16 @@ methods: {
}
},
focusNextInput(nextRef) {
this.$refs[nextRef].focus()
// console.log("====focusNextInput===>",nextRef)
if(this.$refs[nextRef]){
this.$refs[nextRef].focus()
}
},
handleCalcVolumeDebounce(row){
// 控制触发频率
debounce(250, this.handleCalcVolume(row))
},
handleCalcVolume(row){
// 初始化不计算
if(!this.isNeedSave){
return;
}
if(row!=null){
let singleVolume=parseFloat(row.length)*parseFloat(row.width)*parseFloat(row.height);
@ -1798,10 +1843,10 @@ methods: {
async handleCalcFeeItem(row){
if(row!=null){
if(row!=null && this.form.settlementWeight!=null){
// console.log("===>calcExp====>",row.calcExp);
// console.log("===>calcExp111==row==>",row);
if(row.calcExp){
if(row.calcExp&&row.calcExp!='undefined'){
let expr=row.calcExp;
// 如果公式包含变量,使用变量进行计算
if(expr.indexOf('s')!=-1 || expr.indexOf('d')!=-1){
@ -1816,10 +1861,13 @@ methods: {
}else{
let expr="s+w*d";
if(row.initialWeightFee>0||row.addWeightPrice>0){
expr=expr.replace("s",row.initialWeightFee);
expr=expr.replace("d",row.addWeightPrice);
expr=expr.replace("w",this.form.settlementWeight);
row.realFee=parseFloat(eval(expr)).toFixed(2);
// console.log("===>calcExp222==expr==>",expr);
// console.log("===>calcExp222==row==>",row);
}
}
@ -1859,10 +1907,6 @@ methods: {
},
// 计算体积重量
handleCalcVolumeWeight(){
// 初始化不计算
if(!this.isNeedSave){
return;
}
if( this.form.totalVolume
&& this.form.productType
@ -1882,10 +1926,6 @@ methods: {
},
// 计算结算重量
handleCalcSettlementWeight(){
// 初始化不计算
if(!this.isNeedSave){
return;
}
if(this.form.billWeight
&& this.form.volumeWeight
@ -1912,10 +1952,7 @@ methods: {
},
calcBillFee(){
// 初始化不计算
if(!this.isNeedSave){
return;
}
if(this.form.settlementWeight
&& this.form.productType
@ -2111,18 +2148,21 @@ methods: {
debounce(250, this.handleCargoQtyChange(row))
},
handleCargoQtyChange(row){
// console.log("====>handleCargoQtyChange===>")
this.handleGenSubbill();
this.handleInitGenGoods();
this.handleCalcVolume(row);
this.handleCalcVolumeDebounce(row);
},
deleteGoodsItem(row,index){
this.$confirm('确定删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.form.cargoList.splice(index,1)
this.handleCalcVolume(row);
this.handleCalcVolumeDebounce(row);
}).catch(() => {
})
},
@ -2131,7 +2171,7 @@ methods: {
newItem.cargoQty=1;
this.form.cargoList.splice(index+1, 0, newItem);
// this.form.cargoList.push(newItem);
this.handleCargoQtyChange();
this.handleCargoQtyChangeDebounce(row);
},
showLocalTime(){
@ -2154,6 +2194,7 @@ methods: {
this.form.billCode=response.data;
this.initGetTotalAvailablePag(this.form.sendSiteCode);
this.handleGenSubbill();
this.autoAjustBillCode();
});
}else{
this.form.billCode=""

View File

@ -393,27 +393,32 @@
</el-table-column>
<el-table-column prop="length" :label="$t('长(cm)')" align="center" width="60">
<template slot-scope="scope">
<el-input-number v-model="scope.row.length" @input="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+(scope.$index+1)" @keyup.native.enter="focusNextInput('input_'+(scope.$index+2)+'')" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
<!-- @input="(val)=>handleCalcVolumeDebounce(scope.row)" -->
<el-input-number v-model="scope.row.length" @blur="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+scope.$index+'_1'" @keyup.enter.native="focusNextInput('input_'+scope.$index+'_2')" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="width" :label="$t('宽(cm)')" align="center" width="60">
<template slot-scope="scope">
<el-input-number v-model="scope.row.width" @input="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+(scope.$index+2)" @keyup.native.enter="focusNextInput('input_'+(scope.$index+3)+'')" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
<!-- @input="(val)=>handleCalcVolumeDebounce(scope.row)" -->
<el-input-number v-model="scope.row.width" @blur="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+scope.$index+'_2'" @keyup.enter.native="focusNextInput('input_'+scope.$index+'_3')" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="height" :label="$t('高(cm)')" align="center" width="60">
<template slot-scope="scope">
<el-input-number v-model="scope.row.height" @input="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+(scope.$index+3)" @keyup.native.enter="focusNextInput('input_'+(scope.$index+4)+'')" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
<!-- @input="(val)=>handleCalcVolumeDebounce(scope.row)" -->
<el-input-number v-model="scope.row.height" @blur="(val)=>handleCalcVolumeDebounce(scope.row)" :ref="'input_'+scope.$index+'_3'" @keyup.enter.native="focusNextInput('input_'+scope.$index+'_4')" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="cargoQty" :label="$t('件数')" align="center" width="60">
<template slot-scope="scope">
<el-input-number v-model="scope.row.cargoQty" @blur="(val)=>handleCargoQtyChangeDebounce(scope.row)" :ref="'input_'+(scope.$index+4)" @keyup.enter.native="(val)=>handleCargoQtyChange(scope.row)" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
<!-- -->
<el-input-number v-model="scope.row.cargoQty" @blur="(val)=>handleCargoQtyChangeDebounce(scope.row)" :ref="'input_'+scope.$index+'_4'" @keyup.enter.native="(val)=>{ handleCargoQtyChangeDebounce(scope.row); focusNextInput('input_'+(scope.$index+1)+'_1')}" size="mini" placeholder="" :min="0" :controls="false" :precision="0"></el-input-number>
</template>
</el-table-column>
<el-table-column prop="volume" :label="$t('体积(m³)')" align="center" width="80">
<template slot-scope="scope">
<el-input-number v-model="scope.row.volume" size="mini" placeholder="" disabled :min="0" :controls="false" :precision="5"></el-input-number>
<span > {{scope.row.volume}}</span>
<!-- <el-input-number v-model="scope.row.volume" size="mini" placeholder="" disabled :min="0" :controls="false" :precision="5"></el-input-number> -->
</template>
</el-table-column>
@ -636,21 +641,21 @@
<el-table-column prop="initialWeightFee" :label="$t('首重费')" align="center" width="60">
<template slot-scope="scope">
<el-input-number v-if="form.blSpecialQuote==1" v-model="scope.row.initialWeightFee" @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.initialWeightFee" @blur="(val)=>handleCalcFeeItem(scope.row)" @keyup.enter.native="handleCalcFeeItem(scope.row)" size="mini" placeholder="" :min="0.00" :controls="false" :precision="2"></el-input-number>
<div v-else> {{scope.row.initialWeightFee}} </div>
</template>
</el-table-column>
<el-table-column prop="addWeightPrice" :label="$t('续重单价')" align="center" width="70">
<template slot-scope="scope">
<el-input-number v-if="form.blSpecialQuote==1" v-model="scope.row.addWeightPrice" @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.addWeightPrice" @blur="(val)=>handleCalcFeeItem(scope.row)" @keyup.enter.native="handleCalcFeeItem(scope.row)" size="mini" placeholder="" :min="0.00" :controls="false" :precision="2"></el-input-number>
<div v-else> {{scope.row.addWeightPrice}} </div>
</template>
</el-table-column>
<el-table-column prop="realFee" :label="$t('实收')" align="center" width="50">
<template slot-scope="scope">
<el-input-number v-if="form.blSpecialQuote==1 && scope.row.addWeightPrice==0 && scope.row.initialWeightFee==0" 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 && scope.row.addWeightPrice==0 && scope.row.initialWeightFee==0" v-model="scope.row.realFee" @blur="(val)=>handleCalcFeeItem(scope.row)" @keyup.enter.native="handleCalcFeeItem(scope.row)" size="mini" placeholder="" :min="0.00" :controls="false" :precision="2" ></el-input-number>
<div v-else> {{scope.row.realFee}} </div>
</template>
</el-table-column>
@ -863,7 +868,6 @@ data() {
addressType:null,
// 遮罩层
loading: true,
isNeedSave:false,
triggerCount:0,
action:null,
addFrom:null,
@ -1403,31 +1407,14 @@ methods: {
if(this.billCode && this.billCode!=undefined) {
this.loading = true;
getWaybillDetail(this.billCode).then(response => {
this.form = response.data;
if(this.$store.getters.ownerSiteCode!='88888'&&this.addFrom!='userOrder'){
if(this.$store.getters.ownerSiteCode!=this.form.sendSiteCode){
if(this.$store.getters.ownerSiteCode!=response.data.sendSiteCode){
this.$message.error('此单归属不允许修改');
return;
}
}
this.form.productTypeSelArr=[this.form.transLine,this.form.productType];
this.loading = false;
this.isNeedSave=true;
this.form.printTypeCheckList=[0,1,5]
this.form.destinationCountry=this.form.reciever.country;
if(this.form.packType&&this.form.packType!=''){
this.form.packType=this.form.packType.split(",");
}
if(!this.form.attachmentList){
this.form.attachmentList=[];
}
this.form = response.data;
if(this.form.lockFlag=="T"&&this.addFrom!='userOrder'){
this.$confirm(this.form.lockReason, '提示', {
confirmButtonText: '确认',
@ -1440,9 +1427,22 @@ methods: {
})
}
this.form.productTypeSelArr=[this.form.transLine,this.form.productType];
this.loading = false;
this.form.printTypeCheckList=[0,1,5]
this.form.destinationCountry=this.form.reciever.country;
if(this.form.packType&&this.form.packType!=''){
this.form.packType=this.form.packType.split(",");
}
if(!this.form.attachmentList){
this.form.attachmentList=[];
}
// 接单处理
if(this.addFrom=="userOrder"){
if(!this.form.feeItems){
this.form.feeItems=[];
@ -1450,18 +1450,17 @@ methods: {
if(!this.form.cargoList){
this.form.cargoList=[];
this.handleInitGenGoods();
}
// 获取可用运单数
this.initGetTotalAvailablePag(this.form.sendSiteCode);
this.startTimer();
}
});
}else{
// this.startTimer();
// this.form.sendDate = parseTime(new Date());
this.form.sendSiteCode=this.$store.getters.ownerSiteCode;
@ -1482,7 +1481,7 @@ methods: {
this.form.calcFeeType='1';
this.form.blMessage='1'
this.form.blAcceptMessage='1'
this.isNeedSave=true;
//
this.form.printTypeCheckList=[0,1,5],
// 获取可用运单数
@ -1491,6 +1490,8 @@ methods: {
this.handleInitGenGoods();
this.startTimer();
}
@ -1812,17 +1813,16 @@ methods: {
}
},
focusNextInput(nextRef) {
this.$refs[nextRef].focus()
// console.log("====focusNextInput===>",nextRef)
if(this.$refs[nextRef]){
this.$refs[nextRef].focus()
}
},
handleCalcVolumeDebounce(row){
// 控制触发频率
debounce(250, this.handleCalcVolume(row))
},
handleCalcVolume(row){
// 初始化不计算
if(!this.isNeedSave){
return;
}
if(row!=null){
let singleVolume=parseFloat(row.length)*parseFloat(row.width)*parseFloat(row.height);
@ -1843,10 +1843,10 @@ methods: {
async handleCalcFeeItem(row){
if(row!=null){
if(row!=null && this.form.settlementWeight!=null){
// console.log("===>calcExp====>",row.calcExp);
// console.log("===>calcExp111==row==>",row);
if(row.calcExp){
if(row.calcExp&&row.calcExp!='undefined'){
let expr=row.calcExp;
// 如果公式包含变量,使用变量进行计算
if(expr.indexOf('s')!=-1 || expr.indexOf('d')!=-1){
@ -1861,10 +1861,13 @@ methods: {
}else{
let expr="s+w*d";
if(row.initialWeightFee>0||row.addWeightPrice>0){
expr=expr.replace("s",row.initialWeightFee);
expr=expr.replace("d",row.addWeightPrice);
expr=expr.replace("w",this.form.settlementWeight);
row.realFee=parseFloat(eval(expr)).toFixed(2);
// console.log("===>calcExp222==expr==>",expr);
// console.log("===>calcExp222==row==>",row);
}
}
@ -1904,10 +1907,6 @@ methods: {
},
// 计算体积重量
handleCalcVolumeWeight(){
// 初始化不计算
if(!this.isNeedSave){
return;
}
if( this.form.totalVolume
&& this.form.productType
@ -1927,10 +1926,6 @@ methods: {
},
// 计算结算重量
handleCalcSettlementWeight(){
// 初始化不计算
if(!this.isNeedSave){
return;
}
if(this.form.billWeight
&& this.form.volumeWeight
@ -1957,10 +1952,7 @@ methods: {
},
calcBillFee(){
// 初始化不计算
if(!this.isNeedSave){
return;
}
if(this.form.settlementWeight
&& this.form.productType
@ -2156,18 +2148,21 @@ methods: {
debounce(250, this.handleCargoQtyChange(row))
},
handleCargoQtyChange(row){
// console.log("====>handleCargoQtyChange===>")
this.handleGenSubbill();
this.handleInitGenGoods();
this.handleCalcVolume(row);
this.handleCalcVolumeDebounce(row);
},
deleteGoodsItem(row,index){
this.$confirm('确定删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.form.cargoList.splice(index,1)
this.handleCalcVolume(row);
this.handleCalcVolumeDebounce(row);
}).catch(() => {
})
},
@ -2176,7 +2171,7 @@ methods: {
newItem.cargoQty=1;
this.form.cargoList.splice(index+1, 0, newItem);
// this.form.cargoList.push(newItem);
this.handleCargoQtyChange();
this.handleCargoQtyChangeDebounce(row);
},
showLocalTime(){