@@ -1,799 +1,111 @@
<!doctype html>
<!doctype html>
<!--
docs/features/accounting - voucher - check/accounting - voucher - check - prototype.html
用途:立账凭证检核 Agent 低保真原型——对话为主入口、日批为主;只查共享盘材料是否存在,不做字段吻合 。
依赖:浏览器原生 HTML/CSS/JavaScript,无需构建;用于产品/业务评审 。
逻辑:顶栏切换「会话 / 检核记录 / 共享盘材料 / 缺资料通知」;
会话内模拟发起检核 → 进度卡 → 单票结果卡;记录页可筛选批次与发票明细;
共享盘按发票号展示材料齐全度(必检清单占位 TBD);缺资料触发企微 textcard。
用途:展示 Profile 驱动的立账凭证资料批量检核,突出批量缺件的 Excel 汇总与按 invoice 通知。
依赖:浏览器原生 HTML/CSS/JavaScript,无需构建 。
逻辑:销售 Profile 模拟周度上月增量;采购 Profile 展示待确认规则;结果以单文件明细、批次汇总和通知三个视角呈现 。
-->
< html lang = "zh-CN" >
< head >
< meta charset = "utf-8" / >
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
< title > 立账凭证检核 Agent · 原型< / title >
< meta name = "viewport" content = "width=device-width,initial-scale=1" / >
< title > 立账凭证资料 检核 · 原型< / title >
< style >
: root {
--bg : #f7f9fc ; --panel : #ffffff ; --line : #d8e0ec ; --line-strong : #a7b3c5 ;
--text : #172033 ; --muted : #667792 ; --brand : #2f80d1 ; --brand-soft : #eaf4ff ;
--success : #067647 ; --success-soft : #ecfdf3 ; --warning : #b54708 ; --warning-soft : #fffaeb ;
--danger : #b42318 ; --danger-soft : #fef3f2 ; --info : #1 75cd3 ; --info-soft : #e ff8 ff ;
--shadow : 0 14 px 36 px rgba ( 23 , 32 , 51 , 0.08 ) ;
}
* { box-sizing : border-box ; }
body { margin : 0 ; min-height : 100 vh ; background : var ( - - bg ) ; color : var ( - - text ) ;
font : 14 px / 1.45 - apple-system , BlinkMacSystemFont , "Segoe UI" , "Microsoft YaHei" , sans-serif ; }
button , input , select , textarea { font : inherit ; }
button { cursor : pointer ; }
. proto-bar { display : flex ; align-items : center ; justify-content : space-between ; gap : 16 px ;
padding : 10 px 18 px ; background : #0f 172a ; color : #e2e8f0 ; flex-wrap : wrap ; position : sticky ; top : 0 ; z-index : 20 ; }
. proto-bar strong { color : #fff ; font-size : 13 px ; }
. proto-meta { color : #94a3b8 ; font-size : 12 px ; margin-left : 8 px ; }
. view-tabs { display : flex ; gap : 6 px ; background : #1e293b ; padding : 4 px ; border-radius : 10 px ; flex-wrap : wrap ; }
. view-tabs button { border : 0 ; border-radius : 8 px ; padding : 8 px 14 px ; background : transparent ; color : #cbd5e1 ; font-weight : 600 ; font-size : 13 px ; }
. view-tabs button . active { background : var ( - - brand ) ; color : #fff ; }
. view { display : none ; min-height : calc ( 100 vh - 52 px ) ; }
. view . active { display : grid ; }
. chat-shell { grid-template-columns : 280 px minmax ( 0 , 1 fr ) ; min-height : calc ( 100 vh - 52 px ) ; }
. sidebar { display : flex ; flex-direction : column ; gap : 16 px ; padding : 18 px 16 px ; border-right : 1 px solid var ( - - line ) ; background : var ( - - panel ) ; }
. agent-name { display : flex ; align-items : center ; gap : 10 px ; font-weight : 700 ; font-size : 15 px ; }
. avatar { width : 34 px ; height : 34 px ; border-radius : 10 px ; display : grid ; place-items : center ; background : var ( - - brand ) ; color : #fff ; font-weight : 700 ; font-size : 12 px ; flex-shrink : 0 ; }
. new-chat { width : 100 % ; height : 42 px ; border : 1 px solid var ( - - line ) ; border-radius : 10 px ; background : #f8fbff ; font-weight : 600 ; }
. side-label { margin : 0 0 8 px ; color : var ( - - muted ) ; font-size : 12 px ; font-weight : 600 ; }
. hist-item { padding : 10 px 12 px ; border-radius : 10 px ; border : 1 px solid transparent ; margin-bottom : 6 px ; cursor : pointer ; }
. hist-item : hover { background : #f5f8fc ; }
. hist-item . active { background : var ( - - brand - soft ) ; border-color : #c8dff8 ; }
. hist-item . t { font-weight : 600 ; font-size : 13 px ; }
. hist-item . s { color : var ( - - muted ) ; font-size : 12 px ; margin-top : 2 px ; }
. hint-box { padding : 12 px 14 px ; border-radius : 12 px ; background : var ( - - info - soft ) ; border : 1 px solid #b2ddff ; color : var ( - - info ) ; font-size : 12 px ; line-height : 1.5 ; }
. chat-main { display : grid ; grid-template-rows : 1 fr auto ; min-height : calc ( 100 vh - 52 px ) ; background : linear-gradient ( 180 deg , #f4f7fb 0 % , #eef3f9 100 % ) ; }
. chat-scroll { overflow : auto ; padding : 20 px 22 px 8 px ; }
. chat-welcome { display : none ; place-items : center ; padding : 48 px 24 px 24 px ; text-align : center ; }
. chat-welcome . show { display : grid ; }
. chat-welcome h1 { margin : 0 ; font-size : 26 px ; font-weight : 650 ; }
. chat-welcome h1 em { font-style : normal ; color : var ( - - brand ) ; }
. chat-welcome p { margin : 10 px 0 0 ; color : var ( - - muted ) ; font-size : 13 px ; max-width : 520 px ; }
. quick-row { display : flex ; flex-wrap : wrap ; gap : 8 px ; justify-content : center ; margin-top : 22 px ; max-width : 640 px ; }
. quick-chip { border : 1 px solid var ( - - line ) ; background : #fff ; border-radius : 999 px ; padding : 8 px 14 px ; font-size : 12 px ; font-weight : 650 ; color : var ( - - text ) ; }
. quick-chip : hover { border-color : var ( - - brand ) ; color : var ( - - brand ) ; background : var ( - - brand - soft ) ; }
. msg-list { max-width : 920 px ; margin : 0 auto ; display : grid ; gap : 14 px ; }
. msg { display : grid ; gap : 8 px ; max-width : 860 px ; }
. msg . user { justify-items : end ; margin-left : auto ; }
. msg . assistant { justify-items : start ; }
. bubble { padding : 12 px 14 px ; border-radius : 14 px ; background : #fff ; border : 1 px solid var ( - - line ) ; box-shadow : 0 4 px 14 px rgba ( 23 , 32 , 51 , 0.04 ) ; white-space : pre-line ; line-height : 1.55 ; font-size : 13 px ; }
. msg . user . bubble { background : var ( - - brand ) ; color : #fff ; border-color : transparent ; }
. msg-meta { font-size : 11 px ; color : var ( - - muted ) ; }
. progress-card , . result-card { width : min ( 640 px , 100 % ) ; border : 1 px solid var ( - - line ) ; border-radius : 14 px ; background : #fff ; box-shadow : var ( - - shadow ) ; overflow : hidden ; }
. progress-card . hd , . result-card . hd { display : flex ; justify-content : space-between ; align-items : center ; gap : 10 px ; padding : 12 px 14 px ; border-bottom : 1 px solid var ( - - line ) ; background : #fbfdff ; }
. progress-card . hd strong , . result-card . hd h3 { margin : 0 ; font-size : 13 px ; }
. result-card . hd { align-items : flex-start ; }
. result-card . hd p { margin : 4 px 0 0 ; font-size : 12 px ; color : var ( - - muted ) ; }
. status { font-size : 12 px ; font-weight : 700 ; padding : 3 px 8 px ; border-radius : 999 px ; }
. status . running { background : var ( - - info - soft ) ; color : var ( - - info ) ; }
. status . done { background : var ( - - success - soft ) ; color : var ( - - success ) ; }
. status . partial { background : var ( - - warning - soft ) ; color : var ( - - warning ) ; }
. progress-card . bd , . result-card . bd { padding : 14 px ; display : grid ; gap : 12 px ; }
. bar-wrap { height : 8 px ; border-radius : 999 px ; background : #e8eef6 ; overflow : hidden ; }
. bar { height : 100 % ; width : 0 ; background : linear-gradient ( 90 deg , #2f80d1 , #56a3e8 ) ; transition : width 0.35 s ease ; }
. counters { display : grid ; grid-template-columns : repeat ( 6 , 1 fr ) ; gap : 8 px ; }
. counter . skip . n { color : #475569 ; }
. counter { border : 1 px solid var ( - - line ) ; border-radius : 10 px ; padding : 8 px 6 px ; text-align : center ; background : #fafcff ; }
. counter . n { font-size : 16 px ; font-weight : 750 ; }
. counter . l { font-size : 11 px ; color : var ( - - muted ) ; margin-top : 2 px ; }
. counter . ok . n { color : var ( - - success ) ; }
. counter . fail . n { color : var ( - - danger ) ; }
. counter . miss . n { color : var ( - - warning ) ; }
. progress-sub { font-size : 12 px ; color : var ( - - muted ) ; }
. progress-actions { display : flex ; flex-wrap : wrap ; gap : 8 px ; }
. btn { height : 34 px ; padding : 0 12 px ; border-radius : 9 px ; border : 1 px solid var ( - - line ) ; background : #fff ; color : var ( - - text ) ; font-weight : 650 ; font-size : 12 px ; }
. btn . primary { background : var ( - - brand ) ; border-color : var ( - - brand ) ; color : #fff ; }
. btn : disabled { opacity : 0.5 ; cursor : not-allowed ; }
. pill { display : inline-flex ; align-items : center ; padding : 3 px 9 px ; border-radius : 999 px ; font-size : 11 px ; font-weight : 750 ; white-space : nowrap ; }
. pill . ok { background : var ( - - success - soft ) ; color : var ( - - success ) ; }
. pill . fail { background : var ( - - danger - soft ) ; color : var ( - - danger ) ; }
. pill . miss { background : var ( - - warning - soft ) ; color : var ( - - warning ) ; }
. pill . human { background : #f4f3ff ; color : #5925dc ; }
. pill . cron { background : #eef2f7 ; color : #475569 ; }
. pill . chat { background : var ( - - brand - soft ) ; color : var ( - - brand ) ; }
. field-table { width : 100 % ; border-collapse : collapse ; font-size : 12 px ; }
. field-table th , . field-table td { border-bottom : 1 px solid var ( - - line ) ; padding : 8 px 6 px ; text-align : left ; vertical-align : top ; }
. field-table th { color : var ( - - muted ) ; font-weight : 650 ; background : #fafcff ; }
. mat-list { display : flex ; flex-wrap : wrap ; gap : 6 px ; }
. mat-chip { font-size : 11 px ; font-weight : 650 ; padding : 4 px 8 px ; border-radius : 8 px ; border : 1 px solid var ( - - line ) ; background : #f8fafc ; }
. mat-chip . ok { border-color : #abefc6 ; background : var ( - - success - soft ) ; color : var ( - - success ) ; }
. mat-chip . miss { border-color : #f7c948 ; background : var ( - - warning - soft ) ; color : var ( - - warning ) ; }
. composer { padding : 10 px 22 px 16 px ; border-top : 1 px solid var ( - - line ) ; background : rgba ( 255 , 255 , 255 , 0.96 ) ; }
. composer-dock { max-width : 920 px ; margin : 0 auto ; }
. composer-meta { display : flex ; flex-wrap : wrap ; align-items : center ; gap : 8 px ; margin-bottom : 8 px ; }
. composer-meta . hint { font-size : 12 px ; color : var ( - - muted ) ; }
. composer-box { display : grid ; grid-template-columns : 1 fr auto ; gap : 8 px ; align-items : end ; border : 1 px solid var ( - - line ) ; border-radius : 18 px ; padding : 8 px 10 px ; background : #fff ; box-shadow : var ( - - shadow ) ; }
. composer-box textarea { border : 0 ; outline : none ; resize : none ; min-height : 44 px ; max-height : 120 px ; padding : 8 px 6 px ; width : 100 % ; background : transparent ; }
. send-btn { height : 40 px ; min-width : 72 px ; border : 0 ; border-radius : 12 px ; background : var ( - - brand ) ; color : #fff ; font-weight : 700 ; }
. send-btn : disabled { opacity : 0.45 ; cursor : not-allowed ; }
. page-shell { grid-template-columns : 1 fr ; padding : 20 px 22 px 32 px ; max-width : 1180 px ; margin : 0 auto ; width : 100 % ; gap : 16 px ; align-content : start ; }
. page-head { display : flex ; justify-content : space-between ; align-items : flex-start ; gap : 16 px ; flex-wrap : wrap ; }
. page-head h1 { margin : 0 ; font-size : 22 px ; font-weight : 700 ; }
. page-head p { margin : 6 px 0 0 ; color : var ( - - muted ) ; font-size : 13 px ; }
. stats { display : grid ; grid-template-columns : repeat ( 4 , minmax ( 0 , 1 fr ) ) ; gap : 10 px ; }
. stat { background : var ( - - panel ) ; border : 1 px solid var ( - - line ) ; border-radius : 12 px ; padding : 14 px ; }
. stat . n { font-size : 22 px ; font-weight : 750 ; }
. stat . l { font-size : 12 px ; color : var ( - - muted ) ; margin-top : 4 px ; }
. toolbar { display : flex ; justify-content : space-between ; align-items : center ; gap : 12 px ; flex-wrap : wrap ; }
. filters { display : flex ; flex-wrap : wrap ; gap : 6 px ; background : #eef2f7 ; padding : 4 px ; border-radius : 10 px ; }
. filters button { border : 0 ; border-radius : 8 px ; padding : 7 px 12 px ; background : transparent ; color : var ( - - muted ) ; font-weight : 650 ; font-size : 12 px ; }
. filters button . active { background : #fff ; color : var ( - - brand ) ; box-shadow : 0 1 px 4 px rgba ( 23 , 32 , 51 , 0.08 ) ; }
. panel { background : var ( - - panel ) ; border : 1 px solid var ( - - line ) ; border-radius : 14 px ; overflow : hidden ; box-shadow : 0 4 px 18 px rgba ( 23 , 32 , 51 , 0.04 ) ; }
table . data { width : 100 % ; border-collapse : collapse ; font-size : 13 px ; }
table . data th , table . data td { padding : 11 px 12 px ; border-bottom : 1 px solid var ( - - line ) ; text-align : left ; vertical-align : middle ; }
table . data th { background : #fafcff ; color : var ( - - muted ) ; font-weight : 650 ; font-size : 12 px ; }
table . data tr : last-child td { border-bottom : 0 ; }
table . data tbody tr { cursor : pointer ; }
table . data tbody tr : hover { background : #f8fbff ; }
table . data tbody tr . active { background : var ( - - brand - soft ) ; }
. muted { color : var ( - - muted ) ; font-size : 12 px ; }
. detail-grid { display : grid ; grid-template-columns : 1.1 fr 1 fr ; gap : 14 px ; }
. card-block { background : var ( - - panel ) ; border : 1 px solid var ( - - line ) ; border-radius : 14 px ; padding : 14 px ; }
. card-block h3 { margin : 0 0 10 px ; font-size : 14 px ; }
. path-box { font-family : ui-monospace , SFMono-Regular , Menlo , Consolas , monospace ; font-size : 12 px ; background : #0f172a ; color : #e2e8f0 ; border-radius : 10 px ; padding : 12 px 14 px ; line-height : 1.6 ; overflow : auto ; white-space : pre-wrap ; }
. folder-list { display : grid ; gap : 8 px ; }
. folder-item { display : flex ; justify-content : space-between ; align-items : center ; gap : 10 px ; padding : 10 px 12 px ; border : 1 px solid var ( - - line ) ; border-radius : 10 px ; background : #fafcff ; cursor : pointer ; }
. folder-item : hover , . folder-item . active { border-color : #c8dff8 ; background : var ( - - brand - soft ) ; }
. folder-item . name { font-weight : 700 ; font-size : 13 px ; }
. folder-item . sub { font-size : 12 px ; color : var ( - - muted ) ; margin-top : 2 px ; }
. file-rows { display : grid ; gap : 8 px ; }
. file-row-item { display : grid ; grid-template-columns : 1 fr auto ; gap : 8 px ; align-items : center ; padding : 10 px 12 px ; border : 1 px solid var ( - - line ) ; border-radius : 10 px ; }
. file-row-item . fn { font-weight : 650 ; font-size : 13 px ; }
. file-row-item . fs { font-size : 12 px ; color : var ( - - muted ) ; margin-top : 2 px ; }
. tbd-note { margin-top : 10 px ; padding : 10 px 12 px ; border-radius : 10 px ; background : var ( - - warning - soft ) ; border : 1 px solid #f7c948 ; color : var ( - - warning ) ; font-size : 12 px ; line-height : 1.5 ; }
. wecom-stage { min-height : calc ( 100 vh - 120 px ) ; display : grid ; place-items : center ; padding : 24 px ; gap : 18 px ; justify-items : center ; }
. phone { width : 360 px ; border-radius : 28 px ; background : #111827 ; padding : 16 px 14 px 22 px ; box-shadow : var ( - - shadow ) ; }
. phone-bar { color : #94a3b8 ; font-size : 12 px ; text-align : center ; margin-bottom : 14 px ; }
. wecom-card { background : #fff ; border-radius : 12 px ; overflow : hidden ; color : var ( - - text ) ; }
. wecom-card . hd { padding : 14 px 16 px 8 px ; font-weight : 750 ; font-size : 15 px ; }
. wecom-card . bd { padding : 0 16 px 14 px ; color : #334155 ; font-size : 13 px ; line-height : 1.55 ; white-space : pre-line ; }
. wecom-card . ft { border-top : 1 px solid #e2e8f0 ; padding : 12 px 16 px ; color : var ( - - brand ) ; font-weight : 700 ; font-size : 13 px ; cursor : pointer ; }
. wecom-side { width : min ( 420 px , 100 % ) ; display : grid ; gap : 10 px ; }
. toast { position : fixed ; right : 20 px ; bottom : 20 px ; z-index : 50 ; min-width : 240 px ; max-width : 360 px ; padding : 12 px 14 px ; border-radius : 12 px ; background : #0f172a ; color : #fff ; box-shadow : var ( - - shadow ) ; opacity : 0 ; transform : translateY ( 8 px ) ; pointer-events : none ; transition : 0.2 s ease ; font-size : 13 px ; font-weight : 600 ; }
. toast . show { opacity : 1 ; transform : translateY ( 0 ) ; }
@ media ( max-width : 900px ) {
. chat-shell { grid-template-columns : 1 fr ; }
. sidebar { display : none ; }
. stats , . counters { grid-template-columns : 1 fr 1 fr ; }
. detail-grid { grid-template-columns : 1 fr ; }
}
: root { --ink : #142033 ; --muted : #64748b ; --line : #dce4ef ; --bg : #f4f7fb ; --panel : #fff ; --nav : #111c31 ; --brand : #2563eb ; --soft : #eaf2ff ; --green : #067647 ; --amber : #b54708 ; --red : #b42318 ; }
* { box-sizing : border-box ; } body { margin : 0 ; background : var ( - - bg ) ; color : var ( - - ink ) ; font : 14 px / 1.5 - apple-system , BlinkMacSystemFont , "Segoe UI" , "Microsoft YaHei" , sans-serif ; } button , select { font : inherit ; } button { cursor : pointer ; }
. top { display : flex ; justify-content : space-between ; gap : 16 px ; align-items : center ; padding : 12 px 24 px ; background : var ( - - nav ) ; color : #fff ; } . top small { color : #aac0db ; margin-left : 8 px ; } . tabs { display : flex ; gap : 5 px ; } . tabs button { border : 0 ; border-radius : 7 px ; padding : 7 px 11 px ; color : #c5d3e6 ; background : transparent ; font-weight : 700 ; font-size : 12 px ; } . tabs button . active { color : #fff ; background : var ( - - brand ) ; }
main { width : min ( 1220 px , calc ( 100 % - 32 px ) ) ; margin : auto ; padding : 24 px 0 42 px ; } . view { display : none ; } . view . active { display : block ; } . profile { display : grid ; grid-template-columns : 250 px 1 fr auto ; gap : 14 px ; align-items : center ; padding : 13 px 15 px ; border : 1 px solid #c9dcfb ; border-radius : 13 px ; background : linear-gradient ( 100 deg , #edf5ff , #fff ) ; margin-bottom : 18 px ; } select { padding : 8 px ; border : 1 px solid #b8c8dd ; border-radius : 8 px ; font-weight : 700 ; }
. muted { color : var ( - - muted ) ; font-size : 12 px ; } . badge , . status { display : inline-flex ; padding : 3 px 8 px ; border-radius : 99 px ; font-size : 11 px ; font-weight : 800 ; } . blue { color : #175cd3 ; background : var ( - - soft ) ; } . green { color : var ( - - green ) ; background : #eafaf1 ; } . amber { color : var ( - - amber ) ; background : #fff7e6 ; } . gray { color : #4 75569 ; background : #edf1f6 ; } . red { color : var ( - - red ) ; background : #fff0e f ; }
. hero { display : flex ; justify-content : space-between ; gap : 16 px ; align-items : flex-start ; margin-bottom : 15 px ; } . hero h1 { margin : 0 ; font-size : 24 px ; } . hero p { margin : 5 px 0 ; color : var ( - - muted ) ; } . btn { border : 1 px solid var ( - - line ) ; border-radius : 8 px ; padding : 8 px 11 px ; background : #fff ; font-size : 12 px ; font-weight : 750 ; } . btn . primary { border-color : var ( - - brand ) ; color : #fff ; background : var ( - - brand ) ; } . btn : disabled { opacity : .5 ; cursor : not-allowed ; }
. grid { display : grid ; gap : 14 px ; } . three { grid-template-columns : repeat ( 3 , 1 fr ) ; } . task-metrics { grid-template-columns : repeat ( 4 , 1 fr ) ; } . two { grid-template-columns : 1.15 fr .85 fr ; margin-top : 14 px ; } . card { border : 1 px solid var ( - - line ) ; border-radius : 13 px ; background : #fff ; overflow : hidden ; } . hd { display : flex ; justify-content : space-between ; gap : 12 px ; padding : 13 px 15 px 9 px ; } . hd h2 { margin : 0 ; font-size : 14 px ; } . hd p { margin : 3 px 0 ; color : var ( - - muted ) ; font-size : 12 px ; } . bd { padding : 0 15 px 15 px ; }
. metric { padding : 16 px ; } . metric b { display : block ; font-size : 27 px ; } . metric span { color : var ( - - muted ) ; font-size : 12 px ; } . bar { height : 8 px ; background : #e7edf5 ; border-radius : 9 px ; overflow : hidden ; } . bar i { display : block ; width : 0 ; height : 100 % ; background : linear-gradient ( 90 deg , #2563eb , #60a5fa ) ; transition : .3 s ; } . stats { display : grid ; grid-template-columns : repeat ( 6 , 1 fr ) ; gap : 7 px ; margin : 12 px 0 ; } . stat { padding : 8 px ; text-align : center ; border : 1 px solid var ( - - line ) ; border-radius : 8 px ; background : #fbfdff ; } . stat b { display : block ; font-size : 17 px ; } . stat span { color : var ( - - muted ) ; font-size : 11 px ; }
. step { display : grid ; grid-template-columns : 28 px 1 fr auto ; gap : 8 px ; align-items : center ; padding : 9 px ; border : 1 px solid var ( - - line ) ; border-radius : 9 px ; margin : 7 px 0 ; } . no { display : grid ; place-items : center ; width : 24 px ; height : 24 px ; border-radius : 50 % ; color : var ( - - brand ) ; background : var ( - - soft ) ; font-size : 11 px ; font-weight : 800 ; } . step strong { font-size : 12 px ; } . step small { display : block ; color : var ( - - muted ) ; }
table { width : 100 % ; border-collapse : collapse ; font-size : 12 px ; } th , td { padding : 10 px 8 px ; border-bottom : 1 px solid var ( - - line ) ; text-align : left ; vertical-align : top ; } th { color : var ( - - muted ) ; background : #f9fbfe ; } tr [ data-rule ] , tr [ data-subject ] { cursor : pointer ; } tr . active , tr [ data-rule ] : hover { background : #f1f6ff ; } . source { font-weight : 700 ; } . source . erp { color : #2563eb ; } . source . oa { color : #7c3aed ; } . source . dir { color : #059669 ; } . source . pay { color : #d97706 ; }
. detail { min-height : 335 px ; } . kv { display : grid ; grid-template-columns : 110 px 1 fr ; gap : 10 px ; padding : 9 px 0 ; border-bottom : 1 px solid var ( - - line ) ; font-size : 12 px ; } . kv b { color : var ( - - muted ) ; } . code { padding : 8 px ; border-radius : 7 px ; color : #dbeafe ; background : #142036 ; font : 11 px ui-monospace , monospace ; } . layout { display : grid ; grid-template-columns : 270 px 1 fr ; gap : 14 px ; } . menu { padding : 9 px ; } . menu button { display : flex ; justify-content : space-between ; width : 100 % ; border : 1 px solid transparent ; border-radius : 8 px ; padding : 10 px ; background : transparent ; text-align : left ; } . menu button . active { border-color : #c9dcfb ; background : var ( - - soft ) ; } . result { display : grid ; grid-template-columns : 1 fr 1.25 fr auto ; gap : 8 px ; align-items : center ; padding : 10 px ; border : 1 px solid var ( - - line ) ; border-radius : 9 px ; margin : 7 px 0 ; } . path { color : #475569 ; font : 11 px ui-monospace , monospace ; word-break : break-all ; }
. kpis { display : grid ; grid-template-columns : repeat ( 4 , 1 fr ) ; border-top : 1 px solid var ( - - line ) ; border-left : 1 px solid var ( - - line ) ; margin-bottom : 14 px ; } . kpi { padding : 10 px ; border-right : 1 px solid var ( - - line ) ; border-bottom : 1 px solid var ( - - line ) ; background : #fbfdff ; } . kpi b { display : block ; font-size : 18 px ; } . kpi span { color : var ( - - muted ) ; font-size : 11 px ; } . excel-note { margin : 10 px 0 0 ; padding : 9 px ; border-radius : 8 px ; color : #175cd3 ; background : var ( - - soft ) ; font-size : 12 px ; }
. workbook { overflow : auto ; border : 1 px solid var ( - - line ) ; border-radius : 10 px ; background : #fff ; } . workbook table { min-width : 1140 px ; } . workbook th { white-space : nowrap ; } . sheet-title { margin : 0 ; font-size : 16 px ; } . sheet-meta { margin : 4 px 0 14 px ; color : var ( - - muted ) ; font-size : 12 px ; } . field-list { display : flex ; flex-wrap : wrap ; gap : 7 px ; } . field-list span { padding : 4 px 7 px ; border : 1 px solid var ( - - line ) ; border-radius : 6 px ; color : #475569 ; background : #fbfdff ; font : 11 px ui-monospace , monospace ; } . file-ok { color : var ( - - green ) ; font-weight : 800 ; } . file-missing { color : var ( - - red ) ; font-weight : 800 ; } . file-pending { color : var ( - - amber ) ; font-weight : 800 ; }
. phone { width : 360 px ; padding : 15 px ; border-radius : 25 px ; color : #fff ; background : #172033 ; } . phone small { display : block ; color : #aab9cc ; text-align : center ; } . notice { margin-top : 10 px ; overflow : hidden ; border-radius : 10 px ; color : var ( - - ink ) ; background : #fff ; } . notice h3 { margin : 0 ; padding : 13 px 14 px 7 px ; } . notice p { min-height : 190 px ; margin : 0 ; padding : 0 14 px 13 px ; white-space : pre-line ; color : #3d4b61 ; font-size : 12 px ; } . notice button { width : 100 % ; padding : 10 px ; border : 0 ; border-top : 1 px solid var ( - - line ) ; color : var ( - - brand ) ; background : #fff ; font-weight : 800 ; } . toast { position : fixed ; right : 18 px ; bottom : 18 px ; padding : 10 px 12 px ; border-radius : 9 px ; color : #fff ; background : #142036 ; opacity : 0 ; transition : .2 s ; } . toast . show { opacity : 1 ; }
. filters { display : flex ; flex-wrap : wrap ; align-items : end ; gap : 10 px ; padding : 13 px 15 px ; margin-bottom : 14 px ; } . filters label { display : grid ; gap : 4 px ; color : var ( - - muted ) ; font-size : 11 px ; font-weight : 700 ; } . filters select { min-width : 120 px ; padding : 7 px ; font-size : 12 px ; } . task-actions { margin-left : auto ; display : flex ; gap : 8 px ; } . link { border : 0 ; padding : 0 ; color : #175cd3 ; background : transparent ; font-size : 12 px ; font-weight : 800 ; } . task-table td { vertical-align : middle ; } . task-count { color : #b42318 ; font-weight : 800 ; } . task-empty { padding : 30 px ; color : var ( - - muted ) ; text-align : center ; }
@ media ( max-width : 850px ) { . top , . hero { align-items : flex-start ; flex-direction : column ; } . profile , . two , . layout { grid-template-columns : 1 fr ; } . three , . task-metrics , . kpis { grid-template-columns : 1 fr ; } . stats { grid-template-columns : repeat ( 3 , 1 fr ) ; } . result { grid-template-columns : 1 fr ; } . phone { width : 100 % ; } }
< / style >
< / head >
< body >
< div class = "proto-bar" >
< div >
< strong > 立账凭证检核 Agent · 原型 < / strong >
< span class = "proto-meta" > 对话为主入口 · 日批为主 · 只查文件在不在 · 不回写 ERP < / span >
< / div >
< div class = "view-tabs" id = "topTabs" >
< button type = "button " data-view = "chat" class = "active "> 会话 < / button >
< button type = "button" data-view = "records "> 检核记录 < / button >
< button type = "button" data-view = "share" > 共享盘材料 < / button >
< button type = "button " data-view = "wecom " > 缺资料通知 < / button >
< / div >
< / div >
< section class = "view chat-shell active" id = "view-chat" >
< aside class = "sidebar" >
< div class = "agent-name" >
< div class = "avatar" > 凭< / div >
< div >
< div > 立账凭证检核< / div >
< div class = "muted" > 每日 09:00 自动检核< / div >
< / div >
< / div >
< button type = "button" class = "new-chat" id = "btnNewChat" > 新建会话< / button >
< div >
< p class = "side-label" > 最近会话< / p >
< div class = "hist-item active" > < div class = "t" > 今日日批检核< / div > < div class = "s" > 定时 · 09:00 · 含 2 票缺资料< / div > < / div >
< div class = "hist-item" > < div class = "t" > 加急:INV-20260802018< / div > < div class = "s" > 会话手动 · 昨日< / div > < / div >
< div class = "hist-item" > < div class = "t" > 查询缺资料发票< / div > < div class = "s" > 会话 · 上周< / div > < / div >
< / div >
< div class = "hint-box" > 审计找资料:只查文件在不在。已齐全且材料未变更 → 跳过;缺资料/新票/目录有变更 → 再扫。ERP 只取发票清单。< / div >
< / aside >
< div class = "chat-main" >
< div class = "chat-scroll" id = "chatScroll" >
< div class = "chat-welcome show" id = "chatWelcome" >
< div >
< h1 > 立账凭证< em > 检核助手< / em > < / h1 >
< p > 每日按当月发票号扫描共享盘:只看必检材料在不在,不核对金额/供应商。已齐全且材料未变更则跳过。也可会话手动触发。< / p >
< div class = "quick-row" id = "quickRow" >
< button type = "button" class = "quick-chip" data-q = "执行今日立账凭证检核" > 执行今日立账凭证检核(增量)< / button >
< button type = "button" class = "quick-chip" data-q = "重新检核当月全部" > 重新检核当月全部< / button >
< button type = "button" class = "quick-chip" data-q = "检核发票 INV-20260803001" > 检核发票 INV-20260803001< / button >
< button type = "button" class = "quick-chip" data-q = "查询最新检核结果" > 查询最新检核结果< / button >
< button type = "button" class = "quick-chip" data-q = "查询缺资料发票" > 查询缺资料发票< / button >
< / div >
< / div >
< / div >
< div class = "msg-list" id = "msgList" > < / div >
< / div >
< div class = "composer" >
< div class = "composer-dock" >
< div class = "composer-meta" >
< span class = "pill cron" > 绑定日批任务< / span >
< span class = "hint" > 只查材料存在性 · 不做字段吻合 · 单票状态落库 · 必检清单 TBD< / span >
< / div >
< div class = "composer-box" >
< textarea id = "composerInput" rows = "2" placeholder = "例如:执行今日立账凭证检核 / 重新检核当月全部 / 检核发票 INV-xxx" > < / textarea >
< button type = "button" class = "send-btn" id = "btnSend" > 发送< / button >
< / div >
< / div >
< / div >
< / div >
< / section >
< section class = "view page-shell" id = "view-records" >
< div class = "page-head" >
< div >
< h1 > 检核记录< / h1 >
< p > 定时与会话触发统一落库;日批默认增量(齐全且材料未变更计入跳过);可按缺资料筛选< / p >
< / div >
< div style = "display:flex;gap:8px;flex-wrap:wrap;" >
< button type = "button" class = "btn" id = "btnGotoWecom" > 查看缺资料通知< / button >
< button type = "button" class = "btn primary" id = "btnMockExport" > 下载批次 Excel(示意)< / button >
< / div >
< / div >
< div class = "stats" id = "recordStats" > < / div >
< div class = "toolbar" >
< div class = "filters" id = "recordFilters" >
< button type = "button" data-filter = "all" class = "active" > 全部批次< / button >
< button type = "button" data-filter = "cron" > 定时< / button >
< button type = "button" data-filter = "chat" > 会话< / button >
< button type = "button" data-filter = "missing" > 含缺资料< / button >
< / div >
< span class = "muted" id = "recordCount" > 共 0 批< / span >
< / div >
< div class = "detail-grid" >
< div class = "panel" >
< table class = "data" >
< thead > < tr > < th > 批次< / th > < th > 触发< / th > < th > 时间< / th > < th > 统计< / th > < th > 状态< / th > < / tr > < / thead >
< tbody id = "batchTable" > < / tbody >
< / table >
< / div >
< div class = "card-block" id = "batchDetail" > < h3 > 批次明细< / h3 > < p class = "muted" > 选择左侧批次查看按发票号结果< / p > < / div >
< / div >
< / section >
< section class = "view page-shell" id = "view-share" >
< div class = "page-head" >
< div >
< h1 > 共享盘材料< / h1 >
< p > 每个发票号一个子目录;Agent 只判断必检材料文件是否存在(不做字段核对)< / p >
< / div >
< / div >
< div class = "path-box" > \\192.168.x.x\立账凭证\{发票号}\
├─ 核价单.*
├─ 采购单.*
└─ 发票扫描件.* ← 第三项是否必检:TBD< / div >
< div class = "detail-grid" >
< div class = "card-block" >
< h3 > 发票文件夹< / h3 >
< div class = "folder-list" id = "folderList" > < / div >
< / div >
< div class = "card-block" >
< h3 id = "folderTitle" > 材料预览< / h3 >
< div class = "file-rows" id = "fileRows" > < / div >
< div class = "tbd-note" > 必检材料清单尚未最终确认。当前原型默认:核价单、采购单为必检;发票扫描件暂标「待确认」。< / div >
< / div >
< / div >
< div class = "card-block" >
< h3 > ERP 用途(占位)< / h3 >
< p class = "muted" style = "margin:0 0 10px;" > ERP 只提供当月立账凭证的< strong > 发票号清单< / strong > ,用于定位共享盘子目录。不核对金额、供应商等字段是否吻合。< / p >
< table class = "data" >
< thead > < tr > < th > 示意字段< / th > < th > 用途< / th > < / tr > < / thead >
< tbody >
< tr > < td > 发票号< / td > < td > 当月清单主键 → 共享盘文件夹名< / td > < / tr >
< tr > < td > 会计月(TBD) < / td > < td > 限定「当月」集合< / td > < / tr >
< / tbody >
< / table >
< / div >
< / section >
< section class = "view" id = "view-wecom" >
< div class = "wecom-stage" >
< div class = "phone" >
< div class = "phone-bar" > 企业微信 · 应用消息< / div >
< div class = "wecom-card" >
< div class = "hd" id = "wecomTitle" > 立账凭证缺资料提醒< / div >
< div class = "bd" id = "wecomBody" > < / div >
< div class = "ft" id = "wecomJump" > 查看检核记录< / div >
< / div >
< / div >
< div class = "wecom-side" >
< div class = "card-block" >
< h3 > 通知规则(示意)< / h3 >
< p class = "muted" style = "margin:0;line-height:1.6;" >
• 日批或会话检核发现「缺资料」时推送< br >
• 收件人:排程负责人 / 可配置抄送(TBD)< br >
• 卡片跳转:HXOPS 检核记录对应批次< br >
• 同一发票同日重复缺资料:合并或节流(TBD)
< / p >
< / div >
< div style = "display:flex;gap:8px;flex-wrap:wrap;" >
< button type = "button" class = "btn primary" id = "btnSimulateNotify" > 模拟推送下一条< / button >
< button type = "button" class = "btn" id = "btnOpenRecordsFromWecom" > 打开检核记录< / button >
< / div >
< / div >
< / div >
< / section >
< div class = "toast" id = "toast" > < / div >
< header class = "top" > < div > < b > 立账凭证资料检核 < / b > < small > Profile 驱动 · 多来源获取 · 按 invoice 归档 < / small > < / div > < nav class = "tabs" id = "tabs" > < button class = "active" data-v = "tasks" > 检核任务 < / button > < button data-v = "work" > 检核工作台 < / button > < button data-v = "rules" > 文件规则 < / button > < button data-v = "records" > 执行记录 < / button > < button data-v = "excel" > 企微通知附件 Excel < / button > < button data-v = "notice" > 企业微信通知 < / button > < / nav > < / header >
< main >
< section class = "profile" > < label > < b > 当前业务方 Profile < / b > < br > < select id = "profile" > < option value = "sales" > 销售一期 · 已确认 < / option > < option value = "procurement" > 采购二期 · 待确认 < / option > < / select > < / label > < div id = "profileInfo" > < / div > < div id = "profileBadge" > < / div > < / section >
< section class = "view active" id = "v-tasks" > < div class = "hero" > < div > < h1 > 检核任务 < / h1 > < p > 按批次查看销售、采购等业务方的资料检核结果,并进入明细、企微通知附件和通知记录。 < / p > < / div > < div > < button class = "btn" id = "taskForce" > 强制重检 < / button > < button class = "btn primary" id = "taskCreate" > 新建任务 < / button > < / div > < / div > < div class = "grid task-metrics" id = "taskMetrics" > < / div > < article class = "card filters" > < label > 资料所属期间 < select id = "taskPeriod" > < option value = "all" > 全部期间 < / option > < option value = "2026-07" selected > 2026-07 < / option > < option value = "2026-06" > 2026-06 < / option > < option value = "2026-05" > 2026-05 < / option > < / select > < / label > < label > 业务方 < select id = "taskProfile" > < option value = "all" > 全部 < / option > < option value = "sales" selected > 销售 < / option > < option value = "procurement" > 采购 < / option > < / select > < / label > < label > 状态 < select id = "taskStatus" > < option value = "all" > 全部 < / option > < option value = "missing" > 缺件 < / option > < option value = "complete" > 已完成 < / option > < option value = "failed" > 技术失败 < / option > < / select > < / label > < div class = "task-actions" > < button class = "btn primary" id = "taskSearch" > 查询 < / button > < button class = "btn" id = "taskReset" > 重置 < / button > < / div > < / article > < article class = "card" > < div class = "hd" > < div > < h2 > 任务列表 < / h2 > < p id = "taskCount" > < / p > < / div > < / div > < div class = "bd" style = "padding:0" > < div class = "workbook" > < table class = "task-table" > < thead > < tr > < th > 批次号 < / th > < th > 业务方 < / th > < th > 资料所属期间 < / th > < th > 执行时间 < / th > < th > 主体总数 < / th > < th > 已归档 < / th > < th > 缺件文件 < / th > < th > 缺件 invoice < / th > < th > 状态 < / th > < th > 操作 < / th > < / tr > < / thead > < tbody id = "taskRows" > < / tbody > < / table > < / div > < / div > < / article > < / section >
< section class = "view" id = "v-work" > < div class = "hero" > < div > < h1 id = "title" > < / h1 > < p id = "desc" > < / p > < / div > < div > < button class = "btn" id = "force" > 强制重检上月 < / button > < button class = "btn primary" id = "run" > 执行本周增量检核 < / button > < / div > < / div > < div class = "grid three" id = "metrics" > < / div > < div class = "grid two" > < article class = "card" > < div class = "hd" > < div > < h2 > 本周执行批次 · DCR-20260818-001 < / h2 > < p > 检核期间:2026-07(上一个自然月) < / p > < / div > < span class = "badge blue" id = "runBadge" > 待执行 < / span > < / div > < div class = "bd" > < div class = "bar" > < i id = "bar" > < / i > < / div > < div class = "stats" id = "stats" > < / div > < p class = "muted" id = "runText" > < / p > < button class = "btn" data-go = "records" > 查看执行明细 < / button > < button class = "btn" id = "excel" > 下载统一 Excel(示意) < / button > < / div > < / article > < article class = "card" > < div class = "hd" > < div > < h2 > 通用执行链路 < / h2 > < p > 业务差异由 Profile 与 Adapter 承担 < / p > < / div > < span class = "badge blue" > 可扩展 < / span > < / div > < div class = "bd" > < div class = "step" > < b class = "no" > 1 < / b > < div > < strong > 确定上一个自然月 < / strong > < small > 每周执行,正确处理跨年 < / small > < / div > < span class = "badge gray" > 通用 < / span > < / div > < div class = "step" > < b class = "no" > 2 < / b > < div > < strong > 加载 Profile 与文件规则 < / strong > < small > 销售、采购拥有不同文件及命名 < / small > < / div > < span class = "badge gray" > 通用 < / span > < / div > < div class = "step" > < b class = "no" > 3 < / b > < div > < strong > 调用来源 Adapter < / strong > < small > ERP / OA / 固定目录 / 网盘 < / small > < / div > < span class = "badge blue" > Adapter < / span > < / div > < div class = "step" > < b class = "no" > 4 < / b > < div > < strong > 归档、汇总、Excel 与通知 < / strong > < small > 同 invoice 集中归档;缺件按两个维度汇总 < / small > < / div > < span class = "badge green" > 通用 < / span > < / div > < / div > < / article > < / div > < div class = "grid two" > < article class = "card" > < div class = "hd" > < div > < h2 > Excel 结果预览 < / h2 > < p > 工作表:检核结果(逐票状态) < / p > < / div > < span class = "badge amber" > 批量缺件 < / span > < / div > < div class = "bd" id = "excelSummary" > < / div > < / article > < article class = "card" > < div class = "hd" > < div > < h2 > 归档原则 < / h2 > < p > 临时保存 → 校验关联 → 复制归档 < / p > < / div > < / div > < div class = "bd" > < p class = "muted" id = "archiveNote" > < / p > < div class = "code" > {归档根路径}/{yyyy}/{MM}/{invoice号}/ < / div > < / div > < / article > < / div > < div class = "grid two" > < article class = "card" > < div class = "hd" > < div > < h2 > 本 Profile 文件覆盖 < / h2 > < p > 来源与待确认状态 < / p > < / div > < button class = "btn" data-go = "rules" > 完整规则 < / button > < / div > < div class = "bd" id = "ruleSummary" > < / div > < / article > < article class = "card" > < div class = "hd" > < div > < h2 > Excel 结果粒度 < / h2 > < p > 一行一个 invoice < / p > < / div > < / div > < div class = "bd" > < p class = "muted" > 顶部选择资料所属期间并展示执行时间;表格仅展示每个必检文件是否缺件和总体状态,全部文件均不缺时状态为“完整”。 < / p > < button class = "btn" data-go = "excel" > 查看检核结果表 < / button > < / div > < / article > < / div > < / section >
< section class = "view" id = "v-rules" > < div class = "hero" > < div > < h1 > 文件规则配置 < / h1 > < p > 新增业务方优先新增 Profile;新增外部系统时才增加 Adapter。 < / p > < / div > < / div > < div class = "grid two" > < article class = "card" > < div class = "bd" style = "padding:0" > < table > < thead > < tr > < th > 文件类型 < / th > < th > 命名方式 < / th > < th > 来源 < / th > < th > 状态 < / th > < / tr > < / thead > < tbody id = "ruleTable" > < / tbody > < / table > < / div > < / article > < article class = "card detail" > < div class = "hd" > < div > < h2 > 规则详情 < / h2 > < p > 点击左侧规则查看 < / p > < / div > < / div > < div class = "bd" id = "ruleDetail" > < / div > < / article > < / div > < / section >
< section class = "view" id = "v-records" > < div class = "hero" > < div > < h1 > 执行记录与归档明细 < / h1 > < p > 记录粒度:invoice + 文件规则 + 文件实例;左侧显示每张 invoice 的缺件数。 < / p > < / div > < button class = "btn primary" data-go = "excel" > 查看当前批次 Excel(示意) < / button > < / div > < div class = "grid two" > < article class = "card" > < div class = "hd" > < div > < h2 > 本批次缺件 invoice 汇总 < / h2 > < p > 用于通知和业务跟进 < / p > < / div > < / div > < div class = "bd " id = "invoiceSummary" > < / div > < / article > < article class = "card" > < div class = "hd" > < div > < h2 > 按文件类型缺件汇总 < / h2 > < p > 用于通知和业务跟进 < / p > < / div > < / div > < div class = "bd" id = "typeSummary" > < / div > < / article > < / div > < div class = "layout" style = "margin-top:14px" > < aside class = "card menu" id = "subjects" > < / aside > < article class = "card" > < div class = "bd" id = "subjectDetail "> < / div > < / article > < / div > < / section >
< section class = "view" id = "v-excel" > < div class = "hero" > < div > < h1 > 企业微信通知附件 Excel < / h1 > < p > 企业微信汇总通知的下载文件: < b id = "excelFilename" > voucher_check_sales_2026-07_DCR-20260818-001.xlsx < / b > · 一张“检核结果”工作表,每行一个 invoice。 < / p > < / div > < div > < label class = "muted" > 资料所属期间 < select id = "reportYear" > < option > 2025 < / option > < option selected > 2026 < / option > < / select > 年 < select id = "reportMonth" > < option > 01 < / option > < option > 02 < / option > < option > 03 < / option > < option > 04 < / option > < option > 05 < / option > < option > 06 < / option > < option selected > 07 < / option > < option > 08 < / option > < option > 09 < / option > < option > 10 < / option > < option > 11 < / option > < option > 12 < / option > < / select > 月 < / label > < button class = "btn primary" id = "downloadExcel" > 下载企微通知附件(示意) < / button > < / div > < / div > < article class = "card" > < div class = "hd" > < div > < h2 class = "sheet-title" id = "sheetTitle "> < / h2 > < p class = "sheet-meta" id = "sheetMeta" > < / p > < / div > < span class = "badge blue" id = "sheetBadge" > < / span > < / div > < div class = "bd" id = "sheetContent" > < / div > < / article > < / section >
< section class = "view" id = "v-notice" > < div class = "hero" > < div > < h1 > 企业微信缺件通知 < / h1 > < p > 一次检核发送一条批次汇总;完整 invoice 明细通过企业微信通知附件 Excel 与执行记录查看。 < / p > < / div > < / div > < div class = "grid two" > < div class = "phone" > < small > 企业微信 · 应用消息 < / small > < div class = "notice" > < h3 id = "noticeTitle" > < / h3 > < p id = "noticeBody" > < / p > < button id = "noticeExcel" > 查看企微通知附件 Excel(示意) < / button > < / div > < / div > < article class = "card" > < div class = "hd" > < div > < h2 > 通知策略 < / h2 > < p > 由 Profile 配置 < / p > < / div > < span class = "badge amber" > 接收人待定 < / span > < / div > < div class = "bd" > < div class = "kv" > < b > 触发 < / b > < span > 本批存在任一必检文件缺件 < / span > < / div > < div class = "kv" > < b > 聚合 < / b > < span > 每个检核批次合并为一条汇总通知 < / span > < / div > < div class = "kv" > < b > 内容 < / b > < span > 业务方、检核月份、批次号、主体总数、缺件文件数、缺件 invoice 数、主要缺失类型 < / span > < / div > < div class = "kv" > < b > 明细 < / b > < span > 不在消息正文逐票展开;完整 invoice 与文件明细查看企微通知附件 Excel 或执行记录 < / span > < / div > < div class = "kv" > < b > 附件 < / b > < span > 消息提供本批 Excel 附件下载入口;一行一个 invoice,展示每个文件状态和总体状态 < / span > < / div > < div class = "kv" > < b > 无接收人 < / b > < span > 不发送空通知;Excel 和日志记录未发送原因 < / span > < / div > < / div > < / article > < / div > < / section >
< / main > < div class = "toast " id = "toast " > < / div >
< script >
/**
* 立账凭证检核 HTML 原型交互(演示数据,不接真实 API)。
*/
( function ( ) {
const REQUIRED _MATERIALS = [
{ key : "pricing" , label : "核价单" , required : true } ,
{ key : "po" , label : "采购单" , required : true } ,
{ key : "invoice_scan" , label : "发票扫描件" , required : false , tbd : true } ,
] ;
const FOLDERS = [
{
invoiceNo : "INV-20260803001" ,
vendor : "煜英精密" ,
files : [
{ key : "pricing" , name : "核价单_煜英_0803.pdf" , present : true } ,
{ key : "po" , name : "采购单_PO26080301.pdf" , present : true } ,
{ key : "invoice_scan" , name : "发票扫描件.jpg" , present : true } ,
] ,
} ,
{
invoiceNo : "INV-20260803012" ,
vendor : "华信材料" ,
files : [
{ key : "pricing" , name : "" , present : false } ,
{ key : "po" , name : "采购单_PO26080312.pdf" , present : true } ,
{ key : "invoice_scan" , name : "" , present : false } ,
] ,
} ,
{
invoiceNo : "INV-20260803018" ,
vendor : "南通机电" ,
files : [
{ key : "pricing" , name : "核价单.pdf" , present : true } ,
{ key : "po" , name : "采购单.pdf" , present : true } ,
{ key : "invoice_scan" , name : "发票.pdf" , present : true } ,
] ,
} ,
] ;
const BATCHES = [
{
id : "AVR-20260803-001" ,
trigger : "cron" ,
time : "2026-08-03 09:00" ,
status : "done" ,
stats : { total : 28 , todo : 6 , skip : 22 , ok : 3 , human : 0 , missing : 2 , human : 0 } ,
rows : [
{ invoiceNo : "INV-20260803001" , conclusion : "ok" , note : "必检材料齐全(今日增量跳过)" } ,
{ invoiceNo : "INV-20260803012" , conclusion : "missing" , note : "缺核价单;发票扫描件待确认" } ,
{ invoiceNo : "INV-20260803015" , conclusion : "human" , note : "目录内文件命名无法识别是否为核价单" } ,
{ invoiceNo : "INV-20260803018" , conclusion : "ok" , note : "必检材料齐全(今日增量可跳过)" } ,
{ invoiceNo : "INV-20260803021" , conclusion : "missing" , note : "共享盘无此发票号文件夹" } ,
] ,
} ,
{
id : "AVR-20260802-003" ,
trigger : "chat" ,
time : "2026-08-02 15:22" ,
status : "done" ,
stats : { total : 1 , todo : 1 , skip : 0 , ok : 1 , human : 0 , missing : 0 , human : 0 } ,
rows : [ { invoiceNo : "INV-20260802018" , conclusion : "ok" , note : "会话加急单票检核通过" } ] ,
} ,
{
id : "AVR-20260802-001" ,
trigger : "cron" ,
time : "2026-08-02 09:00" ,
status : "done" ,
stats : { total : 9 , todo : 9 , skip : 0 , ok : 7 , fail : 0 , missing : 2 , human : 0 } ,
rows : [
{ invoiceNo : "INV-20260802003" , conclusion : "missing" , note : "缺采购单" } ,
{ invoiceNo : "INV-20260802007" , conclusion : "missing" , note : "共享盘无发票号文件夹" } ,
] ,
} ,
] ;
const MISSING _NOTIFY _QUEUE = [
{
title : "立账凭证缺资料提醒" ,
body : "批次:AVR-20260803-001\n发票号:INV-20260803012\n供应商:华信材料\n缺失材料:核价单\n共享路径:\\\\share\\立账凭证\\INV-20260803012\\\n请尽快补齐后可回复「检核发票 INV-20260803012」重跑。" ,
} ,
{
title : "立账凭证缺资料提醒" ,
body : "批次:AVR-20260803-001\n发票号:INV-20260803021\n缺失材料:共享盘无发票号文件夹\n共享路径:\\\\share\\立账凭证\\INV-20260803021\\\n请创建目录并放入核价单、采购单后重检。" ,
} ,
] ;
let selectedBatchId = BATCHES [ 0 ] . id ;
let selectedFolder = FOLDERS [ 0 ] . invoiceNo ;
let notifyIndex = 0 ;
let running = false ;
let progressTimer = null ;
function $ ( id ) { return document . getElementById ( id ) ; }
function toast ( text ) {
const el = $ ( "toast" ) ;
el . textContent = text ;
el . classList . add ( "show" ) ;
clearTimeout ( toast . _t ) ;
toast . _t = setTimeout ( function ( ) { el . classList . remove ( "show" ) ; } , 2200 ) ;
}
function switchView ( name ) {
document . querySelectorAll ( ".view" ) . forEach ( function ( v ) { v . classList . remove ( "active" ) ; } ) ;
document . querySelectorAll ( "#topTabs button" ) . forEach ( function ( b ) {
b . classList . toggle ( "active" , b . dataset . view === name ) ;
} ) ;
const view = $ ( "view-" + name ) ;
if ( view ) view . classList . add ( "active" ) ;
}
function conclusionPill ( c ) {
const map = {
ok : [ "齐全" , "ok" ] ,
missing : [ "缺资料" , "miss" ] ,
human : [ "人工判定" , "human" ] ,
} ;
const pair = map [ c ] || [ "未知" , "human" ] ;
return '<span class="pill ' + pair [ 1 ] + '">' + pair [ 0 ] + "</span>" ;
}
function triggerPill ( t ) {
return t === "cron"
? '<span class="pill cron">定时</span>'
: '<span class="pill chat">会话</span>' ;
}
function hideWelcome ( ) { $ ( "chatWelcome" ) . classList . remove ( "show" ) ; }
function scrollChat ( ) {
const sc = $ ( "chatScroll" ) ;
sc . scrollTop = sc . scrollHeight ;
}
function appendUser ( text ) {
hideWelcome ( ) ;
const wrap = document . createElement ( "div" ) ;
wrap . className = "msg user" ;
wrap . innerHTML = '<div class="bubble"></div><div class="msg-meta">我 · 刚刚</div>' ;
wrap . querySelector ( ".bubble" ) . textContent = text ;
$ ( "msgList" ) . appendChild ( wrap ) ;
scrollChat ( ) ;
}
function appendAssistant ( html ) {
hideWelcome ( ) ;
const wrap = document . createElement ( "div" ) ;
wrap . className = "msg assistant" ;
wrap . innerHTML = html + '<div class="msg-meta">立账凭证检核 · 刚刚</div>' ;
$ ( "msgList" ) . appendChild ( wrap ) ;
scrollChat ( ) ;
return wrap ;
}
function buildProgressCard ( runId ) {
return (
'<div class="progress-card" data-run="' + runId + '">' +
'<div class="hd"><strong>检核批次 ' + runId + '</strong><span class="status running">进行中</span></div>' +
'<div class="bd"><div class="bar-wrap"><div class="bar" style="width:8%"></div></div>' +
'<div class="counters">' +
'<div class="counter"><div class="n" data-k="total">28</div><div class="l">当月总数</div></div>' +
'<div class="counter"><div class="n" data-k="todo">0</div><div class="l">本次待检</div></div>' +
'<div class="counter skip"><div class="n" data-k="skip">0</div><div class="l">跳过</div></div>' +
'<div class="counter ok"><div class="n" data-k="ok">0</div><div class="l">齐全</div></div>' +
'<div class="counter miss"><div class="n" data-k="missing">0</div><div class="l">缺资料</div></div>' +
'<div class="counter"><div class="n" data-k="human">0</div><div class="l">人工判定</div></div>' +
'</div><div class="progress-sub" data-step>阶段:拉取 ERP 当月立账凭证…</div>' +
'<div class="progress-actions">' +
'<button type="button" class="btn" data-act="records" disabled>查看记录</button>' +
'<button type="button" class="btn" data-act="excel" disabled>下载 Excel</button>' +
'<button type="button" class="btn" data-act="notify" disabled>查看缺资料通知</button>' +
'</div></div></div>'
) ;
}
function buildResultCard ( ) {
return (
'<div class="result-card"><div class="hd"><div><h3>INV-20260803012 · 华信材料</h3>' +
'<p>共享盘:\\\\share\\立账凭证\\INV-20260803012\\ · 只查文件在不在</p></div>' + conclusionPill ( "missing" ) + "</div>" +
'<div class="bd"><div><div class="muted" style="margin-bottom:6px;">必检材料是否存在(不做金额/供应商核对)</div><div class="mat-list">' +
'<span class="mat-chip miss">核价单 · 缺失</span><span class="mat-chip ok">采购单 · 已找到</span>' +
'<span class="mat-chip miss">发票扫描件 · 缺失(TBD) </span></div></div>' +
'<p class="muted" style="margin:0;">审计用途:快速定位缺件;补齐后可再扫该票或等日批增量。</p>' +
'<div class="progress-actions">' +
'<button type="button" class="btn primary" data-act="notify">已发企微补件通知</button>' +
'<button type="button" class="btn" data-act="records">打开检核记录</button></div></div></div>'
) ;
}
function simulateRun ( mode , invoiceHint ) {
if ( running ) { toast ( "检核进行中,请先查看当前进度" ) ; return ; }
running = true ;
$ ( "btnSend" ) . disabled = true ;
const runId = mode === "single" ? "AVR-MANUAL-" + Date . now ( ) . toString ( ) . slice ( - 6 ) : "AVR-20260803-RUN" ;
let intro ;
if ( mode === "single" ) {
intro = [ "已接收单票检核请求:" + ( invoiceHint || "指定发票" ) + "。" , "强制扫描该票(忽略跳过),正在检查共享盘必检材料是否存在…" ] . join ( String . fromCharCode ( 10 ) ) ;
} else if ( mode === "force" ) {
intro = [ "已启动「重新检核当月全部」(强制模式)。" , "将忽略历史齐全状态,对当月全部发票重新扫描材料是否存在…" ] . join ( String . fromCharCode ( 10 ) ) ;
} else {
intro = [ "已启动今日立账凭证检核(增量模式,与日批同一引擎)。" , "拉取 ERP 当月集合后,已齐全且材料未变更的票将跳过…" ] . join ( String . fromCharCode ( 10 ) ) ;
}
appendAssistant ( '<div class="bubble">' + intro + "</div>" ) ;
const cardWrap = appendAssistant ( buildProgressCard ( runId ) ) ;
const card = cardWrap . querySelector ( ".progress-card" ) ;
let steps ;
if ( mode === "single" ) {
card . querySelector ( '[data-k="total"]' ) . textContent = "1" ;
card . querySelector ( '[data-k="todo"]' ) . textContent = "1" ;
card . querySelector ( '[data-k="skip"]' ) . textContent = "0" ;
steps = [
{ pct : 35 , todo : 1 , skip : 0 , ok : 0 , human : 0 , missing : 0 , text : "阶段:定位共享盘 · " + ( invoiceHint || "INV-xxx" ) } ,
{ pct : 70 , todo : 1 , skip : 0 , ok : 0 , human : 0 , missing : 0 , text : "阶段:检查必检材料是否存在" } ,
{ pct : 100 , todo : 1 , skip : 0 , ok : 0 , human : 0 , missing : 1 , text : "阶段:完成 · 结论:缺资料(已通知)" } ,
] ;
} else if ( mode === "force" ) {
card . querySelector ( '[data-k="total"]' ) . textContent = "28" ;
steps = [
{ pct : 20 , todo : 28 , skip : 0 , ok : 4 , human : 0 , missing : 1 , text : "阶段:强制重检 · 不跳过历史合格票" } ,
{ pct : 55 , todo : 28 , skip : 0 , ok : 14 , human : 0 , missing : 2 , text : "阶段:材料齐全度进行中…" } ,
{ pct : 100 , todo : 28 , skip : 0 , ok : 24 , human : 0 , missing : 2 , text : "阶段:完成 · 当月 28 票全部重检(跳过 0)" } ,
] ;
} else {
card . querySelector ( '[data-k="total"]' ) . textContent = "28" ;
steps = [
{ pct : 15 , todo : 6 , skip : 22 , ok : 0 , human : 0 , missing : 0 , text : "阶段:状态比对 · 当月 28 票,跳过已齐全未变更 22 票" } ,
{ pct : 45 , todo : 6 , skip : 22 , ok : 2 , human : 0 , missing : 1 , text : "阶段:检核待办票 · 当前 INV-20260803012(缺核价单)" } ,
{ pct : 75 , todo : 6 , skip : 22 , ok : 3 , human : 0 , missing : 2 , text : "阶段:检核待办票 · 当前 INV-20260803015" } ,
{ pct : 100 , todo : 6 , skip : 22 , ok : 3 , human : 0 , missing : 2 , text : "阶段:完成 · 新检 6 / 跳过 22 · 缺资料已推送企微" } ,
] ;
}
let i = 0 ;
clearInterval ( progressTimer ) ;
progressTimer = setInterval ( function ( ) {
const s = steps [ i ++ ] ;
if ( ! s ) return ;
card . querySelector ( ".bar" ) . style . width = s . pct + "%" ;
card . querySelector ( '[data-k="todo"]' ) . textContent = String ( s . todo ) ;
card . querySelector ( '[data-k="skip"]' ) . textContent = String ( s . skip ) ;
card . querySelector ( '[data-k="ok"]' ) . textContent = String ( s . ok ) ;
card . querySelector ( '[data-k="human"]' ) . textContent = String ( s . human ) ;
card . querySelector ( '[data-k="missing"]' ) . textContent = String ( s . missing ) ;
card . querySelector ( "[data-step]" ) . textContent = s . text ;
if ( s . pct >= 100 ) {
clearInterval ( progressTimer ) ;
const st = card . querySelector ( ".status" ) ;
st . textContent = s . missing > 0 ? "完成(含缺资料)" : "已完成" ;
st . className = "status " + ( s . missing > 0 ? "partial" : "done" ) ;
card . querySelectorAll ( "[data-act]" ) . forEach ( function ( b ) { b . disabled = false ; } ) ;
running = false ;
$ ( "btnSend" ) . disabled = false ;
const summary = [
"检核完成。当月 " + card . querySelector ( '[data-k="total"]' ) . textContent +
" 票 · 本次待检 " + s . todo + " · 跳过 " + s . skip +
" · 齐全 " + s . ok + " · 缺资料 " + s . missing + " · 人工判定 " + s . human + "。" ,
( s . skip > 0 ? "已齐全且材料未变更的票未重复扫描。" : "本次为强制全量,未跳过。" )
] . concat ( s . missing > 0 ? [ "缺资料发票已发送企微通知。" ] : [ ] ) . join ( String . fromCharCode ( 10 ) ) ;
appendAssistant ( '<div class="bubble">' + summary + "</div>" + ( ( mode === "single" || s . missing > 0 ) ? buildResultCard ( ) : "" ) ) ;
renderWecom ( 0 ) ;
/** 原型交互:切换 Profile 后刷新规则、汇总、明细和通知;销售可模拟周度上月增量执行。 */
( ( ) => {
const $ = ( id ) => document . getElementById ( id ) ;
const profiles = {
sales : {
name : '销售一期' , enabled : true ,
desc : '每周增量检核上一个自然月;以销售 invoice 为核心,从 ERP、OA 与固定目录获取文件并集中归档。' ,
metrics : [ [ '6' , '必检文件规则' ] , [ '每周' , '执行频率' ] , [ '上月' , '检核范围' ] ] ,
note : '缺少任一必检文件时生成双维度汇总 Excel 并发送企业微信通知;通知接收人待业务确认。' ,
rules : [
[ 'PO订单' , '{invoice号}-{订单号}.pdf' , 'erp' , 'ERP 查询并打印' , '以 invoice 反查 PO' , '查询条件待补充' , '已确认' ] ,
[ '报关资料' , '{invoice号}.pdf' , 'dir' , '固定目录扫描' , '文件名含 invoice' , '路径待确认' , '待确认' ] ,
[ '销货放行申请单' , '{invoice号}-{销货单号}.pdf' , 'oa' , 'OA 报表打印' , 'OA 读取发票号和销货单号' , '上月 + 归档 + HXJM + 发票号非空' , '流程已确认' ] ,
[ '发票' , '{invoice号}-{发票号}.pdf' , 'dir' , '固定目录扫描' , '文件名含 invoice' , '路径待确认' , '待确认' ] ,
[ '报关单' , '{invoice号}-{报关单号}.pdf' , 'dir' , '固定目录扫描' , '文件名含 invoice' , '路径待确认' , '待确认' ] ,
[ '提单' , '{invoice号}-提单.pdf' , 'dir' , '固定目录扫描' , '文件名含 invoice' , '路径待确认' , '待确认' ]
] ,
subjects : [
[ 'INV-202607-00128' , '已归档' , [ [ 'PO订单' , 'ERP 打印' , 'archived' ] , [ '销货放行申请单' , 'OA 打印' , 'archived' ] , [ '报关资料' , '固定目录' , 'archived' ] , [ '发票' , '固定目录' , 'archived' ] , [ '报关单' , '固定目录' , 'archived' ] , [ '提单' , '固定目录' , 'archived' ] ] ] ,
[ 'INV-202607-00135' , '缺 2 件' , [ [ 'PO订单' , 'ERP 打印' , 'archived' ] , [ '报关资料' , '固定目录' , 'missing' ] , [ '销货放行申请单' , 'OA 打印' , 'archived' ] , [ '报关单' , '固定目录' , 'missing' ] ] ] ,
[ 'INV-202607-00148' , '缺 2 件' , [ [ 'PO订单' , 'ERP 打印' , 'archived' ] , [ '发票' , '固定目录' , 'missing' ] , [ '提单' , '固定目录' , 'missing' ] ] ] ,
[ 'INV-202607-00141' , '已跳过' , [ [ '全部文件' , '来源指纹未变' , 'skipped' ] ] ]
] ,
notice : [ '销售立账凭证缺件汇总提醒' , '业务方:销售\n检核月份:2026-07\n批次:DCR-20260818-001\n检核主体:8 张\n缺件文件:4 项\n缺件发票:2 张\n主要缺失:报关资料、报关单、发票、提单\n\n完整缺件清单请下载本批 Excel 查看。\n\n接收人:待配置' ]
} ,
procurement : {
name : '采购二期' , enabled : false ,
desc : '采购复用同一引擎,加载独立 Profile;当前仅展示文件规则,主体来源、路径和 Adapter 参数待业务确认。' ,
metrics : [ [ '6' , '拟定文件规则' ] , [ '待定' , '扫描路径' ] , [ '复用' , '归档 / Excel / 通知' ] ] ,
note : '采购将复用周度上月增量、单文件结果、批量缺件汇总和按 invoice 归档;暂不执行实际检核。' ,
rules : [
[ '对账单EXCEL版' , '{发票号}-对账单' , 'dir' , 'P011采购请款单附件' , '发票号' , '路径待确认' , '待确认' ] ,
[ '对账单盖章版' , '{发票号}-对账单PDF' , 'dir' , 'P011采购请款单附件' , '发票号' , '路径待确认' , '待确认' ] ,
[ '核价单' , '{发票号}-核价单' , 'oa' , '关联 OA 开票申请' , '通过出货单号关联' , 'OA 条件待确认' , '待确认' ] ,
[ '发票' , '{发票号}' , 'dir' , 'P011采购请款单附件' , '发票号' , '路径待确认' , '待确认' ] ,
[ '送货单' , '{发票号}-送货单' , 'dir' , '网盘仓储上传' , '发票号' , '路径待确认' , '待确认' ] ,
[ '付款回单' , '{发票号}-付款回单' , 'pay' , '出纳付款下载' , '发票号' , '路径待确认' , '待确认' ]
] , subjects : [ ] ,
notice : [ '采购立账凭证缺件汇总提醒(示意)' , '采购二期 Profile 尚未启用。\n\n待确认:采购 invoice 主体来源、各扫描路径、核价单 OA 关联条件、付款回单下载方式及企业微信接收人。' ]
}
} , 700 ) ;
}
function handleQuery ( text ) {
const t = text . trim ( ) ;
if ( ! t ) return ;
appendUser ( t ) ;
if ( /缺资料/ . test ( t ) ) {
appendAssistant (
'<div class="bubble">最近一批(AVR-20260803-001)缺资料发票:\n\n• INV-20260803012 — 缺核价单\n• INV-20260803021 — 共享盘无文件夹\n\n已对企业微信推送补件提醒。</div>' +
'<div class="progress-actions" style="margin-top:8px;">' +
'<button type="button" class="btn primary" data-act="records">打开检核记录</button>' +
'<button type="button" class="btn" data-act="notify">查看企微卡片</button></div>'
) ;
return ;
}
if ( /最新|结果|记录/ . test ( t ) && ! /执行|检核发票/ . test ( t ) ) {
const b = BATCHES [ 0 ] ;
appendAssistant (
'<div class="bubble">最新批次 ' + b . id + "(定时 · " + b . time + ") \n总数 " + b . stats . total +
" · 跳过 " + ( b . stats . skip || 0 ) + " · 齐全 " + b . stats . ok + " · 缺资料 " + b . stats . missing + "\n\n可下载 Excel,或到「检核记录」查看按发票号明细。</div>" +
'<div class="progress-actions" style="margin-top:8px;">' +
'<button type="button" class="btn primary" data-act="records">打开检核记录</button>' +
'<button type="button" class="btn" data-act="excel">下载 Excel(示意)</button></d iv> '
) ;
return ;
}
const m = t . match ( /INV-[\w-]+/i ) ;
if ( /检核发票|单票/ . test ( t ) || ( m && /检核/ . test ( t ) ) ) {
simulateRun ( "single" , m ? m [ 0 ] . toUpperCase ( ) : "INV-20260803012" ) ;
return ;
}
if ( /重新检核当月|强制重检|全量检核/ . test ( t ) ) {
simulateRun ( "force" ) ;
return ;
}
if ( /执行|今日|日批|开始检核|立账凭证检核/ . test ( t ) ) {
simulateRun ( "batch" ) ;
return ;
}
appendAssistant (
'<div class="bubble">我可以帮你:\n1)执行今日立账凭证检核(增量:跳过已齐全且材料未变更)\n2)重新检核当月全部(强制重扫)\n3)检核指定发票号\n4)查询最新结果 / 缺资料发票\n\n只查文件在不在;不做金额/供应商核对。</div>'
) ;
}
function renderRecordStats ( ) {
const agg = BATCHES . reduce ( function ( a , b ) {
a . batches += 1 ; a . total += b . stats . total ; a . missing += b . stats . missing ; a . fail += b . stats . fail ;
a . skip += ( b . stats . skip || 0 ) ; return a ;
} , { batches : 0 , total : 0 , missing : 0 , fail : 0 , skip : 0 } ) ;
$ ( "recordStats" ) . innerHTML =
'<div class="stat"><div class="n">' + agg . batches + '</div><div class="l">历史批次</div></div>' +
'<div class="stat"><div class="n">' + agg . total + '</div><div class="l">批次覆盖票数</div></div>' +
'<div class="stat"><div class="n" style="color:#475569">' + agg . skip + '</div><div class="l">累计跳过</div></div>' +
'<div class="stat"><div class="n" style="color:var(--warning)">' + agg . missing + '</div><div class="l">缺资料票数</div></div>' ;
}
function filteredBatches ( ) {
const active = document . querySelector ( "#recordFilters button.active" ) ;
const f = active ? active . dataset . filter : "all" ;
return BATCHES . filter ( function ( b ) {
if ( f === "cron" ) return b . trigger === "cron" ;
if ( f === "chat" ) return b . trigger === "chat" ;
if ( f === "missing" ) return b . stats . missing > 0 ;
return true ;
} ) ;
}
function renderBatchDetail ( ) {
const b = BATCHES . find ( function ( x ) { return x . id === selectedBatchId ; } ) ;
const box = $ ( "batchDetail" ) ;
if ( ! b ) { box . innerHTML = "<h3>批次明细</h3><p class=\"muted\">无数据</p>" ; return ; }
box . innerHTML =
'<div style="display:flex;justify-content:space-between;gap:10px;align-items:flex-start;flex-wrap:wrap;">' +
"<div><h3 style=\"margin:0;\">" + b . id + "</h3><p class=\"muted\" style=\"margin:6px 0 0;\">" +
b . time + " · " + ( b . trigger === "cron" ? "定时日批" : "会话手动" ) + "</p></div>" + triggerPill ( b . trigger ) + "</div>" +
'<table class="data" style="margin-top:12px;"><thead><tr><th>发票号</th><th>结论</th><th>说明</th></tr></thead><tbody>' +
b . rows . map ( function ( r ) {
return "<tr><td><strong>" + r . invoiceNo + "</strong></td><td>" + conclusionPill ( r . conclusion ) +
'</td><td class="muted">' + r . note + "</td></tr>" ;
} ) . join ( "" ) +
'</tbody></table><div class="progress-actions" style="margin-top:12px;">' +
'<button type="button" class="btn primary" id="btnDetailExcel">下载本批 Excel</button>' +
( b . stats . missing > 0 ? '<button type="button" class="btn" id="btnDetailNotify">缺资料通知</button>' : "" ) +
"</div>" ;
const ex = $ ( "btnDetailExcel" ) ;
if ( ex ) ex . onclick = function ( ) { toast ( "原型示意:将下载 " + b . id + ".xlsx" ) ; } ;
const nt = $ ( "btnDetailNotify" ) ;
if ( nt ) nt . onclick = function ( ) { renderWecom ( 0 ) ; switchView ( "wecom" ) ; } ;
}
function renderBatches ( ) {
const list = filteredBatches ( ) ;
$ ( "recordCount" ) . textContent = "共 " + list . length + " 批" ;
$ ( "batchTable" ) . innerHTML = list . map ( function ( b ) {
return '<tr data-id="' + b . id + '" class="' + ( b . id === selectedBatchId ? "active" : "" ) + '">' +
"<td><strong>" + b . id + "</strong></td><td>" + triggerPill ( b . trigger ) + "</td><td>" + b . time +
'</td><td class="muted">合' + b . stats . ok + " / 不" + b . stats . fail + " / 缺" + b . stats . missing +
'</td><td><span class="pill ok">完成</span></td></tr>' ;
} ) . join ( "" ) ;
if ( ! list . find ( function ( b ) { return b . id === selectedBatchId ; } ) && list [ 0 ] ) selectedBatchId = list [ 0 ] . id ;
renderBatchDetail ( ) ;
}
function renderFiles ( ) {
const f = FOLDERS . find ( function ( x ) { return x . invoiceNo === selectedFolder ; } ) || FOLDERS [ 0 ] ;
$ ( "folderTitle" ) . textContent = "材料预览 · " + f . invoiceNo ;
$ ( "fileRows" ) . innerHTML = REQUIRED _MATERIALS . map ( function ( m ) {
const file = f . files . find ( function ( x ) { return x . key === m . key ; } ) ;
const present = file && file . present ;
const name = present ? file . name : "(未找到)" ;
const tag = m . tbd ? '<span class="pill human">待确认是否必检</span>'
: present ? '<span class="pill ok">已找到</span>' : '<span class="pill miss">缺失</span>' ;
return '<div class="file-row-item"><div><div class="fn">' + m . label + ( m . required ? " · 必检" : "" ) +
'</div><div class="fs">' + name + "</div></div>" + tag + "</div>" ;
} ) . join ( "" ) ;
}
function renderFolders ( ) {
$ ( "folderList" ) . innerHTML = FOLDERS . map ( function ( f ) {
const missing = f . files . filter ( function ( x ) {
return ! x . present && REQUIRED _MATERIALS . find ( function ( m ) { return m . key === x . key && m . required ; } ) ;
} ) ;
const label = missing . length ? "缺 " + missing . length + " 项必检" : "必检齐全" ;
return '<div class="folder-item ' + ( f . invoiceNo === selectedFolder ? "active" : "" ) +
'" data-inv="' + f . invoiceNo + '"><div><div class="name">' + f . invoiceNo +
'</div><div class="sub">' + f . vendor + "</div></div>" +
( missing . length ? '<span class="pill miss">' + label + "</span>" : '<span class="pill ok">' + label + "</span>" ) +
"</div>" ;
} ) . join ( "" ) ;
renderFiles ( ) ;
}
function renderWecom ( index ) {
notifyIndex = index % MISSING _NOTIFY _QUEUE . length ;
const item = MISSING _NOTIFY _QUEUE [ notifyIndex ] ;
$ ( "wecomTitle" ) . textContent = item . title ;
$ ( "wecomBody" ) . textContent = item . body ;
}
document . querySelectorAll ( "#topTabs button" ) . forEach ( function ( btn ) {
btn . addEventListener ( "click" , function ( ) { switchView ( btn . dataset . view ) ; } ) ;
} ) ;
$ ( "quickRow" ) . addEventListener ( "click" , function ( e ) {
const chip = e . target . closest ( "[data-q]" ) ;
if ( ! chip ) return ;
$ ( "composerInput" ) . value = chip . dataset . q ;
handleQuery ( chip . dataset . q ) ;
} ) ;
$ ( "btnSend" ) . addEventListener ( "click" , function ( ) {
const v = $ ( "composerInput" ) . value ;
$ ( "composerInput" ) . value = "" ;
handleQuery ( v ) ;
} ) ;
$ ( "composerInput" ) . addEventListener ( "keydown" , function ( e ) {
if ( e . key === "Enter" && ! e . shiftKey ) { e . preventDefault ( ) ; $ ( "btnSend" ) . click ( ) ; }
} ) ;
$ ( "btnNewChat" ) . addEventListener ( "click" , function ( ) {
if ( running ) { toast ( "检核进行中,暂不新建" ) ; return ; }
$ ( "msgList" ) . innerHTML = "" ;
$ ( "chatWelcome" ) . classList . add ( "show" ) ;
toast ( "已新建会话" ) ;
} ) ;
document . body . addEventListener ( "click" , function ( e ) {
const act = e . target . closest ( "[data-act]" ) ;
if ( ! act ) return ;
const a = act . dataset . act ;
if ( a === "records" ) switchView ( "records" ) ;
if ( a === "notify" ) { renderWecom ( 0 ) ; switchView ( "wecom" ) ; }
if ( a === "excel" ) toast ( "原型示意:下载检核报告 Excel" ) ;
} ) ;
$ ( "recordFilters" ) . addEventListener ( "click" , function ( e ) {
const btn = e . target . closest ( "button[data-filter]" ) ;
if ( ! btn ) return ;
$ ( "recordFilters" ) . querySelectorAll ( "button" ) . forEach ( function ( b ) { b . classList . remove ( "active" ) ; } ) ;
btn . classList . add ( "active" ) ;
renderBatches ( ) ;
} ) ;
$ ( "batchTable" ) . addEventListener ( "click" , function ( e ) {
const tr = e . target . closest ( "tr[data-id]" ) ;
if ( ! tr ) return ;
selectedBatchId = tr . dataset . id ;
renderBatches ( ) ;
} ) ;
$ ( "folderList" ) . addEventListener ( "click" , function ( e ) {
const item = e . target . closest ( "[data-inv]" ) ;
if ( ! item ) return ;
selectedFolder = item . dataset . inv ;
renderFolders ( ) ;
} ) ;
$ ( "btnGotoWecom" ) . addEventListener ( "click" , function ( ) { switchView ( "wecom" ) ; } ) ;
$ ( "btnMockExport" ) . addEventListener ( "click" , function ( ) { toast ( "原型示意:导出当前筛选批次 Excel" ) ; } ) ;
$ ( "btnSimulateNotify" ) . addEventListener ( "click" , function ( ) {
renderWecom ( notifyIndex + 1 ) ;
toast ( "已切换到下一条缺资料通知" ) ;
} ) ;
$ ( "btnOpenRecordsFromWecom" ) . addEventListener ( "click" , function ( ) { switchView ( "records" ) ; } ) ;
$ ( "wecomJump" ) . addEventListener ( "click" , function ( ) {
selectedBatchId = "AVR-20260803-001" ;
renderBatches ( ) ;
switchView ( "records" ) ;
toast ( "已跳转检核记录(示意)" ) ;
} ) ;
renderRecordStats ( ) ;
renderBatches ( ) ;
renderFolders ( ) ;
renderWecom ( 0 ) ;
} ) ( ) ;
} ;
const tasks = [
{ runNo : 'DCR-20260818-001' , profile : 'sales' , period : '2026-07' , executedAt : '2026-08-18 09:30' , subjects : 8 , archived : 28 , missingFiles : 4 , missingInvoices : 2 , status : 'missing' } ,
{ runNo : 'DCR-20260721-001' , profile : 'sales' , period : '2026-06' , executedAt : '2026-07-21 09:00' , subjects : 12 , archived : 64 , missingFiles : 8 , missingInvoices : 5 , status : 'missing' } ,
{ runNo : 'DCR-20260622-002' , profile : 'sales' , period : '2026-05' , executedAt : '2026-06-22 10:15' , subjects : 9 , archived : 54 , missingFiles : 0 , missingInvoices : 0 , status : 'complete' } ,
{ runNo : 'DCR-20260622-001' , profile : 'sales' , period : '2026-05' , executedAt : '2026-06-22 10:12' , subjects : 10 , archived : 22 , missingFiles : 2 , missingInvoices : 2 , status : 'failed' } ,
{ runNo : 'DCR-20260818-002' , profile : 'procurement' , period : '2026-07' , executedAt : '—' , subjects : 0 , archived : 0 , missingFiles : 0 , missingInvoices : 0 , status : 'draft' }
] ;
let profileKey = 'sales' ; let selectedRule = 0 ; let selectedSubject = 0 ; let running = false ;
const current = ( ) => profiles [ profileKey ] ;
const status = ( value ) => { const data = { archived : [ '已归档' , 'green' ] , missing : [ '缺件' , 'amber' ] , skipped : [ '已跳过' , 'gray' ] , technical _error : [ '技术失败' , 'red' ] } [ value ] || [ value , 'blue' ] ; return '<span class="status ' + data [ 1 ] + '">' + data [ 0 ] + '</span>' ; } ;
const toast = ( message ) => { $ ( 'toast' ) . textContent = message ; $ ( 'toast' ) . classList . add ( 'show' ) ; setTimeout ( ( ) => $ ( 'toast' ) . classList . remove ( 'show' ) , 2200 ) ; } ;
const taskStatus = ( value ) => ( { missing : [ '缺件' , 'amber' ] , complete : [ '已完成' , 'green' ] , failed : [ '技术失败' , 'red' ] , draft : [ '待配置' , 'gray' ] } [ value ] || [ value , 'blue' ] ) ;
function renderTasks ( ) { const period = $ ( 'taskPeriod' ) . value ; const profile = $ ( 'taskProfile' ) . value ; const taskState = $ ( 'taskStatus' ) . value ; const filtered = tasks . filter ( ( task ) => ( period === 'all' || task . period === period ) && ( profile === 'all' || task . profile === profile ) && ( taskState === 'all' || task . status === taskState ) ) ; const subjectTotal = filtered . reduce ( ( sum , task ) => sum + task . subjects , 0 ) ; const archivedTotal = filtered . reduce ( ( sum , task ) => sum + task . archived , 0 ) ; const missingFileTotal = filtered . reduce ( ( sum , task ) => sum + task . missingFiles , 0 ) ; const missingInvoiceTotal = filtered . reduce ( ( sum , task ) => sum + task . missingInvoices , 0 ) ; $ ( 'taskMetrics' ) . innerHTML = [ [ subjectTotal , '本期主体总数' ] , [ archivedTotal , '已归档文件' ] , [ missingFileTotal , '缺件文件数' ] , [ missingInvoiceTotal , '缺件 invoice 数' ] ] . map ( ( [ number , label ] , index ) => '<article class="card metric"><b class="' + ( index > 1 ? 'task-count' : '' ) + '">' + number + '</b><span>' + label + '</span></article>' ) . join ( '' ) ; $ ( 'taskCount' ) . textContent = '共 ' + filtered . length + ' 条任务记录' ; $ ( 'taskRows' ) . innerHTML = filtered . length ? filtered . map ( ( task ) => { const state = taskStatus ( task . status ) ; const profileName = task . profile === 'sales' ? '销售' : '采购' ; return '<tr><td><b>' + task . runNo + '</b></td><td>' + profileName + '</td><td>' + task . period + '</td><td>' + task . executedAt + '</td><td>' + task . subjects + '</td><td>' + task . archived + '</td><td class="task-count">' + task . missingFiles + '</td><td class="task-count">' + task . missingInvoices + '</td><td><span class="status ' + state [ 1 ] + '">' + state [ 0 ] + '</span></td><td><button class="link" data-task="' + task . runNo + '">查看详情</button></td></tr>' ; } ) . join ( '' ) : '<tr><td colspan="10" class="task-empty">暂无符合筛选条件的检核任务</td></tr>' ; }
const getMissing = ( p ) => p . subjects . flatMap ( ( subject ) => subject [ 2 ] . filter ( ( item ) => item [ 2 ] === 'missing' ) . map ( ( item ) => ( { invoice : subject [ 0 ] , type : item [ 0 ] } ) ) ) ;
const renderStats = ( values ) => { $ ( 'stats' ) . innerHTML = values . map ( ( [ number , label ] ) => '<div class="stat"><b>' + number + '</b><span>' + label + '</span></div>' ) . join ( '' ) ; } ;
function resetRun ( ) { $ ( 'bar' ) . style . width = '0%' ; $ ( 'runBadge' ) . className = 'badge blue' ; $ ( 'runBadge' ) . textContent = current ( ) . enabled ? '待执行' : 'Profile 未启用' ; renderStats ( [ [ '0' , '主体' ] , [ '0' , '已处理' ] , [ '0' , '已跳过' ] , [ '0' , '已归档' ] , [ '0' , '缺件文件' ] , [ '0' , '缺件 invoice' ] ] ) ; $ ( 'runText' ) . textContent = current ( ) . enabled ? '等待启动:加载销售 Profile 后按 invoice 执行文件规则。' : '采购 Profile 当前仅供评审,待配置完成后启用。' ; }
function renderRules ( ) { const p = current ( ) ; const rule = p . rules [ selectedRule ] ; $ ( 'ruleTable' ) . innerHTML = p . rules . map ( ( item , index ) => '<tr data-rule="' + index + '" class="' + ( index === selectedRule ? 'active' : '' ) + '"><td><b>' + item [ 0 ] + '</b></td><td>' + item [ 1 ] + '</td><td class="source ' + item [ 2 ] + '">' + item [ 3 ] + '</td><td><span class="badge ' + ( item [ 6 ] . includes ( '确认' ) ? 'green' : 'amber' ) + '">' + item [ 6 ] + '</span></td></tr>' ) . join ( '' ) ; $ ( 'ruleDetail' ) . innerHTML = '<div class="kv"><b>文件类型</b><span>' + rule [ 0 ] + ' · 必检</span></div><div class="kv"><b>命名模板</b><span class="code">' + rule [ 1 ] + '</span></div><div class="kv"><b>来源 Adapter</b><span class="source ' + rule [ 2 ] + '">' + rule [ 3 ] + '</span></div><div class="kv"><b>主体关联</b><span>' + rule [ 4 ] + '</span></div><div class="kv"><b>扫描 / 查询</b><span>' + rule [ 5 ] + '</span></div><div class="kv"><b>归档方式</b><span>按 invoice 集中归档</span></div>' + ( rule [ 0 ] === '销货放行申请单' ? '<p class="muted">关联字段不完整:直接跳过该 OA 记录,不打印、不归档、不记录字段异常。</p>' : '' ) ; }
function renderExcelSummary ( ) { const p = current ( ) ; if ( ! p . subjects . length ) { $ ( 'excelSummary' ) . innerHTML = '<p class="muted">采购 Profile 尚未启用;启用后将生成一张按 invoice 展示各文件缺件状态的“检核结果”工作表。</p>' ; return ; } const missing = getMissing ( p ) ; const missingInvoices = [ ... new Set ( missing . map ( ( item ) => item . invoice ) ) ] ; const typeCounts = Object . entries ( missing . reduce ( ( result , item ) => { result [ item . type ] = ( result [ item . type ] || 0 ) + 1 ; return result ; } , { } ) ) ; $ ( 'excelSummary' ) . innerHTML = '<div class="kpis"><div class="kpi"><b>' + p . subjects . length + '</b><span>主体总数</span></div><div class="kpi"><b>28</b><span>已归档文件</span></div><div class="kpi"><b>' + missing . length + '</b><span>缺件文件总数</span></div><div class="kpi"><b>' + missingInvoices . length + '</b><span>缺件 invoice 数</span></div></div><table><thead><tr><th>缺失文件类型</th><th>缺件文件数</th><th>涉及 invoice 数</th></tr></thead><tbody>' + typeCounts . map ( ( [ type , count ] ) => '<tr><td><b>' + type + '</b></td><td>' + count + '</td><td>' + new Set ( missing . filter ( ( item ) => item . type === type ) . map ( ( item ) => item . invoice ) ) . size + '</td></tr>' ) . join ( '' ) + '</tbody></table><p class="excel-note">下载 Excel 为一张“检核结果”表:每行一个 invoice,逐列显示每个必检文件是否缺件;全部为“否”时状态为“完整”。</p>' ; }
function renderWorkbook ( ) { const p = current ( ) ; const year = $ ( 'reportYear' ) . value ; const month = $ ( 'reportMonth' ) . value ; $ ( 'excelFilename' ) . textContent = 'voucher_check_' + profileKey + '_' + year + '-' + month + '_DCR-20260818-001.xlsx' ; if ( ! p . subjects . length ) { $ ( 'sheetTitle' ) . textContent = '检核结果' ; $ ( 'sheetMeta' ) . textContent = '资料所属期间:' + year + '-' + month + ';采购 Profile 尚未启用,待确认主体来源、扫描路径与 Adapter 参数。' ; $ ( 'sheetBadge' ) . textContent = '待配置' ; $ ( 'sheetContent' ) . innerHTML = '<p class="muted">启用后将按采购 Profile 的文件规则动态生成文件状态列。</p>' ; return ; } const fileStatus = ( value ) => value === 'missing' ? '<span class="file-missing">缺件</span>' : value === 'archived' ? '<span class="file-ok">有</span>' : '<span class="file-pending">未检核</span>' ; $ ( 'sheetTitle' ) . textContent = '工作表:检核结果' ; $ ( 'sheetMeta' ) . textContent = '资料所属期间:' + year + '-' + month + '(业务月份) · 执行时间:2026-08-18 09:30(本批实际检核完成时间)。' ; $ ( 'sheetBadge' ) . textContent = '逐票结果' ; const columns = p . rules . map ( ( rule ) => rule [ 0 ] ) ; $ ( 'sheetContent' ) . innerHTML = '<p class="muted">主要字段:</p><div class="field-list"><span>invoice</span>' + columns . map ( ( name ) => '<span>' + name + '</span>' ) . join ( '' ) + '<span>状态</span></div><div class="workbook" style="margin-top:14px"><table><thead><tr><th>invoice</th>' + columns . map ( ( name ) => '<th>' + name + '</th>' ) . join ( '' ) + '<th>状态</th></tr></thead><tbody>' + p . subjects . map ( ( subject ) => { const resultMap = new Map ( subject [ 2 ] . map ( ( item ) => [ item [ 0 ] , item [ 2 ] ] ) ) ; const values = columns . map ( ( name ) => resultMap . get ( name ) || ( subject [ 2 ] [ 0 ] [ 2 ] === 'skipped' ? 'skipped' : 'missing' ) ) ; const hasMissing = values . includes ( 'missing' ) ; const hasPending = values . some ( ( value ) => value !== 'archived' && value !== 'missing' ) ; const overall = hasMissing ? '<span class="status amber">缺件</span>' : hasPending ? '<span class="status gray">待处理</span>' : '<span class="status green">完整</span>' ; return '<tr><td><b>' + subject [ 0 ] + '</b></td>' + values . map ( fileStatus ) . map ( ( value ) => '<td>' + value + '</td>' ) . join ( '' ) + '<td>' + overall + '</td></tr>' ; } ) . join ( '' ) + '</tbody></table></div>' ; }
function renderRecords ( ) { const p = current ( ) ; if ( ! p . subjects . length ) { $ ( 'subjects' ) . innerHTML = '<p class="muted">采购 Profile 尚未启用</p>' ; $ ( 'subjectDetail' ) . innerHTML = '<p class="muted">待确认采购主体来源、扫描路径与来源 Adapter 参数后生成执行记录。</p>' ; $ ( 'invoiceSummary' ) . innerHTML = '<p class="muted">暂无批次数据</p>' ; $ ( 'typeSummary' ) . innerHTML = '<p class="muted">暂无批次数据</p>' ; return ; } const missing = getMissing ( p ) ; const groups = [ ... new Map ( missing . map ( ( item ) => [ item . invoice , missing . filter ( ( other ) => other . invoice === item . invoice ) ] ) ) . entries ( ) ] ; const typeCounts = Object . entries ( missing . reduce ( ( result , item ) => { result [ item . type ] = ( result [ item . type ] || 0 ) + 1 ; return result ; } , { } ) ) ; $ ( 'invoiceSummary' ) . innerHTML = '<table><thead><tr><th>invoice</th><th>缺件数</th><th>缺失文件</th><th>通知</th></tr></thead><tbody>' + groups . map ( ( [ invoice , items ] ) => '<tr><td><b>' + invoice + '</b></td><td>' + items . length + '</td><td>' + items . map ( ( item ) => item . type ) . join ( '、' ) + '</td><td><span class="badge amber">待配置接收人</span></td></tr>' ) . join ( '' ) + '</tbody></table>' ; $ ( 'typeSummary' ) . innerHTML = '<table><thead><tr><th>文件类型</th><th>缺件文件数</th><th>涉及 invoice 数</th></tr></thead><tbody>' + typeCounts . map ( ( [ type , count ] ) => '<tr><td><b>' + type + '</b></td><td>' + count + '</td><td>' + new Set ( missing . filter ( ( item ) => item . type === type ) . map ( ( item ) => item . invoice ) ) . size + '</td></tr>' ) . join ( '' ) + '</tbody></table>' ; $ ( 'subjects' ) . innerHTML = p . subjects . map ( ( item , index ) => { const count = item [ 2 ] . filter ( ( result ) => result [ 2 ] === 'missing' ) . length ; return '<button data-subject="' + index + '" class="' + ( index === selectedSubject ? 'active' : '' ) + '"><span><b>' + item [ 0 ] + '</b><br><small>' + ( count ? '缺 ' + count + ' 件' : item [ 1 ] ) + '</small></span>' + status ( count ? 'missing' : item [ 2 ] [ 0 ] [ 2 ] ) + '</button>' ; } ) . join ( '' ) ; const subject = p . subjects [ selectedSubject ] ; $ ( 'subjectDetail' ) . innerHTML = '<h2>' + subject [ 0 ] + '</h2><p class="muted">检核月份 2026-07 · 同一 invoice 集中归档</p>' + subject [ 2 ] . map ( ( item ) => '<div class="result"><div><b>' + item [ 0 ] + '</b><br><small>' + item [ 1 ] + '</small></div><div class="path">' + ( item [ 2 ] === 'archived' ? '{归档根路径}/2026/07/' + subject [ 0 ] + '/' : '—' ) + '</div>' + status ( item [ 2 ] ) + '</div>' ) . join ( '' ) ; }
function render ( ) { const p = current ( ) ; selectedRule = 0 ; selectedSubject = 0 ; $ ( 'profileInfo' ) . innerHTML = '<b>' + p . name + '</b><br><span class="muted">' + p . desc + '</span>' ; $ ( 'profileBadge' ) . innerHTML = '<span class="badge ' + ( p . enabled ? 'green' : 'amber' ) + '">' + ( p . enabled ? '一期可评审' : '待业务确认' ) + '</span> <span class="badge blue">上一个自然月</span>' ; $ ( 'title' ) . textContent = p . name + ( p . enabled ? '资料周度增量检核' : '资料检核配置预览' ) ; $ ( 'desc' ) . textContent = p . desc ; $ ( 'run' ) . disabled = $ ( 'force' ) . disabled = ! p . enabled ; $ ( 'run' ) . textContent = p . enabled ? '执行本周增量检核' : '等待 Profile 启用' ; $ ( 'metrics' ) . innerHTML = p . metrics . map ( ( [ number , label ] ) => '<article class="card metric"><b>' + number + '</b><span>' + label + '</span></article>' ) . join ( '' ) ; $ ( 'ruleSummary' ) . innerHTML = p . rules . map ( ( item , index ) => '<div class="step"><b class="no">' + ( index + 1 ) + '</b><div><strong>' + item [ 0 ] + '</strong><small>' + item [ 1 ] + ' · ' + item [ 3 ] + '</small></div><span class="badge ' + ( item [ 6 ] . includes ( '确认' ) ? 'green' : 'amber' ) + '">' + item [ 6 ] + '</span></div>' ) . join ( '' ) ; $ ( 'archiveNote' ) . textContent = p . note ; $ ( 'noticeTitle' ) . textContent = p . notice [ 0 ] ; $ ( 'noticeBody' ) . textContent = p . notice [ 1 ] ; resetRun ( ) ; renderRules ( ) ; renderExcelSummary ( ) ; renderRecords ( ) ; renderWorkbook ( ) ; }
function run ( force ) { if ( ! current ( ) . enabled || running ) return ; running = true ; $ ( 'run' ) . disabled = $ ( 'force' ) . disabled = true ; const steps = force ? [ [ 20 , 8 , 2 , 0 , 10 , 0 , 0 , '强制模式:定位上一个自然月并加载销售 Profile。' ] , [ 60 , 8 , 6 , 0 , 28 , 1 , 1 , 'ERP、OA 与固定目录 Adapter 正在获取文件。' ] , [ 100 , 8 , 8 , 0 , 40 , 4 , 2 , '完成:归档成功 40 项;2 个 invoice 共缺 4 件;已生成 Excel 与通知。' ] ] : [ [ 18 , 8 , 0 , 3 , 0 , 0 , 0 , '定位 2026-07;加载 Profile 与 6 条规则。' ] , [ 60 , 8 , 4 , 3 , 18 , 2 , 1 , '执行 ERP 打印、OA 报表与固定目录扫描。' ] , [ 100 , 8 , 5 , 3 , 28 , 4 , 2 , '完成:3 个主体跳过;2 个 invoice 共缺 4 件,已生成汇总 Excel 与通知。' ] ] ; let index = 0 ; const timer = setInterval ( ( ) => { const step = steps [ index ++ ] ; $ ( 'bar' ) . style . width = step [ 0 ] + '%' ; renderStats ( [ [ step [ 1 ] , '主体' ] , [ step [ 2 ] , '已处理' ] , [ step [ 3 ] , '已跳过' ] , [ step [ 4 ] , '已归档' ] , [ step [ 5 ] , '缺件文件' ] , [ step [ 6 ] , '缺件 invoice' ] ] ) ; $ ( 'runText' ) . textContent = step [ 7 ] ; if ( step [ 0 ] === 100 ) { clearInterval ( timer ) ; running = false ; $ ( 'run' ) . disabled = $ ( 'force' ) . disabled = false ; $ ( 'runBadge' ) . className = 'badge amber' ; $ ( 'runBadge' ) . textContent = '完成 · 含缺件' ; toast ( '原型示意:已生成含缺件汇总与检核明细的 Excel,并发送合并缺件通知。' ) ; } } , 700 ) ; }
function go ( view ) { document . querySelectorAll ( '.view' ) . forEach ( ( item ) => item . classList . toggle ( 'active' , item . id === 'v-' + view ) ) ; document . querySelectorAll ( '#tabs button' ) . forEach ( ( item ) => item . classList . toggle ( 'act ive ', item . dataset . v === view ) ) ; }
$ ( 'profile' ) . addEventListener ( 'change' , ( event ) => { profileKey = event . target . value ; render ( ) ; } ) ; $ ( 'tabs' ) . addEventListener ( 'click' , ( event ) => { const button = event . target . closest ( '[data-v]' ) ; if ( button ) go ( button . dataset . v ) ; } ) ; $ ( 'reportYear' ) . addEventListener ( 'change' , renderWorkbook ) ; $ ( 'reportMonth' ) . addEventListener ( 'change' , renderWorkbook ) ; $ ( 'taskSearch' ) . addEventListener ( 'click' , renderTasks ) ; $ ( 'taskReset' ) . addEventListener ( 'click' , ( ) => { $ ( 'taskPeriod' ) . value = 'all' ; $ ( 'taskProfile' ) . value = 'all' ; $ ( 'taskStatus' ) . value = 'all' ; renderTasks ( ) ; } ) ; $ ( 'taskCreate' ) . addEventListener ( 'click' , ( ) => { go ( 'work' ) ; toast ( '原型示意:已进入新建检核任务流程。' ) ; } ) ; $ ( 'taskForce' ) . addEventListener ( 'click' , ( ) => { go ( 'work' ) ; toast ( '原型示意:已进入强制重检配置。' ) ; } ) ; $ ( 'taskRows' ) . addEventListener ( 'click' , ( event ) => { const button = event . target . closest ( '[data-task]' ) ; if ( ! button ) return ; const task = tasks . find ( ( item ) => item . runNo === button . dataset . task ) ; if ( task && task . profile === 'sales' ) { profileKey = 'sales' ; $ ( 'profile' ) . value = 'sales' ; render ( ) ; go ( 'records' ) ; toast ( '已打开批次 ' + task . runNo + ' 的执行明细(示意)。' ) ; } else { toast ( '采购任务待 Profile 启用后查看明细。' ) ; } } ) ; $ ( 'run' ) . addEventListener ( 'click' , ( ) => run ( false ) ) ; $ ( 'force' ) . addEventListener ( 'click' , ( ) => run ( true ) ) ; $ ( 'excel' ) . addEventListener ( 'click' , ( ) => go ( 'excel' ) ) ; $ ( 'downloadExcel' ) . addEventListener ( 'click' , ( ) => toast ( '原型示意:下载企业微信通知附件 Excel(逐票检核结果)。' ) ) ; $ ( 'noticeExcel' ) . addEventListener ( 'click' , ( ) => go ( 'excel' ) ) ; $ ( 'ruleTable' ) . addEventListener ( 'click' , ( event ) => { const row = event . target . closest ( '[data-rule]' ) ; if ( row ) { selectedRule = Number ( row . dataset . rule ) ; renderRules ( ) ; } } ) ; $ ( 'subjects' ) . addEventListener ( 'click' , ( event ) => { const button = event . target . closest ( '[data-subject]' ) ; if ( button ) { selectedSubject = Number ( button . dataset . subject ) ; renderRecords ( ) ; } } ) ; document . body . addEventListener ( 'click' , ( event ) => { const target = event . target . closest ( '[data-go]' ) ; if ( target ) go ( target . dataset . go ) ; } ) ; renderTasks ( ) ; render ( ) ;
} ) ( ) ;
< / script >
< / body >
< / html >