+
-
+
-
+
-
-
-
-
-
+
-
+
-
-
-
-
+
+
+
-
-
货物信息
-
-
-
-
-
-
-
-
-
-
-
+
-
-
运输信息
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
其他信息
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
其他信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
@@ -16772,8 +16951,6 @@ document.querySelectorAll('.page').forEach(p=>p.classList.remove('active'));
const pg=document.getElementById('page-'+page);
if(pg)pg.classList.add('active');
currentPage=page;
-// Hide booking submit bar when leaving new-booking mode
-if(page!=='booking-detail'){var sb=document.getElementById('booking-submit-bar');if(sb)sb.style.display='none';}
// Update sidebar active
document.querySelectorAll('.sub-menu-item').forEach(i=>i.classList.remove('active'));
if(el&&el.classList.contains('sub-menu-item'))el.classList.add('active');
@@ -18061,55 +18238,27 @@ if(!document.webkitFullscreenElement&&document.body.classList.contains('dashboar
}
});
-// 订舱明细页 Tab 切换
+// 订舱明细页 Tab 切换(统一订舱页,无基本页签回退)
(function(){
- var bookingTabs = document.querySelectorAll('#page-booking-detail .tab-item[data-tab]');
+ // 统一订舱页只保留订舱、MB/L、HB/L 三个页签;不要再绑定已移除的基本信息页签。
+ var bookingTabs = document.querySelectorAll('#page-booking-detail .tab-item[data-tab="booking"], #page-booking-detail .tab-item[data-tab="mbl"], #page-booking-detail .tab-item[data-tab="hbl"]');
bookingTabs.forEach(function(tab){
tab.addEventListener('click', function(){
- // 高亮当前tab
- document.querySelectorAll('#page-booking-detail .tab-item').forEach(function(t){
+ bookingTabs.forEach(function(t){
t.style.background = '';
t.style.color = '';
});
this.style.background = '#52c41a';
this.style.color = '#fff';
-
- // 隐藏所有tab内容
var target = this.getAttribute('data-tab');
- document.querySelectorAll('.booking-tab-content').forEach(function(c){
+ if(['booking','mbl','hbl'].indexOf(target)===-1) return;
+ document.querySelectorAll('#page-booking-detail #booking-tab-booking, #page-booking-detail #booking-tab-mbl, #page-booking-detail #booking-tab-hbl').forEach(function(c){
c.style.display = 'none';
});
- var basicContent = document.getElementById('booking-tab-basic-content');
- if(basicContent) basicContent.style.display = '';
-
- // 显示对应内容:优先查找 booking-tab-{target},找不到则回退到基本五栏
var targetEl = target ? document.getElementById('booking-tab-' + target) : null;
- if(target && target !== 'basic' && targetEl){
- if(basicContent) basicContent.style.display = 'none';
- targetEl.style.display = '';
- } else {
- // basic / 空 / 无对应内容 → 显示五栏布局
- if(basicContent) basicContent.style.display = '';
- }
+ if(targetEl) targetEl.style.display = '';
});
});
-
- // 也给没有 data-tab 的 tab 加上点击高亮
- var allTabs = document.querySelectorAll('#page-booking-detail .tab-item');
- allTabs.forEach(function(tab){
- if(!tab.getAttribute('data-tab')){
- tab.setAttribute('data-tab','');
- tab.addEventListener('click', function(){
- document.querySelectorAll('#page-booking-detail .tab-item').forEach(function(t){
- t.style.background = ''; t.style.color = '';
- });
- this.style.background = '#52c41a'; this.style.color = '#fff';
- document.querySelectorAll('.booking-tab-content').forEach(function(c){ c.style.display = 'none'; });
- var bc = document.getElementById('booking-tab-basic-content');
- if(bc) bc.style.display = '';
- });
- }
- });
})();
// 新增订舱:复用编辑页(订舱明细)布局
@@ -18118,8 +18267,8 @@ function openNewBooking(){
var t=document.getElementById('booking-detail-navtitle');
if(t) t.textContent='新增订舱';
var pg=document.getElementById('page-booking-detail');
- var basic=pg&&pg.querySelector('.tab-item[data-tab="basic"]');
- if(basic) basic.click();
+ var booking=pg&&pg.querySelector('.tab-item[data-tab="booking"]');
+ if(booking) booking.click();
window.scrollTo(0,0);
var sb=document.getElementById('booking-submit-bar');
if(sb) sb.style.display='flex';
@@ -18131,12 +18280,310 @@ function openBookingDetail(el){
var t=document.getElementById('booking-detail-navtitle');
if(t) t.textContent='订舱明细 BYSE2607004';
var pg=document.getElementById('page-booking-detail');
- var basic=pg&&pg.querySelector('.tab-item[data-tab="basic"]');
- if(basic) basic.click();
+ var booking=pg&&pg.querySelector('.tab-item[data-tab="booking"]');
+ if(booking) booking.click();
var sb=document.getElementById('booking-submit-bar');
if(sb) sb.style.display='none';
}
+// 订舱列表打印数据
+const bookingPrintData={
+ BYSE2607044:{
+ jobNo:'BYSE2607044',customer:'浙江柏悦贸易有限公司(香港)',
+ shipper:'ZHEJIANG BAIYUE TRADE CO., LIMITED\nROOM 8613, NO. 1399, CHOUZHOU NORTH ROAD, FUTIAN\nSTREET, YIWU CITY, ZHEJIANG PROVINCE\nTEL: 0579-85695557',
+ consignee:'SANATRK FOR IMPORT AND TRADE OF AUTO SPARE PARTS\n3 ATIA ELZEKRY ST- OMAR EBN ELKHTAB CITY SHOBRA\nELKHIMA QALYUBIA SECOND-OWNER / MENA MATTA GABALLA\nMATTA\nTEL: 01225672354',
+ notify:'SAME AS CONSIGNEE',pic:'苏天雅',tel:'',documentNo:'WHYO74G504054',
+ etd:'2026/07/24',cutoff:'2026/07/20',vessel:'WAN HAI 622',voyage:'W027',
+ pol:'NINGBO',pod:'EL DEKHEILA',delivery:'EL DEKHEILA',serviceTerm:'CY-CY',
+ freightTerm:'FREIGHT PREPAID',carrier:'万海航运(香港)股份有限公司',
+ bookingAgent:'宁波胜泽远航国际物流有限公司',marks:'N/M',packages:'700',
+ packageType:'PACKAGES',goods:'CAR ACCESSORIES\nACID: 4120661061019510011\n申请目的港 21 天免用箱',
+ grossWeight:'28000.00 KGS',measurement:'28.000 CBM',container:'1*20GP',
+ hsCode:'870899',packageWords:'SAY SEVEN HUNDRED PACKAGES ONLY.',
+ blNo:'WHYO74G504054',onBoardDate:'24-JUL-2026',placeOfIssue:'NINGBO',
+ remark:'多个箱子请分别提供分箱数、分箱品名,若未指出默认品名混装。\n请在 ENS/AMS 规定时间内确认好提单内容。',printDate:'2026 年 07 月 16 日'
+ },
+ BYSE2607005:{
+ jobNo:'BYSE2607005',customer:'付银装',
+ shipper:'ZHEJIANG BAIYUE TRADE CO., LIMITED\nROOM 8613, NO. 1399, CHOUZHOU NORTH ROAD, FUTIAN\nSTREET, YIWU CITY, ZHEJIANG PROVINCE\nTEL: 0579-85695557',
+ consignee:'RUDMAR INTERNATIONAL LOGISTICS GMBH\nHAMBURG, GERMANY\nTEL: +49 40 2388 1600',
+ notify:'SAME AS CONSIGNEE',pic:'苏天雅',tel:'',documentNo:'CSSGU100TW',
+ etd:'2026/07/07',cutoff:'2026/07/03',vessel:'OOCL PORTUGAL',voyage:'00TW',
+ pol:'NINGBO',pod:'HAMBURG',delivery:'HAMBURG',serviceTerm:'CY-CY',
+ freightTerm:'FREIGHT PREPAID',carrier:'中远集运',
+ bookingAgent:'宁波泽远通国际物流有限公司',marks:'N/M',packages:'560',
+ packageType:'CARTONS',goods:'GARMENTS\nHS CODE: 620343',
+ grossWeight:'18200.00 KGS',measurement:'55.000 CBM',container:'1*40GP',
+ hsCode:'620343',packageWords:'SAY FIVE HUNDRED AND SIXTY CARTONS ONLY.',
+ blNo:'CSSGU100TW',onBoardDate:'07-JUL-2026',placeOfIssue:'NINGBO',
+ remark:'请核对收发货人、港口及件重尺信息。',printDate:'2026 年 07 月 03 日'
+ },
+ BYSE2607006:{
+ jobNo:'BYSE2607006',customer:'逸特',
+ shipper:'ZHEJIANG BAIYUE TRADE CO., LIMITED\nROOM 8613, NO. 1399, CHOUZHOU NORTH ROAD, FUTIAN\nSTREET, YIWU CITY, ZHEJIANG PROVINCE\nTEL: 0579-85695557',
+ consignee:'ALMONDSSEN INTERNATIONAL TRADING\nDAMIETTA, EGYPT\nTEL: +20 57 240 8891',
+ notify:'SAME AS CONSIGNEE',pic:'苏天雅',tel:'',documentNo:'YAMU7703SW',
+ etd:'2026/07/06',cutoff:'2026/07/02',vessel:'YM WREATH',voyage:'03SW',
+ pol:'NINGBO',pod:'DAMIETTA',delivery:'DAMIETTA',serviceTerm:'CY-CY',
+ freightTerm:'FREIGHT PREPAID',carrier:'阳明海运',
+ bookingAgent:'宁波泽远通国际物流有限公司',marks:'N/M',packages:'860',
+ packageType:'PACKAGES',goods:'HOUSEHOLD ARTICLES\nHS CODE: 392490',
+ grossWeight:'24500.00 KGS',measurement:'67.000 CBM',container:'1*40HC',
+ hsCode:'392490',packageWords:'SAY EIGHT HUNDRED AND SIXTY PACKAGES ONLY.',
+ blNo:'YAMU7703SW',onBoardDate:'07-JUL-2026',placeOfIssue:'NINGBO',
+ remark:'提单内容确认后如有修改,请及时联系操作员。',printDate:'2026 年 07 月 02 日'
+ },
+ BYSE2607007:{
+ jobNo:'BYSE2607007',customer:'曼博无锡配送仓库',
+ shipper:'ZHEJIANG BAIYUE TRADE CO., LIMITED\nROOM 8613, NO. 1399, CHOUZHOU NORTH ROAD, FUTIAN\nSTREET, YIWU CITY, ZHEJIANG PROVINCE\nTEL: 0579-85695557',
+ consignee:'AL EMAN FOR IMPORT AND EXPORT\nDAMIETTA, EGYPT\nTEL: +20 57 221 9038',
+ notify:'SAME AS CONSIGNEE',pic:'苏天雅',tel:'',documentNo:'CANU2903SW',
+ etd:'2026/07/08',cutoff:'2026/07/05',vessel:'YM WREATH',voyage:'03SW',
+ pol:'NINGBO',pod:'DAMIETTA',delivery:'DAMIETTA',serviceTerm:'CY-CY',
+ freightTerm:'FREIGHT PREPAID',carrier:'现代商船',
+ bookingAgent:'德利物流',marks:'N/M',packages:'420',
+ packageType:'CARTONS',goods:'AUTO PARTS\nHS CODE: 870899',
+ grossWeight:'13600.00 KGS',measurement:'29.000 CBM',container:'1*20GP',
+ hsCode:'870899',packageWords:'SAY FOUR HUNDRED AND TWENTY CARTONS ONLY.',
+ blNo:'CANU2903SW',onBoardDate:'08-JUL-2026',placeOfIssue:'NINGBO',
+ remark:'请核对装船日期及目的港信息。',printDate:'2026 年 07 月 05 日'
+ }
+};
+
+function escapePrintHtml(value){
+ return String(value==null?'':value)
+ .replace(/&/g,'&')
+ .replace(//g,'>')
+ .replace(/"/g,'"')
+ .replace(/'/g,''');
+}
+function printText(value){
+ return escapePrintHtml(value).replace(/\n/g,'
');
+}
+
+function renderShippingInstruction(data){
+ const e=escapePrintHtml,t=printText;
+ return `
+
+
+
+ Shipper (Full Name & Address)(托运人):${t(data.shipper)}
+ Consignee(收货人):${t(data.consignee)}
+ Notify Party(通知人):${t(data.notify)}
+
+
+
+
+
Ocean Vessel/Voy(船名航次):${e(data.vessel)} / ${e(data.voyage)}
+
Port of Loading(起运港):${e(data.pol)}
+
Port of Discharge(卸货港):${e(data.pod)}
+
Place of Delivery(交货地):${e(data.delivery)}
+
+
+
+ Marks & Nos (标志和号码) |
+ Quantity & Packaging (件数及包装) |
+ Description of Goods(品名) |
+ Gross Weight (Kilos) 毛重(公斤) |
+ Measurement (CBM) 体积(立方米) |
+
+
+ | ${t(data.marks)} |
+ ${e(data.packages)} ${e(data.packageType)} |
+ ${t(data.goods)} |
+ ${e(data.grossWeight)} |
+ ${e(data.measurement)} |
+
+
+ Total Packages (in words)(件数大写):${e(data.packageWords)}
+
+ 打印于:${e(data.printDate)}
+ `;
+}
+
+function renderBillConfirmation(data){
+ const e=escapePrintHtml,t=printText;
+ return `
+ 提单确认件
+
+
+ ${t(data.shipper)}
+ ${t(data.consignee)}
+ ${t(data.notify)}
+
+
+
+ ${e(data.vessel)} ${e(data.voyage)}
+
+ ${e(data.pol)}${e(data.pod)}
+ ${e(data.pod)}${e(data.delivery)}${e(data.serviceTerm)}
+
+
+
${e(data.marks)}
+
${e(data.packages)} ${e(data.packageType)}
+
SAID TO CONTAIN(S)
${t(data.goods)}
HS CODE ${e(data.hsCode)}
+
${e(data.grossWeight)}
+
${e(data.measurement)}
+
+
+
${e(data.freightTerm)}
SHPR’S LOAD, COUNT AND SEAL
${e(data.container)}
+
SHIPPED ON BOARD:
${e(data.onBoardDate)}
+
D R A F T
+
+ ${e(data.packageWords)}
+ ${e(data.documentNo)} / ${e(data.container)} / ${e(data.packages)}${e(data.packageType)} / ${e(data.grossWeight)} / ${e(data.measurement)}
+ 备注:${t(data.remark)}
+
+ `;
+}
+
+let currentBookingPrintId='';
+let currentBookingPrintType='';
+
+function openBookingPrint(id){
+ const data=bookingPrintData[id];
+ if(!data){
+ showToast('未找到该订舱记录','error');
+ return;
+ }
+ currentBookingPrintId=id;
+ currentBookingPrintType='';
+ const current=document.getElementById('booking-print-current-id');
+ if(current)current.textContent=id;
+ document.querySelectorAll('input[name="booking-print-type"]').forEach(function(input){input.checked=false;});
+ showModal('modal-booking-print-select');
+ setTimeout(function(){
+ const first=document.querySelector('input[name="booking-print-type"]');
+ if(first)first.focus();
+ },0);
+}
+
+function openBookingPrintPreview(){
+ const selected=document.querySelector('input[name="booking-print-type"]:checked');
+ if(!selected){
+ showToast('请选择打印单据类型','warning');
+ return;
+ }
+ const data=bookingPrintData[currentBookingPrintId];
+ if(!data){
+ closeBookingPrintDialogs();
+ showToast('未找到该订舱记录','error');
+ return;
+ }
+ currentBookingPrintType=selected.value;
+ const sheet=document.getElementById('booking-print-sheet');
+ const title=document.getElementById('booking-print-preview-title');
+ if(!sheet||!title)return;
+ const isShipping=currentBookingPrintType==='shipping';
+ sheet.innerHTML=isShipping?renderShippingInstruction(data):renderBillConfirmation(data);
+ title.textContent=(isShipping?'出口货物托运单':'提单确认件')+' · '+data.jobNo;
+ hideModal('modal-booking-print-select');
+ showModal('modal-booking-print-preview');
+ requestAnimationFrame(fitBookingPrintPreview);
+}
+
+function fitBookingPrintPreview(){
+ const viewport=document.querySelector('.booking-print-preview-scroll');
+ const stage=document.getElementById('booking-print-stage');
+ const sheet=document.querySelector('#booking-print-sheet .booking-print-sheet');
+ if(!viewport||!stage||!sheet)return;
+ sheet.style.transform='none';
+ const naturalWidth=sheet.offsetWidth;
+ const naturalHeight=sheet.offsetHeight;
+ const viewportStyle=getComputedStyle(viewport);
+ const horizontalPadding=parseFloat(viewportStyle.paddingLeft)+parseFloat(viewportStyle.paddingRight);
+ const scale=Math.min(1,Math.max(.35,(viewport.clientWidth-horizontalPadding)/naturalWidth));
+ sheet.style.transform='scale('+scale+')';
+ stage.style.width=Math.round(naturalWidth*scale)+'px';
+ stage.style.height=Math.round(naturalHeight*scale)+'px';
+}
+
+function backToBookingPrintSelect(){
+ hideModal('modal-booking-print-preview');
+ showModal('modal-booking-print-select');
+}
+
+function closeBookingPrintDialogs(){
+ hideModal('modal-booking-print-select');
+ hideModal('modal-booking-print-preview');
+ const sheet=document.getElementById('booking-print-sheet');
+ if(sheet)sheet.innerHTML='';
+ currentBookingPrintId='';
+ currentBookingPrintType='';
+}
+
+function printBookingDocument(){
+ if(!currentBookingPrintId||!currentBookingPrintType){
+ showToast('请先选择并预览打印单据','warning');
+ return;
+ }
+ window.print();
+}
+
+window.addEventListener('resize',function(){
+ if(document.getElementById('modal-booking-print-preview')?.classList.contains('show')){
+ fitBookingPrintPreview();
+ }
+});
+document.addEventListener('keydown',function(event){
+ if(event.key==='Escape'&&(document.getElementById('modal-booking-print-preview')?.classList.contains('show')||document.getElementById('modal-booking-print-select')?.classList.contains('show'))){
+ closeBookingPrintDialogs();
+ }
+});
+
+// 订舱统一页操作
+function copyBooking(){
+ showToast('订舱信息已复制','success');
+}
+function returnBooking(){
+ showToast('已退关','info');
+}
+function printBooking(){
+ window.print();
+}
+function saveBooking(){
+ showToast('订舱信息保存成功','success');
+ switchPage('booking-list');
+}
+function cancelBooking(){
+ switchPage('booking-list');
+}
+
// ========== 供应商中心 ==========
var supplierCatNames={booking:'订舱',customs:'报关',trucking:'拖车',cert:'证书'};