diff --git a/悦/货代SAAS平台后台/货代SaaS平台原型.html b/悦/货代SAAS平台后台/货代SaaS平台原型.html
index cdbf856..1b38062 100644
--- a/悦/货代SAAS平台后台/货代SaaS平台原型.html
+++ b/悦/货代SAAS平台后台/货代SaaS平台原型.html
@@ -680,13 +680,26 @@ body.dashboard-fullscreen #page-dashboard table:has(>thead)>tbody>tr>td{backgrou
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
- | FBA仓库 |
- 华东仓(义乌) 不包税(/CBM) |
- 华东仓(义乌) 包税(/KG) |
- 华南仓(深圳) 包税(/KG) |
- 参考时效 (船开后) |
- 最晚进仓时间 |
- 船期 |
- 附加费 |
- 备注 |
- 操作 |
-
-
-
-
-
+
@@ -5197,6 +5230,26 @@ body.dashboard-fullscreen #page-dashboard table:has(>thead)>tbody>tr>td{backgrou
| 凭证号 | 业务类型 | 关联运单 | 金额 | 会计科目 | 同步时间 | 状态 | 操作 |
|---|
+
+
+
+
首页>财务管理>客户账户
+
+
+
+
| 操作 | 客户基本信息 | 客户编号 | 联系人 | 联系电话 | 实际余额 | 冻结金额 | 可用余额 | 账户状态 | 最后变动时间 |
|---|
+
+
+
+
@@ -6299,6 +6352,15 @@ body.dashboard-fullscreen #page-dashboard table:has(>thead)>tbody>tr>td{backgrou
+
+
@@ -7594,20 +7656,40 @@ GARMENTS( MEN'S COTTON PADDED CLOTHES))
+
-
首页 > FBA退货 > 入库单
+
首页 > 海外仓 > 入库单
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
| 入库单号 |
BOL单号 |
+类型 |
海外仓 |
货主 |
总箱数 |
@@ -10614,6 +10696,29 @@ const cashflowData = [
{no:'CF20260602002',type:'收款',party:'速达供应链',amt:45000,cur:'CNY',balance:12520000,date:'2026-06-02',remark:'6月部分预付款'},
];
+const customerAccountData=[
+{id:'CA001',code:'KH20260018',name:'杭州积乐贸易有限公司',shortName:'积乐贸易',contact:'陈晓敏',phone:'138****6812',email:'finance@jile.com',balance:126580.50,frozen:8500,status:'正常',creditLevel:'A',settlement:'预充值',lastChange:'2026-08-05 10:26'},
+{id:'CA002',code:'KH20260026',name:'义乌卓越科技有限公司',shortName:'卓越科技',contact:'李伟',phone:'137****2935',email:'account@zhuoyue.com',balance:68720,frozen:0,status:'正常',creditLevel:'A',settlement:'预充值',lastChange:'2026-08-04 16:42'},
+{id:'CA003',code:'KH20260031',name:'岩盛进出口有限公司',shortName:'岩盛进出口',contact:'王珊',phone:'159****1066',email:'wangshan@yansheng.com',balance:18350.80,frozen:3200,status:'正常',creditLevel:'B',settlement:'预充值',lastChange:'2026-08-03 14:18'},
+{id:'CA004',code:'KH20260045',name:'宁波海联进出口有限公司',shortName:'宁波海联',contact:'周强',phone:'136****7258',email:'finance@hailian.com',balance:-2680,frozen:0,status:'冻结',creditLevel:'C',settlement:'授信月结',lastChange:'2026-08-02 11:05'},
+{id:'CA005',code:'KH20260052',name:'深圳速达供应链有限公司',shortName:'深圳速达',contact:'赵敏',phone:'135****8801',email:'zhaomin@suda.com',balance:0,frozen:0,status:'正常',creditLevel:'B',settlement:'预充值',lastChange:'2026-07-31 17:20'}
+];
+const customerAccountTransactions={
+CA001:[
+{no:'AC202608050018',time:'2026-08-05 10:26',type:'出库',order:'OUT20260805012',income:0,expense:2860,balance:126580.50,operator:'系统',remark:'一件代发出库费用'},
+{no:'AC202608040031',time:'2026-08-04 15:12',type:'仓储费用',order:'STO202607-018',income:0,expense:4250,balance:129440.50,operator:'系统',remark:'2026年7月仓储费用'},
+{no:'AC202608030026',time:'2026-08-03 11:08',type:'贴牌',order:'LBL20260803008',income:0,expense:1260,balance:133690.50,operator:'系统',remark:'SKU贴牌加工 420件'},
+{no:'AC202608010006',time:'2026-08-01 09:35',type:'充值',order:'RC20260801006',income:50000,expense:0,balance:134950.50,operator:'财务-李芳',remark:'银行转账充值'},
+{no:'AC202607300042',time:'2026-07-30 16:20',type:'自提',order:'PICK2026073003',income:0,expense:680,balance:84950.50,operator:'系统',remark:'客户自提操作费'},
+{no:'AC202607280019',time:'2026-07-28 13:46',type:'暂扣',order:'HOLD2026072811',income:0,expense:1500,balance:85630.50,operator:'客服-张燕',remark:'异常货物暂扣处理'},
+{no:'AC202607250014',time:'2026-07-25 10:12',type:'弃货',order:'DSP2026072502',income:0,expense:900,balance:87130.50,operator:'仓库-王强',remark:'弃货销毁处理费'},
+{no:'AC202607220008',time:'2026-07-22 09:30',type:'其它',order:'OTH2026072201',income:0,expense:350,balance:88030.50,operator:'财务-李芳',remark:'账户调整'}
+],
+CA002:[{no:'AC202608040029',time:'2026-08-04 16:42',type:'出库',order:'OUT20260804021',income:0,expense:3280,balance:68720,operator:'系统',remark:'FBA出库费用'},{no:'AC202608010011',time:'2026-08-01 10:20',type:'充值',order:'RC20260801011',income:30000,expense:0,balance:72000,operator:'财务-李芳',remark:'支付宝充值'}],
+CA003:[{no:'AC202608030022',time:'2026-08-03 14:18',type:'仓储费用',order:'STO202607-031',income:0,expense:1649.20,balance:18350.80,operator:'系统',remark:'7月仓储费用'},{no:'AC202607200013',time:'2026-07-20 09:12',type:'充值',order:'RC20260720013',income:20000,expense:0,balance:20000,operator:'财务-王芳',remark:'银行转账充值'}],
+CA004:[{no:'AC202608020016',time:'2026-08-02 11:05',type:'出库',order:'OUT20260802009',income:0,expense:2680,balance:-2680,operator:'系统',remark:'出库后账户余额不足,自动冻结'}],CA005:[]
+};
+
const integrationData = [
{no:'VCH202606001',bizType:'海运费收入',orderNo:'BY20260525001',amt:48500,cur:'CNY',account:'主营业务收入',syncTime:'2026-06-01 10:30',status:'已同步'},
{no:'VCH202606002',bizType:'海运费成本',orderNo:'BY20260525001',amt:22000,cur:'USD',account:'主营业务成本',syncTime:'2026-06-01 10:30',status:'已同步'},
@@ -11051,12 +11156,20 @@ const fbaReturnOutboundData = [
/* FBA退货 - 入库单数据 */
const fbaInboundOrderData = [
-{inboundNo:'FBIO20260720001',bolNo:'BOL260720001',wh:'洛杉矶长滩海外仓',owner:'杭州积乐',totalBoxes:120,chargeVol:24.5,palletTotal:4,status:'待审核'},
-{inboundNo:'FBIO20260721002',bolNo:'BOL260720002',wh:'纽约海外仓',owner:'岩盛、欧业',totalBoxes:200,chargeVol:38.0,palletTotal:6,status:'已审核'},
-{inboundNo:'FBIO20260722003',bolNo:'BOL260220003',wh:'汉堡海外仓',owner:'上海粤讯',totalBoxes:80,chargeVol:15.2,palletTotal:3,status:'已入库'},
-{inboundNo:'FBIO20260723004',bolNo:'BOL260240004',wh:'洛杉矶长滩海外仓',owner:'义乌卓越',totalBoxes:150,chargeVol:29.8,palletTotal:5,status:'待审核'},
-{inboundNo:'FBIO20260725005',bolNo:'BOL260250005',wh:'纽约海外仓',owner:'杭州积乐',totalBoxes:90,chargeVol:18.6,palletTotal:3,status:'已审核'},
+{inboundNo:'FBIO20260720001',bolNo:'BOL260720001',type:'国内订单',wh:'洛杉矶长滩海外仓',owner:'杭州积乐',totalBoxes:120,chargeVol:24.5,palletTotal:4,status:'待审核'},
+{inboundNo:'FBIO20260721002',bolNo:'BOL260720002',type:'海外订单',wh:'纽约海外仓',owner:'岩盛、欧业',totalBoxes:200,chargeVol:38.0,palletTotal:6,status:'已审核'},
+{inboundNo:'FBIO20260722003',bolNo:'BOL260220003',type:'海外订单',wh:'汉堡海外仓',owner:'上海粤讯',totalBoxes:80,chargeVol:15.2,palletTotal:3,status:'已入库'},
+{inboundNo:'FBIO20260723004',bolNo:'BOL260240004',type:'国内订单',wh:'洛杉矶长滩海外仓',owner:'义乌卓越',totalBoxes:150,chargeVol:29.8,palletTotal:5,status:'待审核'},
+{inboundNo:'FBIO20260725005',bolNo:'BOL260250005',type:'国内订单',wh:'纽约海外仓',owner:'杭州积乐',totalBoxes:90,chargeVol:18.6,palletTotal:3,status:'已审核'},
];
+const fbioQueryMeta=[
+{deliveryWh:'宁波仓',warehouseCode:'RK26072001',eta:'2026-07-28',feeAudit:'已审核',containerNo:'MSCU7283910',cabinetNo:'40HQ-001',channel:'洛杉矶普船海卡',sailingDate:'2026-07-22',loaded:'是',fullContainer:'是',measureAudit:'已审核',fbaCode:'ONT8-A1001',createdDate:'2026-07-20'},
+{deliveryWh:'义乌仓',warehouseCode:'RK26072102',eta:'2026-07-31',feeAudit:'待审核',containerNo:'COSU6158243',cabinetNo:'40HQ-002',channel:'纽约EXX海铁',sailingDate:'2026-07-24',loaded:'是',fullContainer:'否',measureAudit:'待审核',fbaCode:'ABE8-B2002',createdDate:'2026-07-21'},
+{deliveryWh:'上海仓',warehouseCode:'RK26072203',eta:'2026-08-05',feeAudit:'已审核',containerNo:'MAEU9321764',cabinetNo:'40GP-003',channel:'芝加哥普船海铁',sailingDate:'2026-07-26',loaded:'是',fullContainer:'是',measureAudit:'已审核',fbaCode:'HAM2-C3003',createdDate:'2026-07-22'},
+{deliveryWh:'深圳仓',warehouseCode:'RK26072304',eta:'2026-08-02',feeAudit:'已驳回',containerNo:'OOLU4812057',cabinetNo:'40HQ-004',channel:'洛杉矶普船海卡',sailingDate:'2026-07-27',loaded:'否',fullContainer:'否',measureAudit:'已驳回',fbaCode:'LGB8-D4004',createdDate:'2026-07-23'},
+{deliveryWh:'宁波仓',warehouseCode:'RK26072505',eta:'2026-08-08',feeAudit:'待审核',containerNo:'TGHU5903218',cabinetNo:'40HQ-005',channel:'纽约EXX海铁',sailingDate:'2026-07-29',loaded:'否',fullContainer:'是',measureAudit:'待审核',fbaCode:'JFK8-E5005',createdDate:'2026-07-25'}
+];
+fbaInboundOrderData.forEach((d,i)=>Object.assign(d,fbioQueryMeta[i]||{}));
/* FBA退货 - 换标单数据 */
const fbaRelabelOrderData = [
@@ -11199,6 +11312,7 @@ const menuPermTree = [
{key:'ct-board',label:'柜态看板'},
]},
{module:'财务管理',key:'finance',children:[
+ {key:'customer-account',label:'客户账户'},
{key:'finance-ar',label:'应收款'},
{key:'finance-ap',label:'应付款'},
{key:'finance-bill',label:'对账单'},
@@ -12909,54 +13023,83 @@ function viewSupplierReconDetail(id){
switchPage('finance-bill-recon-detail',null);
}
-function renderGenVoyage(){renderTable('tbody-gen-voyage',genVoyageData,['fba','eastCbm','eastTax','southTax','time','deadline','voyage','surcharge','remark',''],(d,c)=>{
-if(c==='eastCbm')return `¥${d.eastCbm}`;
-if(c==='eastTax')return `¥${d.eastTax}`;
-if(c==='southTax')return `¥${d.southTax}`;
-if(c==='surcharge')return d.surcharge==='—'?`—`:`${d.surcharge}`;
-if(c==='')return ` `;
-return d[c];
-});}
-
+const voyageChannels=['美森正班海卡','美森加班海卡','EXX海卡','合德海卡','纽约EXX海铁','洛杉矶普船海卡','洛杉矶普船全卡','芝加哥普船海铁','休斯顿普船海卡'];
+genVoyageData.forEach(function(d,i){if(!d.channel)d.channel=voyageChannels[i%voyageChannels.length];if(d.southCbm==null)d.southCbm=d.eastCbm+30;});
+const voyageWeekFactors={'2026-08-03':1,'2026-07-27':.985,'2026-07-20':1.018,'2026-07-13':1.035,'2026-07-06':1.012,'2026-06-29':.972};
let voyageEditingId=null;
+function switchVoyageTab(tab){
+ document.querySelectorAll('#page-gen-voyage .voyage-tab').forEach(function(el){el.classList.toggle('active',el.dataset.tab===tab);});
+ document.querySelectorAll('#page-gen-voyage .voyage-pane').forEach(function(el){el.classList.toggle('active',el.id==='voyage-pane-'+tab);});
+ if(tab==='weekly')renderGenVoyage();else renderCostCalcRows();
+}
+
+function voyageWeekEnd(start){var d=new Date(start+'T00:00:00');d.setDate(d.getDate()+6);return d.getFullYear()+'-'+String(d.getMonth()+1).padStart(2,'0')+'-'+String(d.getDate()).padStart(2,'0');}
+function getVoyageWeeklyRows(){
+ var week=(document.getElementById('voyage-filter-week')||{}).value||'2026-08-03',factor=voyageWeekFactors[week]||1;
+ return genVoyageData.map(function(d){return Object.assign({},d,{week:week,eastCbm:Math.round(d.eastCbm*factor/10)*10,eastTax:Number((d.eastTax*factor).toFixed(1)),southCbm:Math.round(d.southCbm*factor/10)*10,southTax:Number((d.southTax*factor).toFixed(1))});});
+}
+
+function filterVoyageWeeklyPrices(){voyageEditingId=null;renderGenVoyage();}
+function resetVoyageWeeklyFilters(){
+ document.getElementById('voyage-filter-fba').value='';document.getElementById('voyage-filter-channel').value='';document.getElementById('voyage-filter-week').value='2026-08-03';document.getElementById('voyage-filter-sailing').value='';renderGenVoyage();
+}
+
+function renderGenVoyage(){
+ var tbody=document.getElementById('tbody-gen-voyage');if(!tbody)return;
+ var week=document.getElementById('voyage-filter-week').value;
+ var fba=document.getElementById('voyage-filter-fba').value.trim().toUpperCase(),channel=document.getElementById('voyage-filter-channel').value,sailing=document.getElementById('voyage-filter-sailing').value;
+ var rows=getVoyageWeeklyRows().filter(function(d){return (!fba||d.fba.toUpperCase().indexOf(fba)>-1)&&(!channel||d.channel===channel)&&(!sailing||d.voyage.indexOf(sailing)>-1);});
+ var current=week==='2026-08-03';
+ document.getElementById('voyage-week-badge').textContent=current?'当前周':'历史周';document.getElementById('voyage-week-title').textContent=week+' 至 '+voyageWeekEnd(week);document.getElementById('voyage-week-note').textContent=current?'本周价格生效中,后续修改仅影响当前周数据':'历史价格仅供查看,切换至当前周可进行编辑';document.getElementById('voyage-total-count').textContent='共 '+rows.length+' 条';
+ tbody.innerHTML=rows.map(function(d){
+ var action=current?' ':'';
+ return '
| '+action+' | '+d.fba+' | '+d.channel+' | ¥'+d.eastCbm+' | ¥'+d.eastTax.toFixed(1)+' | ¥'+d.southCbm+' | ¥'+d.southTax.toFixed(1)+' | '+d.time+' | '+d.deadline+' | '+d.voyage+' | '+(d.surcharge==='—'?'—':''+d.surcharge+'')+' | '+(d.remark||'—')+' | '+(current?'生效中':'已归档')+' |
';
+ }).join('')||'| 未查询到符合条件的周价格 |
';
+}
+
function editVoyageRow(id){
- if(voyageEditingId)return;
- voyageEditingId=id;
- const d=genVoyageData.find(v=>v.id===id);if(!d)return;
- const tbody=document.getElementById('tbody-gen-voyage');
- const idx=genVoyageData.findIndex(v=>v.id===id);
- const row=tbody.querySelectorAll('tr')[idx];if(!row)return;
- const cells=row.querySelectorAll('td');
- const fields=['fba','eastCbm','eastTax','southTax','time','deadline','voyage','surcharge','remark'];
- const widths={fba:'100px',eastCbm:'80px',eastTax:'80px',southTax:'80px',time:'85px',deadline:'95px',voyage:'85px',surcharge:'80px',remark:'120px'};
- fields.forEach((f,i)=>{
- const v=d[f]||'';
- cells[i].innerHTML=``;
- });
- cells[fields.length].innerHTML=` `;
+ if(voyageEditingId)return;voyageEditingId=id;
+ var d=genVoyageData.find(function(v){return v.id===id;}),row=document.querySelector('#tbody-gen-voyage tr[data-row-id="'+id+'"]');if(!d||!row)return;
+ var cells=row.querySelectorAll('td'),fields=['fba','channel','eastCbm','eastTax','southCbm','southTax','time','deadline','voyage','surcharge','remark'];
+ cells[0].innerHTML=' ';
+ fields.forEach(function(f,i){cells[i+1].innerHTML='';});
}
function saveVoyageRow(id){
- const tbody=document.getElementById('tbody-gen-voyage');
- const idx=genVoyageData.findIndex(v=>v.id===id);
- const row=tbody.querySelectorAll('tr')[idx];if(!row)return;
- const inputs=row.querySelectorAll('input');
- const d=genVoyageData[idx];
- inputs.forEach(inp=>{
- const f=inp.dataset.field;
- if(f && d.hasOwnProperty(f)){
- const v=inp.value.trim();
- if(f==='eastCbm')d[f]=parseInt(v)||0;
- else if(f==='eastTax'||f==='southTax')d[f]=parseFloat(v)||0;
- else d[f]=v;
- }
- });
- voyageEditingId=null;renderGenVoyage();showToast('保存成功','success');
+ var d=genVoyageData.find(function(v){return v.id===id;}),row=document.querySelector('#tbody-gen-voyage tr[data-row-id="'+id+'"]');if(!d||!row)return;
+ row.querySelectorAll('input[data-field]').forEach(function(inp){var f=inp.dataset.field,v=inp.value.trim();d[f]=(f==='eastCbm'||f==='southCbm'?parseInt(v)||0:(f==='eastTax'||f==='southTax'?parseFloat(v)||0:v));});
+ voyageEditingId=null;renderGenVoyage();showToast('当前周价格已保存','success');
}
-
function cancelVoyageEdit(){voyageEditingId=null;renderGenVoyage();}
+const voyageCostWarehouses=['ORD2','IGQ2','RFD2','RFD4','MDW2','MDW6','JVL1','IND5','IND9','FWA4','MQJ1','STL4','CMH2','CMH3','STL3','TOL3','MCI4'];
+const voyageDeliveryFees=[650,650,700,700,750,800,950,1150,1200,1350,1400,1550,1750,1800,1900,2200,2450];
+let voyageCostSeq=voyageCostWarehouses.length+1;
+const voyageCostData=voyageCostWarehouses.map(function(warehouse,i){return{id:'VC'+(i+1),warehouse:warehouse,ams:105,inland:1000,customs:150,tariff:3000,pickup:700,devanning:300,pallet:200,delivery:voyageDeliveryFees[i],base:13000};});
+
+function costNumber(v){v=parseFloat(v);return isNaN(v)?0:v;}
+function updateCostField(id,field,value){var row=voyageCostData.find(function(d){return d.id===id;});if(row)row[field]=field==='warehouse'?value:costNumber(value);}
+function calculateCostRow(d){
+ var ocean=costNumber(document.getElementById('cost-ocean').value),rate=costNumber(document.getElementById('cost-rate').value),markup=costNumber(document.getElementById('cost-markup').value);
+ var subtotal=d.ams+d.inland+d.customs+d.tariff+d.pickup+d.devanning+d.pallet+d.delivery,total=subtotal+ocean,cny=total*rate,unit=d.base?cny/d.base:0;
+ return{subtotal:subtotal,ocean:ocean,total:total,rate:rate,cny:cny,unit:unit,quote:unit+markup};
+}
+function renderCostCalcRows(){
+ var tbody=document.getElementById('tbody-voyage-cost');if(!tbody)return;
+ tbody.innerHTML=voyageCostData.map(function(d){var c=calculateCostRow(d);function input(field,cls){return '';}
+ return ' | '+input('warehouse','warehouse')+' | '+input('ams')+' | '+input('inland')+' | '+input('customs')+' | '+input('tariff')+' | '+input('pickup')+' | '+input('devanning')+' | '+input('pallet')+' | '+input('delivery')+' | $'+c.subtotal.toFixed(2)+' | $'+c.ocean.toFixed(2)+' | $'+c.total.toFixed(2)+' | '+c.rate.toFixed(2)+' | ¥'+c.cny.toFixed(2)+' | '+input('base')+' | ¥'+c.unit.toFixed(2)+' | ¥'+c.quote.toFixed(2)+' |
';
+ }).join('');
+}
+function calculateVoyageCosts(){renderCostCalcRows();showToast('成本测算已完成','success');}
+function toggleCostTaxMode(){
+ var taxed=document.getElementById('cost-tax-mode').value==='tax';document.getElementById('cost-markup').value=taxed?'0.6':'150';document.getElementById('cost-markup-label').textContent=taxed?'报价加成(元/kg)':'报价加成(元/m³)';document.getElementById('cost-base-header').textContent=taxed?'重量(kg)':'立方(m³)';document.getElementById('cost-unit-header').textContent=taxed?'成本单价(元/kg)':'成本单价(元/m³)';
+ voyageCostData.forEach(function(d){d.tariff=taxed?3000:0;d.base=taxed?13000:80;});renderCostCalcRows();
+}
+function addCostCalcRow(){voyageCostData.push({id:'VC'+voyageCostSeq++,warehouse:'新仓库',ams:105,inland:1000,customs:150,tariff:document.getElementById('cost-tax-mode').value==='tax'?3000:0,pickup:700,devanning:300,pallet:200,delivery:0,base:document.getElementById('cost-tax-mode').value==='tax'?13000:80});renderCostCalcRows();}
+function removeCostCalcRow(id){var i=voyageCostData.findIndex(function(d){return d.id===id;});if(i>-1){voyageCostData.splice(i,1);renderCostCalcRows();}}
+function saveCostCalcPlan(){renderCostCalcRows();showToast('成本测算方案已保存','success');}
+
var salesVisitEditingId=null;
function salesVisitNow(){
@@ -13171,6 +13314,33 @@ function scReset(){
renderSalesCommission();
}
+let currentCustomerAccountId=null;
+function caMoney(n){return '¥'+Number(n||0).toLocaleString('zh-CN',{minimumFractionDigits:2,maximumFractionDigits:2});}
+function renderCustomerAccounts(){
+ var kw=(document.getElementById('ca-filter-keyword').value||'').trim().toLowerCase(),status=document.getElementById('ca-filter-status').value,balanceFilter=document.getElementById('ca-filter-balance').value;
+ var list=customerAccountData.filter(function(d){var balanceOk=!balanceFilter||(balanceFilter==='positive'&&d.balance>0)||(balanceFilter==='zero'&&d.balance===0)||(balanceFilter==='negative'&&d.balance<0);return (!kw||(d.name+d.code).toLowerCase().indexOf(kw)>-1)&&(!status||d.status===status)&&balanceOk;});
+ var totalBalance=customerAccountData.reduce(function(s,d){return s+d.balance;},0),totalFrozen=customerAccountData.reduce(function(s,d){return s+d.frozen;},0),monthDeduction=Object.keys(customerAccountTransactions).reduce(function(sum,id){return sum+(customerAccountTransactions[id]||[]).filter(function(t){return t.time.slice(0,7)==='2026-08';}).reduce(function(s,t){return s+t.expense;},0);},0);
+ document.getElementById('ca-stat-count').innerHTML=customerAccountData.length+'个';document.getElementById('ca-stat-balance').textContent=caMoney(totalBalance);document.getElementById('ca-stat-frozen').textContent=caMoney(totalFrozen);document.getElementById('ca-stat-deduction').textContent=caMoney(monthDeduction);document.getElementById('ca-total-count').textContent='共 '+list.length+' 条';
+ document.getElementById('tbody-customer-account').innerHTML=list.map(function(d){var available=d.balance-d.frozen,statusClass=d.status==='正常'?'tag-green':(d.status==='冻结'?'tag-orange':'tag-gray');return '| | '+d.shortName.slice(0,1)+' | '+d.code+' | '+d.contact+' | '+d.phone+' | '+caMoney(d.balance)+' | '+caMoney(d.frozen)+' | '+caMoney(available)+' | '+d.status+' | '+d.lastChange+' |
';}).join('')||'| 暂无符合条件的客户账户 |
';
+}
+function resetCustomerAccountFilters(){document.getElementById('ca-filter-keyword').value='';document.getElementById('ca-filter-status').value='';document.getElementById('ca-filter-balance').value='';renderCustomerAccounts();}
+function showCustomerAccountDetail(id){currentCustomerAccountId=id;switchPage('customer-account-detail',null);renderCustomerAccountDetail();}
+function renderCustomerAccountDetail(){
+ var d=customerAccountData.find(function(x){return x.id===currentCustomerAccountId;});if(!d)return;
+ document.getElementById('ca-detail-name').textContent=d.name;var status=document.getElementById('ca-detail-status');status.textContent=d.status;status.className='tag '+(d.status==='正常'?'tag-green':d.status==='冻结'?'tag-orange':'tag-gray');document.getElementById('ca-detail-balance').textContent=caMoney(d.balance);document.getElementById('ca-detail-frozen').textContent=caMoney(d.frozen);document.getElementById('ca-detail-available').textContent=caMoney(d.balance-d.frozen);document.getElementById('ca-detail-recharge-btn').onclick=function(){showCustomerRecharge(d.id);};
+ var info=[['客户编号',d.code],['联系人',d.contact],['联系电话',d.phone],['联系邮箱',d.email],['客户简称',d.shortName],['信用等级',d.creditLevel],['结算方式',d.settlement],['最后变动时间',d.lastChange]];document.getElementById('ca-detail-info').innerHTML=info.map(function(x){return '';}).join('');renderCustomerAccountTransactions();
+}
+function renderCustomerAccountTransactions(){
+ var type=document.getElementById('ca-detail-type').value,start=document.getElementById('ca-detail-start').value,end=document.getElementById('ca-detail-end').value,rows=(customerAccountTransactions[currentCustomerAccountId]||[]).filter(function(t){var day=t.time.slice(0,10);return(!type||t.type===type)&&(!start||day>=start)&&(!end||day<=end);});document.getElementById('ca-detail-total').textContent='共 '+rows.length+' 条';document.getElementById('tbody-customer-account-detail').innerHTML=rows.map(function(t){return '| '+t.no+' | '+t.time+' | '+t.type+' | '+(t.order||'—')+' | '+(t.income?('+'+caMoney(t.income)):'—')+' | '+(t.expense?('-'+caMoney(t.expense)):'—')+' | '+caMoney(t.balance)+' | '+t.operator+' | '+(t.remark||'—')+' |
';}).join('')||'| 暂无账户明细 |
';
+}
+function resetCustomerAccountTransactions(){document.getElementById('ca-detail-type').value='';document.getElementById('ca-detail-start').value='';document.getElementById('ca-detail-end').value='';renderCustomerAccountTransactions();}
+function caToday(){var d=new Date(),p=function(n){return String(n).padStart(2,'0');};return d.getFullYear()+'-'+p(d.getMonth()+1)+'-'+p(d.getDate());}
+function showCustomerRecharge(id){var d=customerAccountData.find(function(x){return x.id===id;});if(!d)return;document.getElementById('ca-recharge-id').value=id;document.getElementById('ca-recharge-customer').value=d.name;document.getElementById('ca-recharge-current').value=caMoney(d.balance);document.getElementById('ca-recharge-amount').value='';document.getElementById('ca-recharge-method').value='银行转账';document.getElementById('ca-recharge-date').value=caToday();document.getElementById('ca-recharge-ref').value='';document.getElementById('ca-recharge-remark').value='';showModal('modal-customer-recharge');}
+function saveCustomerRecharge(){
+ var id=document.getElementById('ca-recharge-id').value,d=customerAccountData.find(function(x){return x.id===id;}),amount=parseFloat(document.getElementById('ca-recharge-amount').value),date=document.getElementById('ca-recharge-date').value,method=document.getElementById('ca-recharge-method').value,ref=document.getElementById('ca-recharge-ref').value.trim(),remark=document.getElementById('ca-recharge-remark').value.trim();if(!d)return;if(!amount||amount<=0){showToast('请输入大于0的充值金额','error');return;}if(!date){showToast('请选择到账日期','error');return;}
+ d.balance=Number((d.balance+amount).toFixed(2));d.lastChange=date+' '+new Date().toTimeString().slice(0,5);if(d.status==='冻结'&&d.balance>=0)d.status='正常';var seq=String(Date.now()).slice(-8);if(!customerAccountTransactions[id])customerAccountTransactions[id]=[];customerAccountTransactions[id].unshift({no:'AC'+date.replace(/-/g,'')+seq,time:d.lastChange,type:'充值',order:ref||('RC'+seq),income:amount,expense:0,balance:d.balance,operator:'当前用户',remark:remark||method+'手动充值'});hideModal('modal-customer-recharge');renderCustomerAccounts();if(currentCustomerAccountId===id&&document.getElementById('page-customer-account-detail').classList.contains('active'))renderCustomerAccountDetail();showToast('充值成功,账户余额已更新','success');
+}
+
function renderCashflow(){renderTable('tbody-cashflow',cashflowData,['no','type','party','amt','cur','balance','date','remark'],(d,c)=>{
if(c==='type')return `${d.type}`;
if(c==='amt')return `${d.cur} ${d.amt.toLocaleString()}`;
@@ -15530,6 +15700,7 @@ function renderFbaInboundOrder(list){
tb.innerHTML=data.map(d=>`
| ${d.inboundNo} |
${d.bolNo} |
+ ${d.type} |
${d.wh} |
${d.owner} |
${d.totalBoxes} |
@@ -15542,19 +15713,36 @@ function renderFbaInboundOrder(list){
if(pg)pg.textContent='共 '+data.length+' 条';
}
function fbioSearch(){
- const no=(document.getElementById('fbio-no')||{}).value||'';
- const st=(document.getElementById('fbio-status')||{}).value||'';
+ const value=id=>(document.getElementById(id)||{}).value||'';
+ const no=value('fbio-no'),type=value('fbio-type'),st=value('fbio-status'),locationWh=value('fbio-location-wh'),deliveryWh=value('fbio-delivery-wh'),warehouseCode=value('fbio-warehouse-code'),eta=value('fbio-eta'),feeAudit=value('fbio-fee-audit'),company=value('fbio-company'),containerNo=value('fbio-container-no'),cabinetNo=value('fbio-cabinet-no'),channel=value('fbio-channel'),sailingDate=value('fbio-sailing-date'),loaded=value('fbio-loaded'),fullContainer=value('fbio-full-container'),measureAudit=value('fbio-measure-audit'),fbaCode=value('fbio-fba-code'),createdStart=value('fbio-created-start'),createdEnd=value('fbio-created-end');
const kw=s=>(''+(s||'')).toLowerCase();
const filtered=fbaInboundOrderData.filter(d=>{
if(no && !kw(d.inboundNo).includes(kw(no))) return false;
+ if(type && d.type!==type) return false;
if(st && d.status!==st) return false;
+ if(locationWh && d.wh!==locationWh) return false;
+ if(deliveryWh && d.deliveryWh!==deliveryWh) return false;
+ if(warehouseCode && !kw(d.warehouseCode).includes(kw(warehouseCode))) return false;
+ if(eta && d.eta!==eta) return false;
+ if(feeAudit && d.feeAudit!==feeAudit) return false;
+ if(company && d.owner!==company) return false;
+ if(containerNo && !kw(d.containerNo).includes(kw(containerNo))) return false;
+ if(cabinetNo && !kw(d.cabinetNo).includes(kw(cabinetNo))) return false;
+ if(channel && d.channel!==channel) return false;
+ if(sailingDate && d.sailingDate!==sailingDate) return false;
+ if(loaded && d.loaded!==loaded) return false;
+ if(fullContainer && d.fullContainer!==fullContainer) return false;
+ if(measureAudit && d.measureAudit!==measureAudit) return false;
+ if(fbaCode && !kw(d.fbaCode).includes(kw(fbaCode))) return false;
+ if(createdStart && d.createdDatecreatedEnd) return false;
return true;
});
renderFbaInboundOrder(filtered);
showToast('查询完成,共 '+filtered.length+' 条','success');
}
function fbioReset(){
- ['fbio-no','fbio-status'].forEach(id=>{const el=document.getElementById(id);if(el)el.value='';});
+ ['fbio-location-wh','fbio-delivery-wh','fbio-warehouse-code','fbio-status','fbio-eta','fbio-fee-audit','fbio-company','fbio-container-no','fbio-cabinet-no','fbio-channel','fbio-sailing-date','fbio-loaded','fbio-full-container','fbio-measure-audit','fbio-fba-code','fbio-created-start','fbio-created-end','fbio-no','fbio-type'].forEach(id=>{const el=document.getElementById(id);if(el)el.value='';});
renderFbaInboundOrder();
showToast('已重置','info');
}
@@ -16592,6 +16780,7 @@ if(el&&el.classList.contains('sub-menu-item'))el.classList.add('active');
// Render data for the page
if(page==='tenant-list')renderTenant();
if(page==='supplier-list')renderSupplier();
+if(page==='ocean-channel')renderOceanChannels();
if(page==='truck-list')renderTruckList();
if(page==='overseas-users')renderOverseasUsers();
if(page==='overseas-purchase')renderPurchaseList();
@@ -16706,6 +16895,8 @@ if(page==='finance-bill'){
renderBill();
}
if(page==='finance-bill-generate')renderSupplierRecon();
+if(page==='customer-account')renderCustomerAccounts();
+if(page==='customer-account-detail')renderCustomerAccountDetail();
if(page==='customer-arap')renderArap();
if(page==='customer-recon-stmt')renderCustomerReconStmt();
if(page==='settlement-ap')renderSettleAp();
@@ -18516,6 +18707,32 @@ function confirmPartialSettlement(){
currentPartialSettlement=null;
}
+let oceanChannelData=[
+ {id:'OC001',code:'CHI-SEA-RAIL',name:'芝加哥普船海铁',mode:'海铁',destination:'芝加哥及美中区域',transit:'船开后约35天',sailing:'周四',supplier:'中远海运',status:'启用',updatedAt:'2026-08-05 10:20',remark:'普船到港后转铁路'},
+ {id:'OC002',code:'NYC-EXX-RAIL',name:'纽约EXX海铁',mode:'海铁',destination:'纽约及美东区域',transit:'船开后约28-32天',sailing:'周二/周五',supplier:'EXX合作船司',status:'启用',updatedAt:'2026-08-04 16:35',remark:'EXX快船衔接铁路'},
+ {id:'OC003',code:'LAX-SEA-TRUCK',name:'洛杉矶普船海卡',mode:'海卡',destination:'洛杉矶及美西区域',transit:'船开后约22-28天',sailing:'周三/周六',supplier:'美西卡派供应商',status:'启用',updatedAt:'2026-08-03 14:10',remark:'普船到港后卡车派送'}
+];
+let oceanChannelSeq=4;
+function renderOceanChannels(){
+ const tb=document.getElementById('tbody-ocean-channel');if(!tb)return;
+ const kw=(document.getElementById('oc-search-name').value||'').trim().toLowerCase(),mode=document.getElementById('oc-search-mode').value,status=document.getElementById('oc-search-status').value;
+ const rows=oceanChannelData.filter(d=>(!kw||(d.name+d.code).toLowerCase().includes(kw))&&(!mode||d.mode===mode)&&(!status||d.status===status));
+ tb.innerHTML=rows.map(d=>`| | ${d.code} | ${d.name} | ${d.mode} | ${d.destination||'—'} | ${d.transit||'—'} | ${d.sailing||'—'} | ${d.supplier||'—'} | ${d.status} | ${d.updatedAt} | ${d.remark||'—'} |
`).join('')||'| 暂无符合条件的海运渠道 |
';
+ document.getElementById('oc-total').textContent='共 '+rows.length+' 条';
+}
+function resetOceanChannelSearch(){document.getElementById('oc-search-name').value='';document.getElementById('oc-search-mode').value='';document.getElementById('oc-search-status').value='';renderOceanChannels();}
+function oceanChannelNow(){const d=new Date(),p=n=>String(n).padStart(2,'0');return d.getFullYear()+'-'+p(d.getMonth()+1)+'-'+p(d.getDate())+' '+p(d.getHours())+':'+p(d.getMinutes());}
+function openOceanChannelModal(id){
+ const d=id?oceanChannelData.find(x=>x.id===id):null;document.getElementById('oc-modal-title').textContent=d?'编辑海运渠道':'新增海运渠道';document.getElementById('oc-edit-id').value=d?d.id:'';document.getElementById('oc-name').value=d?d.name:'';document.getElementById('oc-code').value=d?d.code:'';document.getElementById('oc-mode').value=d?d.mode:'海铁';document.getElementById('oc-destination').value=d?d.destination:'';document.getElementById('oc-transit').value=d?d.transit:'';document.getElementById('oc-sailing').value=d?d.sailing:'';document.getElementById('oc-supplier').value=d?d.supplier:'';document.getElementById('oc-status').value=d?d.status:'启用';document.getElementById('oc-remark').value=d?d.remark:'';showModal('modal-ocean-channel');
+}
+function saveOceanChannel(){
+ const id=document.getElementById('oc-edit-id').value,name=document.getElementById('oc-name').value.trim(),code=document.getElementById('oc-code').value.trim().toUpperCase();if(!name){showToast('请输入渠道名称','error');return;}if(!code){showToast('请输入渠道编码','error');return;}if(oceanChannelData.some(d=>d.code===code&&d.id!==id)){showToast('渠道编码已存在','error');return;}
+ const data={code,name,mode:document.getElementById('oc-mode').value,destination:document.getElementById('oc-destination').value.trim(),transit:document.getElementById('oc-transit').value.trim(),sailing:document.getElementById('oc-sailing').value.trim(),supplier:document.getElementById('oc-supplier').value.trim(),status:document.getElementById('oc-status').value,updatedAt:oceanChannelNow(),remark:document.getElementById('oc-remark').value.trim()};
+ if(id){const d=oceanChannelData.find(x=>x.id===id);if(d)Object.assign(d,data);}else{oceanChannelData.unshift(Object.assign({id:'OC'+String(oceanChannelSeq++).padStart(3,'0')},data));}hideModal('modal-ocean-channel');renderOceanChannels();showToast(id?'渠道修改成功':'渠道新增成功','success');
+}
+function toggleOceanChannelStatus(id){const d=oceanChannelData.find(x=>x.id===id);if(!d)return;d.status=d.status==='启用'?'停用':'启用';d.updatedAt=oceanChannelNow();renderOceanChannels();showToast('渠道已'+d.status,'success');}
+function deleteOceanChannel(id){const d=oceanChannelData.find(x=>x.id===id);if(!d)return;if(!confirm('确定删除渠道“'+d.name+'”吗?'))return;oceanChannelData=oceanChannelData.filter(x=>x.id!==id);renderOceanChannels();showToast('渠道已删除','success');}
+
var supplierData=[
// 订舱
{id:'sup001',name:'中远海运集装箱运输有限公司',cat:'booking',region:'宁波',legal:'王海涛',contact:'李经理',phone:'0574-8712 3456',license:'91330200MA2XXXX01',email:'sales@cosco.com',addr:'宁波市鄞州区福明路',status:'合作中',settlePeriod:'月结30天',remark:''},