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

View File

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

View File

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

View File

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

View File

@ -393,27 +393,32 @@
</el-table-column> </el-table-column>
<el-table-column prop="length" :label="$t('长(cm)')" align="center" width="60"> <el-table-column prop="length" :label="$t('长(cm)')" align="center" width="60">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column prop="width" :label="$t('宽(cm)')" align="center" width="60"> <el-table-column prop="width" :label="$t('宽(cm)')" align="center" width="60">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column prop="height" :label="$t('高(cm)')" align="center" width="60"> <el-table-column prop="height" :label="$t('高(cm)')" align="center" width="60">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column prop="cargoQty" :label="$t('件数')" align="center" width="60"> <el-table-column prop="cargoQty" :label="$t('件数')" align="center" width="60">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
<el-table-column prop="volume" :label="$t('体积(m³)')" align="center" width="80"> <el-table-column prop="volume" :label="$t('体积(m³)')" align="center" width="80">
<template slot-scope="scope"> <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> </template>
</el-table-column> </el-table-column>
@ -636,21 +641,21 @@
<el-table-column prop="initialWeightFee" :label="$t('首重费')" align="center" width="60"> <el-table-column prop="initialWeightFee" :label="$t('首重费')" align="center" width="60">
<template slot-scope="scope"> <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> <div v-else> {{scope.row.initialWeightFee}} </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="addWeightPrice" :label="$t('续重单价')" align="center" width="70"> <el-table-column prop="addWeightPrice" :label="$t('续重单价')" align="center" width="70">
<template slot-scope="scope"> <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> <div v-else> {{scope.row.addWeightPrice}} </div>
</template> </template>
</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 && 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> <div v-else> {{scope.row.realFee}} </div>
</template> </template>
</el-table-column> </el-table-column>
@ -863,7 +868,6 @@ data() {
addressType:null, addressType:null,
// 遮罩层 // 遮罩层
loading: true, loading: true,
isNeedSave:false,
triggerCount:0, triggerCount:0,
action:null, action:null,
addFrom:null, addFrom:null,
@ -876,6 +880,8 @@ data() {
openSelectAddress:false, openSelectAddress:false,
printerStatus:0, printerStatus:0,
origBillCode:null,
// 可用面单数 // 可用面单数
totalAvailablePag:{ totalAvailablePag:{
mainHasCnt:0, mainHasCnt:0,
@ -1125,12 +1131,12 @@ methods: {
// printDataList.push(customerItem); // printDataList.push(customerItem);
// 主单 // 主单
// let mainBillItem ={ let mainBillItem ={
// "tplCode":"TAN-GM-130", "tplCode":"TAN-GM-130",
// "printerName":this.$refs.tanexPrinter.getDefaultPrinter(), "printerName":this.$refs.tanexPrinter.getDefaultPrinter(),
// "orderList":orderList.toString() "orderList":orderList.toString()
// } }
// printDataList.push(mainBillItem); printDataList.push(mainBillItem);
@ -1275,8 +1281,51 @@ methods: {
onDestCountryChange(item){ onDestCountryChange(item){
if(item){ if(item){
this.form.reciever.country=item.code; 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(){ onPaymentTypeChange(){
// 非月结清空月结客户选择 // 非月结清空月结客户选择
if(this.form.paymentType == '1' || if(this.form.paymentType == '1' ||
@ -1358,31 +1407,14 @@ methods: {
if(this.billCode && this.billCode!=undefined) { if(this.billCode && this.billCode!=undefined) {
this.loading = true; this.loading = true;
getWaybillDetail(this.billCode).then(response => { getWaybillDetail(this.billCode).then(response => {
this.form = response.data;
if(this.$store.getters.ownerSiteCode!='88888'&&this.addFrom!='userOrder'){ 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('此单归属不允许修改'); this.$message.error('此单归属不允许修改');
return; return;
} }
} }
this.form.productTypeSelArr=[this.form.transLine,this.form.productType]; this.form = response.data;
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=[];
}
if(this.form.lockFlag=="T"&&this.addFrom!='userOrder'){ if(this.form.lockFlag=="T"&&this.addFrom!='userOrder'){
this.$confirm(this.form.lockReason, '提示', { this.$confirm(this.form.lockReason, '提示', {
confirmButtonText: '确认', 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.addFrom=="userOrder"){
if(!this.form.feeItems){ if(!this.form.feeItems){
this.form.feeItems=[]; this.form.feeItems=[];
@ -1405,18 +1450,17 @@ methods: {
if(!this.form.cargoList){ if(!this.form.cargoList){
this.form.cargoList=[]; this.form.cargoList=[];
this.handleInitGenGoods();
} }
// 获取可用运单数 // 获取可用运单数
this.initGetTotalAvailablePag(this.form.sendSiteCode); this.initGetTotalAvailablePag(this.form.sendSiteCode);
this.startTimer(); this.startTimer();
} }
}); });
}else{ }else{
// this.startTimer(); // this.startTimer();
// this.form.sendDate = parseTime(new Date()); // this.form.sendDate = parseTime(new Date());
this.form.sendSiteCode=this.$store.getters.ownerSiteCode; this.form.sendSiteCode=this.$store.getters.ownerSiteCode;
@ -1437,7 +1481,7 @@ methods: {
this.form.calcFeeType='1'; this.form.calcFeeType='1';
this.form.blMessage='1' this.form.blMessage='1'
this.form.blAcceptMessage='1' this.form.blAcceptMessage='1'
this.isNeedSave=true; //
this.form.printTypeCheckList=[0,1,5], this.form.printTypeCheckList=[0,1,5],
// 获取可用运单数 // 获取可用运单数
@ -1446,6 +1490,8 @@ methods: {
this.handleInitGenGoods(); this.handleInitGenGoods();
this.startTimer(); this.startTimer();
} }
@ -1767,17 +1813,16 @@ methods: {
} }
}, },
focusNextInput(nextRef) { focusNextInput(nextRef) {
// console.log("====focusNextInput===>",nextRef)
if(this.$refs[nextRef]){
this.$refs[nextRef].focus() this.$refs[nextRef].focus()
}
}, },
handleCalcVolumeDebounce(row){ handleCalcVolumeDebounce(row){
// 控制触发频率 // 控制触发频率
debounce(250, this.handleCalcVolume(row)) debounce(250, this.handleCalcVolume(row))
}, },
handleCalcVolume(row){ handleCalcVolume(row){
// 初始化不计算
if(!this.isNeedSave){
return;
}
if(row!=null){ if(row!=null){
let singleVolume=parseFloat(row.length)*parseFloat(row.width)*parseFloat(row.height); let singleVolume=parseFloat(row.length)*parseFloat(row.width)*parseFloat(row.height);
@ -1798,10 +1843,10 @@ methods: {
async handleCalcFeeItem(row){ async handleCalcFeeItem(row){
if(row!=null){ if(row!=null && this.form.settlementWeight!=null){
// console.log("===>calcExp====>",row.calcExp); // console.log("===>calcExp====>",row.calcExp);
// console.log("===>calcExp111==row==>",row); // console.log("===>calcExp111==row==>",row);
if(row.calcExp){ if(row.calcExp&&row.calcExp!='undefined'){
let expr=row.calcExp; let expr=row.calcExp;
// 如果公式包含变量,使用变量进行计算 // 如果公式包含变量,使用变量进行计算
if(expr.indexOf('s')!=-1 || expr.indexOf('d')!=-1){ if(expr.indexOf('s')!=-1 || expr.indexOf('d')!=-1){
@ -1816,10 +1861,13 @@ methods: {
}else{ }else{
let expr="s+w*d"; let expr="s+w*d";
if(row.initialWeightFee>0||row.addWeightPrice>0){ if(row.initialWeightFee>0||row.addWeightPrice>0){
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);
row.realFee=parseFloat(eval(expr)).toFixed(2); row.realFee=parseFloat(eval(expr)).toFixed(2);
// console.log("===>calcExp222==expr==>",expr);
// console.log("===>calcExp222==row==>",row);
} }
} }
@ -1859,10 +1907,6 @@ methods: {
}, },
// 计算体积重量 // 计算体积重量
handleCalcVolumeWeight(){ handleCalcVolumeWeight(){
// 初始化不计算
if(!this.isNeedSave){
return;
}
if( this.form.totalVolume if( this.form.totalVolume
&& this.form.productType && this.form.productType
@ -1882,10 +1926,6 @@ methods: {
}, },
// 计算结算重量 // 计算结算重量
handleCalcSettlementWeight(){ handleCalcSettlementWeight(){
// 初始化不计算
if(!this.isNeedSave){
return;
}
if(this.form.billWeight if(this.form.billWeight
&& this.form.volumeWeight && this.form.volumeWeight
@ -1912,10 +1952,7 @@ methods: {
}, },
calcBillFee(){ calcBillFee(){
// 初始化不计算
if(!this.isNeedSave){
return;
}
if(this.form.settlementWeight if(this.form.settlementWeight
&& this.form.productType && this.form.productType
@ -2111,18 +2148,21 @@ methods: {
debounce(250, this.handleCargoQtyChange(row)) debounce(250, this.handleCargoQtyChange(row))
}, },
handleCargoQtyChange(row){ handleCargoQtyChange(row){
// console.log("====>handleCargoQtyChange===>")
this.handleGenSubbill(); this.handleGenSubbill();
this.handleInitGenGoods(); this.handleInitGenGoods();
this.handleCalcVolume(row); this.handleCalcVolumeDebounce(row);
}, },
deleteGoodsItem(row,index){ deleteGoodsItem(row,index){
this.$confirm('确定删除?', '提示', { this.$confirm('确定删除?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.form.cargoList.splice(index,1) this.form.cargoList.splice(index,1)
this.handleCalcVolume(row); this.handleCalcVolumeDebounce(row);
}).catch(() => { }).catch(() => {
}) })
}, },
@ -2131,7 +2171,7 @@ methods: {
newItem.cargoQty=1; newItem.cargoQty=1;
this.form.cargoList.splice(index+1, 0, newItem); this.form.cargoList.splice(index+1, 0, newItem);
// this.form.cargoList.push(newItem); // this.form.cargoList.push(newItem);
this.handleCargoQtyChange(); this.handleCargoQtyChangeDebounce(row);
}, },
showLocalTime(){ showLocalTime(){
@ -2154,6 +2194,7 @@ methods: {
this.form.billCode=response.data; this.form.billCode=response.data;
this.initGetTotalAvailablePag(this.form.sendSiteCode); this.initGetTotalAvailablePag(this.form.sendSiteCode);
this.handleGenSubbill(); this.handleGenSubbill();
this.autoAjustBillCode();
}); });
}else{ }else{
this.form.billCode="" this.form.billCode=""

View File

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