@@ -12,14 +12,19 @@
< style >
: root { --canvas : #f8fafc ; --surface : #fff ; --surface-soft : #f5f8fc ; --line : #e5eaf1 ; --ink : #182230 ; --text : #4d5d73 ; --muted : #8491a5 ; --brand : #1677d2 ; --brand-50 : #edf6ff ; --good : #18854d ; --good-50 : #ecf9f0 ; --warn : #b7730d ; --warn-50 : #fff7e7 ; --bad : #c63d53 ; --bad-50 : #fff0f2 ; --shadow : 0 10 px 28 px rgba ( 21 , 39 , 66 , .07 ) ; }
* { box-sizing : border-box } html , body , # app { width : 100 % ; height : 100 % ; margin : 0 } # app { display : flex ; min-width : 0 ; overflow : hidden } body { font : 14 px / 1.5 "Microsoft YaHei" , "PingFang SC" , Arial , sans-serif ; color : var ( - - text ) ; background : var ( - - canvas ) } button , input , select { font : inherit } button { cursor : pointer } button : focus-visible , input : focus-visible , select : focus-visible { outline : 3 px solid rgba ( 22 , 119 , 210 , .22 ) ; outline-offset : 2 px }
. shell { display : flex ; width : 100 % ; height : 100 % ; min-width : 0 ; overflow : hidden } . side { display : flex ; flex : 0 0 244 px ; width : 244 px ; min-width : 244 px ; max-width : 244 px ; flex-direction : column ; overflow : hidden ; background : var ( - - surface ) ; border-right : 1 px solid var ( - - line ) } . brand { display : flex ; align-items : center ; gap : 10 px ; height : 64 px ; padding : 0 18 px ; border-bottom : 1 px solid var ( - - line ) } . brand-mark { display : grid ; place-items : center ; width : 32 px ; height : 32 px ; border-radius : 9 px ; background : linear-gradient ( 135 deg , #208add , #2368c9 ) ; color : #fff ; font-size : 12 px ; font-weight : 800 } . brand b { display : block ; color : var ( - - ink ) ; font-size : 15 px } . brand span { display : block ; color : var ( - - muted ) ; font-size : 11 px } . new-chat { margin : 14 px ; border : 1 px solid #bfdbf6 ; border-radius : 9 px ; padding : 9 px 12 px ; text-align : left ; color : #1265af ; background : var ( - - brand -50 ) ; font-weight : 700 } . nav-label { padding : 9 px 17 px 5 px ; color : #96a2b3 ; font-size : 10 px ; font-weight : 800 ; letter-spacing : .08 em } . history { min-height : 0 ; padding : 0 9 px ; overflow : auto } . history button { position : relative ; width : 100 % ; border : 0 ; border-radius : 8 px ; padding : 9 px 10 px ; background : transparent ; color : var ( - - text ) ; text-align : left } . history button : hover { background : var ( - - surface - soft ) } . history button . active { color : #1469b4 ; background : var ( - - brand -50 ) } . history b , . history span { display : block ; overflow : hidden ; text-overflow : ellipsis ; white-space : nowrap } . history b { font-size : 12 px } . history span { margin-top : 2 px ; color : var ( - - muted ) ; font-size : 10 px } . dot { position : absolute ; top : 11 px ; right : 10 px ; width : 7 px ; height : 7 px ; border-radius : 50 % ; background : #ed9a2c } . dot . bad { background : #d64d61 } . user { display : flex ; gap : 8 px ; align-items : center ; margin-top : auto ; padding : 14 px 17 px ; border-top : 1 px solid var ( - - line ) } . avatar { display : grid ; place-items : center ; width : 30 px ; height : 30 px ; border-radius : 50 % ; color : #1269b3 ; background : #dff1ff ; font-size : 11 px ; font-weight : 800 } . user b , . user span { display : block } . user b { color : var ( - - ink ) ; font-size : 11 px } . user span { color : var ( - - muted ) ; font-size : 10 px }
. shell { display : flex ; width : 100 % ; height : 100 % ; min-width : 0 ; overflow : hidden } . side { display : flex ; flex : 0 0 244 px ; width : 244 px ; min-width : 244 px ; max-width : 244 px ; flex-direction : column ; overflow : hidden ; background : var ( - - surface ) ; border-right : 1 px solid var ( - - line ) } . brand { display : flex ; align-items : center ; gap : 10 px ; height : 64 px ; padding : 0 18 px ; border-bottom : 1 px solid var ( - - line ) } . brand-mark { display : grid ; place-items : center ; width : 32 px ; height : 32 px ; border-radius : 9 px ; background : linear-gradient ( 135 deg , #208add , #2368c9 ) ; color : #fff ; font-size : 12 px ; font-weight : 800 } . brand b { display : block ; color : var ( - - ink ) ; font-size : 15 px } . brand span { display : block ; color : var ( - - muted ) ; font-size : 11 px } . new-chat { margin : 14 px ; border : 1 px solid #bfdbf6 ; border-radius : 9 px ; padding : 9 px 12 px ; text-align : left ; color : #1265af ; background : var ( - - brand -50 ) ; font-weight : 700 } . nav-label { padding : 9 px 17 px 5 px ; color : #96a2b3 ; font-size : 10 px ; font-weight : 800 ; letter-spacing : .08 em } . history { min-height : 0 ; padding : 0 9 px ; overflow : auto } . history button { position : relative ; width : 100 % ; border : 0 ; border-radius : 8 px ; padding : 9 px 10 px ; background : transparent ; color : var ( - - text ) ; text-align : left } . history button : hover { background : var ( - - surface - soft ) } . history button . active { color : #1469b4 ; background : var ( - - brand -50 ) } . history b , . history span { display : block ; overflow : hidden ; text-overflow : ellipsis ; white-space : nowrap } . history b { font-size : 12 px } . history span { margin-top : 2 px ; color : var ( - - muted ) ; font-size : 10 px } . history-divider { height : 1 px ; margin : 8 px 8 px 4 px ; background : var ( - - line ) } . history-label { padding : 5 px 10 px 3 px ; color : #96a2b3 ; font-size : 10 px ; font-weight : 800 ; letter-spacing : .05 em } . history button . walkthrough b { font-weight : 600 } . history button . walkthrough span { color : #8797ab } . dot { position : absolute ; top : 11 px ; right : 10 px ; width : 7 px ; height : 7 px ; border-radius : 50 % ; background : #ed9a2c } . dot . bad { background : #d64d61 } . user { display : flex ; gap : 8 px ; align-items : center ; margin-top : auto ; padding : 14 px 17 px ; border-top : 1 px solid var ( - - line ) } . avatar { display : grid ; place-items : center ; width : 30 px ; height : 30 px ; border-radius : 50 % ; color : #1269b3 ; background : #dff1ff ; font-size : 11 px ; font-weight : 800 } . user b , . user span { display : block } . user b { color : var ( - - ink ) ; font-size : 11 px } . user span { color : var ( - - muted ) ; font-size : 10 px }
. main { display : flex ; min-width : 0 ; min-height : 0 ; flex : 1 1 auto ; flex-direction : column ; overflow : hidden } . topbar { height : 64 px ; display : flex ; align-items : center ; gap : 10 px ; padding : 0 28 px ; background : var ( - - surface ) ; border-bottom : 1 px solid var ( - - line ) } . agent-icon { display : grid ; place-items : center ; width : 32 px ; height : 32 px ; border-radius : 9 px ; color : var ( - - brand ) ; background : var ( - - brand -50 ) ; font-weight : 800 } . title b { display : block ; color : var ( - - ink ) ; font-size : 14 px } . title span { display : block ; margin-top : 1 px ; color : var ( - - muted ) ; font-size : 11 px } . crumb { margin-left : auto ; color : var ( - - muted ) ; font-size : 12 px } . layout { min-height : 0 ; flex : 1 ; overflow : auto } . page { width : min ( 1160 px , 100 % ) ; margin : 0 auto ; padding : 28 px } . page-head { display : flex ; align-items : flex-start ; justify-content : space-between ; gap : 18 px ; margin-bottom : 18 px } . page-head h1 { margin : 0 ; color : var ( - - ink ) ; font-size : 22 px } . page-head p { max-width : 720 px ; margin : 5 px 0 0 ; color : var ( - - muted ) ; font-size : 13 px } . back { border : 0 ; background : transparent ; color : #176fba ; font-weight : 700 } . card { border : 1 px solid var ( - - line ) ; border-radius : 12 px ; background : var ( - - surface ) ; box-shadow : var ( - - shadow ) } . card-h { display : flex ; align-items : center ; justify-content : space-between ; gap : 12 px ; padding : 15 px 18 px ; border-bottom : 1 px solid var ( - - line ) } . card-h h2 { margin : 0 ; color : var ( - - ink ) ; font-size : 15 px } . card-h p { margin : 3 px 0 0 ; color : var ( - - muted ) ; font-size : 11 px } . card-b { padding : 18 px } . grid { display : grid ; gap : 16 px } . grid . two { grid-template-columns : 1.55 fr 1 fr } . summary { display : grid ; grid-template-columns : repeat ( 4 , 1 fr ) ; gap : 12 px } . metric { padding : 13 px ; border : 1 px solid var ( - - line ) ; border-radius : 10 px ; background : #fff } . metric b { display : block ; color : var ( - - ink ) ; font-size : 20 px } . metric span { display : block ; margin-top : 3 px ; color : var ( - - muted ) ; font-size : 11 px } . metric button { border : 0 ; padding : 0 ; background : transparent ; color : inherit ; text-align : left } . metric . action { border-color : #cfe5f9 ; background : var ( - - brand -50 ) } . metric . action b { color : #1268b2 } . notice { display : flex ; gap : 9 px ; margin-top : 14 px ; border-radius : 8 px ; padding : 10 px 12 px ; color : #596b82 ; background : var ( - - surface - soft ) ; font-size : 12 px } . notice i { font-style : normal ; font-weight : 800 } . notice . good { color : #167642 ; background : var ( - - good -50 ) } . notice . warn { color : #97620c ; background : var ( - - warn -50 ) } . notice . bad { color : #ae3146 ; background : var ( - - bad -50 ) } . btn { border : 1 px solid #d1dbe7 ; border-radius : 8 px ; padding : 8 px 12 px ; color : #43536a ; background : #fff ; font-size : 12 px ; font-weight : 700 } . btn : hover { background : var ( - - surface - soft ) } . btn . primary { border-color : var ( - - brand ) ; color : #fff ; background : var ( - - brand ) } . btn . danger { border-color : #efb9c2 ; color : #b43449 ; background : var ( - - bad -50 ) } . btn [ disabled ] { cursor : not-allowed ; opacity : .48 } . actions { display : flex ; flex-wrap : wrap ; gap : 8 px ; margin-top : 14 px } . chip { display : inline-flex ; align-items : center ; border-radius : 999 px ; padding : 3 px 8 px ; font-size : 11 px ; font-weight : 700 } . chip . good { color : #147340 ; background : var ( - - good -50 ) } . chip . warn { color : #9a640c ; background : var ( - - warn -50 ) } . chip . bad { color : #ad3145 ; background : var ( - - bad -50 ) } . chip . gray { color : #68788e ; background : #eff3f7 } . chat-panel { min-height : 370 px ; display : flex ; flex-direction : column } . chat-messages { flex : 1 ; padding : 18 px } . bubble { max-width : 88 % ; margin-bottom : 13 px ; border : 1 px solid var ( - - line ) ; border-radius : 4 px 12 px 12 px ; padding : 10 px 12 px ; color : var ( - - text ) ; background : #fff ; font-size : 13 px } . bubble . user-msg { margin-left : auto ; border-color : var ( - - brand ) ; border-radius : 12 px 4 px 12 px 12 px ; color : #fff ; background : var ( - - brand ) } . composer { display : flex ; gap : 8 px ; padding : 12 px ; border-top : 1 px solid var ( - - line ) } . composer input { min-width : 0 ; flex : 1 ; border : 1 px solid #d4dee9 ; border-radius : 8 px ; padding : 9 px 11 px } . quick { display : grid ; gap : 8 px } . quick button { border : 1 px solid var ( - - line ) ; border-radius : 8 px ; padding : 10 px ; color : #53637a ; background : #fff ; text-align : left ; font-size : 12 px } . quick button : hover { border-color : #bfdcf7 ; color : #1267b1 ; background : var ( - - brand -50 ) }
. scope { display : flex ; justify-content : space-between ; gap : 16 px ; align-items : center ; padding : 14 px ; border : 1 px solid #d7e9fa ; border-radius : 10 px ; background : #f5faff } . scope b { display : block ; color : #145f9f } . scope span { display : block ; margin-top : 2 px ; color : #60748c ; font-size : 12 px } . source-toolbar { display : flex ; gap : 10 px ; align-items : center ; margin-bottom : 13 px } . source-toolbar input { width : 280 px ; border : 1 px solid #d4dee9 ; border-radius : 8 px ; padding : 8 px 10 px } . source-toolbar . count { margin-left : auto ; color : var ( - - muted ) ; font-size : 12 px } . source-group { border : 1 px solid var ( - - line ) ; border-radius : 10 px ; overflow : hidden ; margin-top : 10 px } . source-group-head { display : flex ; align-items : center ; gap : 10 px ; padding : 12 px 13 px ; background : #fbfcfe } . source-group-head b { color : var ( - - ink ) } . source-group-head span { color : var ( - - muted ) ; font-size : 11 px } . source-group-head button { margin-left : auto ; border : 0 ; color : #176fba ; background : transparent ; font-size : 12 px } . source-list { display : grid ; grid-template-columns : repeat ( 2 , minmax ( 0 , 1 fr ) ) ; border-top : 1 px solid var ( - - line ) } . source-item { display : flex ; align-items : center ; gap : 9 px ; min-height : 54 px ; padding : 10 px 13 px ; border-right : 1 px solid var ( - - line ) ; border-bottom : 1 px solid var ( - - line ) } . source-item : nth-child ( even ) { border-right : 0 } . source-item : last-child { border-bottom : 0 } . source-item b { display : block ; color : var ( - - ink ) ; font-size : 12 px } . source-item span { display : block ; color : var ( - - muted ) ; font-size : 11 px } . sticky-actions { position : sticky ; bottom : 0 ; display : flex ; justify-content : flex-end ; gap : 8 px ; margin : 18 px -18 px -18 px ; padding : 13 px 18 px ; border-top : 1 px solid var ( - - line ) ; background : rgba ( 255 , 255 , 255 , .96 ) }
. stage-list { display : grid ; gap : 10 px } . stage { display : grid ; grid-template-columns : 14 px 1 fr auto ; gap : 10 px ; align-items : start ; padding : 12 px ; border : 1 px solid var ( - - line ) ; border-radius : 9 px } . stage . mark { width : 10 px ; height : 10 px ; margin-top : 4 px ; border-radius : 50 % ; background : #a8b3c1 } . stage . good . mark { background : var ( - - good ) } . stage . warn . mark { background : #e1a238 } . stage . bad . mark { background : var ( - - bad ) } . stage b { display : block ; color : var ( - - ink ) ; font-size : 12 px } . stage span { display : block ; margin-top : 2 px ; color : var ( - - muted ) ; font-size : 11 px } . facts { display : grid ; grid-template-columns : repeat ( 3 , 1 fr ) ; gap : 0 ; border : 1 px solid var ( - - line ) ; border-radius : 9 px ; overflow : hidden } . fact { padding : 10 px 12 px ; border-right : 1 px solid var ( - - line ) ; border-bottom : 1 px solid var ( - - line ) } . fact : nth-child ( 3n ) { border-right : 0 } . fact : nth-last-child ( -n + 3 ) { border-bottom : 0 } . fact span { display : block ; color : var ( - - muted ) ; font-size : 10 px } . fact b { display : block ; margin-top : 3 px ; color : var ( - - ink ) ; font-size : 12 px } . table-wrap { overflow : auto } . table { width : 100 % ; border-collapse : collapse ; font-size : 12 px } . table th , . table td { padding : 11 px 10 px ; border-bottom : 1 px solid var ( - - line ) ; text-align : left ; vertical-align : middle } . table th { color : #7d8ba0 ; background : #fafbfd ; font-size : 11 px ; font-weight : 700 } . table td b { color : var ( - - ink ) } . table tr . disabled { color : #8693a4 ; background : #fbfcfe } . link { border : 0 ; padding : 0 ; color : #146fba ; background : transparent ; font-weight : 700 } . confirm-band { display : flex ; justify-content : space-between ; align-items : center ; gap : 14 px ; margin-top : 13 px ; border : 1 px solid #d3e8f9 ; border-radius : 9 px ; padding : 12 px ; background : #f5faff } . confirm-band b { color : #155f9f } . route-org { margin-top : 12 px ; border : 1 px solid var ( - - line ) ; border-radius : 10 px ; background : #fff ; overflow : hidden } . route-org > summary , . route-item > summary { display : flex ; align-items : center ; gap : 12 px ; list-style : none ; cursor : pointer } . route-org > summary :: -webkit-details-marker , . route-item > summary :: -webkit-details-marker { display : none } . route-org > summary { padding : 14 px 16 px ; background : #fbfcfe } . route-org > summary :: before , . route-item > summary :: before { content : '› ' ; width : 16 px ; color : #6d7d91 ; font-size : 20 px ; line-height : 1 ; transition : transform .15 s } . route-org [ open ] > summary :: before , . route-item [ open ] > summary :: before { transform : rotate ( 90 deg ) } . route-org-title { min-width : 0 ; flex : 1 } . route-org-title b { display : block ; color : var ( - - ink ) ; font-size : 14 px } . route-org-title span { display : block ; margin-top : 2 px ; color : var ( - - muted ) ; font-size : 11 px } . route-org-metrics { display : flex ; gap : 14 px ; color : #52637a ; font-size : 12 px } . route-org-metrics b { color : var ( - - ink ) } . route-table { border-top : 1 px solid var ( - - line ) } . route-item { border-bottom : 1 px solid var ( - - line ) } . route-item : last-child { border-bottom : 0 } . route-item > summary { padding : 11 px 16 px } . route-item > summary : hover { background : var ( - - surface - soft ) } . route-item-main { min-width : 0 ; flex : 1 } . route-item-main b { color : var ( - - ink ) } . route-item-main span { margin-left : 8 px ; color : var ( - - muted ) ; font-size : 11 px } . route-item-metrics { display : flex ; gap : 18 px ; color : #52637a ; font-size : 12 px } . route-item-metrics strong { color : var ( - - ink ) } . route-invoices { padding : 0 16 px 14 px 44 px ; background : #fcfdff } . tabs { display : flex ; gap : 5 px ; border-bottom : 1 px solid var ( - - line ) ; margin-bottom : 14 px } . tab { border : 0 ; border-bottom : 2 px solid transparent ; padding : 9 px 11 px ; color : #718097 ; background : transparent ; font-size : 12 px ; font-weight : 700 } . tab . active { border-color : var ( - - brand ) ; color : #146bb4 } . filters { display : flex ; gap : 8 px ; margin-bottom : 12 px } . filters select { border : 1 px solid #d5dfe9 ; border-radius : 7 px ; padding : 7 px 9 px ; color : var ( - - text ) ; background : #fff } . progress { height : 7 px ; border-radius : 999 px ; background : #eaf0f6 ; overflow : hidden } . progress i { display : block ; height : 100 % ; border-radius : inherit ; background : var ( - - brand ) }
. scope { display : flex ; justify-content : space-between ; gap : 16 px ; align-items : center ; padding : 14 px ; border : 1 px solid #d7e9fa ; border-radius : 10 px ; background : #f5faff } . scope b { display : block ; color : #145f9f } . scope span { display : block ; margin-top : 2 px ; color : #60748c ; font-size : 12 px } . source-toolbar { display : flex ; gap : 10 px ; align-items : center ; margin-bottom : 13 px } . source-toolbar input { width : 280 px ; border : 1 px solid #d4dee9 ; border-radius : 8 px ; padding : 8 px 10 px } . source-toolbar . count { margin-left : auto ; color : var ( - - muted ) ; font-size : 12 px } . source-group { border : 1 px solid var ( - - line ) ; border-radius : 10 px ; overflow : hidden ; margin-top : 10 px } . source-group-head { display : flex ; align-items : center ; gap : 10 px ; padding : 12 px 13 px ; background : #fbfcfe } . source-group-head b { color : var ( - - ink ) } . source-group-head span { color : var ( - - muted ) ; font-size : 11 px } . source-group-head button { margin-left : auto ; border : 0 ; color : #176fba ; background : transparent ; font-size : 12 px } . source-list { display : grid ; grid-template-columns : repeat ( 2 , minmax ( 0 , 1 fr ) ) ; border-top : 1 px solid var ( - - line ) } . source-item { display : flex ; align-items : flex-start ; gap : 9 px ; min-height : 82 px ; padding : 10 px 13 px ; border-right : 1 px solid var ( - - line ) ; border-bottom : 1 px solid var ( - - line ) } . source-item input { margin-top : 4 px } . source-item : nth-child ( even ) { border-right : 0 } . source-item : last-child { border-bottom : 0 } . source-detail { min-width : 0 ; flex : 1 } . source-item b { display : block ; color : var ( - - ink ) ; font-size : 12 px } . source-item span { display : block ; color : var ( - - muted ) ; font-size : 11 px } . source-file { display : flex ; align-items : center ; gap : 6 px ; min-width : 0 ; margin-top : 6 px } . source-file-name { overflow : hidden ; text-overflow : ellipsis ; white-space : nowrap ; color : #536b84 !important } . source-file-meta { font-size : 10 px !important } . source-file-empty { color : #9aa6b5 !important } . icon-button { display : grid ; place-items : center ; width : 26 px ; height : 26 px ; flex : 0 0 26 px ; border : 1 px solid #c9d8e8 ; border-radius : 6 px ; padding : 0 ; color : #176fba ; background : #fff ; font-size : 15 px ; font-weight : 800 } . icon-button : hover { border-color : #8cc3eb ; background : var ( - - brand -50 ) } . icon-button [ disabled ] { cursor : not-allowed ; color : #9aa6b5 ; background : #f5f7fa } . sticky-actions { position : sticky ; bottom : 0 ; display : flex ; justify-content : flex-end ; gap : 8 px ; margin : 18 px -18 px -18 px ; padding : 13 px 18 px ; border-top : 1 px solid var ( - - line ) ; background : rgba ( 255 , 255 , 255 , .96 ) }
. stage-list { display : grid ; gap : 10 px } . stage { display : grid ; grid-template-columns : 14 px 1 fr auto ; gap : 10 px ; align-items : start ; padding : 12 px ; border : 1 px solid var ( - - line ) ; border-radius : 9 px } . stage . mark { width : 10 px ; height : 10 px ; margin-top : 4 px ; border-radius : 50 % ; background : #a8b3c1 } . stage . good . mark { background : var ( - - good ) } . stage . warn . mark { background : #e1a238 } . stage . bad . mark { background : var ( - - bad ) } . stage b { display : block ; color : var ( - - ink ) ; font-size : 12 px } . stage span { display : block ; margin-top : 2 px ; color : var ( - - muted ) ; font-size : 11 px } . facts { display : grid ; grid-template-columns : repeat ( 3 , 1 fr ) ; gap : 0 ; border : 1 px solid var ( - - line ) ; border-radius : 9 px ; overflow : hidden } . fact { padding : 10 px 12 px ; border-right : 1 px solid var ( - - line ) ; border-bottom : 1 px solid var ( - - line ) } . fact : nth-child ( 3n ) { border-right : 0 } . fact : nth-last-child ( -n + 3 ) { border-bottom : 0 } . fact span { display : block ; color : var ( - - muted ) ; font-size : 10 px } . fact b { display : block ; margin-top : 3 px ; color : var ( - - ink ) ; font-size : 12 px } . table-wrap { overflow : auto } . table { width : 100 % ; border-collapse : collapse ; font-size : 12 px } . table th , . table td { padding : 11 px 10 px ; border-bottom : 1 px solid var ( - - line ) ; text-align : left ; vertical-align : middle } . table th { color : #7d8ba0 ; background : #fafbfd ; font-size : 11 px ; font-weight : 700 } . table td b { color : var ( - - ink ) } . table tr . disabled { color : #8693a4 ; background : #fbfcfe } . link { border : 0 ; padding : 0 ; color : #146fba ; background : transparent ; font-weight : 700 } . confirm-band { display : flex ; justify-content : space-between ; align-items : center ; gap : 14 px ; margin-top : 13 px ; border : 1 px solid #d3e8f9 ; border-radius : 9 px ; padding : 12 px ; background : #f5faff } . confirm-band b { color : #155f9f } . tabs { display : flex ; gap : 5 px ; border-bottom : 1 px solid var ( - - line ) ; margin-bottom : 14 px } . tab { border : 0 ; border-bottom : 2 px solid transparent ; padding : 9 px 11 px ; color : #718097 ; background : transparent ; font-size : 12 px ; font-weight : 700 } . tab . active { border-color : var ( - - brand ) ; color : #146bb4 } . filters { display : flex ; gap : 8 px ; margin-bottom : 12 px } . filters select { border : 1 px solid #d5dfe9 ; border-radius : 7 px ; padding : 7 px 9 px ; color : var ( - - text ) ; background : #fff } . progress { height : 7 px ; border-radius : 999 px ; background : #eaf0f6 ; overflow : hidden } . progress i { display : block ; height : 100 % ; border-radius : inherit ; background : var ( - - brand ) }
. toast { position : fixed ; right : 24 px ; bottom : 24 px ; z-index : 20 ; max-width : 380 px ; border-radius : 9 px ; padding : 11 px 14 px ; color : #fff ; background : #253c57 ; box-shadow : 0 12 px 30 px rgba ( 20 , 37 , 60 , .23 ) ; font-size : 12 px ; opacity : 0 ; transform : translateY ( 12 px ) ; pointer-events : none ; transition : .18 s } . toast . show { opacity : 1 ; transform : translateY ( 0 ) } . overlay { position : fixed ; inset : 0 ; z-index : 10 ; display : none ; align-items : center ; justify-content : center ; padding : 20 px ; background : rgba ( 19 , 32 , 49 , .38 ) } . overlay . show { display : flex } . modal { width : min ( 480 px , 100 % ) ; border-radius : 12 px ; background : #fff ; box-shadow : 0 24 px 60 px rgba ( 20 , 37 , 60 , .28 ) } . modal h2 { margin : 0 ; padding : 17 px 18 px 10 px ; color : var ( - - ink ) ; font-size : 16 px } . modal p { margin : 0 ; padding : 0 18 px ; color : var ( - - muted ) ; font-size : 12 px } . modal . body { padding : 16 px 18 px } . modal input { width : 100 % ; border : 1 px solid #d4dee9 ; border-radius : 8 px ; padding : 9 px 10 px } . modal . footer { display : flex ; justify-content : flex-end ; gap : 8 px ; padding : 12 px 18 px ; border-top : 1 px solid var ( - - line ) }
/* Chat 首页复用 HXOPS 真实 Chat 壳层:无业务顶栏、消息列居中、输入容器贴近底部。 */
. chat-mode . topbar { display : none } . chat-mode . main { background : var ( - - surface ) } . chat-mode . layout { overflow : hidden } . chat-mode . side { flex-basis : 320 px ; width : 320 px ; max-width : 320 px } . chat-mode . page { width : 100 % ; height : 100 % ; max-width : none ; margin : 0 ; padding : 0 24 px } . chat-home { display : flex ; height : 100 % ; min-height : 0 ; flex-direction : column ; align-items : center } . chat-home-head { width : 100 % ; max-width : 780 px ; padding : 38 px 0 12 px ; text-align : center } . chat-home-head . welcome-mark { display : grid ; place-items : center ; width : 46 px ; height : 46 px ; margin : 0 auto 14 px ; border-radius : 50 % ; color : #fff ; background : linear-gradient ( 135 deg , #2f80d1 , #1f65b0 ) ; font-weight : 800 ; box-shadow : 0 8 px 22 px rgba ( 47 , 128 , 209 , .22 ) } . chat-home-head h1 { margin : 0 ; color : #0f172a ; font-size : 28 px ; line-height : 1.25 } . chat-home-head h1 span { color : #2f80d1 } . chat-home-head p { margin : 9 px auto 0 ; max-width : 650 px ; color : #64748b ; font-size : 13 px } . chat-scenarios { display : flex ; width : 100 % ; max-width : 860 px ; gap : 8 px ; overflow-x : auto ; padding : 6 px 0 14 px ; scrollbar-width : none } . chat-scenarios :: -webkit-scrollbar { display : none } . chat-scenarios . tab { flex : 0 0 auto ; border : 1 px solid #e2e8f0 ; border-bottom : 1 px solid #e2e8f0 ; border-radius : 999 px ; padding : 8 px 13 px ; color : #475569 ; background : #fff ; font-size : 12 px ; font-weight : 600 ; white-space : nowrap } . chat-scenarios . tab . active { border-color : #9cc7f2 ; color : #1f5f99 ; background : #eef6ff } . chat-thread { width : 100 % ; max-width : 780 px ; min-height : 0 ; flex : 1 ; overflow : auto ; padding : 12 px 0 150 px } . chat-thread . bubble { max-width : 82 % ; border-radius : 14 px ; background : #fff ; box-shadow : 0 2 px 8 px rgba ( 15 , 23 , 42 , .04 ) } . chat-thread . bubble . user-msg { border : 0 ; border-radius : 14 px 5 px 14 px 14 px ; background : #2f80d1 ; box-shadow : none } . chat-thread . scope { border-color : #cfe5f9 ; border-radius : 14 px ; background : #f8fbff } . chat-thread . notice { border-radius : 12 px } . chat-action { display : flex ; justify-content : flex-end ; margin-top : 10 px } . chat-input-wrap { position : fixed ; right : 0 ; bottom : 0 ; left : 320 px ; z-index : 4 ; padding : 12 px 24 px 18 px ; background : linear-gradient ( transparent , rgba ( 255 , 255 , 255 , .96 ) 22 % ) } . chat-input { display : flex ; align-items : flex-end ; gap : 8 px ; width : min ( 780 px , 100 % ) ; margin : 0 auto ; border : 1 px solid #d8e0ec ; border-radius : 16 px ; padding : 9 px 10 px ; background : #fff ; box-shadow : 0 8 px 28 px rgba ( 15 , 23 , 42 , .10 ) } . chat-input input { min-width : 0 ; flex : 1 ; border : 0 ; outline : 0 ; padding : 9 px 8 px ; color : #0f172a ; background : transparent ; font-size : 15 px } . chat-input button { display : grid ; place-items : center ; width : 38 px ; height : 38 px ; border : 0 ; border-radius : 50 % ; color : #fff ; background : #2f80d1 ; font-weight : 700 } . chat-input-hint { width : min ( 780 px , 100 % ) ; margin : 7 px auto 0 ; text-align : center ; color : #94a3b8 ; font-size : 10 px }
@ media ( max-width : 800px ) { body { font-size : 13 px } # app { display : block ; height : auto ; min-height : 100 % ; overflow : auto } . shell { display : block ; overflow : auto } . side { display : none } . main { min-height : 100 % ; overflow : visible } . topbar { padding : 0 16 px } . crumb { display : none } . page { padding : 17 px } . grid . two { grid-template-columns : 1 fr } . summary { grid-template-columns : repeat ( 2 , 1 fr ) } . page-head { display : block } . page-head . back { margin-bottom : 8 px } . source-toolbar { flex-wrap : wrap } . source-toolbar input { width : 100 % } . source-toolbar . count { margin-left : 0 } . source-list { grid-template-columns : 1 fr } . source-item { border-right : 0 } . facts { grid-template-columns : 1 fr } . fact { border-right : 0 } . fact : nth-last-child ( -n + 3 ) { border-bottom : 1 px solid var ( - - line ) } . fact : last-child { border-bottom : 0 } . confirm-band { display : block } . confirm-band . actions { margin-top : 10 px } . table { min-width : 650 px } . chat-mode . page { padding : 0 14 px } . chat-home-head { padding-top : 25 px } . chat-home-head h1 { font-size : 23 px } . chat-input-wrap { left : 0 ; padding : 10 px 12 px 14 px } . chat-thread { padding-bottom : 140 px } . chat-thread . bubble { max-width : 92 % } }
. precheck-meta { display : flex ; align-items : center ; gap : 8 px ; flex-wrap : wrap ; margin-top : 6 px ; color : var ( - - muted ) ; font-size : 12 px } . precheck-meta . link { font-size : 12 px } . precheck-summary { display : flex ; flex-wrap : wrap ; gap : 7 px ; margin-bottom : 14 px } . transfer-precheck-table { min-width : 1320 px } . transfer-precheck-table th : nth-child ( 2 ) { min-width : 112 px } . transfer-precheck-table th : nth-child ( 3 ) { min-width : 104 px } . transfer-precheck-table th : nth-child ( 4 ) { min-width : 128 px } . transfer-precheck-table th : nth-child ( 5 ) { min-width : 122 px } . transfer-precheck-table th : nth-child ( 6 ) { min-width : 108 px } . transfer-precheck-table th : nth-child ( 7 ) , . transfer-precheck-table th : nth-child ( 9 ) { min-width : 138 px } . transfer-precheck-table th : nth-child ( 8 ) , . transfer-precheck-table th : nth-child ( 10 ) { min-width : 104 px } . transfer-precheck-table th : nth-child ( 11 ) { min-width : 118 px } . erp-document { margin-top : 10 px ; border : 1 px solid var ( - - line ) ; border-radius : 9 px ; overflow : hidden } . erp-document : first-of-type { margin-top : 0 } . erp-document summary { display : grid ; grid-template-columns : 18 px minmax ( 190 px , 1.25 fr ) minmax ( 150 px , 1 fr ) minmax ( 120 px , .7 fr ) auto ; gap : 14 px ; align-items : center ; padding : 13 px 15 px ; cursor : pointer ; list-style : none } . erp-document summary :: -webkit-details-marker { display : none } . erp-document summary :: before { content : '› ' ; color : #6d7d91 ; font-size : 20 px ; transform : rotate ( 0 deg ) ; transition : transform .15 s } . erp-document [ open ] summary :: before { transform : rotate ( 90 deg ) } . erp-document summary b { display : block ; color : var ( - - ink ) ; font-size : 13 px } . erp-document summary span { display : block ; margin-top : 2 px ; color : var ( - - muted ) ; font-size : 11 px } . erp-document . document-total { text-align : right } . erp-document . document-details { border-top : 1 px solid var ( - - line ) ; padding : 0 15 px 13 px ; background : #fcfdff } . result-downloads { display : flex ; flex-wrap : wrap ; gap : 8 px ; padding-top : 14 px ; margin-top : 14 px ; border-top : 1 px solid var ( - - line ) } . result-downloads span { width : 100 % ; color : var ( - - muted ) ; font-size : 11 px }
/* Chat 首页对齐当前 HXOPS Chat:深色画布、56px 顶栏、抽屉式历史记录与底部双行输入区。 */
.chat-mode{background:#020617;color:#cbd5e1}.chat-mode #app{background:#020617}.chat-mode .main{background:#020617}.chat-mode .topbar{display:flex;height:56px;gap:9px;padding:0 16px;border-color:#1e293b;background:#020617}.chat-mode .agent-icon{width:28px;height:28px;border-radius:8px;color:#e0f2fe;background:#2582ca;font-size:11px}.chat-mode .title{display:flex;align-items:center;gap:10px}.chat-mode .title b{color:#f8fafc;font-size:14px}.chat-mode .title span{display:none}.chat-mode .crumb{margin-left:0;border:1px solid #7dd3fc;border-radius:8px;padding:5px 10px;color:#0369a1;background:#e0f2fe;font-size:12px;font-weight:700}.chat-mode .chat-nav-actions{display:flex;align-items:center;gap:8px;margin-left:auto}.chat-mode .chat-nav-actions button{display:grid;place-items:center;width:32px;height:32px;border:0;border-radius:8px;color:#94a3b8;background:transparent;font-size:18px}.chat-mode .chat-nav-actions button:hover{color:#e2e8f0;background:#0f172a}.chat-mode .layout{overflow:hidden}.chat-mode .page{width:100%;height:100%;max-width:none;margin:0;padding:0}.chat-mode .side{position:fixed;top:0;bottom:0;left:0;z-index:30;display:flex;flex:0 0 296px;width:296px;min-width:296px;max-width:296px;transform:translateX(-100%);border-color:#1e293b;background:#0f172a;box-shadow:18px 0 44px rgba(0,0,0,.38);transition:transform .2s ease}.chat-mode.history-open .side{transform:translateX(0)}.chat-mode .brand{height:56px;border-color:#1e293b;padding:0 16px}.chat-mode .brand-mark{width:28px;height:28px;border-radius:8px;background:#2582ca;font-size:11px}.chat-mode .brand b{color:#f8fafc;font-size:14px}.chat-mode .brand span{color:#64748b}.chat-mode .new-chat{margin:12px;border-color:#1d4f78;border-radius:8px;color:#bae6fd;background:#082f49}.chat-mode .nav-label,.chat-mode .history-label{color:#64748b}.chat-mode .history-divider{background:#1e293b}.chat-mode .history button{color:#cbd5e1}.chat-mode .history button:hover{background:#172554}.chat-mode .history button.active{color:#e0f2fe;background:#0c4a6e}.chat-mode .history span{color:#64748b}.chat-mode .user{border-color:#1e293b}.chat-mode .user b{color:#e2e8f0}.chat-mode .user span{color:#64748b}.chat-mode .avatar{color:#bae6fd;background:#164e63}.chat-home{display:flex;height:100%;min-height:0;flex-direction:column;align-items:center}.chat-home-head{width:100%;max-width:920px;padding:67px 20px 17px;text-align:center}.chat-home-head .welcome-mark{display:none}.chat-home-head h1{margin:0;color:#f8fafc;font-size:29px;line-height:1.3}.chat-home-head h1 span{margin-left:6px;color:#7dd3fc}.chat-home-head p{display:none}.chat-todo-section{width:100%;max-width:760px;padding:0 16px 12px}.chat-todo-label{margin:0 0 8px;color:#94a3b8;font-size:12px;font-weight:700}.chat-today{display:flex;justify-content:center}.today-item{display:flex;align-items:center;gap:9px;width:auto;max-width:100%;border:1px solid #334155;border-radius:999px;padding:9px 14px;color:#cbd5e1;background:#0f172a;text-align:left}.today-item:hover{border-color:#7dd3fc;color:#e0f2fe;background:#172554}.today-item .today-icon{display:grid;place-items:center;width:18px;height:18px;flex:0 0 18px;border-radius:50%;color:#0c4a6e;background:#7dd3fc;font-size:15px;line-height:1}.today-item b{display:inline;color:inherit;font-size:13px}.today-item span{display:inline;margin:0;color:#94a3b8;font-size:12px}.today-item span span{display:none}.today-item .today-go{display:none}.chat-pending{display:flex;justify-content:center;gap:8px}.pending-item{display:flex;align-items:center;gap:6px;min-width:0;width:auto;border:1px solid #334155;border-radius:999px;padding:8px 12px;color:#cbd5e1;background:#0f172a;text-align:left}.pending-item:hover{border-color:#64748b;background:#172554}.pending-item.primary{border-color:#2c5572;background:#082f49}.pending-item b{display:inline;color:inherit;font-size:12px}.pending-item.primary b{color:#bae6fd}.pending-item span{display:none}.pending-item .pending-count{display:inline;margin:0;color:#7dd3fc;font-size:12px}.pending-item.warning .pending-count{color:#fbbf24}.pending-item.muted .pending-count{color:#94a3b8}.chat-thread{width:100%;max-width:760px;min-height:0;flex:1;overflow:auto;padding:36px 16px 154px}.chat-thread .bubble{max-width:82%;border:1px solid #1e293b;border-radius:6px 14px 14px;padding:11px 13px;color:#cbd5e1;background:#0f172a;box-shadow:none}.chat-thread .bubble.user-msg{margin-left:auto;border:0;border-radius:14px 5px 14px 14px;color:#eff6ff;background:#075985}.chat-thread .scope{border-color:#1e3a5f;border-radius:10px;color:#cbd5e1;background:#0b1327}.chat-thread .scope b{color:#bae6fd}.chat-thread .scope span{color:#94a3b8}.chat-thread .notice{border-radius:10px;color:#fcd34d;background:#2a1d05}.chat-action .btn{border-color:#0369a1;color:#e0f2fe;background:#075985}.chat-input-wrap{position:fixed;right:0;bottom:0;left:0;z-index:4;padding:0 14px 8px;background:#020617}.chat-input{display:block;width:min(760px,100%);margin:0 auto;border:0;border-radius:0;padding:0;backLine truncated
/* 当前浏览器的浅色 Chat 基线:常驻会话栏、无业务顶栏、居中欢迎区和底部输入容器。 */
. chat-mode { color : #334155 ; background : #fff } . chat-mode # app { background : #fff } . chat-mode . main { background : #fff } . chat-mode . topbar { display : none } . chat-mode . layout { overflow : hidden } . chat-mode . page { width : 100 % ; height : 100 % ; max-width : none ; margin : 0 ; padding : 0 } . chat-mode . side { position : static ; z-index : auto ; display : flex ; flex : 0 0 300 px ; width : 300 px ; min-width : 300 px ; max-width : 300 px ; transform : none ; border-color : #dbe7ef ; background : #fff ; box-shadow : none ; transition : none } . chat-mode . history-open . side { transform : none } . chat-mode . brand { height : 72 px ; border : 0 ; padding : 16 px } . chat-mode . brand-mark { width : 34 px ; height : 34 px ; border-radius : 10 px ; background : #3187cf ; font-size : 12 px } . chat-mode . brand b { color : #0f172a ; font-size : 15 px } . chat-mode . brand span { color : #94a3b8 } . chat-mode . new-chat { margin : 10 px 16 px 18 px ; border-color : #e2e8f0 ; border-radius : 10 px ; padding : 11 px 12 px ; color : #334155 ; background : #f8fafc ; box-shadow : 0 2 px 8 px rgba ( 15 , 23 , 42 , .04 ) } . chat-mode . nav-label , . chat-mode . history-label { padding-left : 16 px ; color : #64748b ; font-size : 12 px ; letter-spacing : 0 } . chat-mode . history-divider { margin : 10 px 16 px 6 px ; background : #e2e8f0 } . chat-mode . history { padding : 0 9 px } . chat-mode . history button { padding : 9 px 10 px ; color : #475569 } . chat-mode . history button : hover { background : #f1f5f9 } . chat-mode . history button . active { color : #0f5e9c ; background : #eaf5ff } . chat-mode . history span { color : #94a3b8 } . chat-mode . user { margin : 0 ; padding : 14 px 16 px ; border-color : #edf2f7 } . chat-mode . user b { color : #334155 } . chat-mode . user span { color : #94a3b8 } . chat-mode . avatar { color : #1d70b7 ; background : #e0f2fe } . chat-home-head { max-width : 960 px ; padding : 49 px 20 px 24 px } . chat-home-head . welcome-mark { display : none } . chat-home-head h1 { color : #0f172a ; font-size : 30 px ; font-weight : 800 } . chat-home-head h1 span { margin-left : 6 px ; color : #2582ca } . chat-home-head p { display : none } . chat-todo-section { max-width : 760 px ; padding : 0 16 px 14 px } . chat-todo-label { margin-bottom : 9 px ; color : #64748b } . chat-today { display : flex ; justify-content : center } . today-item { gap : 8 px ; width : auto ; border-color : #d9e3eb ; border-radius : 999 px ; padding : 9 px 14 px ; color : #334155 ; background : #fff ; box-shadow : 0 2 px 7 px rgba ( 15 , 23 , 42 , .035 ) } . today-item : hover { border-color : #7dc0ed ; color : #1267a7 ; background : #f6fbff } . today-item . today-icon { width : 18 px ; height : 18 px ; flex-basis : 18 px ; border-radius : 50 % ; color : #0f5e9c ; background : #dff1ff ; font-size : 15 px ; line-height : 1 } . today-item b { display : inline ; color : inherit ; font-size : 13 px } . today-item span { display : inline ; margin : 0 ; color : #64748b ; font-size : 12 px } . today-item span span { display : none } . today-item . today-go { display : none } . chat-pending { display : flex ; justify-content : center ; gap : 8 px } . pending-item { display : flex ; align-items : center ; gap : 6 px ; width : auto ; border-color : #e2e8f0 ; border-radius : 999 px ; padding : 8 px 12 px ; color : #475569 ; background : #fff ; box-shadow : 0 2 px 7 px rgba ( 15 , 23 , 42 , .03 ) } . pending-item : hover { border-color : #b9d9ef ; background : #f8fbff } . pending-item . primary { border-color : #c5e2f4 ; background : #f4faff } . pending-item b { display : inline ; color : inherit ; font-size : 12 px } . pending-item . primary b { color : #1f5f99 } . pending-item span { display : none } . pending-item . pending-count { display : inline ; margin : 0 ; color : #2582ca ; font-size : 12 px } . pending-item . warning . pending-count { color : #b7791f } . pending-item . muted . pending-count { color : #64748b } . chat-thread { max-width : 760 px ; padding : 34 px 16 px 154 px } . chat-thread . bubble { border-color : #e2e8f0 ; border-radius : 6 px 14 px 14 px ; padding : 11 px 13 px ; color : #475569 ; background : #fff ; box-shadow : 0 2 px 8 px rgba ( 15 , 23 , 42 , .04 ) } . chat-thread . bubble . user-msg { border : 0 ; border-radius : 14 px 5 px 14 px 14 px ; color : #fff ; background : #2582ca } . chat-thread . scope { border-color : #d8ecfa ; border-radius : 10 px ; color : #475569 ; background : #f6fbff } . chat-thread . scope b { color : #1f5f99 } . chat-thread . scope span { color : #64748b } . chat-thread . notice { border-radius : 10 px ; color : #9a640c ; background : #fff7e7 } . chat-action . btn { border-color : #2582ca ; color : #fff ; background : #2582ca } . chat-input-wrap { left : 300 px ; padding : 0 14 px 8 px ; background : linear-gradient ( transparent , rgba ( 255 , 255 , 255 , .96 ) 28 % ) } . chat-input { width : min ( 760 px , 100 % ) ; border : 1 px solid #edf1f5 ; border-radius : 17 px ; padding : 8 px 10 px ; background : #fff ; box-shadow : 0 8 px 26 px rgba ( 15 , 23 , 42 , .08 ) } . chat-input textarea { min-height : 42 px ; padding : 8 px 10 px ; color : #0f172a } . chat-input textarea :: placeholder { color : #94a3b8 } . chat-input-tools { min-height : 35 px ; padding : 0 4 px } . chat-input-tools button { width : 30 px ; height : 30 px ; color : #64748b } . chat-input-tools button : hover { color : #2582ca ; background : #f1f5f9 } . chat-input-tools . kb-pill { border-color : #e2e8f0 ; border-radius : 7 px ; color : #94a3b8 ; background : #fff } . chat-input-tools . send { border-color : #edf1f5 ; color : #cbd5e1 ; background : #f8fafc } . chat-input-hint { margin-top : 8 px ; color : #94a3b8 }
/* 待办是业务工作入口,保留卡片、计数和辅助说明,不压缩为聊天快捷问题。 */
. chat-mode . chat-todo-section { width : 100 % ; max-width : 780 px ; padding : 0 0 14 px } . chat-mode . chat-todo-label { margin : 0 0 8 px ; color : #506e8b ; font-size : 14 px ; font-weight : 800 } . chat-mode . chat-today { display : grid ; grid-template-columns : 1 fr ; gap : 10 px } . chat-mode . today-item { display : flex ; align-items : center ; gap : 12 px ; width : 100 % ; border : 1 px solid #9cc7f2 ; border-radius : 12 px ; padding : 13 px ; color : #1f5f99 ; background : #eef6ff ; text-align : left ; box-shadow : none } . chat-mode . today-item : hover { background : #e3f1ff } . chat-mode . today-item . today-icon { display : grid ; place-items : center ; width : 34 px ; height : 34 px ; flex : 0 0 34 px ; border-radius : 10 px ; color : #fff ; background : #2f80d1 ; font-size : 18 px ; font-weight : 800 } . chat-mode . today-item b , . chat-mode . today-item span { display : block } . chat-mode . today-item b { color : #1f5f99 ; font-size : 13 px } . chat-mode . today-item span { margin-top : 2 px ; color : #54718f ; font-size : 11 px } . chat-mode . today-item span span { display : block } . chat-mode . today-item . today-go { display : block ; margin-left : auto ; color : #2f80d1 ; font-size : 19 px } . chat-mode . chat-pending { display : grid ; width : 100 % ; grid-template-columns : 1.3 fr 1 fr 1 fr ; gap : 10 px } . chat-mode . pending-item { display : block ; min-width : 0 ; width : 100 % ; border : 1 px solid #e2e8f0 ; border-radius : 12 px ; padding : 12 px 13 px ; color : #475569 ; background : #fff ; text-align : left ; box-shadow : none } . chat-mode . pending-item : hover { border-color : #9cc7f2 ; background : #f8fbff } . chat-mode . pending-item . primary { border-color : #9cc7f2 ; background : #eef6ff } . chat-mode . pending-item b , . chat-mode . pending-item span { display : block } . chat-mode . pending-item b { color : #0f172a ; font-size : 13 px } . chat-mode . pending-item . primary b { color : #1f5f99 } . chat-mode . pending-item span { margin-top : 3 px ; color : #64748b ; font-size : 11 px } . chat-mode . pending-item . pending-count { display : inline-block ; margin : 0 0 4 px ; color : #2f80d1 ; font-size : 22 px ; line-height : 1 ; font-weight : 800 } . chat-mode . pending-item . warning . pending-count { color : #b7730d } . chat-mode . pending-item . muted . pending-count { color : #64748b }
@ media ( max-width : 800px ) { body { font-size : 13 px } # app { display : block ; height : auto ; min-height : 100 % ; overflow : auto } . shell { display : block ; overflow : auto } . side { display : none } . main { min-height : 100 % ; overflow : visible } . topbar { padding : 0 16 px } . crumb { display : none } . page { padding : 17 px } . grid . two { grid-template-columns : 1 fr } . summary { grid-template-columns : repeat ( 2 , 1 fr ) } . page-head { display : block } . page-head . back { margin-bottom : 8 px } . source-toolbar { flex-wrap : wrap } . source-toolbar input { width : 100 % } . source-toolbar . count { margin-left : 0 } . source-list { grid-template-columns : 1 fr } . source-item { border-right : 0 } . facts { grid-template-columns : 1 fr } . fact { border-right : 0 } . fact : nth-last-child ( -n + 3 ) { border-bottom : 1 px solid var ( - - line ) } . fact : last-child { border-bottom : 0 } . confirm-band { display : block } . confirm-band . actions { margin-top : 10 px } . table { min-width : 650 px } . chat-mode . page { padding : 0 14 px } . chat-home-head { padding-top : 25 px } . chat-home-head h1 { font-size : 23 px } . chat-pending { grid-template-columns : 1 fr ; padding-bottom : 10 px } . chat-input-wrap { left : 0 ; padding : 10 px 12 px 14 px } . chat-thread { padding-bottom : 140 px } . chat-thread . bubble { max-width : 92 % } }
< / style >
< / head >
< body >
@@ -33,11 +38,18 @@
< button data-action = "go-precheck" > < b > DBS 昨日收料预检< / b > < span > PRE-20260818-001< / span > < / button >
< button data-action = "go-run" > < b > 自动调拨结果< / b > < span > AUTO-20260818-0900< / span > < i class = "dot" > < / i > < / button >
< button data-action = "go-backlog" > < b > 待处理调拨< / b > < span > 6 笔可恢复异常< / span > < i class = "dot bad" > < / i > < / button >
< div class = "history-divider" > < / div >
< div class = "history-label" > 评审对话走查(演示)< / div >
< button class = "walkthrough" data-action = "chat-scene-intent" > < b > 处理昨天 DBS-AWSBI 的收料< / b > < span > 发起调拨意图< / span > < / button >
< button class = "walkthrough" data-action = "chat-scene-status" > < b > 还有哪些待处理调拨?< / b > < span > 历史待办状态< / span > < / button >
< button class = "walkthrough" data-action = "chat-scene-mismatch" > < b > INV-031 为什么不可调拨?< / b > < span > 数量不一致说明< / span > < / button >
< button class = "walkthrough" data-action = "chat-scene-recovery" > < b > 我已在 ERP 处理好库存,如何复查?< / b > < span > 异常 ERP 复查< / span > < / button >
< button class = "walkthrough" data-action = "chat-scene-schedule" > < b > 最近自动调拨执行结果?< / b > < span > 自动 Run 汇总< / span > < / button >
< / div >
< div class = "user" > < div class = "avatar" > 仓< / div > < div > < b > 仓库管理人员< / b > < span > 在途仓调拨 Agent< / span > < / div > < / div >
< / aside >
< main class = "main" >
< header class = "topbar" > < div class = "agent-icon" > AI< / div > < div class = "title" > < b > 在途仓自动调拨< / b > < span id = "sub-title" > Chat 首页 · 仅展示摘要与入口< / span > < / div > < div class = "crumb" id = "crumb" > /chat/:agentId < / div > < / header >
< header class = "topbar" > < div class = "agent-icon" > AI< / div > < div class = "title" > < b > 在途仓自动调拨< / b > < span id = "sub-title" > Chat 首页 · 仅展示摘要与入口< / span > < / div > < div class = "crumb" id = "crumb" > 调拨中心 < / div > < div class = "chat-nav-actions" > < button type = "button" aria-label = "打开历史记录" title = "历史记录" data-action = "toggle-history" > ↶ < / button > < button type = "button" aria-label = "更多功能" title = "更多功能" > ▦ < / button > < / div > < / header >
< div class = "layout" id = "page" > < / div >
< / main >
< / div >
@@ -45,20 +57,20 @@
< div class = "overlay" id = "modal-mask" > < div class = "modal" > < h2 id = "modal-title" > < / h2 > < p id = "modal-desc" > < / p > < div class = "body" > < input id = "reason" placeholder = "请输入原因(必填)" / > < / div > < div class = "footer" > < button class = "btn" data-action = "modal-cancel" > 取消< / button > < button class = "btn primary" data-action = "modal-confirm" > 确认< / button > < / div > < / div > < / div >
< script >
const $ = id => document . getElementById ( id ) ;
const S = { selected : new Set ( [ 'DBS-AWSBI' ] ) , collapsed : new Set ( ) , businessDate : '2026-08-18' , backlogTab : 'recoverable' , modal : null , toastTimer : null , precheckRequery : 'initial' , routeOrgs : new Set ( ) } ;
const S = { selected : new Set ( [ 'DBS-AWSBI' ] ) , collapsed : new Set ( ) , businessDate : '2026-08-18' , backlogTab : 'recoverable' , modal : null , toastTimer : null , precheckRequery : 'initial' , historyOpen : false } ;
const sources = [
{ platform : 'DBS' , code : 'DBS-AWSBI' , name : 'AWSBI 在途仓' , warehouse : 'AWSBI-TRANSIT' , enabled : true } ,
{ platform : 'DBS' , code : 'DBS-AWSSG' , name : 'AWSSG 在途仓' , warehouse : 'AWSSG-TRANSIT' , enabled : true } ,
{ platform : 'DBS' , code : 'DBS-AWSMY' , name : 'AWSMY 在途仓' , warehouse : 'AWSMY-TRANSIT' , enabled : true } ,
{ platform : 'Crane' , code : 'CRANE-SZ' , name : '深圳在途仓' , warehouse : 'CRANE-SZ-TRANSIT' , enabled : true } ,
{ platform : 'Crane' , code : 'CRANE-SG' , name : '新加坡在途仓' , warehouse : 'CRANE-SG-TRANSIT' , enabled : true } ,
{ platform : 'Crane' , code : 'CRANE-HK' , name : '香港在途仓' , warehouse : 'CRANE-HK-TRANSIT' , enabled : false }
{ platform : 'DBS' , code : 'DBS-AWSBI' , name : 'AWSBI 在途仓' , warehouse : 'AWSBI-TRANSIT' , enabled : true , file : { name : 'DBS-AWSBI-receipt-20260818-v3.xlsx' , downloadedAt : 'RPA 下载于 08:00' } } ,
{ platform : 'DBS' , code : 'DBS-AWSSG' , name : 'AWSSG 在途仓' , warehouse : 'AWSSG-TRANSIT' , enabled : true , file : { name : 'DBS-AWSSG-receipt-20260818-v2.xlsx' , downloadedAt : 'RPA 下载于 08:02' } } ,
{ platform : 'DBS' , code : 'DBS-AWSMY' , name : 'AWSMY 在途仓' , warehouse : 'AWSMY-TRANSIT' , enabled : true , file : { name : 'DBS-AWSMY-receipt-20260818-v1.xlsx' , downloadedAt : 'RPA 下载于 08:05' } } ,
{ platform : 'Crane' , code : 'CRANE-SZ' , name : '深圳在途仓' , warehouse : 'CRANE-SZ-TRANSIT' , enabled : true , file : { name : 'CRANE-SZ-receipt-20260818-v4.xlsx' , downloadedAt : 'RPA 下载于 08:01' } } ,
{ platform : 'Crane' , code : 'CRANE-SG' , name : '新加坡在途仓' , warehouse : 'CRANE-SG-TRANSIT' , enabled : true , file : null } ,
{ platform : 'Crane' , code : 'CRANE-HK' , name : '香港在途仓' , warehouse : 'CRANE-HK-TRANSIT' , enabled : false , file : null }
] ;
const text = ( s = '' ) => String ( s ) . replace ( /[&<>"']/g , c => ( { '&' : '&' , '<' : '<' , '>' : '>' , '"' : '"' , "'" : ''' } [ c ] ) ) ;
const button = ( label , action , kind = '' ) => ` <button class="btn ${ kind } " data-action=" ${ action } "> ${ label } </button> ` ;
const tag = ( label , kind ) => ` <span class="chip ${ kind } "> ${ label } </span> ` ;
const goto = ( page , extras = { } ) => { const u = new URL ( location . href ) ; u . search = '' ; u . searchParams . set ( 'page' , page ) ; Object . entries ( extras ) . forEach ( ( [ k , v ] ) => u . searchParams . set ( k , v ) ) ; history . pushState ( { } , '' , u ) ; render ( ) ; } ;
const pageName = ( ) => new URL ( location . href ) . searchParams . get ( 'page' ) || 'chat' ;
const pageName = ( ) => { const page = new URL ( location . href ) . searchParams . get ( 'page' ) || 'chat' ; return page === 'confirm' ? 'precheck' : page ; } ;
const toast = msg => { const el = $ ( 'toast' ) ; el . textContent = msg ; el . classList . add ( 'show' ) ; clearTimeout ( S . toastTimer ) ; S . toastTimer = setTimeout ( ( ) => el . classList . remove ( 'show' ) , 2800 ) ; } ;
const setHeader = ( sub , crumb ) => { $ ( 'sub-title' ) . textContent = sub ; $ ( 'crumb' ) . textContent = crumb ; } ;
const facts = rows => ` <div class="facts"> ${ rows . map ( ( [ k , v ] ) => ` <div class="fact"><span> ${ k } </span><b> ${ v } </b></div> ` ) . join ( '' ) } </div> ` ;
@@ -66,102 +78,70 @@
welcome : { label : '开始使用' , user : '我想处理昨天的在途仓收料。' , reply : '可以。我会先帮你进入来源实例选择,再由业务页面创建预检。DBS、Crane 是平台分组;实际选择单位是来源实例,例如 DBS-AWSBI。' , evidence : '尚未创建调拨任务;不会读取 RPA 或查询 ERP。' , action : 'go-source' , actionLabel : '选择处理范围' } ,
rule : { label : '业务规则' , user : '为什么今天不能调拨?' , reply : '当天收料尚未成熟,不能进入 ERP 库存查询或调拨写入。系统默认处理昨天及更早的收料日期;当天 Invoice 会保留为 not_matured,待后续业务日期再处理。' , evidence : '规则边界:not_matured 不查询 ERP、不创建 ERP 单据。' , action : 'go-source' , actionLabel : '查看可选业务日期与来源' } ,
status : { label : '待处理状态' , user : '现在还有多少待处理调拨?' , reply : '演示数据中有 6 笔可恢复异常、2 笔已人工关闭,以及 1 笔结果未知。三类状态的允许操作不同,不能混合处理。' , evidence : '可恢复异常可仅重查 ERP;已关闭可恢复;结果未知只读。' , action : 'go-backlog' , actionLabel : '查看待处理调拨' } ,
intent : { label : '发起调拨' , user : '查询昨天 DBS-AWSBI 的可调拨数据。' , reply : '我已理解为发起调拨意图,但不会直接写入 ERP。请先在页面选择 DBS-AWSBI 和业务日期,创建预检后再 勾选严格匹配的 Invoice。' , evidence : '需要经过:选择范围 → 预检 → 最终确认 → ERP 写入 。' , action : 'go-source' , actionLabel : '选择 DBS-AWSBI 并预检' } ,
intent : { label : '发起调拨' , user : '查询昨天 DBS-AWSBI 的可调拨数据。' , reply : '我已理解为发起调拨意图,但不会直接写入 ERP。请先在页面选择 DBS-AWSBI 和业务日期,创建预检后核对并 勾选严格匹配的 Invoice。' , evidence : '需要经过:选择范围 → 预检核对 → 生成调拨单 。' , action : 'go-source' , actionLabel : '选择 DBS-AWSBI 并预检' } ,
progress : { label : '文件与预检进度' , user : '系统现在在做什么?' , reply : '当创建预检时,系统会按来源实例显示真实阶段:优先使用任务创建前的最新有效收料文件;如果该文件不存在,才实时抓取并等待 RPA 回调。文件确定后,再汇总 Invoice 并查询 ERP。' , evidence : '实时抓取期间会持续展示来源实例、阶段和等待原因;任务创建后文件版本冻结。' , action : 'go-source' , actionLabel : '进入来源实例与预检流程' } ,
mismatch : { label : '不可调拨原因' , user : 'INV-031 为什么不可调拨?' , reply : '该 Invoice 当前收料数量为 300 PCS、ERP 账面库存为 280 PCS,未满足严格等量条件,因此不会进入确认或 ERP 写入范围。' , evidence : '可在 ERP 人工处理后,仅重新查询该异常的 ERP 库存;不会重新抓 RPA 或替换冻结文件。' , action : 'go-precheck' , actionLabel : '查看 INV-031 预检与复查入口' } ,
recovery : { label : 'ERP 处理后复查' , user : '我已经在 ERP 处理好了库存,下一步怎么做?' , reply : '请进入原预检页,点击“我已处理 ERP,重新查询异常库存”。系统会为异常 Invoice 新增一条 ERP 查询 Attempt;若严格匹配,才会自动加入可确认 范围。' , evidence : '复查不更新 RPA 文件、不改变收料快照、不写入 ERP。' , action : 'go-precheck' , actionLabel : '进入异常预检页' } ,
mismatch : { label : '不可调拨原因' , user : 'INV-031 为什么不可调拨?' , reply : '该 Invoice 当前收料数量为 300 PCS、ERP 账面库存为 280 PCS,未满足严格等量条件,因此不会进入 ERP 写入范围。' , evidence : '可在 ERP 人工处理后,仅重新查询该异常的 ERP 库存;不会重新抓 RPA 或替换冻结文件。' , action : 'go-precheck' , actionLabel : '查看 INV-031 预检与复查入口' } ,
recovery : { label : 'ERP 处理后复查' , user : '我已经在 ERP 处理好了库存,下一步怎么做?' , reply : '请进入原预检页,点击“我已处理 ERP,重新查询异常库存”。系统会为异常 Invoice 新增一条 ERP 查询 Attempt;若严格匹配,才会自动加入可生成调拨单 范围。' , evidence : '复查不更新 RPA 文件、不改变收料快照、不写入 ERP。' , action : 'go-precheck' , actionLabel : '进入异常预检页' } ,
safety : { label : '结果未知说明' , user : '为什么不能重试结果未知?' , reply : 'ERP 调用未返回可确认的成功或失败时,系统无法证明没有产生单据。再次提交存在重复写入风险,所以该状态只读,必须由 ERP 管理员线下核实。' , evidence : '禁止:重试、关闭、恢复、重新执行;允许:查看已知事实与审计。' , action : 'go-unknown' , actionLabel : '查看结果未知事项' } ,
schedule : { label : '自动调拨结果' , user : '最近一次自动调拨执行得怎么样?' , reply : '自动排程按来源实例独立处理:每个实例使用其任务开始前的最新有效文件,分别预检、写入和汇总通知。一个实例失败不会阻断其他实例。' , evidence : '演示 Run: DBS-AWSBI 成功 18 项;CRANE-SZ 文件获取超时并保留异常证据。' , action : 'go-run' , actionLabel : '查看最近自动 Run' }
} ;
const chatScenario = ( ) => new URL ( location . href ) . searchParams . get ( 'scene' ) || 'welcome' ;
const chatScenario = ( ) => new URL ( location . href ) . searchParams . get ( 'scene' ) ;
function chatPage ( ) {
setHeader ( 'Chat 首页 · 对话解释与业务入口' , '/chat/:agentId' ) ;
const key = chatScenario ( ) , scene = chatScenarios [ key ] || chatScenarios . welcome ;
const scenarioTabs = Object . entries ( chatScenarios ) . map ( ( [ id , item ] ) => ` <button class="tab ${ id === key ? 'active' : '' } " data-action="chat-scene- ${ id } "> ${ item . label } </button> ` ) . join ( '' ) ;
return ` <section class="page"><div class="chat-home"><div class="chat-home-head"><div class="welcome-mark">AI</div><h1>你好,欢迎使用<span>在途仓自动调拨 Agent</span></h1><p>我会解释规则、展示收料文件与 ERP 查询进度;需要改变业务数据时,请在对应页面点击按钮确认。</p></div><div class="chat-scenarios" aria-label="对话场景"> ${ scenarioTabs } </div> <div class="chat-thread"><div class="bubble user-msg">${ scene . user } </div><div class="bubble"> ${ scene . reply } </div><div class="scope"><div><b>系统状态 / 可核验依据</b><span> ${ scene . evidence } </span></div></div><div class="chat-action"> ${ button ( scene . actionLabel , scene . action , 'primary' ) } </div><div class="notice warn"><i>!</i><span>对话不会绕过业务按钮直接发起 ERP 写入;当天收料不会进入 ERP 查询或调拨。</span></div></div><div class="chat-input-wrap"><div class="chat-input"><input id="chat-input" aria-label="对话输入" placeholder="例如:为什么今天不能调拨?" /><button aria-label="发送" data-action="chat-send">↑</button></div><div class="chat-input-hint">AI 可能会犯错,请核实重要信息。 · 原型数据仅用于业务走查</div></div></div></section> ` ;
const key = chatScenario ( ) , scene = key && chatScenarios [ key ] ;
const welcome = ` <div class="chat-home-head"><div class="welcome-mark">AI</div><h1>你好,您已进入<span>在途仓自动调拨 Agent</span></h1><p>我会解释规则、展示收料文件与 ERP 查询进度;需要改变业务数据时,请在对应页面点击按钮确认。</p></div><section class="chat-todo-section" aria-label="今日待办"><p class="chat-todo-label">今日待办</p><div class="chat-today"><button class="today-item" data-action="go-source"><i class="today-icon">+ </i><span><b>发起今日调拨预检</b><span>选择来源实例后,系统默认以昨天为业务日期处理可成熟收料。</span></span><i class="today-go">› </i></button></div></section><section class="chat-todo-section" aria-label="历史待办"><p class="chat-todo-label">历史待办</p><div class="chat-pending"><button class="pending-item primary" data-action="go-backlog-recoverable"><span class="pending-count">6</span><b>可恢复异常</b><span>可重新查询 ERP 库存后继续处理</span></button><button class="pending-item muted" data-action="go-backlog-closed"><span class="pending-count">2</span><b>已人工关闭</b><span>可查看原因并恢复处理</span></button><button class="pending-item warning" data-action="go-unknown"><span class="pending-count">1</span><b>结果未知</b><span>只读,需线下核实 ERP 事实</span></button></div></section> ` ;
const thread = scene ? ` <div class="chat-thread"><div class="bubble user-msg"> ${ scene . user } </div><div class="bubble"> ${ scene . reply } </div><div class="scope"><div><b>系统状态 / 可核验依据</b><span> ${ scene . evidence } </span></div></div><div class="chat-action"> ${ button ( scene . actionLabel , scene . action , 'primary' ) } </div><div class="notice warn"><i>!</i><span>对话不会绕过业务按钮直接发起 ERP 写入;当天收料不会进入 ERP 查询或调拨。</span></div></div> ` : welcome ;
return ` <section class="page"><div class="chat-home"> ${ thread } <div class="chat-input-wrap"><div class="chat-input"><textarea id="chat-input" aria-label="对话输入" rows="1" placeholder="问我任何事..."></textarea><div class="chat-input-tools"><button type="button" aria-label="语音功能" title="语音功能">♩</button><button type="button" class="kb-pill" aria-label="企业知识库" disabled>▤ 企业知识库⌄</button><button type="button" class="send" aria-label="发送" title="发送" data-action="chat-send">➤</button></div></div><div class="chat-input-hint">AI 可能会犯错,请核实重要信息。</div></div></div></section> ` ;
}
function sourcePage ( ) {
setHeader ( '来源实例选择 · 本次调拨范围' , '/chat/:agentId?mode=transfer-source-selection' ) ;
const groups = [ ... new Set ( sources . map ( x => x . platform ) ) ] ;
return ` <section class="page"><div class="page-head"> ${ button ( '← 返回对话' , 'go-chat' ) } <div style="flex:1"><h1>选择收料来源实例</h1><p>DBS、Crane 仅为平台分组。请勾选实际需要处理的在途仓实例;未来新增实例会自动显示在对应平台。</p></div></div><div class="card"><div class="card-h"><div><h2>本次处理范围</h2><p>已选择的实例会独立准备文件、解析、预检与审计。</p></div></div><div class="card-b"><div class="source-toolbar"><input id="source-search" placeholder="搜索实例名称或编码,例如 AWSBI" /><button class="btn" data-action="select-enabled">全选已启用</button><button class="btn" data-action="clear-sources">清空</button><span class="count" id="source-count"></span></div><div id="source-groups"> ${ groups . map ( platform => sourceGroup ( platform ) ) . join ( '' ) } </div><div class="sticky-actions"> ${ button ( '取消' , 'go-chat' ) } ${ button ( '确认范围并预检' , 'start-precheck' , 'primary' ) } </div></div></div></section> ` ;
}
function sourceGroup ( platform ) { const items = sources . filter ( x => x . platform === platform ) ; const collapsed = S . collapsed . has ( platform ) ; return ` <section class="source-group" data-platform=" ${ platform } "><div class="source-group-head"><b> ${ platform } </b><span> ${ items . filter ( x => x . enabled ) . length } 个已启用实例</span><button data-action="toggle- ${ platform } "> ${ collapsed ? '展开' : '收起' } </button></div><div class="source-list" ${ collapsed ? 'style="display:none"' : '' } > ${ items . map ( s => ` <label class="source-item" data-source-row=" ${ s . code } "><input type="checkbox" data-source=" ${ s . code } " ${ S . selected . has ( s . code ) ? 'checked' : '' } ${ s . enabled ? '' : 'disabled' } /><span ><b> ${ s . code } </b><span> ${ s . name } · 来源仓 ${ s . warehouse } ${ s . enabled ? '' : ' · 未启用' } </span></span></label > ` ) . join ( '' ) } </div></section> ` ; }
function precheckPage ( ) {
setHeader ( '调拨预检 · 冻结的文件与 ERP 匹配结果' , '/chat/:agentId?mode=transfer-precheck&precheck_id=PRE-20260819-001' ) ;
const requerying = S . precheckRequery === 'loading' ;
const matched = S . precheckRequery === 'matched' ;
const mismatchRow = requerying
? ` <tr class="disabled"><td><input type="checkbox" disabled /></td><td>DBS-AWSBI</td><td><b>INV-031</b></td><td>300 PCS</td><td><span class="chip gray">查询中…</span></td><td><small>正在重新查询 ERP 库存;收料文件保持冻结。</small></td></tr> `
: matched
? ` <tr><td><input type="checkbox" data-invoice="INV-031" checked /></td><td>DBS-AWSBI</td><td><b>INV-031</b></td><td>300 PCS</td><td>300 PCS<br /><small>最新查询 10:06</small></td><td> ${ tag ( '可执行' , 'good' ) } <br /><button class="link" data-action="show-requery-history">查看历史比对</button></td></tr> `
: ` <tr class="disabled"><td><input type="checkbox" disabled /></td><td>DBS-AWSBI</td><td><b>INV-031</b></td><td>300 PCS</td><td>280 PCS<br /><small>上次查询 09:12 · Attempt 1</small></td><td> ${ tag ( '数量不一致' , 'warn' ) } <br /><button class="link" data-action="show-requery-history">查看历史比对</button></td></tr> ` ;
const requeryNotice = requerying
? ` <div class="notice"><i>i</i><span>正在仅查询 1 个数量不一致 Invoice 的 ERP 库存;不会重新抓 RPA、替换文件或写入 ERP。</span></div> `
: matched
? ` <div class="notice good"><i>✓</i><span>INV-031 已在 Attempt 2 匹配:收料 300 / ERP 300。该项目已自动勾选;请在进入确认后再执行 ERP 调拨。</span></div> `
: ` <div class="notice warn"><i>!</i><span>若已在 ERP 完成人工库存处理,可重新查询数量不一致项。该操作只生成新的 ERP 查询 Attempt,不改变冻结收料文件。</span></div> ` ;
const total = matched ? '已选 4 张 · 预计调拨总数量 2,600 PCS · 预计 ERP 写入 4 张' : '已选 3 张 · 预计调拨总数量 2,300 PCS · 预计 ERP 写入 3 张' ;
return ` <section class="page"><div class="page-head"> ${ button ( '← 返回修改范围' , 'go-source' ) } <div style="flex:1"><h1>调拨预检</h1><p>本次任务已固定收料文件、解析映射和策略;不可在中途抓取或替换 RPA 文件。</p></div> ${ tag ( '预检完成' , 'good' ) } </div><div class="grid two"><div class="card"><div class="card-h"><div><h2>来源实例处理进度</h2><p>不显示伪造总百分比;按实例反映真实状态。</p></div></div><div class="card-b"><div class="stage-list"><div class="stage good"><i class="mark"></i><div><b>DBS-AWSBI · 收料文件已就绪</b><span>累计全量文件 DBS-AWSBI-receipt-20260818-v3.xlsx · checksum 7A4E…91B2</span></div> ${ tag ( '预检完成' , 'good' ) } </div><div class="stage warn"><i class="mark"></i><div><b>DBS-AWSSG · 当天收料已排除</b><span>INV-041 收料日期为当天,标记 not_matured,未查询 ERP。</span></div> ${ tag ( '1 项未成熟' , 'warn' ) } </div><div class="stage good"><i class="mark"></i><div><b>CRANE-SZ · ERP 库存已查询</b><span>按 Invoice 汇总收料数量后完成严格等量校验。</span></div> ${ tag ( '预检完成' , 'good' ) } </div></div><div class="notice"><i>i</i><span>若实例文件失败,只阻断该实例;不影响本次选择中的其他来源实例。</span></div></div></div><div class="card"><div class="card-h"><div><h2>冻结上下文</h2><p>历史 Run 永久指向以下快照。</p></div></div><div class="card-b"> ${ facts ( [ [ '业务日期' , '2026-08-18' ] , [ 'ERP 组织' , 'CN01' ] , [ '目标 HUB 仓' , 'HUB-SZ' ] , [ '文件版本' , 'v3 · 7A4E…91B2' ] , [ '策略版本' , 'transfer-policy-v1' ] , [ '预检有效期' , '10:32' ] ] ) } <div class="actions"> ${ button ( '查看冻结文件' , 'show-file' ) } ${ button ( '查看审计快照' , 'show-audit' ) } </div></div></div></div><div class="card" style="margin-top:16px"><div class="card-h"><div><h2>Invoice 预检明细</h2><p>同一 Invoice 的多行先汇总收料数量;仅可勾选严格匹配项。</p></div> ${ button ( requerying ? '正在查询异常 ERP 库存…' : '我已处理 ERP,重新查询异常库存(1)' , 'requery-precheck' , requerying ? '' : 'primary' ) . replace ( '<button ' , '<button ' + ( requerying ? 'disabled ' : '' ) ) } </div><div class="card-b"><div class="table-wrap"><table class="table"><thead><tr><th></th><th>来源实例</th><th>Invoice</th><th>收料数量</th><th>ERP 库存</th><th>预检结果</th></tr></thead><tbody><tr><td><input type="checkbox" data-invoice="INV-001" checked /></td><td>DBS-AWSBI</td><td><b>INV-001</b></td><td>500 PCS</td><td>500 PCS</td><td> ${ tag ( '可执行' , 'good' ) } </td></tr><tr><td><input type="checkbox" data-invoice="INV-002" checked /></td><td>DBS-AWSBI</td><td><b>INV-002</b></td><td>1,200 PCS</td><td>1,200 PCS</td><td> ${ tag ( '可执行' , 'good' ) } </td></tr><tr><td><input type="checkbox" data-invoice="INV-008" checked /></td><td>CRANE-SZ</td><td><b>INV-008</b></td><td>600 PCS</td><td>600 PCS</td><td> ${ tag ( '可执行' , 'good' ) } </td></tr> ${ mismatchRow } <tr class="disabled"><td><input type="checkbox" disabled /></td><td>DBS-AWSSG</td><td><b>INV-041</b></td><td>400 PCS</td><td>—</td><td> ${ tag ( '当天收料' , 'gray' ) } </td></tr></tbody></table></div> ${ requeryNotice } <div class="confirm-band"><div><b id="selected-summary"> ${ total } </b><br /><small>此时尚未调用 ERP 写入接口。</small></div> ${ button ( '进入确认' , 'go-confirm' , 'primary' ) } </div></div></div></section> ` ;
}
function confirmPage ( ) {
setHeader ( '确认 ERP 写入 · 最终范围确认' , '/chat/:agentId?mode=transfer-precheck&precheck_id=PRE-20260819-001&step=confirm' ) ;
return ` <section class="page"><div class="page-head"> ${ button ( '← 返回预检' , 'go-precheck' ) } <div style="flex:1"><h1>确认执行调拨</h1><p>请确认本次 ERP 写入范围。点击“执行调拨”后,Worker 将逐项调用 ERP 的创建、审核、过账接口。</p></div> ${ tag ( '等待确认' , 'warn' ) } </div><div class="card"><div class="card-h"><div><h2>最终写入摘要</h2><p>系统将在实际写入前再次校验预检有效性;快照过期时必须重新预检。</p></div></div><div class="card-b"> ${ facts ( [ [ '业务日期' , '2026-08-18' ] , [ '来源实例' , 'DBS-AWSBI、CRANE-SZ' ] , [ 'ERP 组织' , 'CN01' ] , [ '来源仓' , '按实例固定映射' ] , [ 'HUB 仓' , 'HUB-SZ' ] , [ '预检有效期' , '10:32' ] ] ) } <div class="table-wrap" style="margin-top:15px"><table class="table"><thead><tr><th>Invoice</th><th>来源实例</th><th>收料 / ERP</th><th>预计结果</th></tr></thead><tbody><tr><td><b>INV-001</b></td><td>DBS-AWSBI</td><td>500 / 500 PCS</td><td> ${ tag ( '写入 ERP' , 'good' ) } </td></tr><tr><td><b>INV-002</b></td><td>DBS-AWSBI</td><td>1,200 / 1,200 PCS</td><td> ${ tag ( '写入 ERP' , 'good' ) } </td></tr><tr><td><b>INV-008</b></td><td>CRANE-SZ</td><td>600 / 600 PCS</td><td> ${ tag ( '写入 ERP' , 'good' ) } </td></tr></tbody></table></div><div class="notice warn"><i>!</i><span>将写入 3 张 Invoice,预计调拨总数量 2,300 PCS,预计 ERP 单据 3 张。此确认会追加操作者、时间、范围与冻结快照审计。</span></div><div class="actions"> ${ button ( '返回预检' , 'go-precheck' ) } ${ button ( '执行调拨' , 'execute' , 'primary' ) } </div></div></div></section> ` ;
}
/* 调拨路由为确认与审计的业务边界:来源实例 + ERP 组织 + 来源仓 + 目标仓。 */
const transferRoutes = {
awsbi : { source : 'DBS-AWSBI' , organization : 'CN01' , from : 'AWSBI-TRANSIT' , to : 'HUB-SZ' , invoices : [ [ 'INV-001' , 500 ] , [ 'INV-002' , 1200 ] , [ 'INV-031' , 300 ] ] } ,
craneSz : { source : 'CRANE-SZ' , organization : 'CN02' , from : 'CRANE-SZ-TRANSIT' , to : 'HUB-SH' , invoices : [ [ 'INV-008' , 600 ] ] }
} ;
function routeText ( route ) { return ` ${ route . organization } · ${ route . from } → ${ route . to } ` ; }
function routeCell ( route ) { return ` <b> ${ route . organization } </b><br /><small> ${ route . from } → ${ route . to } </small> ` ; }
function sourceGroup ( platform ) { const items = sources . filter ( x => x . platform === platform ) ; const collapsed = S . collapsed . has ( platform ) ; const fileRow = s => s . file ? ` <div class="source-file"><span class="source-file-name" title=" ${ text ( s . file . name ) } "> ${ text ( s . file . name ) } </span><button class="icon-button" type="button" data-action="download-source- ${ s . code } " aria-label="下载 ${ text ( s . code ) } 的收料 Excel" title="下载本地 RPA 收料 Excel">↓</button></div><span class="source-file-meta"> ${ s . file . downloadedAt } </span> ` : ` <div class="source-file"><span class="source-file-empty">暂无可下载的本地 RPA 收料 Excel</span><button class="icon-button" type="button" disabled aria-label="暂无可下载文件" title="暂无可下载文件">↓</button></div> ` ; return ` <section class="source-group" data-platform=" ${ platform } "><div class="source-group-head"><b> ${ platform } </b><span> ${ items . filter ( x => x . enabled ) . length } 个已启用实例</span><button data-action="toggle- ${ platform } "> ${ collapsed ? '展开' : '收起' } </button></div><div class="source-list" ${ collapsed ? 'style="display:none"' : '' } > ${ items . map ( s => ` <div class="source-item" data-source-row=" ${ s . code } "><input type="checkbox" data-source=" ${ s . code } " ${ S . selected . has ( s . code ) ? 'checked' : '' } ${ s . enabled ? '' : 'disabled' } /><div class="source-detail" ><b> ${ s . code } </b><span> ${ s . name } · 来源仓 ${ s . warehouse } ${ s . enabled ? '' : ' · 未启用' } </span> ${ fileRow ( s ) } </div></div >` ) . join ( '' ) } </div></section> ` ; }
function precheckPage ( ) {
setHeader ( '调拨预检 · 冻结的文件与 ERP 匹配结果' , '/chat/:agentId?mode=transfer-precheck&precheck_id=PRE-20260819-001' ) ;
const loading = S . precheckRequery === 'loading' , matched = S . precheckRequery === 'matched' ;
const inv031 = loading
? ` <tr class="disabled"><td><input type="checkbox" disabled /></td><td>DBS-AWSBI</td><td> ${ routeCell ( transferRoutes . awsbi ) } </td><td><b>INV-031</b></td><td>300 PCS </td><td><span class="chip gray">查询中…</span></td><td><small>仅重新查询 ERP;收料文件保持冻结。</small></td></tr> `
? ` <tr class="disabled"><td><input type="checkbox" disabled /></td><td>DBS-AWSBI</td><td>MAT-10001</td><td>连接器组件</td><td>A 型 / 24PIN </td><td><b>INV-031</b></td><td>AWSBI-TRANSIT </td><td><span class="chip gray">查询中…</span></td><td>HUB-SZ</td><td>300 PCS</td><td> <small>仅重新查询 ERP;收料文件保持冻结。</small></td></tr> `
: matched
? ` <tr><td><input type="checkbox" data-invoice="INV-031" checked /></td><td>DBS-AWSBI</td><td> ${ routeCell ( transferRoutes . awsbi ) } </td><td><b>INV-031</b></td><td>300 PCS </td><td>300 PCS<br /><small>最新查询 10:06</small></td><td> ${ tag ( '可执行' , 'good' ) } <br /><button class="link" data-action="show-requery-history">查看历史比对</button></td></tr> `
: ` <tr class="disabled"><td><input type="checkbox" disabled /></td><td>DBS-AWSBI</td><td> ${ routeCell ( transferRoutes . awsbi ) } </td><td><b>INV-031</b></td><td>300 PCS </td><td>280 PCS<br /><small>上次查询 09:12 · Attempt 1</small></td><td> ${ tag ( '数量不一致' , 'warn' ) } <br /><button class="link" data-action="show-requery-history">查看历史比对</button></td></tr> ` ;
? ` <tr><td><input type="checkbox" data-invoice="INV-031" checked /></td><td>DBS-AWSBI</td><td>MAT-10001</td><td>连接器组件</td><td>A 型 / 24PIN </td><td><b>INV-031</b></td><td>AWSBI-TRANSIT </td><td>300 PCS<br /><small>最新查询 10:06</small></td><td>HUB-SZ</td><td>300 PCS</td><td> ${ tag ( '可执行' , 'good' ) } <br /><button class="link" data-action="show-requery-history">查看历史比对</button></td></tr> `
: ` <tr class="disabled"><td><input type="checkbox" disabled /></td><td>DBS-AWSBI</td><td>MAT-10001</td><td>连接器组件</td><td>A 型 / 24PIN </td><td><b>INV-031</b></td><td>AWSBI-TRANSIT </td><td>280 PCS<br /><small>上次查询 09:12 · Attempt 1</small></td><td>HUB-SZ</td><td>300 PCS</td><td> ${ tag ( '数量不一致' , 'warn' ) } <br /><button class="link" data-action="show-requery-history">查看历史比对</button></td></tr> ` ;
const summary = matched ? '已选 4 张 · 2 条调拨路由 · 预计调拨总数量 2,600 PCS · 预计 ERP 单据 4 张' : '已选 3 张 · 2 条调拨路由 · 预计调拨总数量 2,300 PCS · 预计 ERP 单据 3 张' ;
const hint = loading ? '正在仅查询 INV-031 的 ERP 库存;不会重新抓 RPA、替换文件或写入 ERP。' : matched ? 'INV-031 已在 Attempt 2 匹配并加入 DBS-AWSBI → HUB-SZ 路由;仍须进入确认 。' : '如果已在 ERP 完成人工库存处理,可只重查数量不一致项。每次结果新增 Attempt,冻结文件不变。' ;
return ` <section class="page"><div class="page-head"> ${ button ( '← 返回修改范围' , 'go-source' ) } <div style="flex:1"><h1>调拨预检</h1><p>本次任务已固定收料文件、解析映射和策略;不可在中途抓取或替换 RPA 文件。</p></div> ${ tag ( '预检完成' , 'good' ) } </div><div class="grid two"><div class="card"><div class="card-h"><div><h2>来源实例处理进度</h2><p>来源实例分别准备文件和查询库存。</p></div></div><div class="card-b"><div class="stage-list"><div class="stage good"><i class="mark"></i><div><b>DBS-AWSBI · 收料文件已就绪</b><span>累计全量文件 DBS-AWSBI-receipt-20260818-v3.xlsx · checksum 7A4E…91B2</span></div> ${ tag ( '预检完成' , 'good' ) } </div><div class="stage warn"><i class="mark"></i><div><b>DBS-AWSSG · 当天收料已排除</b><span>INV-041 标记 not_matured,未查询 ERP。</span></div> ${ tag ( '1 项未成熟' , 'warn' ) } </div><div class="stage good"><i class="mark"></i><div><b>CRANE-SZ · ERP 库存已查询</b><span>ERP 组织 CN02 · CRANE-SZ-TRANSIT → HUB-SH</span></div> ${ tag ( '预检完成' , 'good' ) } </div></div></div></div><div class="card"><div class="card-h"><div><h2>冻结上下文</h2><p>每条调拨路由均随本次 Run 冻结。</p></div></div><div class="card-b"> ${ facts ( [ [ '业务日期' , '2026-08-18' ] , [ '调拨路由' , '2 条' ] , [ '文件版本' , 'v3 · 7A4E…91B2' ] , [ '策略版本' , 'transfer-policy-v1' ] , [ '路由 1' , 'CN01 · AWSBI → HUB-SZ' ] , [ '路由 2' , 'CN02 · CRANE-SZ → HUB-SH' ] ] ) } <div class="actions"> ${ button ( '查看冻结文件' , 'show-file' ) } ${ button ( '查看审计快照' , 'show-audit' ) } </div></div></div></div><div class="card" style="margin-top:16px"><div class="card-h"><div><h2>Invoice 预检明细</h2><p>每一笔均显示实际 ERP 组织及来源仓 → 目标 HUB 仓路由。</p></div> ${ button ( loading ? '正在查询异常 ERP 库存…' : '我已处理 ERP,重新查询异常库存(1)' , 'requery-precheck' , loading ? '' : 'primary' ) . replace ( '<button ' , '<button ' + ( loading ? 'disabled ' : '' ) ) } </div><div class="card-b"><div class="table-wrap"><table class="table"><thead><tr><th></th><th>来源实例</th><th>调拨路由</th><th>Invoice</th><th>收料数量</th><th>ERP 库存</th><th>预检结果</th></tr></thead><tbody><tr><td><input type="checkbox" data-invoice="INV-001" checked /></td><td>DBS-AWSBI</td><td> ${ routeCell ( transferRoutes . awsbi ) } </td><td><b>INV-001</b></td><td>500 PCS</td><td>500 PCS</td><td> ${ tag ( '可执行' , 'good' ) } </td></tr><tr><td><input type="checkbox" data-invoice="INV-002" checked /></td><td>DBS-AWSBI</td><td> ${ routeCell ( transferRoutes . awsbi ) } </td><td><b>INV-002</b></td><td>1,200 PCS</td><td>1,200 PCS</td><td> ${ tag ( '可执行' , 'good' ) } </td></tr><tr><td><input type="checkbox" data-invoice="INV-008" checked /></td><td>CRANE-SZ</td><td> ${ routeCell ( transferRoutes . craneSz ) } </td><td><b>INV-008</b></td><td>600 PCS</td><td>600 PCS</td><td> ${ tag ( '可执行' , 'good' ) } </td></tr> ${ inv031 } <tr class="disabled"><td><input type="checkbox" disabled /></td><td>DBS-AWSSG</td><td><b>未进入路由</b><br /><small>当天收料</small></td><td><b>INV-041</b></td><td>400 PCS</td><td>—</td><td> ${ tag ( '当天收料' , 'gray' ) } </td></tr></tbody></table></div><div class="notice ${ matched ? 'good' : loading ? '' : 'warn' } "><i> ${ matched ? '✓' : loading ? 'i' : '!' } </i><span> ${ hint } </span></div><div class="confirm-band"><div><b id="selected-summary"> ${ summary } </b><br /><small>此时尚未调用 ERP 写入接口。</small></div> ${ button ( '进入确认' , 'go-confirm' , 'primary' ) } </div></div></div></section> ` ;
}
function confirmPage ( ) {
setHeader ( '确认 ERP 写入 · 按 ERP 组织聚合' , '/chat/:agentId?mode=transfer-precheck&precheck_id=PRE-20260819-001&step=confirm' ) ;
const matched = S . precheckRequery === 'matched' ;
const routeRows = [
{ ... transferRoutes . awsbi , invoices : matched ? transferRoutes . awsbi . invoices : transferRoutes . awsbi . invoices . slice ( 0 , 2 ) } ,
{ ... transferRoutes . craneSz }
] . map ( route => ( { ... route , qty : route . invoices . reduce ( ( sum , [ , qty ] ) => sum + qty , 0 ) } ) ) ;
const groups = Object . values ( routeRows . reduce ( ( acc , route ) => { ( acc [ route . organization ] ? ? = { organization : route . organization , routes : [ ] } ) . routes . push ( route ) ; return acc ; } , { } ) ) ;
const count = routeRows . reduce ( ( sum , route ) => sum + route . invoices . length , 0 ) , total = routeRows . reduce ( ( sum , route ) => sum + route . qty , 0 ) ;
const routeDetail = route => ` <details class="route-item"><summary><div class="route-item-main"><b> ${ route . from } → ${ route . to } </b><span> ${ route . source } </span></div><div class="route-item-metrics"><span><strong> ${ route . invoices . length } </strong> 张 Invoice</span><span><strong> ${ route . qty . toLocaleString ( ) } </strong> PCS</span><span> ${ tag ( '可写入' , 'good' ) } </span></div></summary><div class="route-invoices"><div class="table-wrap"><table class="table"><thead><tr><th>Invoice</th><th>来源实例</th><th>来源仓</th><th>目标 HUB 仓</th><th>收料 / ERP</th></tr></thead><tbody> ${ route . invoices . map ( ( [ id , qty ] ) => ` <tr><td><b> ${ id } </b></td><td> ${ route . source } </td><td> ${ route . from } </td><td> ${ route . to } </td><td> ${ qty . toLocaleString ( ) } / ${ qty . toLocaleString ( ) } PCS</td></tr> ` ) . join ( '' ) } </tbody></table></div></div></details> ` ;
const orgBlock = group => { const qty = group . routes . reduce ( ( sum , route ) => sum + route . qty , 0 ) , invoices = group . routes . reduce ( ( sum , route ) => sum + route . invoices . length , 0 ) , open = S . routeOrgs . has ( group . organization ) ; return ` <details class="route-org" ${ open ? 'open' : '' } ><summary data-action="toggle-org- ${ group . organization } "><div class="route-org-title"><b> ${ group . organization } · ERP 调拨组织</b><span> ${ group . routes . length } 条调拨路由 · 点击展开路由汇总</span></div><div class="route-org-metrics"><span><b> ${ invoices } </b> 张 Invoice</span><span><b> ${ qty . toLocaleString ( ) } </b> PCS</span><span><b> ${ invoices } </b> 张 ERP 单据</span></div></summary><div class="route-table"> ${ group . routes . map ( routeDetail ) . join ( '' ) } </div></details> ` ; } ;
return ` <section class="page"><div class="page-head"> ${ button ( '← 返回预检' , 'go-precheck' ) } <div style="flex:1"><h1>确认执行调拨</h1><p>先按 ERP 组织聚合确认;展开组织查看路由,展开路由查看 Invoice。默认不平铺路由或 Invoice 明细。</p></div> ${ tag ( '等待确认' , 'warn' ) } </div><div class="card"><div class="card-h"><div><h2>最终写入摘要</h2><p>实际写入前会复核预检快照有效性;快照过期必须重新预检。</p></div></div><div class="card-b"> ${ facts ( [ [ '业务日期' , '2026-08-18' ] , [ 'ERP 组织' , ` ${ groups . length } 个 ` ] , [ '调拨路由' , ` ${ routeRows . length } 条 ` ] , [ '预计调拨总数量' , ` ${ total . toLocaleString ( ) } PCS ` ] , [ '预计 ERP 单据' , ` ${ count } 张 ` ] , [ '预检有效期' , '10:32' ] ] ) } <div class="notice"><i>i</i><span>组织是确认页的一级聚合;路由按“来源实例 + ERP 组织 + 来源仓 + 目标仓”计算。仅异常组织或用户主动点击时展开详细内容。</span></div> ${ groups . map ( orgBlock ) . join ( '' ) } <div class="notice warn"><i>!</i><span>将按 ${ groups . length } 个 ERP 组织、 ${ routeRows . length } 条调拨路由写入 ${ count } 张 Invoice,预计调拨总数量 ${ total . toLocaleString ( ) } PCS。确认会记录操作者、时间、每条路由和冻结快照。</span></div><div class="actions"> ${ button ( '返回预检' , 'go-precheck' ) } ${ button ( ` 执行 ${ count } 张调拨 ` , 'execute' , 'primary' ) } </div></div></div></section> ` ;
const hint = loading ? '正在仅查询 INV-031 的 ERP 库存;不会重新抓 RPA、替换文件或写入 ERP。' : matched ? 'INV-031 已在 Attempt 2 匹配并加入 DBS-AWSBI → HUB-SZ 路由;核对后可直接生成调拨单 。' : '如果已在 ERP 完成人工库存处理,可只重查数量不一致项。每次结果新增 Attempt,冻结文件不变。' ;
const resultSummary = matched ? '可执行 4 张 · 当天收料 1 张' : '可执行 3 张 · 数量不一致 1 张 · 当天收料 1 张' ;
const selectedCount = matched ? 4 : 3 ;
return ` <section class="page"><div class="page-head"> ${ button ( '← 返回修改范围' , 'go-source' ) } <div style="flex:1"><h1>调拨预检</h1><div class="precheck-meta"><span>业务日期 2026-08-18 · 收料文件已固定</span><span>·</span><button class="link" data-action="show-file">查看文件</button></div></div> ${ tag ( '预检完成' , 'good' ) } </div><div class="card"><div class="card-h"><div><h2>处理进度</h2><p>按来源实例查看文件与 ERP 查询结果。</p></div></div><div class="card-b"><div class="stage-list"><div class="stage good"><i class="mark"></i><div><b>DBS-AWSBI · 已完成</b><span>收料文件已就绪,ERP 库存已查询。</span></div> ${ tag ( '预检完成' , 'good' ) } </div><div class="stage warn"><i class="mark"></i><div><b>DBS-AWSSG · 当天收料</b><span>INV-041 未进入 ERP 查询或调拨范围。</span></div> ${ tag ( '1 项未成熟' , 'warn' ) } </div><div class="stage good"><i class="mark"></i><div><b>CRANE-SZ · 已完成</b><span>收料文件已就绪,ERP 库存已查询。</span></div> ${ tag ( '预检完成' , 'good' ) } </div></div></div></div><div class="card" style="margin-top:16px"><div class="card-h"><div><h2>调拨预检明细</h2><p>核对物料、来源与仓库;数量不一致请先在 ERP 处理后重新查询。</p></div> ${ button ( loading ? '正在查询异常 ERP 库存…' : '我已处理 ERP,重新查询异常库存(1)' , 'requery-precheck' , loading ? '' : 'primary' ) . replace ( '<button ' , '<button ' + ( loading ? 'disabled ' : '' ) ) } </div><div class="card-b"><div class="precheck-summary"> ${ resultSummary . split ( ' · ' ) . map ( item => tag ( item , item . includes ( '可执行' ) ? 'good' : item . includes ( '不一致' ) ? 'warn' : 'gray' ) ) . join ( '' ) } </div><div class="table-wrap"><table class="table transfer-precheck-table"><thead><tr><th></th><th>收料来源</th><th>料号</th><th>品名</th><th>规格</th><th>Invoice</th><th>拨出仓库</th><th>拨出数量</th><th>拨入仓库</th><th>拨入数量</th><th>预检结果</th></tr></thead><tbody><tr><td><input type="checkbox" data-invoice="INV-001" checked /></td><td>DBS-AWSBI</td><td>MAT-10001</td><td>连接器组件</td><td>A 型 / 24PIN</td><td><b>INV-001</b></td><td>AWSBI-TRANSIT</td><td>500 PCS</td><td>HUB-SZ</td><td>500 PCS</td><td> ${ tag ( '可执行' , 'good' ) } </td></tr><tr><td><input type="checkbox" data-invoice="INV-002" checked /></td><td>DBS-AWSBI</td><td>MAT-10002</td><td>控制器组件</td><td>标准型 / 48V</td><td><b>INV-002</b></td><td>AWSBI-TRANSIT</td><td>1,200 PCS</td><td>HUB-SZ</td><td>1,200 PCS</td><td> ${ tag ( '可执行' , 'good' ) } </td></tr><tr><td><input type="checkbox" data-invoice="INV-008" checked /></td><td>CRANE-SZ</td><td>MAT-20008</td><td>传感器模组</td><td>SZ-8 / IP67</td><td><b>INV-008</b></td><td>CRANE-SZ-TRANSIT</td><td>600 PCS</td><td>HUB-SH</td><td>600 PCS</td><td> ${ tag ( '可执行' , 'good' ) } </td></tr> ${ inv031 } <tr class="disabled"><td><input type="checkbox" disabled /></td><td>DBS-AWSSG</td><td>MAT-10041</td><td>连接器组件</td><td>B 型 / 16PIN</td><td><b>INV-041</b></td><td>—</td><td>—</td><td>—</td><td>400 PCS</td><td> ${ tag ( '当天收料' , 'gray' ) } </td></tr></tbody></table></div><div class="notice ${ matched ? 'good' : loading ? '' : 'warn' } "><i> ${ matched ? '✓' : loading ? 'i' : '!' } </i><span> ${ hint } </span></div><div class="confirm-band"><div><b id="selected-summary"> ${ summary } </b><br /><small>点击后将创建、审核并过账 ERP 调拨单。</small></div> ${ button ( ` 生成 ${ selectedCount } 张调拨单 ` , 'execute' , 'primary' ) } </div></div></div></section> ` ;
}
function runPage ( ) {
setHeader ( 'Run 结果 · 固定执行证据 ' , '/chat/:agentId?mode=transfer-run&run_id=AUTO-20260818-0900' ) ;
return ` <section class="page"><div class="page-head"> ${ button ( '← 返回对话' , 'go-chat' ) } <div style="flex:1"><h1>自动调拨 Run 详情</h1><p>AUTO-20260818-0900 · 企业微信深链可直接进入该 Run,不创建新对话。</p></div> ${ tag ( '已完成' , 'good' ) } </div><div class="card"><div class="card-h"><div><h2>执行概览</h2><p>自动排程按来源实例分别处理并发送一条汇总通知。</p></div></div><div class="card-b"> ${ facts ( [ [ '业务日期' , '2026-08-18' ] , [ '触发方式' , '自动排程' ] , [ '成功' , '18' ] , [ '业务阻断' , '2' ] , [ '来源异常' , '1' ] , [ '通知' , '已发送' ] ] ) } <div class="progress" style="margin-top:15px"><i style="width:84%"></i></div><div class="stage-list" style="margin-top:15px"><div class="stage good"><i class="mark"></i><div><b>DBS-AWSBI · 已完成</b><span>20 项预检,18 项 ERP 成功;重复 Invoice 已由 ERP 返回原 调拨单号。 </span></div>${ tag ( '成功 18' , 'good' ) } </div><div class="stage bad"><i class="mark"></i><div><b>CRANE-SZ · 文件获取超时</b><span>HTTP Callback 超时,已留存来源异常和任务证据;不影响 DBS 结果。</span></div> ${ tag ( '来源异常' , 'bad' ) } </div></div><div class="actions"> ${ button ( '下载固定异常 Excel' , 'download' ) } ${ button ( '查看执行审计' , 'show-audit' ) } ${ button ( '进入待处理' , 'go-backlog' , 'primary' ) } </div></div></div><div class="card" style="margin-top:16px"><div class="card-h"><div><h2>逐项结果</h2><p>结果固定,不从此页重新抓取 RPA 或发起新 ERP 写入。</p></div></div><div class="card-b "><div class="table-wrap"><table class="table"><thead><tr><th>Invoice </th><th>结果 </th><th>ERP 单据 / 事实</th><th>审计</th></tr></thead><tbody><tr><td>INV-001</td><td> ${ tag ( '成功' , 'good' ) } </td><td>TRF-10001</td><td><button class="link" data-action="show-audit">查看</button></td></tr><tr><td>INV-002</td><td> ${ tag ( '重复成功' , 'good' ) } </td><td>TRF-98220</td><td><button class="link" data-action="show-audit">查看</button></td></tr><tr><td>INV-031</td><td> ${ tag ( '数量不一致' , 'warn' ) } </td><td>收料 300 / ERP 280</td><td><button class="link" data-action="go-backlog">待处理</button></td></tr> </tbody></table></div></div></div></section >` ;
setHeader ( 'Run 结果 · ERP 调拨单 ' , '/chat/:agentId?mode=transfer-run&run_id=AUTO-20260818-0900' ) ;
const documentRow = ( number , from , to , count , total , details ) => ` <details class="erp-document" open><summary><div><b> ${ number } </b><span>ERP 调拨单</span></div><div><b> ${ from } → ${ to } </b><span>拨出仓 → 拨入仓</span></div><div><b> ${ count } 项物料</b><span>已完成过账</span></div><div class="document-total"><b> ${ total } </b><span>调拨数量</span></div></summary><div class="document-details "><div class="table-wrap"><table class="table"><thead><tr><th>料号 </th><th>品名 </th><th>规格</th><th>Invoice</th><th>调拨数量</th></tr></thead><tbody> ${ details } </tbody></table></div></div></details > ` ;
const documentRows = [
documentRow ( 'TRF-10001' , 'AWSBI-TRANSIT' , 'HUB-SZ' , 2 , '1,700 PCS' , '<tr><td>MAT-10001</td><td>连接器组件</td><td>A 型 / 24PIN</td><td>INV-001</td><td>500 PCS</td></tr><tr><td>MAT-10002</td><td>控制器组件</td><td>标准型 / 48V</td><td>INV-002</td><td>1,200 PCS</td></tr>' ) ,
documentRow ( 'TRF-10008' , 'CRANE-SZ-TRANSIT' , 'HUB-SH' , 1 , '600 PCS' , '<tr><td>MAT-20008</td><td>传感器模组</td><td>SZ-8 / IP67</td><td>INV-008</td><td>600 PCS</td></tr>' )
] . join ( '' ) ;
return ` <section class="page"><div class="page-head"> ${ button ( '← 返回对话' , 'go-chat' ) } <div style="flex:1"><h1>自动调拨 Run 详情</h1><p>AUTO-20260818-0900 · 以 ERP 最终调拨单为准,展开可核对物料明细。</p></div> ${ tag ( '已完成' , 'good' ) } </div><div class="card"><div class="card-h"><div><h2>执行结果</h2><p>本次已生成的 ERP 调拨单与未生成单据的异常分开显示。</p></div></div><div class="card-b"> ${ facts ( [ [ '业务日期' , '2026-08-18' ] , [ '已生成 ERP 单据' , '2 张' ] , [ '已完成物料' , '3 项' ] , [ '调拨总数量' , '2,300 PCS' ] , [ '未生成单据' , '2 项' ] , [ '触发方式' , '手动发起' ] ] ) } <div class="result-downloads"><span>本次数据留底</span> ${ button ( '下载收料来源文件(2) ' , 'download-receipt-files' ) } ${ button ( '下载 ERP 库存表' , 'download-erp-stock' ) } </div></div></div><div class="card" style="margin-top:16px"><div class="card-h"><div><h2>已生成 ERP 调拨单</h2><p>每条记录对应一张已创建、审核并过账的 ERP 单据。</p></div></div><div class="card-b"> ${ documentRows } </div></div><div class="card" style="margin-top:16px"><div class="card-h"><div><h2>未生成 ERP 调拨单</h2><p>以下项目未写入 ERP,需要在处理完成后重新预检。</p></div> ${ button ( '进入待处理' , 'go-backlog' , 'primary' ) } </div><div class="card-b"><div class="table-wrap"><table class="table"><thead><tr><th>收料来源</th><th>Invoice</th><th>物料</th><th>未生成原因</th><th>当前事实</th></tr></thead><tbody><tr><td>DBS-AWSBI</td><td>INV-031</td><td>MAT-10001 · 连接器组件</td><td> ${ tag ( '数量不一致' , 'warn' ) } </td><td>收料 300 PCS / ERP 280 PCS</td></tr><tr><td>DBS-AWSSG</td><td>INV-041</td><td>MAT-10041 · 连接器组件</td><td> ${ tag ( '当天收料' , 'gray' ) } </td><td>未进入 ERP 查询或调拨范围</td></tr></tbody></table></div></div></div></section> ` ;
}
function backlogPage ( ) {
setHeader ( '待处理调拨 · 可恢复、已关闭与结果未知分离' , '/chat/:agentId?mode=transfer-backlog' ) ;
const tab = S . backlogTab ; const body = tab === 'recoverable' ? recoverable ( ) : tab === 'closed' ? closed ( ) : unknown ( ) ; return ` <section class="page"><div class="page-head"> ${ button ( '← 返回对话' , 'go-chat' ) } <div style="flex:1"><h1>待处理调拨</h1><p>将可恢复异常、已人工关闭和结果未知隔离展示,避免把安全边界不同的事项混在同一张表中。</p></div></div><div class="card"><div class="card-h"><div><h2>跨 Run 待处理事项</h2><p>可恢复项只允许重新查询 ERP 库存,不更新文件、不抓 RPA、不直接写 ERP。</p></div></div><div class="card-b"><div class="tabs"><button class="tab ${ tab === 'recoverable' ? 'active' : '' } " data-action="tab-recoverable">可恢复异常 6</button><button class="tab ${ tab === 'closed' ? 'active' : '' } " data-action="tab-closed">已人工关闭 2</button><button class="tab ${ tab === 'unknown' ? 'active' : '' } " data-action="tab-unknown">结果未知 1</button></div> ${ body } </div></div></section> ` ;
}
function recoverable ( ) { return ` <div class="filters"><select><option>来源:全部</option><option>DBS</option><option>Crane</option></select><select><option>日期:全部</option><option>最近 3 天</option></select></div><div class="table-wrap"><table class="table"><thead><tr><th></th><th>来源实例 / 日期</th><th>Invoice</th><th>当前事实</th><th>最近查询</th><th></th></tr></thead><tbody><tr><td><input type="checkbox" checked /></td><td>DBS-AWSBI<br><small>2026-08-16</small></td><td><b>INV-031</b></td><td>收料 300 / ERP 280</td><td>09:12</td><td><button class="link" data-action="show-audit">证据</button></td></tr><tr><td><input type="checkbox" checked /></td><td>CRANE-SZ<br><small>2026-08-15</small></td><td><b>INV-042</b></td><td>收料 800 / ERP 0</td><td>09:12</td><td><button class="link" data-action="show-audit">证据</button></td></tr><tr><td><input type="checkbox" /></td><td>DBS-AWSSG<br><small>2026-08-14</small></td><td><b>INV-073</b></td><td>明确技术失败</td><td>08:50</td><td><button class="link" data-action="show-audit">证据</button></td></tr></tbody></table></div><div class="notice"><i>i</i><span>多选后每个 Invoice 都会重新查询 ERP 库存;满足严格等量的项目才进入新的确认页 。</span></div><div class="actions"> ${ button ( '重新查询 ERP 库存(2) ' , 'requery' , 'primary' ) } ${ button ( '标记无需继续处理' , 'close-item' , 'danger' ) } </div> ` }
function recoverable ( ) { return ` <div class="filters"><select><option>来源:全部</option><option>DBS</option><option>Crane</option></select><select><option>日期:全部</option><option>最近 3 天</option></select></div><div class="table-wrap"><table class="table"><thead><tr><th></th><th>来源实例 / 日期</th><th>Invoice</th><th>当前事实</th><th>最近查询</th><th></th></tr></thead><tbody><tr><td><input type="checkbox" checked /></td><td>DBS-AWSBI<br><small>2026-08-16</small></td><td><b>INV-031</b></td><td>收料 300 / ERP 280</td><td>09:12</td><td><button class="link" data-action="show-audit">证据</button></td></tr><tr><td><input type="checkbox" checked /></td><td>CRANE-SZ<br><small>2026-08-15</small></td><td><b>INV-042</b></td><td>收料 800 / ERP 0</td><td>09:12</td><td><button class="link" data-action="show-audit">证据</button></td></tr><tr><td><input type="checkbox" /></td><td>DBS-AWSSG<br><small>2026-08-14</small></td><td><b>INV-073</b></td><td>明确技术失败</td><td>08:50</td><td><button class="link" data-action="show-audit">证据</button></td></tr></tbody></table></div><div class="notice"><i>i</i><span>多选后每个 Invoice 都会重新查询 ERP 库存;满足严格等量的项目可返回预检明细后直接生成调拨单 。</span></div><div class="actions"> ${ button ( '重新查询 ERP 库存(2) ' , 'requery' , 'primary' ) } ${ button ( '标记无需继续处理' , 'close-item' , 'danger' ) } </div> ` }
function closed ( ) { return ` <div class="table-wrap"><table class="table"><thead><tr><th>Invoice</th><th>关闭原因</th><th>关闭人 / 时间</th><th></th></tr></thead><tbody><tr><td>INV-061</td><td>货代确认无需调拨</td><td>仓库管理人员 · 08-17 15:00</td><td><button class="link" data-action="restore-item">恢复处理</button></td></tr><tr><td>INV-068</td><td>业务已线下完成</td><td>仓库管理人员 · 08-17 16:20</td><td><button class="link" data-action="restore-item">恢复处理</button></td></tr></tbody></table></div><div class="notice"><i>i</i><span>恢复后回到“可恢复异常”池;原关闭原因、操作者和快照永久保留。</span></div> ` }
function unknown ( ) { return ` <div class="notice bad"><i>!</i><span>ERP 未返回确定成功或失败。系统只展示已知事实,不提供重查、关闭、恢复或执行按钮。</span></div><div class="table-wrap"><table class="table"><thead><tr><th>Invoice</th><th>所属 Run</th><th>调用时间</th><th>Operation ID</th><th></th></tr></thead><tbody><tr><td><b>INV-052</b></td><td>AUTO-20260818-0900</td><td>09:17:21</td><td>OP-20260818-8891</td><td><button class="link" data-action="show-unknown">查看事实与 SOP</button></td></tr></tbody></table></div> ` }
function render ( ) { const page = pageName ( ) ; document . body . classList . toggle ( 'chat-mode' , page === 'chat' ) ; const renderer = { chat : chatPage , source : sourcePage , precheck : precheckPage , confirm : confirmPage , run : runPage , backlog : backlogPage , unknown : backlogPage } [ page ] || chatPage ; $ ( 'page' ) . innerHTML = renderer ( ) ; bind ( ) ; if ( page === 'source' ) filterSources ( ) ; }
function render ( ) { const page = pageName ( ) ; document . body . classList . toggle ( 'chat-mode' , page === 'chat' ) ; document . body . classList . toggle ( 'history-open' , page === 'chat' && S . historyOpen ) ; const renderer = { chat : chatPage , source : sourcePage , precheck : precheckPage , run : runPage , backlog : backlogPage , unknown : backlogPage } [ page ] || chatPage ; $ ( 'page' ) . innerHTML = renderer ( ) ; bind ( ) ; if ( page === 'source' ) filterSources ( ) ; }
function filterSources ( ) { const input = $ ( 'source-search' ) ; if ( ! input ) return ; const apply = ( ) => { const q = input . value . trim ( ) . toLowerCase ( ) ; document . querySelectorAll ( '[data-source-row]' ) . forEach ( row => row . hidden = ! row . textContent . toLowerCase ( ) . includes ( q ) ) ; } ; input . addEventListener ( 'input' , apply ) ; $ ( 'source-count' ) . textContent = ` 已选 ${ S . selected . size } 个来源实例 ` ; }
function openModal ( type ) { S . modal = type ; const data = { close : [ '标记“无需继续处理”' , '该 Invoice 将变为 manually_closed,自动排程不再处理;历史与审计永久保留。' ] , restore : [ '恢复处理' , '恢复后回到可恢复异常池,可重新查询 ERP 库存。' ] } [ type ] ; $ ( 'modal-title' ) . textContent = data [ 0 ] ; $ ( 'modal-desc' ) . textContent = data [ 1 ] ; $ ( 'reason' ) . value = '' ; $ ( 'modal-mask' ) . classList . add ( 'show' ) ; }
function action ( a ) {
if ( a . startsWith ( 'chat-scene-' ) ) return goto ( 'chat ', { scene : a . slice ( 11 ) } ) ;
if ( a === 'go-chat' ) return goto ( 'chat' ) ; if ( a === 'go-source' ) return goto ( 'source' ) ; if ( a === 'go-precheck' ) return goto ( 'precheck' ) ; if ( a === 'go-confirm' ) return goto ( 'confirm ' ) ; if ( a === 'go-run' ) return goto ( 'run' ) ; if ( a === 'go-backlog' ) return goto ( 'backlog' ) ; if ( a === 'go-unknown' ) { S . backlogTab = 'unknown' ; return goto ( 'backlog' ) }
if ( a === 'select-enabled' ) { sources . filter ( x => x . enabled ) . forEach ( x => S . selected . add ( x . code ) ) ; render ( ) ; return } if ( a === 'clear-sources' ) { S . selected . clear ( ) ; render ( ) ; return } if ( a . startsWith ( 'toggle-org-' ) ) { const org = a . slice ( 11 ) ; S . routeOrgs . has ( org ) ? S . routeOrgs . delete ( org ) : S . routeOrgs . add ( org ) ; return } if ( a . startsWith ( 'toggle-' ) ) { const p = a . slice ( 7 ) ; S . collapsed . has ( p ) ? S . collapsed . delete ( p ) : S . collapsed . add ( p ) ; render ( ) ; return }
if ( a === 'toggle-history ') { S . historyOpen = ! S . historyOpen ; render ( ) ; return }
if ( a . startsWith ( 'chat-scene-' ) ) { S . historyOpen = false ; return goto ( 'chat ' , { scene : a . slice ( 11 ) } ) ; }
if ( a === 'go-chat' ) return goto ( 'chat' ) ; if ( a === 'go-source' ) return goto ( 'source' ) ; if ( a === 'go-precheck' ) return goto ( 'precheck' ) ; if ( a === 'go-run' ) return goto ( 'run' ) ; if ( a === 'go-backlog' ) return goto ( 'backlog' ) ; if ( a === 'go-backlog-recoverable' ) { S . backlogTab = 'recoverable' ; return goto ( 'backlog' ) } if ( a === 'go-backlog-closed' ) { S . backlogTab = 'closed' ; return goto ( 'backlog' ) } if ( a === 'go-unknown' ) { S . backlogTab = 'unknown' ; return goto ( 'backlog' ) }
if ( a === 'select-enabled' ) { sources . filter ( x => x . enabled ) . forEach ( x => S . selected . add ( x . code ) ) ; render ( ) ; return } if ( a === 'clear-sources' ) { S . selected . clear ( ) ; render ( ) ; return } if ( a . startsWith ( 'toggle-' ) ) { const p = a . slice ( 7 ) ; S . collapsed . has ( p ) ? S . collapsed . delete ( p ) : S . collapsed . add ( p ) ; render ( ) ; return }
if ( a === 'start-precheck' ) { if ( ! S . selected . size ) { toast ( '请至少选择一个已启用来源实例。' ) ; return } toast ( '原型:正在使用任务创建前可用的最新有效文件。' ) ; setTimeout ( ( ) => goto ( 'precheck' ) , 450 ) ; return }
if ( a === 'execute' ) { toast ( '原型:已提交 Worker 执行 。关闭页面不会取消后台任务。' ) ; setTimeout ( ( ) => goto ( 'run' ) , 650 ) ; return } if ( a === 'requery' ) { toast ( '原型:仅重新查询所选异常的 ERP 库存;文件版本不变,未写入 ERP。' ) ; setTimeout ( ( ) => goto ( 'confirm ' ) , 500 ) ; return } if ( a === 'requery-precheck' ) { S . precheckRequery = 'loading' ; render ( ) ; toast ( '原型:正在重新查询 INV-031 的 ERP 库存;未抓取 RPA 文件。' ) ; setTimeout ( ( ) => { S . precheckRequery = 'matched' ; render ( ) ; toast ( '原型:INV-031 已匹配并加入本次确认 范围。' ) ; } , 900 ) ; return }
if ( a === 'execute' ) { toast ( '原型:已提交 Worker 创建、审核并过账 ERP 调拨单 。关闭页面不会取消后台任务。' ) ; setTimeout ( ( ) => goto ( 'run' ) , 650 ) ; return } if ( a === 'requery' ) { toast ( '原型:仅重新查询所选异常的 ERP 库存;文件版本不变,未写入 ERP。' ) ; setTimeout ( ( ) => goto ( 'precheck ' ) , 500 ) ; return } if ( a === 'requery-precheck' ) { S . precheckRequery = 'loading' ; render ( ) ; toast ( '原型:正在重新查询 INV-031 的 ERP 库存;未抓取 RPA 文件。' ) ; setTimeout ( ( ) => { S . precheckRequery = 'matched' ; render ( ) ; toast ( '原型:INV-031 已匹配并加入可生成调拨单 范围。' ) ; } , 900 ) ; return }
if ( a === 'tab-recoverable' ) { S . backlogTab = 'recoverable' ; render ( ) ; return } if ( a === 'tab-closed' ) { S . backlogTab = 'closed' ; render ( ) ; return } if ( a === 'tab-unknown' ) { S . backlogTab = 'unknown' ; render ( ) ; return } if ( a === 'close-item' ) { openModal ( 'close' ) ; return } if ( a === 'restore-item' ) { openModal ( 'restore' ) ; return }
if ( a === 'modal-cancel' ) { $ ( 'modal-mask' ) . classList . remove ( 'show' ) ; return } if ( a === 'modal-confirm' ) { if ( ! $ ( 'reason' ) . value . trim ( ) ) { toast ( '请填写原因。' ) ; return } $ ( 'modal-mask' ) . classList . remove ( 'show' ) ; toast ( '原型:已追加审计并更新事项状态。' ) ; S . backlogTab = S . modal === 'restore' ? 'recoverable' : 'closed' ; render ( ) ; return }
if ( a === 'show-file' ) { toast ( '原型:展示冻结文件版本、checksum、原始行和下载访问审计。' ) ; return } if ( a === 'show-audit' ) { toast ( '原型:展示操作人、时间、动作、变更前后快照与关联 Run。' ) ; return } if ( a === 'show-requery-history' ) { toast ( '原型:Attempt 1 为收料 300 / ERP 280;最新 Attempt 会追加保存,原快照不被覆盖。' ) ; return } if ( a === 'show-unknown' ) { toast ( '原型:结果未知只能由 ERP 管理员线下核实;系统不生成第二次 ERP 写入。' ) ; return } if ( a === 'download' ) { toast ( '原型:下载 Run 创建时的固定异常 Excel,并记录下载审计。' ) ; return } if ( a === 'chat-send' ) { const q = ( $ ( 'chat-input' ) ? . value || '' ) . trim ( ) ; const scene = q . includes ( '今天' ) ? 'rule' : q . includes ( '待处理' ) ? 'status' : q . includes ( 'INV-031' ) || q . includes ( '不一致' ) ? 'mismatch' : q . includes ( 'ERP' ) && q . includes ( '处理好' ) ? 'recovery' : q . includes ( '未知' ) ? 'safety' : q . includes ( '自动' ) || q . includes ( '排程' ) ? 'schedule' : q . includes ( '现在' ) || q . includes ( '进度' ) ? 'progress' : q . includes ( '调拨' ) || q . includes ( '昨天' ) ? 'intent' : 'welcome' ; return goto ( 'chat' , { scene } ) ; }
if ( a . startsWith ( 'download-source-' ) ) { const source = sources . find ( x => x . code === a . slice ( 16 ) ) ; if ( source ? . file ) toast ( ` 原型:已下载 ${ source . file . name } ;正式实现将记录下载访问审计。 ` ) ; return } if ( a === 'download-receipt-files' ) { toast ( '原型:已下载本次 Run 使用的 DBS-AWSBI 与 CRANE-SZ 收料来源文件。' ) ; return } if ( a === 'download-erp-stock' ) { toast ( '原型:已下载本次预检冻结的 ERP 库存表。' ) ; return } if ( a === 'show-file' ) { toast ( '原型:展示冻结文件版本、checksum、原始行和下载访问审计。' ) ; return } if ( a === 'show-audit' ) { toast ( '原型:展示操作人、时间、动作、变更前后快照与关联 Run。' ) ; return } if ( a === 'show-requery-history' ) { toast ( '原型:Attempt 1 为收料 300 / ERP 280;最新 Attempt 会追加保存,原快照不被覆盖。' ) ; return } if ( a === 'show-unknown' ) { toast ( '原型:结果未知只能由 ERP 管理员线下核实;系统不生成第二次 ERP 写入。' ) ; return } if ( a === 'download' ) { toast ( '原型:下载 Run 创建时的固定异常 Excel,并记录下载审计。' ) ; return } if ( a === 'chat-send' ) { const q = ( $ ( 'chat-input' ) ? . value || '' ) . trim ( ) ; const scene = q . includes ( '今天' ) ? 'rule' : q . includes ( '待处理' ) ? 'status' : q . includes ( 'INV-031' ) || q . includes ( '不一致' ) ? 'mismatch' : q . includes ( 'ERP' ) && q . includes ( '处理好' ) ? 'recovery' : q . includes ( '未知' ) ? 'safety' : q . includes ( '自动' ) || q . includes ( '排程' ) ? 'schedule' : q . includes ( '现在' ) || q . includes ( '进度' ) ? 'progress' : q . includes ( '调拨' ) || q . includes ( '昨天' ) ? 'intent' : 'welcome' ; return goto ( 'chat' , { scene } ) ; }
}
function bind ( ) { document . querySelectorAll ( '[data-action]' ) . forEach ( el => el . onclick = ( ) => action ( el . dataset . action ) ) ; document . querySelectorAll ( '[data-source]' ) . forEach ( el => el . onchange = ( ) => { el . checked ? S . selected . add ( el . dataset . source ) : S . selected . delete ( el . dataset . source ) ; const count = $ ( 'source-count' ) ; if ( count ) count . textContent = ` 已选 ${ S . selected . size } 个来源实例 ` ; } ) ; document . querySelectorAll ( '[data-invoice]' ) . forEach ( el => el . onchange = ( ) => { const checked = [ ... document . querySelectorAll ( '[data-invoice]:checked' ) ] ; const n = checked . length , total = checked . reduce ( ( sum , x ) => sum + ( { "INV-001" : 500 , "INV-002" : 1200 , "INV-008" : 600 , "INV-031" : 300 } [ x . dataset . invoice ] || 0 ) , 0 ) ; const t = $ ( 'selected-summary' ) ; if ( t ) t . textContent = ` 已选 ${ n } 张 · 预计调拨总数量 ${ total . toLocaleString ( ) } PCS · 预计 ERP 写入 ${ n } 张 ` ; } ) ; }
window . addEventListener ( 'popstate' , render ) ; render ( ) ;