This commit is contained in:
linfso 2024-05-22 14:21:10 +08:00
parent cd1415fe34
commit 057e588d2b
2 changed files with 71 additions and 120 deletions

View File

@ -29,11 +29,6 @@
type: String,
required: false
},
isInitiated:{
type: [Boolean,String],
required: false,
default:false
}
},
data() {
@ -43,34 +38,32 @@
};
},
watch: {
value(newVal) {
this.svalue = newVal;
},
svalue(newVal, oldVal) {
this.$emit("input", this.svalue);
},
countryCode(newVal, oldVal) {
this.queryData();
}
},
created() {
if(this.isInitiated || this.svalue!=null){
this.queryData();
}
this.queryData();
},
methods: {
onChange() {
console.log("xxxxx00000:"+this.svalue)
this.$emit("input", this.svalue);
this.$emit("onChange");
this.$emit("onChange",this.svalue);
},
queryData() {
queryData() {
this.optionItems =[];
if(this.countryCode==null && this.svalue==null){
if(!this.countryCode && !this.svalue){
return;
}
let queryParams = {countryCode:this.countryCode,regionType:1};
let queryParams = {
pageNum:1,
pageSize:100,
countryCode:this.countryCode,
regionType:1
};
listSimpleEmisRegion(queryParams).then(response => {
this.optionItems = response.rows;
});

View File

@ -297,7 +297,7 @@
<el-form-item label="国家地区" prop="reciever.province">
<div style="display:inline-flex">
<country-picker2 v-model="form.reciever.country" ></country-picker2>
<ProvincePicker2 v-model="form.reciever.province" :countryCode="form.reciever.country" style="margin-left:5px"></ProvincePicker2>
<ProvincePicker2 v-model="form.reciever.province" :countryCode="form.reciever.country" style="margin-left:5px" @onChange="handleCalcDestSite" ></ProvincePicker2>
<city-picker2 v-model="form.reciever.city" :parentCode="form.reciever.province" style="margin-left:5px"></city-picker2>
<district-picker2 v-model="form.reciever.county" :parentCode="form.reciever.city" style="margin-left:5px"></district-picker2>
</div>
@ -360,7 +360,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="实际重量" prop="billWeight" label-width="70px">
<el-input v-model="form.billWeight" @blur="reCalcSettlementWeight" style="text-align: right;min-width: 80px" placeholder="请输入实际重量" >
<el-input v-model="form.billWeight" @blur="handleCalcSettlementWeight" style="text-align: right;min-width: 80px" placeholder="请输入实际重量" >
<span slot="suffix">(kg)</span>
</el-input>
</el-form-item>
@ -397,17 +397,22 @@
</el-table-column>
<el-table-column prop="length" label="长(cm)" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.length" @input="(val)=>handleCalcVolume(val,scope.row)" size="mini" placeholder=""></el-input>
<el-input v-model="scope.row.length" @blur="(val)=>handleCalcVolume(scope.row)" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column prop="width" label="宽(cm)" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.width" @input="(val)=>handleCalcVolume(val,scope.row)" size="mini" placeholder=""></el-input>
<el-input v-model="scope.row.width" @blur="(val)=>handleCalcVolume(scope.row)" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column prop="height" label="高(cm)" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.height" @input="(val)=>handleCalcVolume(val,scope.row)" size="mini" placeholder=""></el-input>
<el-input v-model="scope.row.height" @blur="(val)=>handleCalcVolume(scope.row)" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column prop="cargoQty" label="件数" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.cargoQty" @blur="(val)=>handleCargoQtyChange(scope.row)" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<el-table-column prop="volume" label="体积(m³)" align="center" width="80">
@ -415,11 +420,6 @@
<el-input v-model="scope.row.volume" size="mini" placeholder="" disabled></el-input>
</template>
</el-table-column>
<el-table-column prop="cargoQty" label="件数" align="center" width="60">
<template slot-scope="scope">
<el-input v-model="scope.row.cargoQty" @blur="(val)=>handleCargoQtyChange(val,scope.row)" @keyup.enter.native="(val)=>handleCargoQtyChange(val,scope.row)" size="mini" placeholder=""></el-input>
</template>
</el-table-column>
<!-- @input="(val)=>handleCalcQty(val,scope.row)" -->
<!-- <el-table-column prop="goodsName" label="描述" align="center" width="60">
@ -462,7 +462,7 @@
<el-col :span="12">
<el-form-item label="总体积" prop="totalVolume" label-width="70px" >
<div style="">
<el-input v-model="form.totalVolume" style="text-align: right;width: 120px" placeholder="体积" >
<el-input v-model="form.totalVolume" @input="handleCalcVolumeWeight" style="text-align: right;width: 120px" placeholder="体积" >
<span slot="suffix">(m³)</span>
</el-input>
</div>
@ -472,7 +472,7 @@
<el-col :span="12">
<el-form-item label="体积重量" prop="volumeWeight" label-width="70px">
<el-input v-model="form.volumeWeight" placeholder="" disabled>
<el-input v-model="form.volumeWeight" @input="calcBillFee" placeholder="" disabled>
<span slot="suffix">(kg)</span>
</el-input>
</el-form-item>
@ -480,7 +480,7 @@
<el-col :span="12">
<el-form-item label="结算重量" prop="settlementWeight" label-width="70px">
<el-input v-model="form.settlementWeight" placeholder="" disabled >
<el-input v-model="form.settlementWeight" @input="calcBillFee" placeholder="" disabled >
<span slot="suffix">(kg)</span>
</el-input>
</el-form-item>
@ -598,20 +598,20 @@
<el-table-column prop="initialWeightFee" label="首重费" align="center" width="60">
<template slot-scope="scope">
<el-input v-if="form.blSpecialQuote==1" v-model="scope.row.initialWeightFee" @input="(val)=>handleCalcFeeItem(val,scope.row)" size="mini" placeholder=""></el-input>
<el-input v-if="form.blSpecialQuote==1" v-model="scope.row.initialWeightFee" @input="(val)=>handleCalcFeeItem(scope.row)" size="mini" placeholder=""></el-input>
<div v-else> {{scope.row.initialWeightFee}} </div>
</template>
</el-table-column>
<el-table-column prop="addWeightPrice" label="续重单价" align="center" width="70">
<template slot-scope="scope">
<el-input v-if="form.blSpecialQuote==1" v-model="scope.row.addWeightPrice" @input="(val)=>handleCalcFeeItem(val,scope.row)" size="mini" placeholder=""></el-input>
<el-input v-if="form.blSpecialQuote==1" v-model="scope.row.addWeightPrice" @input="(val)=>handleCalcFeeItem(scope.row)" size="mini" placeholder=""></el-input>
<div v-else> {{scope.row.addWeightPrice}} </div>
</template>
</el-table-column>
<el-table-column prop="realFee" label="实收" align="center" width="50">
<template slot-scope="scope">
<el-input v-if="form.blSpecialQuote==1" v-model="scope.row.realFee" @input="(val)=>handleCalcFeeItem(val,scope.row)" size="mini" placeholder=""></el-input>
<el-input v-if="form.blSpecialQuote==1" v-model="scope.row.realFee" @input="(val)=>handleCalcFeeItem(scope.row)" size="mini" placeholder=""></el-input>
<div v-else> {{scope.row.realFee}} </div>
</template>
</el-table-column>
@ -862,6 +862,9 @@ data() {
billCode: [
{ required: true, message: "运单号不能为空", trigger: ["blur",'change'] }
],
destinationCountry: [
{ required: true, message: "目的国不能为空", trigger: ["blur",'change'] }
],
reciever:{
name: [
{ required: true, message: "收货人名不能为空", trigger: "blur" }
@ -869,9 +872,6 @@ data() {
phone: [
{ required: true, message: "收货人手机号不能为空", trigger: "blur" }
],
destinationCountry: [
{ required: true, message: "目的国不能为空", trigger: ["blur",'change'] }
],
country: [
{ required: true, message: "收货人国家不能为空", trigger: ["blur",'change'] }
],
@ -993,51 +993,9 @@ data() {
}
};
},
computed:{
},
computed: {
},
watch: {
"form.reciever.province":{
handler (newValue, oldValue) {
// this.isNeedSave=true;
this.calcDestSite();
},
immediate: false,
deep: true,
},
"form.totalVolume":{
handler (newValue, oldValue) {
this.reCalcVolumeWeight();
},
deep: true
},
"form.volumeWeight":{
handler (newValue, oldValue) {
this.reCalcSettlementWeight();
},
immediate: false,
deep: true
},
"form.billWeight":{
handler (newValue, oldValue) {
this.reCalcSettlementWeight();
},
immediate: false,
deep: true
},
"form.calcFeeType":{
handler (newValue, oldValue) {
this.calcBillFee();
},
immediate: false,
deep: true
},
"form.settlementWeight":{
handler (newValue, oldValue) {
this.calcBillFee();
},
immediate: false,
deep: true
},
"form.parcelQty":{
handler (newValue, oldValue) {
this.handleGenSubbill();
@ -1061,12 +1019,7 @@ computed:{
},
},
activated(){
},
mouted(){
},
updated(){
},
created() {
this.billCode=this.$route.query.billCode;
this.action=this.$route.query.action;
@ -1252,16 +1205,13 @@ methods: {
lpadZero(val,len) {
return (new Array(len + 1).join('0') + val).slice(-len);
},
handleGenSubbill(value){
handleGenSubbill(){
if(this.form.blGenSubbill==1 && this.form.parcelQty > 0 && this.form.billCode){
let billSubCodeStr="";
for(let i=1;i<=this.form.parcelQty;i++){
for(let i=1;i<=this.form.parcelQty&&i<50;i++){
let subBillCode = this.form.billCode+""+this.lpadZero(i,4);
billSubCodeStr=billSubCodeStr+subBillCode+","
// console.log(billSubCodeStr);
}
// let billSubCodeStr = this.form.billCode+"["+this.lpadZero(1,3)+"-"+this.lpadZero(this.form.parcelQty,3)+"]";
// console.log(billSubCodeStr);
this.form.billCodeSub=billSubCodeStr;
}else{
this.form.billCodeSub=null;
@ -1293,6 +1243,7 @@ methods: {
this.form.sendSiteCode=this.$store.getters.ownerSiteCode;
this.form.sendSiteName=this.$store.getters.ownerSiteName;
this.form.customsEclaration='1';
this.form.customsClear='1';
// this.form.pickupMethod='2';
@ -1495,12 +1446,12 @@ methods: {
},
// 计算目的站点
calcDestSite(){
handleCalcDestSite(){
// 初始化不计算
if(!this.isNeedSave){
return;
}
// if(!this.isNeedSave){
// return;
// }
console.log("1111=>"+this.form.reciever.province)
let queryParams = {
province:this.form.reciever.province
};
@ -1518,27 +1469,30 @@ methods: {
});
}
},
handleCalcVolume(val,row){
handleCalcVolume(row){
// 初始化不计算
if(!this.isNeedSave){
return;
}
let totalVolume=0.0;
if(row!=null){
let volume=parseFloat(row.length)*parseFloat(row.width)*parseFloat(row.height)*parseFloat(row.cargoQty);
row.volume=parseFloat((volume/1000000).toFixed(5));
let singleVolume=parseFloat(row.length)*parseFloat(row.width)*parseFloat(row.height);
let singleTotalVolume=singleVolume*parseFloat(row.cargoQty);
row.volume=parseFloat( (singleTotalVolume/1000000).toFixed(5) );
}
let totalVolume=0.0;
this.form.cargoList.forEach(item=>{
totalVolume=totalVolume+item.volume;
});
this.form.totalVolume = parseFloat(totalVolume.toFixed(5));
this.handleCalcVolumeWeight();
},
handleCalcFeeItem(val,row){
handleCalcFeeItem(row){
if(row!=null){
@ -1558,7 +1512,7 @@ methods: {
this.form.freight = totalFee;
},
// 计算体积重量
reCalcVolumeWeight(){
handleCalcVolumeWeight(){
// 初始化不计算
if(!this.isNeedSave){
return;
@ -1574,12 +1528,15 @@ methods: {
calcVolumeWeight(postData).then(response => {
this.form.volumeWeight = response.data.volumeWeight;
// 计算结算重量
this.handleCalcSettlementWeight();
});
}
},
// 计算计算重量
reCalcSettlementWeight(){
// 计算结算重量
handleCalcSettlementWeight(){
// 初始化不计算
if(!this.isNeedSave){
return;
@ -1589,24 +1546,26 @@ methods: {
&& this.form.volumeWeight
&& this.form.productType
){
setTimeout(()=>{
let postData={
productType: this.form.productType,
volumeWeight: this.form.volumeWeight,
billWeight: this.form.billWeight,
}
// setTimeout(()=>{
// },1000);
calcSetteldWeight(postData).then(response => {
this.form.settlementWeight = response.data.settlementWeight;
this.form.feeWeight = this.form.settlementWeight ;
});
},1000);
let postData={
productType: this.form.productType,
volumeWeight: this.form.volumeWeight,
billWeight: this.form.billWeight,
}
calcSetteldWeight(postData).then(response => {
this.form.settlementWeight = response.data.settlementWeight;
this.form.feeWeight = this.form.settlementWeight ;
// 计算费用
this.calcBillFee();
});
}
},
calcBillFee(){
console.log("11111=>"+this.isNeedSave)
// 初始化不计算
if(!this.isNeedSave){
return;
@ -1738,8 +1697,7 @@ methods: {
this.form.cargoList=[];
}
},
handleCargoQtyChange(val,row){
console.log(row);
handleCargoQtyChange(row){
this.handleInitGenGoods();
this.handleCalcVolume(row);