wwt-certificate-tool 1.2.73 → 1.2.75

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 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.73</title>
6
+ <title>WWT 金蝶凭证工具 · 纯前端版 P1.2.75</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.73</span></h1>
331
+ <h1>金蝶凭证工具 <span class="ver">P1.2.75</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
- <button class="btn" onclick="UI.assetPick()">📂 上传 库存.xls / 入库明细.xls</button>
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>
@@ -2758,7 +2760,7 @@ const S = window.__STATE__ = {
2758
2760
  };
2759
2761
 
2760
2762
  /* ---------------- 版本 & 框架自动更新(只更新程序本身,本地数据/规则不动) ---------------- */
2761
- const WWT_VER=(function(){const raw='P1.2.73';return raw.indexOf('__WVER__')>=0?'P1.2.10':raw;})();
2763
+ const WWT_VER=(function(){const raw='P1.2.75';return raw.indexOf('__WVER__')>=0?'P1.2.10':raw;})();
2762
2764
  const UPD_URL_KEY='wwt_fe_updurl';
2763
2765
  // 默认更新源:Gitee 上本项目的 version.json(API 接口,浏览器可直接跨域读)
2764
2766
  const DEFAULT_UPD_URL='https://gitee.com/api/v5/repos/wwtmrhu/certificate-generation/contents/dist/version.json';
@@ -5897,7 +5899,6 @@ function switchTab(t){
5897
5899
  if(t==='asset')ASSET_UI.init();
5898
5900
  }
5899
5901
  async function init(){
5900
- if(window.__ASSET_PRESET__){ /* 资产基础表在首次进入模块9或生成时补全,避免覆盖用户上传 */ }
5901
5902
  // 1) 先探测持久化模式(任何 await DB.* 都会触发)
5902
5903
  await DB.probe();
5903
5904
  // 2) 加载配置(月度/映射/规则)
@@ -5917,6 +5918,15 @@ async function init(){
5917
5918
  }
5918
5919
  }
5919
5920
  }
5921
+ // 【P1.2.75】资产基础表(资产位置表/资产类别表)随其它内置表在启动时一并补全,
5922
+ // 仅在用户未上传(表缺失或空)时补,绝不覆盖用户已上传的数据。
5923
+ const AP=window.__ASSET_PRESET__||{};
5924
+ for(const k of Object.keys(AP)){
5925
+ if(AP[k]&&AP[k].length&&!(S.base[k]||[]).length){
5926
+ S.base[k]=AP[k];
5927
+ try{ await DB.put('base',k,AP[k]); }catch(_){}
5928
+ }
5929
+ }
5920
5930
  if(z&&Object.keys(z).length) S.biz=z;
5921
5931
  if(m){
5922
5932
  S.draft=(m.draft)||[];
@@ -6225,7 +6235,7 @@ function _dvFilter(){
6225
6235
 
6226
6236
 
6227
6237
  /* ============================================================
6228
- * ⑨ 资产卡片生成引擎 (P1.2.73)
6238
+ * ⑨ 资产卡片生成引擎 (P1.2.75)
6229
6239
  * 数据源:库存.xls(厂牌含"资产工具") + 入库明细.xls(零件编码关联)
6230
6240
  * 输出:金蝶资产卡片引入文件(37列 + 可选供应商/客户/付款方式列)
6231
6241
  * ============================================================ */
@@ -6419,7 +6429,7 @@ const ASSET = (function(){
6419
6429
  })();
6420
6430
 
6421
6431
 
6422
- /* ===== P1.2.73 模块9 UI 交互 ===== */
6432
+ /* ===== P1.2.75 模块9 UI 交互 ===== */
6423
6433
  const ASSET_UI=(function(){
6424
6434
  function log(msg){ const l=$('assetLog'); if(!l)return; l.classList.add('on');
6425
6435
  l.innerHTML+='<div>'+new Date().toLocaleTimeString('zh-CN')+' '+esc(msg)+'</div>'; l.scrollTop=l.scrollHeight; }
@@ -6520,6 +6530,18 @@ const ASSET_UI=(function(){
6520
6530
  el._assetBound=true;
6521
6531
  el.addEventListener('change',async e=>{ await onFiles(Array.from(e.target.files||[])); e.target.value=''; });
6522
6532
  }
6533
+ // 【P1.2.75】拖拽上传:把 库存.xls / 入库明细.xls 拖到按钮上即可(复用上传数据页的 .dropzone 高亮样式)
6534
+ const dz=$('assetDrop');
6535
+ if(dz && !dz._assetDropBound){
6536
+ dz._assetDropBound=true;
6537
+ dz.addEventListener('dragover',e=>{ e.preventDefault(); e.stopPropagation(); dz.classList.add('drag-over'); });
6538
+ dz.addEventListener('dragleave',e=>{ e.preventDefault(); e.stopPropagation(); dz.classList.remove('drag-over'); });
6539
+ dz.addEventListener('drop',async e=>{
6540
+ e.preventDefault(); e.stopPropagation(); dz.classList.remove('drag-over');
6541
+ const fs=Array.from(e.dataTransfer&&e.dataTransfer.files||[]);
6542
+ if(fs.length) await onFiles(fs);
6543
+ });
6544
+ }
6523
6545
  // 自动带出会计期间(月度参数 年-期间),如 2026-11
6524
6546
  const per=$('assetPeriod');
6525
6547
  if(per && !per.value && S.monthly && S.monthly.year && S.monthly.period){
@@ -6809,7 +6831,7 @@ if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',
6809
6831
  else init();
6810
6832
  })();
6811
6833
 
6812
- /* ===== P1.2.73 内置:资产位置表 / 资产类别表 默认数据 ===== */
6834
+ /* ===== P1.2.75 内置:资产位置表 / 资产类别表 默认数据 ===== */
6813
6835
  window.__ASSET_PRESET__={
6814
6836
  '资产位置表':[
6815
6837
  {编码:'AOA001',地址:'广州市花都区先科一路',详细地址:'广州市花都区先科一路'},
package/dist/version.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "ver": "P1.2.73",
3
- "npm": "1.2.73",
4
- "url": "https://cdn.jsdelivr.net/npm/wwt-certificate-tool@1.2.73/dist/app.html",
5
- "url_unpkg": "https://unpkg.com/wwt-certificate-tool@1.2.73/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.73.html",
7
- "note": "㉖ 【P1.2.73】资产类别表按金蝶真实编码内置修正:新增「ZCLBSYQ01_SYS 使用权资产」、移除不存在的「ZCLB07_SYS 低值易耗品」;资产位置/资产类别表已内置,打开模块⑨即可用,需改再自行上传。"
2
+ "ver": "P1.2.75",
3
+ "npm": "1.2.75",
4
+ "url": "https://cdn.jsdelivr.net/npm/wwt-certificate-tool@1.2.75/dist/app.html",
5
+ "url_unpkg": "https://unpkg.com/wwt-certificate-tool@1.2.75/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.75.html",
7
+ "note": "㉘ 【P1.2.75】模块⑨资产卡片上传区支持拖拽:把 库存.xls / 入库明细.xls 直接拖到上传按钮即可导入,拖拽时有高亮提示。"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wwt-certificate-tool",
3
- "version": "1.2.73",
3
+ "version": "1.2.75",
4
4
  "description": "WWT 金蝶凭证工具 · 纯前端版(离线单文件 HTML,双击即用)",
5
5
  "keywords": [
6
6
  "WWT",