|
|
@ -797,6 +797,7 @@ export default { |
|
|
|
}) |
|
|
|
.catch((error) => console.log(error)); |
|
|
|
}, |
|
|
|
//抓卡車相關數據 |
|
|
|
async getInfoItem() { |
|
|
|
await this.$axios |
|
|
|
.get(`/trending/api/Onsite/InfoItem?Lang=${this.$i18n.localeProperties["langQuery"]}&ServiceID=${this.$route.params.id}`) |
|
|
@ -843,7 +844,7 @@ export default { |
|
|
|
bookNow() { |
|
|
|
let validators = this.$refs.ref_selectExhibition.validators(); |
|
|
|
|
|
|
|
console.log(validators); |
|
|
|
console.log(this.$refs.ref_selectExhibition); |
|
|
|
|
|
|
|
if(validators==false){ |
|
|
|
return false; |
|
|
@ -862,7 +863,6 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
let selectExhibitionData = this.$refs.ref_selectExhibition.formData; |
|
|
|
let selectExhibitionServiceData = []; |
|
|
|
if(this.selectExhibitionServiceList.length>0){ |
|
|
|
for(let i=0;i<this.selectExhibitionServiceList.length;i++){ |
|
|
|
let ref = eval("this.$refs.ref_selectExhibitionitem"+this.selectExhibitionServiceList[i].id)[0]; |
|
|
@ -989,33 +989,50 @@ export default { |
|
|
|
}, |
|
|
|
// 堆高機 |
|
|
|
stackerCostRules(data1,data2){ |
|
|
|
|
|
|
|
console.log(this.expenseRules) |
|
|
|
|
|
|
|
|
|
|
|
let price = 0; |
|
|
|
let tmpWeight = 0;//Number(data1.weight)/1000; |
|
|
|
// 材積重 長x寬x高/6000 得到噸 |
|
|
|
|
|
|
|
if((data1.length =="" && data1.width=="" && data1.height=="") && data1.weight!=""){ |
|
|
|
tmpWeight = Number(data1.weight)/1000; |
|
|
|
}else if((data1.length !="" && data1.width!="" && data1.height!="") && data1.weight==""){ |
|
|
|
tmpWeight = Number(data1.weight)/1000; // Number() => 將字串轉為數值!! |
|
|
|
} //長(沒值),寬(沒值),高(沒值) 但重量(有值) => 總噸數 = 重量(公斤)/1000!! |
|
|
|
|
|
|
|
else if((data1.length !="" && data1.width!="" && data1.height!="") && data1.weight==""){ |
|
|
|
tmpWeight = Number(data1.length)*Number(data1.width)*Number(data1.height)/6000/1000; |
|
|
|
}else if(data1.length !="" && data1.width!="" && data1.height!="" && data1.weight!=""){ |
|
|
|
} //長(有值),寬(有值),高(有值) 但重量(沒值) => 總噸數 = 長*寬*高/6000/1000!! |
|
|
|
|
|
|
|
//長(有值),寬(有值),高(有值) 但重量(有值) => 總噸數 = 長*寬*高/6000/1000!! |
|
|
|
else if(data1.length !="" && data1.width!="" && data1.height!="" && data1.weight!=""){ |
|
|
|
let volumeWeight = Number(data1.length)*Number(data1.width)*Number(data1.height)/6000/1000; |
|
|
|
// 比較誰大 |
|
|
|
// 比較誰大 (材積重與客戶給出的公斤重比較)!! |
|
|
|
if(volumeWeight>Number(data1.weight)/1000){ |
|
|
|
tmpWeight = volumeWeight; |
|
|
|
tmpWeight = volumeWeight; //若材積重 > 客戶給的公斤重 => 總噸數 = 材積重!! |
|
|
|
}else{ |
|
|
|
tmpWeight = Number(data1.weight)/1000; |
|
|
|
tmpWeight = Number(data1.weight)/1000; //若材積重 < 客戶給的公斤重 => 總噸數 = 客戶給的公斤重!! |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//判斷 => 若長 > 1000 或 寬 > 1000 或 高 > 330,則顯示提醒dialog!! |
|
|
|
if(Number(data1.length) > 1000 || Number(data1.width) > 1000 || Number(data1.height)>330){ |
|
|
|
this.dialog = true; |
|
|
|
this.openTimer(); |
|
|
|
return -1; |
|
|
|
} |
|
|
|
|
|
|
|
//防呆 => 若總噸數為0,則總金額為0 !! |
|
|
|
if(tmpWeight==0){ |
|
|
|
return price; |
|
|
|
} |
|
|
|
if(this.expenseRules.length>0){ |
|
|
|
for(let i=0;i<this.expenseRules.length;i++){ |
|
|
|
let subArr = this.expenseRules[i].StackerCostRules; |
|
|
|
|
|
|
|
console.log(subArr) |
|
|
|
|
|
|
|
if(this.expenseRules[i].Guid == data2.package_id && subArr.length>0){ |
|
|
|
for(let j=0;j<subArr.length;j++){ |
|
|
|
// 需要判斷按數量還是重量 |
|
|
|