wwt-certificate-tool 1.2.74 → 1.2.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.html +43 -11
- package/dist/version.json +6 -6
- package/package.json +1 -1
package/dist/app.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
-
<title>WWT 金蝶凭证工具 · 纯前端版 P1.2.
|
|
6
|
+
<title>WWT 金蝶凭证工具 · 纯前端版 P1.2.76</title>
|
|
7
7
|
<style>*{box-sizing:border-box;margin:0;padding:0}
|
|
8
8
|
body{font-family:"Microsoft YaHei","PingFang SC",-apple-system,Segoe UI,sans-serif;font-size:13px;color:#1f2328;background:#f4f6f9;line-height:1.6}
|
|
9
9
|
h1{font-size:17px;font-weight:600}
|
|
@@ -328,7 +328,7 @@ input[data-f="field"][list^="dlGe_"]::placeholder{color:#a8861f;font-style:itali
|
|
|
328
328
|
<div class="brand">
|
|
329
329
|
<span class="logo">WWT</span>
|
|
330
330
|
<div>
|
|
331
|
-
<h1>金蝶凭证工具 <span class="ver">P1.2.
|
|
331
|
+
<h1>金蝶凭证工具 <span class="ver">P1.2.76</span></h1>
|
|
332
332
|
<div class="sub">纯前端离线版 · 双击即用 · 数据只存在本机,不上传任何服务器</div>
|
|
333
333
|
</div>
|
|
334
334
|
</div>
|
|
@@ -510,7 +510,9 @@ input[data-f="field"][list^="dlGe_"]::placeholder{color:#a8861f;font-style:itali
|
|
|
510
510
|
<br><b>资产编码 = 零件编码</b>(如 D2206020054);<b>资产类别按零件编码首字母</b>自动判定;资产位置/使用部门等映射可在下方查看与微调。
|
|
511
511
|
</div>
|
|
512
512
|
<div class="genbar">
|
|
513
|
-
<
|
|
513
|
+
<span class="dropzone" id="assetDrop" title="点击选择,或把 库存.xls / 入库明细.xls 拖到这里" style="display:inline-block">
|
|
514
|
+
<button class="btn" onclick="UI.assetPick()">📂 上传 库存.xls / 入库明细.xls(可拖入)</button>
|
|
515
|
+
</span>
|
|
514
516
|
<button class="btn primary big" onclick="UI.assetGenerate()">⚙ 生成资产卡片</button>
|
|
515
517
|
<button class="btn ghost" id="btnAssetDl" style="display:none" onclick="UI.assetDownload()">📥 下载资产卡片引入文件</button>
|
|
516
518
|
<button class="btn ghost" onclick="UI.assetReset()">🧹 清空生成结果</button>
|
|
@@ -541,6 +543,12 @@ input[data-f="field"][list^="dlGe_"]::placeholder{color:#a8861f;font-style:itali
|
|
|
541
543
|
<label>单据头起始号 <input type="number" id="assetBillStart" value="200000" style="width:100px"></label>
|
|
542
544
|
<label>子表序号起始 <input type="number" id="assetSubStart" value="200000" style="width:100px"></label>
|
|
543
545
|
</div>
|
|
546
|
+
<div class="genbar" style="margin-top:8px">
|
|
547
|
+
<label class="chk"><input type="checkbox" id="assetUseDefDept"> 使用默认费用部门(不分部门的行统一填下面这个)</label>
|
|
548
|
+
<label>默认部门名称 <input type="text" id="assetDefDeptName" value="公司费用" style="width:120px" placeholder="如 公司费用"></label>
|
|
549
|
+
<label>默认部门编码 <input type="text" id="assetDefDeptCode" value="006" style="width:90px" placeholder="如 006"></label>
|
|
550
|
+
<span style="font-size:12px;color:#666">(不勾选时:按费用部门→仓位→库号推断,费用部门空则随资产位置,如 福特仓→广州维修基地)</span>
|
|
551
|
+
</div>
|
|
544
552
|
<div id="assetStat" class="stat"></div>
|
|
545
553
|
<div id="assetBanner"></div>
|
|
546
554
|
<div class="tablewrap" id="assetWrap"></div>
|
|
@@ -2758,7 +2766,7 @@ const S = window.__STATE__ = {
|
|
|
2758
2766
|
};
|
|
2759
2767
|
|
|
2760
2768
|
/* ---------------- 版本 & 框架自动更新(只更新程序本身,本地数据/规则不动) ---------------- */
|
|
2761
|
-
const WWT_VER=(function(){const raw='P1.2.
|
|
2769
|
+
const WWT_VER=(function(){const raw='P1.2.76';return raw.indexOf('__WVER__')>=0?'P1.2.10':raw;})();
|
|
2762
2770
|
const UPD_URL_KEY='wwt_fe_updurl';
|
|
2763
2771
|
// 默认更新源:Gitee 上本项目的 version.json(API 接口,浏览器可直接跨域读)
|
|
2764
2772
|
const DEFAULT_UPD_URL='https://gitee.com/api/v5/repos/wwtmrhu/certificate-generation/contents/dist/version.json';
|
|
@@ -5916,7 +5924,7 @@ async function init(){
|
|
|
5916
5924
|
}
|
|
5917
5925
|
}
|
|
5918
5926
|
}
|
|
5919
|
-
// 【P1.2.
|
|
5927
|
+
// 【P1.2.76】资产基础表(资产位置表/资产类别表)随其它内置表在启动时一并补全,
|
|
5920
5928
|
// 仅在用户未上传(表缺失或空)时补,绝不覆盖用户已上传的数据。
|
|
5921
5929
|
const AP=window.__ASSET_PRESET__||{};
|
|
5922
5930
|
for(const k of Object.keys(AP)){
|
|
@@ -6233,7 +6241,7 @@ function _dvFilter(){
|
|
|
6233
6241
|
|
|
6234
6242
|
|
|
6235
6243
|
/* ============================================================
|
|
6236
|
-
* ⑨ 资产卡片生成引擎 (P1.2.
|
|
6244
|
+
* ⑨ 资产卡片生成引擎 (P1.2.76)
|
|
6237
6245
|
* 数据源:库存.xls(厂牌含"资产工具") + 入库明细.xls(零件编码关联)
|
|
6238
6246
|
* 输出:金蝶资产卡片引入文件(37列 + 可选供应商/客户/付款方式列)
|
|
6239
6247
|
* ============================================================ */
|
|
@@ -6386,9 +6394,18 @@ const ASSET = (function(){
|
|
|
6386
6394
|
const posCode=posIdx.byName[placeName]||'';
|
|
6387
6395
|
if(!posCode) stats.posMiss++;
|
|
6388
6396
|
const posName=posCode?(posIdx.byCode[posCode]||placeName):placeName;
|
|
6389
|
-
//
|
|
6390
|
-
|
|
6391
|
-
|
|
6397
|
+
// 使用部门(P1.2.76):
|
|
6398
|
+
// ① 若启用「默认费用部门」→ 全部卡片强制用用户填的名称+编码(不分部门的用户)
|
|
6399
|
+
// ② 否则按 费用部门 → 仓位 → 库号 推断,并经过 normPlace 归一化
|
|
6400
|
+
// (费用部门为空时随位置走,如「福特仓」→「广州维修基地」)
|
|
6401
|
+
let deptName, deptCode;
|
|
6402
|
+
if(opts.useDefDept){
|
|
6403
|
+
deptName=clean(opts.defDeptName)||'公司费用';
|
|
6404
|
+
deptCode=clean(opts.defDeptCode)||deptIdx[deptName]||'';
|
|
6405
|
+
}else{
|
|
6406
|
+
deptName=normPlace(clean(r['费用部门'])||clean(r['仓位'])||clean(r['库号']));
|
|
6407
|
+
deptCode=deptIdx[deptName]||'';
|
|
6408
|
+
}
|
|
6392
6409
|
if(!deptCode) stats.deptMiss++;
|
|
6393
6410
|
const cost=isLow(cg.name)?COST.low:COST.fixed;
|
|
6394
6411
|
// 供应商/客户/付款方式
|
|
@@ -6427,7 +6444,7 @@ const ASSET = (function(){
|
|
|
6427
6444
|
})();
|
|
6428
6445
|
|
|
6429
6446
|
|
|
6430
|
-
/* ===== P1.2.
|
|
6447
|
+
/* ===== P1.2.76 模块9 UI 交互 ===== */
|
|
6431
6448
|
const ASSET_UI=(function(){
|
|
6432
6449
|
function log(msg){ const l=$('assetLog'); if(!l)return; l.classList.add('on');
|
|
6433
6450
|
l.innerHTML+='<div>'+new Date().toLocaleTimeString('zh-CN')+' '+esc(msg)+'</div>'; l.scrollTop=l.scrollHeight; }
|
|
@@ -6464,6 +6481,9 @@ const ASSET_UI=(function(){
|
|
|
6464
6481
|
acctFrom: $('acctDateFrom')?$('acctDateFrom').value:'same',
|
|
6465
6482
|
billStart: $('assetBillStart')?$('assetBillStart').value:'200000',
|
|
6466
6483
|
subStart: $('assetSubStart')?$('assetSubStart').value:'200000',
|
|
6484
|
+
useDefDept: !!$('assetUseDefDept')?.checked,
|
|
6485
|
+
defDeptName: $('assetDefDeptName')?$('assetDefDeptName').value:'公司费用',
|
|
6486
|
+
defDeptCode: $('assetDefDeptCode')?$('assetDefDeptCode').value:'006',
|
|
6467
6487
|
});
|
|
6468
6488
|
if(!r.ok){ $('assetBanner').innerHTML='<div class="banner err">❌ '+esc(r.msg)+'</div>'; toast(r.msg); return; }
|
|
6469
6489
|
S.assetResult=r;
|
|
@@ -6528,6 +6548,18 @@ const ASSET_UI=(function(){
|
|
|
6528
6548
|
el._assetBound=true;
|
|
6529
6549
|
el.addEventListener('change',async e=>{ await onFiles(Array.from(e.target.files||[])); e.target.value=''; });
|
|
6530
6550
|
}
|
|
6551
|
+
// 【P1.2.76】拖拽上传:把 库存.xls / 入库明细.xls 拖到按钮上即可(复用上传数据页的 .dropzone 高亮样式)
|
|
6552
|
+
const dz=$('assetDrop');
|
|
6553
|
+
if(dz && !dz._assetDropBound){
|
|
6554
|
+
dz._assetDropBound=true;
|
|
6555
|
+
dz.addEventListener('dragover',e=>{ e.preventDefault(); e.stopPropagation(); dz.classList.add('drag-over'); });
|
|
6556
|
+
dz.addEventListener('dragleave',e=>{ e.preventDefault(); e.stopPropagation(); dz.classList.remove('drag-over'); });
|
|
6557
|
+
dz.addEventListener('drop',async e=>{
|
|
6558
|
+
e.preventDefault(); e.stopPropagation(); dz.classList.remove('drag-over');
|
|
6559
|
+
const fs=Array.from(e.dataTransfer&&e.dataTransfer.files||[]);
|
|
6560
|
+
if(fs.length) await onFiles(fs);
|
|
6561
|
+
});
|
|
6562
|
+
}
|
|
6531
6563
|
// 自动带出会计期间(月度参数 年-期间),如 2026-11
|
|
6532
6564
|
const per=$('assetPeriod');
|
|
6533
6565
|
if(per && !per.value && S.monthly && S.monthly.year && S.monthly.period){
|
|
@@ -6817,7 +6849,7 @@ if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',
|
|
|
6817
6849
|
else init();
|
|
6818
6850
|
})();
|
|
6819
6851
|
|
|
6820
|
-
/* ===== P1.2.
|
|
6852
|
+
/* ===== P1.2.76 内置:资产位置表 / 资产类别表 默认数据 ===== */
|
|
6821
6853
|
window.__ASSET_PRESET__={
|
|
6822
6854
|
'资产位置表':[
|
|
6823
6855
|
{编码:'AOA001',地址:'广州市花都区先科一路',详细地址:'广州市花都区先科一路'},
|
package/dist/version.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"ver": "P1.2.
|
|
3
|
-
"npm": "1.2.
|
|
4
|
-
"url": "https://cdn.jsdelivr.net/npm/wwt-certificate-tool@1.2.
|
|
5
|
-
"url_unpkg": "https://unpkg.com/wwt-certificate-tool@1.2.
|
|
6
|
-
"url_gh": "https://api.github.com/repos/huweipei745839/certificate-generation/contents/dist/WWT%E5%87%AD%E8%AF%81%E5%B7%A5%E5%85%B7_P1.2.
|
|
7
|
-
"note": "
|
|
2
|
+
"ver": "P1.2.76",
|
|
3
|
+
"npm": "1.2.76",
|
|
4
|
+
"url": "https://cdn.jsdelivr.net/npm/wwt-certificate-tool@1.2.76/dist/app.html",
|
|
5
|
+
"url_unpkg": "https://unpkg.com/wwt-certificate-tool@1.2.76/dist/app.html",
|
|
6
|
+
"url_gh": "https://api.github.com/repos/huweipei745839/certificate-generation/contents/dist/WWT%E5%87%AD%E8%AF%81%E5%B7%A5%E5%85%B7_P1.2.76.html",
|
|
7
|
+
"note": "㉙ 【P1.2.76】修复使用部门:费用部门为空时随资产位置推断(福特仓→广州维修基地/编码003.003);新增「默认费用部门」勾选框,可自填名称+编码(如 006 公司费用)统一填入。"
|
|
8
8
|
}
|