1import{u as G,d as H,dp as j,D as E,aA as v,dq as N,ae as g,af as T,P as U,dr as q,ds as k,b as r,A as l,dt as s,du as P,aM as h,dv as S,dw as w,J as C,aU as W,dx as A,I as i,dy as R,dz as Z,e as m,bh as $,dA as B,dB as Y,dC as Q,dD as J,dE as X,dF as p,aV as O,dG as K,dH as b,dI as L,dJ as x,dK as y,dL as tt,dM as et,dN as f,dO as M,dP as st,b5 as D,dQ as V,dR as at,dS as rt,dT as I,dU as it,dV as nt,dW as z,k as F,dX as ct}from"./index-BCISuyjc.js";import{a as ot}from"./control-Bbgxicrz.js";import{I as dt}from"./input-rules-Vw4yiq__.js";const lt={isActive:G(H)||!1};j(lt,_=>{_.addCase(ot,(t,{payload:e})=>{t.isActive=e})});class ut extends E{extractState(t){return{...t.production,tablesorter:t.tablesorter,comments:t.noteblock}}view(){return r` 2 <article class="landing-main__prod__search"> 3 <fieldset> 4 <legend>Suchkriterien:</legend> 5 <div class="flex-jc-centered flex-horizontal gap-md"> 6 <dgn-input-text 7 title="Vorname" 8 value="${this.state.search[this.state.active_view].criteria.first_name}" 9 @input="${v(t=>N("first_name",t.target.value,this.state.active_view))}" 10 > 11 </dgn-input-text> 12 13 <dgn-input-text 14 title="Nachname" 15 value="${this.state.search[this.state.active_view].criteria.last_name}" 16 @input="${v(t=>N("last_name",t.target.value,this.state.active_view))}" 17 > 18 </dgn-input-text> 19 20 <dgn-input-text 21 title="Antragsnummer" 22 value="${this.state.search[this.state.active_view].criteria.application_number}" 23 @input="${v(t=>N("application_number",t.target.value,this.state.active_view))}" 24 > 25 </dgn-input-text> 26 27 <dgn-input-date 28 title="Datum" 29 @input="${v(t=>N("current_status_date_after",g(T.DBDATE,t.target.value),this.state.active_view))}" 30 > 31 </dgn-input-date> 32 33 <button 34 class="btn btn--secondary" 35 @click="${()=>this.executeSearch(0)}" 36 ?disabled="${U(q(this.state.search[this.state.active_view].criteria))}" 37 > 38 Karte(n) suchen 39 </button> 40 41 <button 42 class="btn btn--secondary" 43 @click="${()=>k(this.state.active_view)}" 44 > 45 Zurücksetzen 46 </button> 47 </div> 48 </fieldset> 49 50 <dgn-pagination 51 current-page="${this.state.search[this.state.active_view].pagination.current_page}" 52 total-pages="${this.state.search[this.state.active_view].pagination.total_pages}" 53 name="test" 54 @selection-changed="${t=>this.executeSearch(t.detail.pageIndex)}" 55 ></dgn-pagination> 56 57 <dgn-production-cards 58 is-searched-cards 59 product-id="${0}" 60 @progress-production="${t=>this.dispatchEvent(new CustomEvent("progress-production",{detail:{product_id:t.detail.product_id}}))}" 61 @cancel="${t=>{k(this.state.active_view)}}" 62 ></dgn-production-cards> 63 </article> 64 `}executeSearch(t){this.dispatchEvent(new CustomEvent("search-executed",{detail:{page_index:t}}))}}customElements.define("dgn-production-overview-search",ut);class ht extends E{extractState(t){return{...t.production,tablesorter:t.tablesorter,comments:t.noteblock}}view(){const t=this.getAttribute("product-id"),e=this.getCardsToDisplay(),a=this.hasAttribute("force-show");return e.length>0||a?r` 65 <table class="scrollable cards_to_product-table"> 66 ${this.renderDetailsTableHead(t)} 67 ${this.renderDetailsTableBody(t)} 68 </table> 69 `:l}renderDetailsTableHead(t){return r` 70 <thead> 71 <tr> 72 <th class="checkbox-col"> </th> 73 <th 74 class="cardtype-col" 75 @click="${()=>this.sortDetails(t,["application_type"])}" 76 > 77 <div class="sort-header--start"> 78 <dgn-sort-icon 79 table="${`details_${t}`}" 80 columns="application_type" 81 ></dgn-sort-icon>
82 <span>Antragstyp</span> 83 </div> 84 85 </th> 86 ${this.renderViewBaseDetailsHeadColumns(t)} 87 </tr> 88 </thead> 89 `}renderViewBaseDetailsHeadColumns(){const t=this.getAttribute("product-id");switch(this.state.active_view){case s.PIN_LETTER_PRINT:case s.CARD_PRODUCTION:return r` 90 <th 91 class="firstname-col" 92 @click="${()=>this.sortDetails(t,["first_name"])}" 93 > 94 <div class="sort-header--start"> 95 <dgn-sort-icon 96 table="${`details_${t}`}" 97 columns="first_name" 98 ></dgn-sort-icon> 99 <span>Vorname</span> 100 </div> 101 </th> 102 103 <th 104 class="lastname-col" 105 @click="${()=>this.sortDetails(t,["last_name"])}" 106 > 107 <div class="sort-header--start"> 108 <dgn-sort-icon 109 table="${`details_${t}`}" 110 columns="last_name" 111 ></dgn-sort-icon> 112 <span>Nachname</span> 113 </div> 114 </th> 115 116 <th 117 class="date-of-birth-col" 118 @click="${()=>this.sortDetails(t,["date_of_birth"])}" 119 > 120 <div class="sort-header"> 121 <dgn-sort-icon 122 table="${`details_${t}`}" 123 columns="date_of_birth" 124 ></dgn-sort-icon> 125 <span>Geburtstdatum</span> 126 </div> 127 </th> 128 129 <th 130 class="application-number-col" 131 @click="${()=>this.sortDetails(t,["application_number"])}" 132 > 133 <div class="sort-header--start"> 134 <dgn-sort-icon 135 table="${`details_${t}`}" 136 columns="application_number" 137 ></dgn-sort-icon> 138 <span>Antragsnummer</span> 139 </div> 140 </th> 141 142 <th 143 class="date-of-receipt-col" 144 @click="${()=>this.sortDetails(t,["current_status_date"])}" 145 > 146 <div class="sort-header"> 147 <dgn-sort-icon 148 table="${`details_${t}`}" 149 columns="current_status_date" 150 ></dgn-sort-icon> 151 <span>Empfangsdatum</span> 152 </div> 153 </th> 154 155 <th 156 class="comments-col" 157 > 158 <span>Kommentar</span> 159 </th> 160 `;case s.ABORTED_PERSONALISATION:case s.ABORTED_CARD_LETTER:case s.ABORTED_PIN_LETTER:case s.SMB_ERRORED:return r` 161 <th 162 class="application-number-col" 163 @click="${()=>this.sortDetails(t,["application_number"])}" 164 > 165 <div class="sort-header--start"> 166 <dgn-sort-icon 167 table="${`details_${t}`}" 168 columns="application_number" 169 ></dgn-sort-icon> 170 <span>Antragsnummer</span> 171 </div> 172 </th> 173 174 <th 175 class="firstname-col" 176 @click="${()=>this.sortDetails(t,["first_name"])}" 177 > 178 <div class="sort-header--start"> 179 <dgn-sort-icon 180 table="${`details_${t}`}" 181 columns="first_name" 182 ></dgn-sort-icon>
183 <span>Vorname</span> 184 </div> 185 </th> 186 187 <th 188 class="lastname-col" 189 @click="${()=>this.sortDetails(t,["last_name"])}" 190 > 191 <div class="sort-header--start"> 192 <dgn-sort-icon 193 table="${`details_${t}`}" 194 columns="last_name" 195 ></dgn-sort-icon> 196 <span>Nachname</span> 197 </div> 198 </th> 199 200 <th 201 class="date-of-receipt-col" 202 @click="${()=>this.sortDetails(t,["current_status_date"])}" 203 > 204 <div class="sort-header--start"> 205 <dgn-sort-icon 206 table="${`details_${t}`}" 207 columns="current_status_date" 208 ></dgn-sort-icon> 209 <span>Fehlerdatum:</span> 210 </div> 211 </th> 212 213 <th 214 class="comments-col" 215 > 216 <span>Kommentar</span> 217 </th> 218 219 <th 220 class="error-message-col" 221 @click="${()=>this.sortDetails(t,["error_message"])}" 222 > 223 <div class="sort-header--start"> 224 <dgn-sort-icon 225 table="${`details_${t}`}" 226 columns="error_message" 227 ></dgn-sort-icon> 228 <span>Fehlermeldung:</span> 229 </div> 230 </th> 231 `;default:return l}}getCardsToDisplay(){const t=this.getAttribute("product-id");return this.hasAttribute("is-searched-cards")?P(t,this.state.active_view):P(t,this.state.active_view)}renderProductionNextButtons(){const t=this.getAttribute("product-id");return this.state.active_view===s.SMB_ERRORED?r` 232 <div class="flex-horizontal flex-jc-end"> 233 <button class="btn btn--secondary" ?disabled=${!this.hasDetailsSelected(t)} @click="${()=>this.restartComplete(t)}">Komplett neustarten</button> 234 <button class="btn btn--primary" ?disabled=${!this.hasDetailsSelected(t)} @click="${()=>this.restartLastStep(t)}">Letzten Schritt neustarten</button> 235 </div> 236 `:r` 237 <button class="btn btn--primary" ?disabled=${!this.hasDetailsSelected(t)} @click="${()=>this.progressProduction(t)}">Produktion starten</button> 238 `}renderRowClass(t){const e=t.card_id,a=this.state.responses.retried_smbs[e],c=()=>{switch(a){case i.PENDING:return"table-row--pending";case i.OK:return"table-row--success";case i.SERVER_ERROR:case i.NOT_FOUND:case i.CONFLICT:return"table-row--error";default:return""}};return this.state.active_view!==s.SMB_ERRORED||!a?"":c()}renderDetailsTableBody(){const t=this.getAttribute("product-id"),e=this.getCardsToDisplay();return e.length>0?r` 239 <tbody> 240 ${e.map(a=>r` 241 <tr 242 class="${this.renderRowClass(a)}" 243 @click="${()=>this.toggleSelectedState(t,a.card_id)}" 244 > 245 <td class="checkbox-col"><input type="checkbox" .value=${a.card_id} .checked=${this.isSelected(t,a.card_id)} /></td> 246 <td class="cardtype-col">${a.type}</td> 247 ${this.renderViewBasedDetailsBodyColumns(a)} 248 </tr> 249 `)} 250 251 <tr> 252 <td colspan="8"> 253 <div class="flex-horizontal flex-jc-between"> 254 <button class="btn btn--primary" @click=${()=>this.cancelDetailsSelection(t)}>Abbrechen</button> 255 <div class="flex-horizontal"> 256 <button class="btn btn--primary" @click=${()=>this.selectAllDetailsToProduct(t)}>alle auswählen</button> 257 <button class="btn btn--primary" @click=${()=>this.deselectAllDetailsOfProduct(t)}>alle abwählen</button> 258 <button class="btn btn--primary" @click=${()=>this.selectFirst20DetailsOfProduct(t)}>die ersten 20 auswählen</button> 259 </div> 260 ${this.renderProductionNextButtons()} 261 </div> 262 263 </td> 264 </tr> 265 </tbody> 266 `:r` 267 <tbody> 268 <tr> 269 <td colspan="8"> 270 <div class="no-application flex-horizontal flex-jc-centered ">Keine Fehlerhaften SMBs vorhanden</div> 271 </td> 272 </tr> 273 </tbody> 274 `}renderFailedStatesError(t){switch(t.current_status){case h.CSR_REQUEST_FAILED:return"CSR-Abruf fehlgeschlagen";case h.GET_CSR_FAILED:return"Konnte CSR nicht abrufen";case h.CREATING_PRODUCTION_REQUEST_FAILED:return"Produktinrequest konnte nicht erzeugt werden";case h.SIGNING_CSR_FAILED:return"Signatur der CSR fehlgeschlagen";case h.LOAD_CERT_TO_TIGW_FAILED:return"Abruf des Zertifikats fehlgeschlagen";case"FEEDBACK_ERROR":return t.current_status_description;default:return t.current_status}}renderViewBasedDetailsBodyColumns(t){const e=t.first_name||"",a=t.last_name||"";switch(this.state.active_view){case s.PIN_LETTER_PRINT:case s.CARD_PRODUCTION:return r` 275 <td class="firstname-col" title="${e}">${e.length>43?e.substring(0,40)+"...":e}</td> 276 <td class="lastname-col" title="${a}">${a.length>43?a.substring(0,40)+"...":a}</td> 277 <td class="date-of-birth-col">${g(T.DATE,t.date_of_birth)}</td> 278 <td class="application-number-col">${t.application_number}</td> 279 <td class="date-of-receipt-col">${this.handleCurrentStatusDate(t)}</td> 280 <td class="comments-col" title="${this.renderComment(t.comment,!1)}"> 281 ${this.renderComment(t.comment)} 282 </td> 283 `;case s.ABORTED_PERSONALISATION:case s.ABORTED_CARD_LETTER:case s.ABORTED_PIN_LETTER:return r` 284 <td class="application-number-col">${t.application_number}</td> 285 <td class="firstname-col" title="${e}">${e.length>43?e.substring(0,40)+"...":e}</td> 286 <td class="lastname-col" title="${a}">${a.length>43?a.substring(0,40)+"...":a}</td> 287 <td class="date-of-receipt-col">${this.handleCurrentStatusDate(t)}</td> 288 <td class="comments-col" title="${this.renderComment(t.comment,!1)}"> 289 ${this.renderComment(t.comment)} 290 </td> 291 <td class="error-message-col" title="${t.error_message}"> 292 ${this.shortenLongMessage(t.error_message)} 293 </td> 294 `;
294case s.SMB_ERRORED:return r` 295 <td class="application-number-col">${t.application_number}</td> 296 <td class="firstname-col" title="${e}">${e.length>43?e.substring(0,40)+"...":e}</td> 297 <td class="lastname-col" title="${a}">${a.length>43?a.substring(0,40)+"...":a}</td> 298 <td class="date-of-receipt-col">${this.handleCurrentStatusDate(t)}</td> 299 <td class="comments-col" title="${this.renderComment(t.comment,!1)}"> 300 ${this.renderComment(t.comment)} 301 </td> 302 <td class="error-message-col" title="${t.error_message}"> 303 ${this.renderFailedStatesError(t)} 304 </td> 305 `;default:return l}}renderViewBAsedDetailsActionColumns(t){switch(this.state.active_view){case s.PIN_LETTER_PRINT:case s.CARD_PRODUCTION:return r` 306 <td class="action-col"> </td> 307 <td class="action-col"> </td> 308 <td class="action-col"><button class="btn btn--primary" @click=${()=>this.selectAllDetailsToProduct(t)}>alle auswählen</button></td> 309 <td class="action-col"><button class="btn btn--primary" @click=${()=>this.deselectAllDetailsOfProduct(t)}>alle abwählen</button></td> 310 <td class="action-col">${S(t,this.state.active_view).length>20?r` 311 <button class="btn btn--primary" @click=${()=>this.selectFirst20DetailsOfProduct(t)}>die ersten 20 auswählen</button> 312 `:r` `}</td> 313 `;case s.ABORTED_PERSONALISATION:case s.ABORTED_CARD_LETTER:case s.ABORTED_PIN_LETTER:case s.SMB_ERRORED:return r` 314 <td class="action-col"> </td> 315 <td class="action-col"> </td> 316 <td class="action-col"> </td> 317 <td class="action-col flex-horizontal flex-jc-end gap-xs"> 318 <button class="btn btn--primary" @click=${()=>this.selectAllDetailsToProduct(t)}>alle auswählen</button> 319 <button class="btn btn--primary" @click=${()=>this.deselectAllDetailsOfProduct(t)}>alle abwählen</button> 320 ${S(t,this.state.active_view).length>20?r` 321 <button class="btn btn--primary" @click=${()=>this.selectFirst20DetailsOfProduct(t)}>die ersten 20 auswählen</button> 322 `:r` `} 323 </td> 324 `;default:return l}}renderComment(t,e=!0){return t&&!U(t)?e?this.shortenLongMessage(t.content):t.content:l}shortenLongMessage(t){return t&&t.length>33?t.substring(0,30)+"...":t}handleCurrentStatusDate(t){return t.current_status_date?g(T.DATETIME,t.current_status_date.replace("T"," ")):"nicht vorhanden"}toggleSelectedState(t,e){w(this.state.active_view,t,e)}
324cancelDetailsSelection(t){this.dispatchEvent(new CustomEvent("cancel",{detail:{product_id:t}})),w(this.state.active_view,t,[])}hasDetailsSelected(t){return C(this.state.chooseCheck[this.state.active_view],t)?this.state.chooseCheck[this.state.active_view][t].length>0:!1}isSelected(t,e){return C(this.state.chooseCheck[this.state.active_view],t)?this.state.chooseCheck[this.state.active_view][t].some(a=>a===e):!1}selectAllDetailsToProduct(t){const e=P(t,this.state.active_view).map(a=>a.card_id);w(this.state.active_view,t,e)}deselectAllDetailsOfProduct(t){w(this.state.active_view,t,[])}selectFirst20DetailsOfProduct(t){const e=P(t,this.state.active_view).filter((a,c)=>c<20).map(a=>a.card_id);w(this.state.active_view,t,e)}sortDetails(t,e){const a=`details_${t}`;W(a,e),this.dispatchEvent(new CustomEvent("sort-cards",{detail:{product_id:t,table_name:a}}))}progressProduction(t){this.dispatchEvent(new CustomEvent("progress-production",{detail:{product_id:t}}))}restartComplete(t){this.dispatchEvent(new CustomEvent("progress-production",{detail:{product_id:t,mode:A.COMPLETE_RESTART}}))}restartLastStep(t){this.dispatchEvent(new CustomEvent("progress-production",{detail:{product_id:t,mode:A.LAST_STEP}}))}}customElements.define("dgn-production-cards",ht);class pt extends E{connectedCallback(){super.connectedCallback(),this.show_accordeon=!1}extractState(t){return{...t.production,tablesorter:t.tablesorter,comments:t.noteblock}}view(){return r` 325 <div class='landing-main__prod__result flex-vertical flex-ai-centered'> 326 <dgn-production-overview-search 327 @search-executed="${t=>this.searchProductCards(t.detail.page_index)}" 328 @progress-production="${t=>this.startNextProductionStep(t,t.detail.product_id,"SEARCH")}" 329 ></dgn-production-overview-search> 330 331 ${P("0",this.state.active_view).length>0?r` 332 <button 333 class="btn btn--secondary" 334 @click="${()=>{this.show_accordeon=!this.show_accordeon,this.triggerViewUpdate()}}" 335 > 336 ${this.show_accordeon?"Produktspezifische Auswahl verstecken":"Produktspezifische Auswahl anzeigen"} 337 </button> 338 `:l} 339 340 ${P("0",this.state.active_view).length===0||this.show_accordeon?r` 341 <div class="horizontal-scroll"> 342 <table class="scrollable cardprod"> 343 ${this.renderProductionTableHead()} 344 ${this.renderProductionTableBody()} 345 </table> 346 </div> 347 `:l} 348 349 350 351 </div> 352 `}renderProductionTableHead(){return r` 353 <thead> 354 <tr> 355 <th 356 class="cardproduct-col" 357 @click="${()=>R(["product_type"])}" 358 > 359 <div class="sort-header--start"> 360 <dgn-sort-icon 361 table="products" 362 columns="product_type" 363 ></dgn-sort-icon> 364 <span>Kartenprodukt</span> 365 </div> 366 </th> 367 368 <th 369 class="product-id-col" 370 @click="${()=>R(["product_id"])}" 371 > 372 <div class="sort-header"> 373 <dgn-sort-icon 374 table="products" 375 columns="product_id" 376 ></dgn-sort-icon> 377 <span>Produkt</span> 378 </div> 379 </th> 380 381 ${this.renderViewBaseHeadColumns()} 382 383 <th class="production-queue-col"><!-- Verfügbare Personalisierungsarbeitsplätze --></th> 384 <th class="action-col"></th> 385 </tr> 386 </thead> 387 `}renderProductionTableBody(){return r` 388 <tbody> 389 ${this.state.overview.filter(t=>String(t.product_id).indexOf("5")!==0).map(t=>r` 390 <tr 391 @click="${()=>this.fetchDetailsAndToggleExtended(t.product_id)}" 392 > 393 <td class="cardproduct-col"> 394 ${t.product_type} ${t.variant!==Z.STANDARD?`( ${t.variant} )`:""} 395 </td> 396 <td class="product-id-col"> 397 ${t.product_id} 398 </td> 399 ${this.renderViewBasedBodyColumns(t)} 400 <td class="production-queue-col"> 401 ${""} 402 </td> 403 <td class="action-col"> 404 <div> 405 ${this.state.extended[this.state.active_view].some(e=>
405e===t.product_id)?r`<button class="btn btn--primary" ?disabled=${!this.hasDetailsSelected(t.product_id)} @click="${e=>this.startNextProductionStep(e,t.product_id)}">Produktion starten</button>`:r`<button class="btn btn--primary" ?disabled="${this.state.responses.overview===i.PENDING}">Auftragsauswahl</button>`} 406 </div> 407 </td> 408 </tr> 409 ${this.renderProductionDetails(t.product_id)} 410 `)} 411 </tbody> 412 `}renderViewBaseHeadColumns(){switch(this.state.active_view){case s.CARD_PRODUCTION:return r` 413 <th 414 class="to-produce-col" 415 @click="${()=>R(["view_count"])}" 416 > 417 <div class="sort-header"> 418 <dgn-sort-icon 419 table="products" 420 columns="released" 421 ></dgn-sort-icon> 422 <span>Aufträge (Eingang)</span> 423 </div> 424 </th> 425 426 <th 427 class="in-production-col" 428 @click="${()=>R(["in_production"])}" 429 > 430 <div class="sort-header"> 431 <dgn-sort-icon 432 table="products" 433 columns="in_production" 434 ></dgn-sort-icon> 435 <span>Aufträge (im Kern)</span> 436 </div> 437 </th> 438 `;case s.PIN_LETTER_PRINT:return r` 439 <th 440 class="to-produce-col" 441 @click="${()=>R(["pin_letter_queued"])}" 442 > 443 <div class="sort-header"> 444 <dgn-sort-icon 445 table="products" 446 columns="pin_letter_queued" 447 ></dgn-sort-icon> 448 <span>Anstehende Druckaufträge</span> 449 </div> 450 </th> 451 <th class="in-production-col"></th> 452 `;case s.ABORTED_PERSONALISATION:case s.ABORTED_CARD_LETTER:case s.ABORTED_PIN_LETTER:return r` 453 <th 454 class="to-produce-col" 455 @click="${()=>R(["aborted_prints"])}" 456 > 457 <div class="sort-header"> 458 <dgn-sort-icon 459 table="products" 460 columns="aborted_prints" 461 ></dgn-sort-icon> 462 <span>Aufträge (Abgebrochen)</span> 463 </div> 464 </th> 465 <th class="in-production-col"></th> 466 `;default:return l}}renderViewBasedBodyColumns(t){switch(this.state.active_view){case s.CARD_PRODUCTION:return r` 467 <td class="to-produce-col"> 468 ${this.state.responses.overview===i.PENDING?"-":t.view_count||0} 469 </td> 470 <td class="in-production-col"> 471 ${"-"} 472 </td> 473 `;case s.PIN_LETTER_PRINT:return r` 474 <td class="to-produce-col"> 475 ${this.state.responses.overview===i.PENDING?"-":t.view_count||0} 476 </td> 477 <td class="in-production-col"> 478 </td> 479 `;case s.ABORTED_PERSONALISATION:case s.ABORTED_CARD_LETTER:case s.ABORTED_PIN_LETTER:return r` 480 <td class="to-produce-col"> 481 ${this.state.responses.overview===i.PENDING?"-":t.view_count||0} 482 </td> 483 <td class="in-production-col"> 484 </td> 485 `;default:return l}}renderProductCardsPagination(t){return r` 486 <dgn-pagination 487 current-page="${this.state.pagination[t].current_page}" 488 total-pages="${this.state.pagination[t].total_pages}"
489 name="test" 490 @selection-changed="${e=>{this.fetchCardsToProduct(t,e.detail.pageIndex).then(({json:a})=>{a.items.length===0&&m($.INFO,this.noDetailsFoundMessageByView())})}}" 491 ></dgn-pagination> 492 `}renderProductionDetails(t){return this.state.extended[this.state.active_view].some(e=>e===t)&&S(t,this.state.active_view)?r` 493 <tr class="sub-table"> 494 <td class="sub-table-container" colspan="6"> 495 ${this.renderProductCardsPagination(t)} 496 <dgn-production-cards 497 product-id="${t}" 498 @progress-production="${e=>this.startNextProductionStep(e,e.detail.product_id,"PRODUCT")}" 499 @sort-cards="${e=>this.fetchCardsToProduct(t,this.state.pagination[t].currentPage,e.detail.table_name)}" 500 @cancel="${e=>{B(this.state.active_view,e.detail.product_id)}}" 501 ></dgn-production-cards> 502 </td> 503 </tr> 504 `:l}searchErroredSMB(t=0){return postErroredSMBs}searchProductCards(t=0){return Y(this.statusByView(),this.state.active_view,this.state.search[this.state.active_view].criteria,t).then(({json:e})=>{e.items.length===0&&m($.INFO,`Es konten keine Karten zu den aufgeführten Kriterien, mit dem Status: ${this.statusByView()} gefunden werden`)})}fetchCardsToProduct(t,e=0,a=""){return Q(t,this.statusByView(),this.state.active_view,e,a)}fetchDetailsAndToggleExtended(t){const e=this.state.extended[this.state.active_view].some(c=>c===t),a=this.noDetailsFoundMessageByView();e?(w(this.state.active_view,t,[]),B(this.state.active_view,t)):this.fetchCardsToProduct(t).then(({json:c})=>{c.items.length===0&&m($.INFO,a)})}hasDetailsSelected(t){return C(this.state.chooseCheck[this.state.active_view],t)?this.state.chooseCheck[this.state.active_view][t].length>0:!1}startNextProductionStep(t,e,a){t.stopPropagation();const c=this.state.chooseCheck[this.state.active_view][e],u=this.successMessageByView(),o=this.errorMessageByView(),d=()=>{m($.SUCCESS,u),O("production",()=>K(this.overviewStatusByView()).then(()=>a==="PRODUCT"?this.fetchCardsToProduct(e):this.searchProductCards()))};[s.ABORTED_PERSONALISATION,s.ABORTED_PIN_LETTER,s.ABORTED_CARD_LETTER].includes(this.state.active_view)?Promise.all(c.map(n=>J(n))).then(()=>d()).catch(()=>m($.ERROR,o)):X(c).then(()=>d()).catch(()=>m($.ERROR,o))}statusByView(){switch(this.state.active_view){case s.CARD_PRODUCTION:return h.READY_FOR_PRODUCTION;case s.PIN_LETTER_PRINT:return h.CARD_SENT;case s.ABORTED_PERSONALISATION:return h.PERSONALIZATION_ABORTED;case s.ABORTED_CARD_LETTER:return h.LETTER_PRINT_ABORTED;case s.ABORTED_PIN_LETTER:return h.PIN_LETTER_PRINT_ABORTED;default:return""}}overviewStatusByView(){switch(this.state.active_view){case s.CARD_PRODUCTION:return p.PPRODUCTION;case s.PIN_LETTER_PRINT:return p.CARD_SENT;case s.ABORTED_PERSONALISATION:return p.PERSONALIZATION_ABORTED;case s.ABORTED_CARD_LETTER:return p.LETTER_PRINT_ABORTED;case s.ABORTED_PIN_LETTER:return p.PIN_LETTER_PRINT_ABORTED;default:return""}}noDetailsFoundMessageByView(){switch(this.state.active_view){case s.CARD_PRODUCTION:return"Es liegen keine Karten, die bereit für die Produktion sind, vor";case s.PIN_LETTER_PRINT:return"Es liegen keine Karten, die für den PIN-Brief Druck bereit sind, vor";case s.ABORTED_PERSONALISATION:case s.ABORTED_CARD_LETTER:case s.ABORTED_PIN_LETTER:return"Es liegen keine Karten, mit einem abgebrochenem Prozess, vor";default:return""}}successMessageByView(){switch(this.state.active_view){case s.CARD_PRODUCTION:return"Karte wurden erfolgreich der Produktion vorgelegt";case s.PIN_LETTER_PRINT:return"Pin-Brief wurde erfolgreich dem Druck vorgelegt";case s.ABORTED_PERSONALISATION:case s.ABORTED_CARD_LETTER:case s.ABORTED_PIN_LETTER:return"Abgebrochener Vorgang wurde erfolgreich zurück gesetzt";default:return""}}errorMessageByView(){switch(this.state.active_view){case s.CARD_PRODUCTION:return"Karte wurden nicht erfolgreich der Produktion vorgelegt";case s.PIN_LETTER_PRINT:return"Pin-Brief wurde nicht erfolgreich dem Druck vorgelegt";case s.ABORTED_PERSONALISATION:case s.ABORTED_CARD_LETTER:case s.ABORTED_PIN_LETTER:return"Abgebrochener Vorgang wurde nicht erfolgreich zurück gesetzt";default:return""}}}customElements.define("dgn-production-overview",pt);
504class _t extends E{extractState(t){return{packstation:t.production.packstation,responses:t.production.responses}}triggerViewUpdate(){if(super.triggerViewUpdate(),this.state.packstation[b.CARD_LETTER]===""){const t=document.querySelector("#production-letter-barcode input");t&&t.focus()}else if(!this.state.packstation.isManualMode)if(this.state.packstation[b.CARD]===""){const t=document.querySelector("#production-card-barcode input");t&&t.focus()}else{const t=this.state.packstation[b.CARD_LETTER],e=this.state.packstation[b.CARD];t!==""&&e!==""&&t===e&&[i.UNSET].includes(this.state.responses.markAsSend)&&this.markAsSend()}}view(){const t=this.state.packstation[b.CARD_LETTER],e=this.state.packstation[b.CARD],a=t!=="",c=e!=="",u=t===""||e===""||t===e,o=a&&c&&t===e;return r` 505 <section class="flex-vertical gap-xs"> 506 <div class="flex-horizontal flex-jc-centered gap-md"> 507 <h1>Packstation</h1> 508 <div class="flex-horizontal"> 509 <input 510 id="manual-packstation" 511 type="checkbox" 512 .checked="${this.state.packstation.isManualMode}" 513 @click="${()=>L()}" 514 > 515 <label for="manual-packstation">Manuelle Eingabe</label> 516 </div> 517 </div> 518 <div class="packstation--barcodes flex-horizontal flex-jc-centered"> 519 <dgn-input-text 520 id="production-letter-barcode" 521 title="Barcode-Scan des Kartenbriefs" 522 value=${t} 523 name='Kartenbrief' 524 isValid=${u} 525 validErrorText='Barcodes stimmen nicht überein' 526 @input="${v(d=>x(b.CARD_LETTER,d.target.value),100)}" 527 ></dgn-input-text> 528 529 <dgn-input-text 530 id="production-card-barcode" 531 title='Barcode-Scan der Karte' 532 value=${e} 533 name="karte" 534 isValid=${u} 535 validErrorText='Barcodes stimmen nicht überein' 536 @input="${v(d=>x(b.CARD,d.target.value),100)}" 537 ></dgn-input-text> 538 </div> 539 <div class="flex-horizontal flex-jc-centered"> 540 ${this.state.packstation.isManualMode?r` 541 <button 542 class="btn btn--primary" 543 ?disabled="${!o||this.state.responses.markAsSend===i.PENDING}" 544 @click="${()=>this.markAsSend()}" 545 ><dgn-icon name="check"></dgn-icon>Karte als 'Versandt' markieren</button> 546 `:l} 547 548 <button 549 class="btn btn--primary" 550 ?disabled="${!a&&!c}" 551 @click="${()=>y()}" 552 ><dgn-icon name="eraser"></dgn-icon>Eingabe zurücksetzen</button> 553 554 <div> 555 <input id="batch-upload" style="display: none" type="file" @change="${d=>this.executeStapelVerarbeitung(d)}"> 556 <button 557 class="btn btn--primary" 558 @click="${()=>this.querySelector("#batch-upload").click()}" 559 > 560 <dgn-icon name="assignments"></dgn-icon> 561 <span>Stapelverarbeitungsdatei hochladen</span> 562 </button> 563 </div> 564 565 ${this.state.packstation.batch.length>0?r` 566 <button 567 class="btn btn--primary" 568 @click="${()=>tt()}" 569 > 570 <dgn-icon name="mail-send"></dgn-icon>
571 <span>Stapelverarbeitung starten</span> 572 </button> 573 `:l} 574 </div> 575 576 ${this.renderBatchProcessList()} 577 ${this.renderPackStationLog()} 578 </section> 579 `}executeStapelVerarbeitung(t){const e=u=>{const o=u.replaceAll('"',"").split(";"),d=`${o[0].substring(0,4)}-${o[0].substring(4,6)}-${o[0].substring(6,8)}`,n=`${o[1].substring(0,2)}:${o[1].substring(3,5)}:${o[1].substring(6,8)}`;return{date:`${d} ${n}`,iccsn:o[2]}},a=t.target.files[0];return new Promise((u,o)=>{const d=new FileReader;d.onload=()=>{u(d.result)},d.onerror=()=>{o({message:"Stapelverarbeitungsdatei konnte nicht gelesen werden"})},d.readAsText(a)}).then(u=>{t.target.value="",et(u.split(` 580`).filter(o=>o.trim()!=="").map(o=>e(o)))})}singleMarkAsSend(t){return f({iccsn:t,status:i.PENDING,message:"Wird für Versand markiert.."}),M(t).then(e=>f({iccsn:t,status:e.status,message:e.message})).catch(e=>f({iccsn:t,status:e.status,message:e.message}))}markAsSend(){this.state.responses.markAsSend!==i.PENDING&&M(this.state.packstation[b.CARD_LETTER]).then(()=>y()).catch(()=>L(!0))}renderPackStationLog(){const t=e=>({[i.UNSET]:"",[i.PENDING]:"",[i.NOT_FOUND]:"table-row--error",[i.CONFLICT]:"table-row--error",[i.ERROR]:"table-row--error",[i.OK]:"table-row--success"})[e];return this.state.packstation.log.length>0?r` 581 <button 582 class="btn btn--error" 583 @click="${()=>st()}" 584 > Log zurücksetzen</button> 585 586 <div class="packstation--table packstation--table__log"> 587 <table class="table-view scrollable width-60p"> 588 <thead> 589 <tr> 590 <th class="number">Nr.</th> 591 <th class="iccsn">ICCSN</th> 592 <th class="date">Gestartet um</th> 593 <th class="message">Nachricht</th> 594 <th class="status">Status</th> 595 <th class="diff">Dauer</th> 596 597 </tr> 598 </thead> 599 <tbody> 600 ${this.state.packstation.log.map((e,a)=>r` 601 <tr class="${t(e.status)}"> 602 <td class="number">${a+1}</td> 603 <td class="iccsn">${e.iccsn}</td> 604 <td class="date">${g(T.DATETIME,e.startTime)}</td> 605 <td class="message">${e.message}</td> 606 <td class="status">${e.status}</td> 607 <td class="diff">${e.timeDiff}</td> 608 </tr> 609 `)} 610 </tbody> 611 </table> 612 </div> 613 `:l}renderBatchProcessList(){const t=n=>({[i.UNSET]:"Vorbereitet",[i.PENDING]:"Verarbeitung...",[i.NOT_FOUND]:"Fehler",[i.CONFLICT]:"Fehler",[i.ERROR]:"Fehler",[i.OK]:"Erfolgreich"})[n],e=n=>({[i.UNSET]:"",[i.PENDING]:"",[i.NOT_FOUND]:"table-row--error",[i.CONFLICT]:"table-row--error",[i.ERROR]:"table-row--error",[i.OK]:"table-row--success"})[n],a=this.state.packstation.workload.filter(n=>[i.OK,i.NOT_FOUND,i.CONFLICT,i.ERROR].includes(n.status)),c=this.state.packstation.workload,u=this.state.packstation.workload.filter(n=>n.status===i.OK),o=this.state.packstation.workload.filter(n=>[i.NOT_FOUND,i.CONFLICT,i.ERROR].includes(n.status)),d=this.state.packstation.workload.find(n=>n.status===i.PENDING);return this.state.packstation.batch.length>0?r` 614 ${this.state.packstation.workload.length?r` 615 <div class="packstation--batch-progress packstation--table__batch flex-horizontal flex-jc-centered gap-md"> 616 <div 617 class="flex-horizontal" 618 >
619 <span>${a.length}</span><span>/</span><span>${c.length}</span> 620 </div> 621 622 <div 623 class="flex-horizontal" 624 > 625 <span>Aktuell:</span><span>${d?d.iccsn:"Done"}</span> 626 </div> 627 628 <div 629 class="flex-horizontal" 630 > 631 <span>Erfolgreich:</span><span>${u.length}</span> 632 </div> 633 634 <div 635 class="flex-horizontal" 636 > 637 <span>Fehlgeschlagen:</span><span>${o.length}</span> 638 </div> 639 </div> 640 `:l} 641 642 <div class="packstation--table packstation--table__batch"> 643 <table class="table-view scrollable width-60p"> 644 <thead> 645 <tr> 646 <th class="iccsn">ICCSN</th> 647 <th class="iccsn">Datum</th> 648 <th class="iccsn">Zeit</th> 649 <th class="status">Status</th> 650 <th class="iteration">Versuch</th> 651 <th class="message">Nachricht</th> 652 <th class="redo">Nochmal</th> 653 </tr> 654 </thead> 655 <tbody> 656 ${this.state.packstation.batch.map(n=>r` 657 <tr class="${e(n.status)}"> 658 <td class="iccsn">${n.iccsn}</td> 659 <td class="date">${g(T.DATE,n.date)}</td> 660 <td class="time">${g(T.TIME,n.date)}</td> 661 <td class="status">${t(n.status)}</td> 662 <td class="iteration">${n.iteration}</td> 663 <td class="message">${n.message}</td> 664 <td class="message"> 665 <button class="btn btn--secondary btn--slim" 666 title="Nochmal versuchen" 667 ?disabled="${![i.ERROR,i.NOT_FOUND,i.CONFLICT].includes(n.status)}" 668 @click="${()=>this.singleBatchSend(n.iccsn)}" 669 > 670 <dgn-icon name="refresh"></dgn-icon> 671 </button> 672 673 </td> 674 </tr> 675 `)} 676 </tbody> 677 </table> 678 </div> 679 `:l}}customElements.define("dgn-production-packstation",_t);class bt extends E{extractState(t){return{...t.production}}view(){return r` 680 <p>Bitte geben Sie die Kartennummer der Karte ein, dessen Kartenbrief oder PIN-Brief erneut gedruck werden soll:</p> 681 <div class='production__reprint-container flex-horizontal flex-ai-centered gap-md'> 682 <dgn-input-text 683 title='Kartennummer ICCSN, 20-stellig' 684 value=${this.state.reprint.iccsn} 685 name='iccsn' 686 @input=${v(t=>V(t.target.value,"iccsn"))} 687 ></dgn-input-text> 688 689 <div 690 class='radio_div' 691 @change=${t=>V(t.target.value,"action")} 692 > 693 <div class="text-nowrap"> 694 <input 695 id="card-letter" 696 type="radio" 697 name="letter" 698 .value='${D.RESET_TO_REPRINT_LETTER}' 699 .checked=${this.state.reprint.action===D.RESET_TO_REPRINT_LETTER} 700 /> 701 <label for="card-letter">Kartenbrief</label> 702 </div> 703 704 <div class="text-nowrap"> 705 <input 706 id="pin-letter" 707 type="radio" 708 name="letter" 709 .value='${D.RESET_TO_REPRINT_PIN_LETTER}' 710 .checked=${this.state.reprint.action===D.RESET_TO_REPRINT_PIN_LETTER} 711 /> 712 <label for="pin-letter">PIN-Brief</label> 713 </div> 714 </div> 715 716 <button 717 class="btn btn--primary" 718 @click=${t=>this.excuteReprint(t)} 719 ?disabled="${this.isReprintDisabled()}" 720 >Erneut drucken</button> 721 </div> 722 ${this.renderReprintLog()} 723 `}isReprintDisabled(){const t=[D.RESET_TO_REPRINT_LETTER,D.RESET_TO_REPRINT_PIN_LETTER].includes(this.state.reprint.action),e=dt.iccsn_check.test(this.state.reprint.iccsn.trim()),a=this.state.responses.reprint===i.PENDING;return!t||!e||a}excuteReprint(){O("reprint-production",()=>at()).then(()=>rt())}renderReprintLog(){const t=e=>({[i.UNSET]:"",[i.PENDING]:"",[i.NOT_FOUND]:"table-row--error",[i.CONFLICT]:"table-row--error",[i.ERROR]:"table-row--error",[i.OK]:"table-row--success"})[e];return this.state.reprint.log.length>0?r` 724 <div class="flex-vertical"> 725 <button 726 class="btn btn--error" 727 @click="${()=>resetReprintLog()}" 728 > Log zurücksetzen</button> 729 730 <div class="packstation--table packstation--table__log"> 731 <table class="table-view scrollable width-60p"> 732 <thead> 733 <tr> 734 <th class="number">Nr.</th> 735 <th class="iccsn">ICCSN</th> 736 <th class="action">Typ</th> 737 <th class="date">Gestartet um</th> 738 <th class="message">Nachricht</th> 739 <th class="status">Status</th> 740 <th class="diff">Dauer</th> 741 742 </tr> 743 </thead> 744 <tbody> 745 ${this.state.reprint.log.map((e,a)=>r` 746 <tr class="${t(e.status)}"> 747 <td class="number">${a+1}</td> 748 <td class="iccsn">${e.iccsn}</td> 749 <td class="action">${e.action==="nachdruck"?"Kartenbrief":"PIN-Brief"}</td> 750 <td class="date">${g(T.DATETIME,e.start_time)}</td> 751 <td class="message">${e.message}</td> 752 <td class="status">${e.status}</td> 753 <td class="diff">${e.timeDiff}</td> 754 </tr> 755 `)} 756 </tbody> 757 </table> 758 </div> 759 </div> 760 `:l}}customElements.define("dgn-production-reprint",bt);
760class gt extends E{extractState(t){return{...t.production,tablesorter:t.tablesorter,comments:t.noteblock}}view(){return r` 761 <div class='landing-main__prod__result'> 762 <dgn-pagination 763 current-page="${this.state.search[this.state.active_view].pagination.current_page}" 764 total-pages="${this.state.search[this.state.active_view].pagination.total_pages}" 765 name="test" 766 @selection-changed="${t=>I(t.detail.pageIndex)}" 767 ></dgn-pagination> 768 769 <dgn-production-cards 770 product-id="${-1337}" 771 force-show 772 @progress-production="${t=>{const e=this.state.chooseCheck[this.state.active_view][-1337];switch(t.detail.mode){case A.LAST_STEP:return Promise.all(e.map(a=>nt(a)));case A.COMPLETE_RESTART:return Promise.all(e.map(a=>it(a)))}}}" 773 @cancel="${t=>{I()}}" 774 ></dgn-production-cards> 775 </div> 776 `}}customElements.define("dgn-production-smb-errorr",gt);class Tt extends E{extractState(t){return{pin_letter_history:t.production.pin_letter_history,responses:t.production.responses}}view(){return r` 777 <section class="flex-vertical flex-ai-centered gap-xs" style="padding-top: 1rem"> 778 ${this.renderPinLetterHistory()} 779 </section> 780 `}renderPinLetterHistory(){return this.state.pin_letter_history.length>0,r` 781 <button 782 class="btn btn--secondary" 783 @click="${()=>z()}" 784 style="width: 10rem" 785 > Liste aktualisieren</button> 786 787 <div class="packstation--table packstation--table__log"> 788 <table class="table-view scrollable width-60p"> 789 <thead> 790 <tr> 791 <th class="number">Nr.</th> 792 <th class="iccsn">ICCSN</th> 793 <th class="firstname">Vorname</th> 794 <th class="lastname">Nachname</th> 795 <th class="date-of-receipt">Versandtdatum</th> 796 </tr> 797 </thead> 798 <tbody> 799 ${this.state.pin_letter_history.map((t,e)=>{const a=t.first_name||"",c=t.last_name||"";return r` 800 <tr> 801 <td class="number">${e+1}</td> 802 <td class="iccsn">${t.card_number}</td> 803 <td class="firstname" title="${a}">${a.length>43?a.substring(0,40)+"...":a}</td> 804 <td class="lastname" title="${c}">${c.length>43?c.substring(0,40)+"...":c}</td> 805 <td class="date-of-receipt-col">${this.handleCurrentStatusDate(t)}</td> 806 </tr> 807 `})} 808 </tbody> 809 </table> 810 </div> 811 `}handleCurrentStatusDate(t){return t.current_status_date?g(T.DATETIME,t.current_status_date.replace("T"," ")):"nicht vorhanden"}}customElements.define("dgn-pin-letter-history",Tt);class Et extends E{connectedCallback(){super.connectedCallback(),this.loadProductionOverview()}extractState(t){return{...t.production}}view(){return r` 812 <div class='head_buttons flex-horizontal gab-xs flex-jc-centered '> 813 ${this.renderButton(s.SMB_ERRORED,"SM-B (Fehlerhaft)")} 814 ${this.renderButton(s.PIN_LETTER_HISTORY,"SM-B (PIN-Briefe versandt)")} 815 ${this.renderButton(s.CARD_PRODUCTION,"Karten")} 816 ${this.renderButton(s.PACKSTATION,"Packstation")} 817 ${this.renderButton(s.PIN_LETTER_PRINT,"PIN-Briefe")} 818 ${this.renderButton(s.REPRINT,"Nachdruck")} 819 ${this.renderButton(s.ABORTED_PERSONALISATION,"Karten (Abbruch)")} 820 ${this.renderButton(s.ABORTED_CARD_LETTER,"Kartenbriefe (Abbruch)")} 821 ${this.renderButton(s.ABORTED_PIN_LETTER,"PIN-Briefe (Abbruch)")} 822 <button 823 class="btn btn--secondary" 824 ?disabled="${this.state.responses.overview===i.PENDING}" 825 @click="${()=>{this.loadProductionOverview()}}" 826 > 827 <dgn-icon name="refresh"></dgn-icon> Aktualisieren 828 </button> 829 </div> 830 831 ${this.renderContent(this.state.active_view)} 832 `}loadProductionOverview(){[s.CARD_PRODUCTION,s.PIN_LETTER_PRINT,s.ABORTED_CARD_LETTER,s.ABORTED_PERSONALISATION,s.ABORTED_PIN_LETTER].includes(this.state.active_view)&&F(()=>O("production",()=>K(this.overviewStatusByView()))),F(()=>O("production",()=>{Promise.all([I(),z()])}))}renderButton(t,e){return r` 833 <button 834 class="btn ${this.state.active_view===t?"btn--primary":" btn--secondary"}" 835 ?disabled="${this.state.responses.overview===i.PENDING}" 836 @click=${()=>{ct(t),this.loadProductionOverview()}} 837 >${e}</button> 838 `}overviewStatusByView(){switch(this.state.active_view){case s.CARD_PRODUCTION:return p.PPRODUCTION;case s.PIN_LETTER_PRINT:return p.CARD_SENT;case s.ABORTED_PERSONALISATION:return p.PERSONALIZATION_ABORTED;case s.ABORTED_CARD_LETTER:return p.LETTER_PRINT_ABORTED;case s.ABORTED_PIN_LETTER:return p.PIN_LETTER_PRINT_ABORTED;default:return""}}renderContent(){return{[s.CARD_PRODUCTION]:()=>r`<dgn-production-overview></dgn-production-overview>`,[s.ABORTED_PERSONALISATION]:()=>r`<dgn-production-overview></dgn-production-overview>`,[s.ABORTED_CARD_LETTER]:()=>r`<dgn-production-overview></dgn-production-overview>`,[s.ABORTED_PIN_LETTER]:()=>r`<dgn-production-overview></dgn-production-overview>`,[s.PACKSTATION]:()=>r`<dgn-production-packstation></dgn-production-packstation>`,[s.PIN_LETTER_PRINT]:()=>r`<dgn-production-overview></dgn-production-overview>`,[s.REPRINT]:()=>r`<dgn-production-reprint></dgn-production-reprint>
838`,[s.SMB_ERRORED]:()=>r`<dgn-production-smb-errorr></dgn-production-smb-errorr>`,[s.PIN_LETTER_HISTORY]:()=>r`<dgn-pin-letter-history></dgn-pin-letter-history>`}[this.state.active_view]()}}customElements.define("dgn-production",Et);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.