2023-01-07 22:07:15 +01:00
"use strict" ;
2023-05-24 18:15:23 +02:00
( self [ "webpackChunk" ] = self [ "webpackChunk" ] || [ ] ) . push ( [ [ "app" ] , {
2023-01-07 22:07:15 +01:00
/***/ "./assets/app.js" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / assets / app . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony import */ var core _js _modules _web _timers _js _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/web.timers.js */ "./node_modules/core-js/modules/web.timers.js" ) ;
/* harmony import */ var core _js _modules _web _timers _js _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _web _timers _js _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
/* harmony import */ var jquery _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( /*! jquery */ "./node_modules/jquery/dist/jquery.js" ) ;
/* harmony import */ var jquery _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( jquery _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
2023-01-09 16:40:55 +01:00
/* harmony import */ var _js _getCodeBarre _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( /*! ./js/getCodeBarre */ "./assets/js/getCodeBarre.js" ) ;
2023-01-07 22:07:15 +01:00
/* provided dependency */ var $ = _ _webpack _require _ _ ( /*! jquery */ "./node_modules/jquery/dist/jquery.js" ) ;
/ *
* Welcome to your app ' s main JavaScript file !
*
* We recommend including the built version of this JavaScript file
* ( and its CSS file ) in your base layout ( base . html . twig ) .
* /
// any CSS you import will output into a single css file (app.css in this case)
// start the Stimulus application
$ ( document ) . ready ( function ( ) {
setTimeout ( function ( ) {
// utils.init();
2023-01-09 16:40:55 +01:00
_js _getCodeBarre _ _WEBPACK _IMPORTED _MODULE _2 _ _ [ "default" ] . init ( ) ;
2023-01-07 22:07:15 +01:00
} , 200 ) ;
} ) ;
/***/ } ) ,
/***/ "./assets/js/getCodeBarre.js" :
/ * ! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ! * \
! * * * . / assets / js / getCodeBarre . js * * * !
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
/***/ ( ( _ _unused _webpack _module , _ _webpack _exports _ _ , _ _webpack _require _ _ ) => {
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
/* harmony export */ _ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
/* harmony export */ "default" : ( ) => ( /* binding */ GetEvent )
/* harmony export */ } ) ;
/* harmony import */ var core _js _modules _es _date _to _string _js _ _WEBPACK _IMPORTED _MODULE _0 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.date.to-string.js */ "./node_modules/core-js/modules/es.date.to-string.js" ) ;
/* harmony import */ var core _js _modules _es _date _to _string _js _ _WEBPACK _IMPORTED _MODULE _0 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _date _to _string _js _ _WEBPACK _IMPORTED _MODULE _0 _ _ ) ;
2023-05-24 18:15:23 +02:00
/* harmony import */ var core _js _modules _es _array _for _each _js _ _WEBPACK _IMPORTED _MODULE _1 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.array.for-each.js */ "./node_modules/core-js/modules/es.array.for-each.js" ) ;
/* harmony import */ var core _js _modules _es _array _for _each _js _ _WEBPACK _IMPORTED _MODULE _1 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _array _for _each _js _ _WEBPACK _IMPORTED _MODULE _1 _ _ ) ;
/* harmony import */ var core _js _modules _es _object _to _string _js _ _WEBPACK _IMPORTED _MODULE _2 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js" ) ;
/* harmony import */ var core _js _modules _es _object _to _string _js _ _WEBPACK _IMPORTED _MODULE _2 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _object _to _string _js _ _WEBPACK _IMPORTED _MODULE _2 _ _ ) ;
/* harmony import */ var core _js _modules _web _dom _collections _for _each _js _ _WEBPACK _IMPORTED _MODULE _3 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/web.dom-collections.for-each.js */ "./node_modules/core-js/modules/web.dom-collections.for-each.js" ) ;
/* harmony import */ var core _js _modules _web _dom _collections _for _each _js _ _WEBPACK _IMPORTED _MODULE _3 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _web _dom _collections _for _each _js _ _WEBPACK _IMPORTED _MODULE _3 _ _ ) ;
/* harmony import */ var core _js _modules _web _timers _js _ _WEBPACK _IMPORTED _MODULE _4 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/web.timers.js */ "./node_modules/core-js/modules/web.timers.js" ) ;
/* harmony import */ var core _js _modules _web _timers _js _ _WEBPACK _IMPORTED _MODULE _4 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _web _timers _js _ _WEBPACK _IMPORTED _MODULE _4 _ _ ) ;
/* harmony import */ var core _js _modules _es _object _define _property _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.object.define-property.js */ "./node_modules/core-js/modules/es.object.define-property.js" ) ;
/* harmony import */ var core _js _modules _es _object _define _property _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _object _define _property _js _ _WEBPACK _IMPORTED _MODULE _5 _ _ ) ;
/* harmony import */ var core _js _modules _es _error _cause _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.error.cause.js */ "./node_modules/core-js/modules/es.error.cause.js" ) ;
/* harmony import */ var core _js _modules _es _error _cause _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _error _cause _js _ _WEBPACK _IMPORTED _MODULE _6 _ _ ) ;
/* harmony import */ var core _js _modules _es _error _to _string _js _ _WEBPACK _IMPORTED _MODULE _7 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.error.to-string.js */ "./node_modules/core-js/modules/es.error.to-string.js" ) ;
/* harmony import */ var core _js _modules _es _error _to _string _js _ _WEBPACK _IMPORTED _MODULE _7 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _error _to _string _js _ _WEBPACK _IMPORTED _MODULE _7 _ _ ) ;
/* harmony import */ var core _js _modules _es _array _is _array _js _ _WEBPACK _IMPORTED _MODULE _8 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.array.is-array.js */ "./node_modules/core-js/modules/es.array.is-array.js" ) ;
/* harmony import */ var core _js _modules _es _array _is _array _js _ _WEBPACK _IMPORTED _MODULE _8 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _array _is _array _js _ _WEBPACK _IMPORTED _MODULE _8 _ _ ) ;
/* harmony import */ var core _js _modules _es _symbol _js _ _WEBPACK _IMPORTED _MODULE _9 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.symbol.js */ "./node_modules/core-js/modules/es.symbol.js" ) ;
/* harmony import */ var core _js _modules _es _symbol _js _ _WEBPACK _IMPORTED _MODULE _9 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _symbol _js _ _WEBPACK _IMPORTED _MODULE _9 _ _ ) ;
/* harmony import */ var core _js _modules _es _symbol _description _js _ _WEBPACK _IMPORTED _MODULE _10 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.symbol.description.js */ "./node_modules/core-js/modules/es.symbol.description.js" ) ;
/* harmony import */ var core _js _modules _es _symbol _description _js _ _WEBPACK _IMPORTED _MODULE _10 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _symbol _description _js _ _WEBPACK _IMPORTED _MODULE _10 _ _ ) ;
/* harmony import */ var core _js _modules _es _symbol _iterator _js _ _WEBPACK _IMPORTED _MODULE _11 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.symbol.iterator.js */ "./node_modules/core-js/modules/es.symbol.iterator.js" ) ;
/* harmony import */ var core _js _modules _es _symbol _iterator _js _ _WEBPACK _IMPORTED _MODULE _11 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _symbol _iterator _js _ _WEBPACK _IMPORTED _MODULE _11 _ _ ) ;
/* harmony import */ var core _js _modules _es _array _iterator _js _ _WEBPACK _IMPORTED _MODULE _12 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js" ) ;
/* harmony import */ var core _js _modules _es _array _iterator _js _ _WEBPACK _IMPORTED _MODULE _12 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _array _iterator _js _ _WEBPACK _IMPORTED _MODULE _12 _ _ ) ;
/* harmony import */ var core _js _modules _es _string _iterator _js _ _WEBPACK _IMPORTED _MODULE _13 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js" ) ;
/* harmony import */ var core _js _modules _es _string _iterator _js _ _WEBPACK _IMPORTED _MODULE _13 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _string _iterator _js _ _WEBPACK _IMPORTED _MODULE _13 _ _ ) ;
/* harmony import */ var core _js _modules _web _dom _collections _iterator _js _ _WEBPACK _IMPORTED _MODULE _14 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js" ) ;
/* harmony import */ var core _js _modules _web _dom _collections _iterator _js _ _WEBPACK _IMPORTED _MODULE _14 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _web _dom _collections _iterator _js _ _WEBPACK _IMPORTED _MODULE _14 _ _ ) ;
/* harmony import */ var core _js _modules _es _array _from _js _ _WEBPACK _IMPORTED _MODULE _15 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.array.from.js */ "./node_modules/core-js/modules/es.array.from.js" ) ;
/* harmony import */ var core _js _modules _es _array _from _js _ _WEBPACK _IMPORTED _MODULE _15 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _array _from _js _ _WEBPACK _IMPORTED _MODULE _15 _ _ ) ;
/* harmony import */ var core _js _modules _es _array _slice _js _ _WEBPACK _IMPORTED _MODULE _16 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.array.slice.js */ "./node_modules/core-js/modules/es.array.slice.js" ) ;
/* harmony import */ var core _js _modules _es _array _slice _js _ _WEBPACK _IMPORTED _MODULE _16 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _array _slice _js _ _WEBPACK _IMPORTED _MODULE _16 _ _ ) ;
/* harmony import */ var core _js _modules _es _function _name _js _ _WEBPACK _IMPORTED _MODULE _17 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.function.name.js */ "./node_modules/core-js/modules/es.function.name.js" ) ;
/* harmony import */ var core _js _modules _es _function _name _js _ _WEBPACK _IMPORTED _MODULE _17 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _function _name _js _ _WEBPACK _IMPORTED _MODULE _17 _ _ ) ;
/* harmony import */ var core _js _modules _es _regexp _exec _js _ _WEBPACK _IMPORTED _MODULE _18 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js" ) ;
/* harmony import */ var core _js _modules _es _regexp _exec _js _ _WEBPACK _IMPORTED _MODULE _18 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _regexp _exec _js _ _WEBPACK _IMPORTED _MODULE _18 _ _ ) ;
/* harmony import */ var core _js _modules _es _regexp _test _js _ _WEBPACK _IMPORTED _MODULE _19 _ _ = _ _webpack _require _ _ ( /*! core-js/modules/es.regexp.test.js */ "./node_modules/core-js/modules/es.regexp.test.js" ) ;
/* harmony import */ var core _js _modules _es _regexp _test _js _ _WEBPACK _IMPORTED _MODULE _19 _ _ _default = /*#__PURE__*/ _ _webpack _require _ _ . n ( core _js _modules _es _regexp _test _js _ _WEBPACK _IMPORTED _MODULE _19 _ _ ) ;
2023-01-07 22:07:15 +01:00
/* provided dependency */ var $ = _ _webpack _require _ _ ( /*! jquery */ "./node_modules/jquery/dist/jquery.js" ) ;
2023-05-24 18:15:23 +02:00
function _toConsumableArray ( arr ) { return _arrayWithoutHoles ( arr ) || _iterableToArray ( arr ) || _unsupportedIterableToArray ( arr ) || _nonIterableSpread ( ) ; }
function _nonIterableSpread ( ) { throw new TypeError ( "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ; }
function _unsupportedIterableToArray ( o , minLen ) { if ( ! o ) return ; if ( typeof o === "string" ) return _arrayLikeToArray ( o , minLen ) ; var n = Object . prototype . toString . call ( o ) . slice ( 8 , - 1 ) ; if ( n === "Object" && o . constructor ) n = o . constructor . name ; if ( n === "Map" || n === "Set" ) return Array . from ( o ) ; if ( n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ . test ( n ) ) return _arrayLikeToArray ( o , minLen ) ; }
function _iterableToArray ( iter ) { if ( typeof Symbol !== "undefined" && iter [ Symbol . iterator ] != null || iter [ "@@iterator" ] != null ) return Array . from ( iter ) ; }
function _arrayWithoutHoles ( arr ) { if ( Array . isArray ( arr ) ) return _arrayLikeToArray ( arr ) ; }
function _arrayLikeToArray ( arr , len ) { if ( len == null || len > arr . length ) len = arr . length ; for ( var i = 0 , arr2 = new Array ( len ) ; i < len ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; }
2023-01-07 22:07:15 +01:00
function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
function _defineProperties ( target , props ) { for ( var i = 0 ; i < props . length ; i ++ ) { var descriptor = props [ i ] ; descriptor . enumerable = descriptor . enumerable || false ; descriptor . configurable = true ; if ( "value" in descriptor ) descriptor . writable = true ; Object . defineProperty ( target , descriptor . key , descriptor ) ; } }
function _createClass ( Constructor , protoProps , staticProps ) { if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ; if ( staticProps ) _defineProperties ( Constructor , staticProps ) ; Object . defineProperty ( Constructor , "prototype" , { writable : false } ) ; return Constructor ; }
var GetEvent = /*#__PURE__*/ function ( ) {
function GetEvent ( ) {
_classCallCheck ( this , GetEvent ) ;
}
_createClass ( GetEvent , null , [ {
key : "init" ,
value : function init ( ) {
this . getEvent ( ) ;
}
} , {
key : "getEvent" ,
value : function getEvent ( ) {
var saisie = $ ( '#saisie' ) ;
saisie . focus ( ) ;
var value ;
var $info = $ ( '.info' ) ;
var $infoDon = $ ( '#info-don' ) ;
var $infoDonneur = $ ( '#info-donneur' ) ;
var $infoPsl = $ ( '#info-psl' ) ;
var $don = $ ( '#don' ) ;
var $nom = $ ( '#nom' ) ;
var $prenom = $ ( '#prenom' ) ;
var $naissance = $ ( '#naissance' ) ;
var $typeDon = $ ( '#typeDon' ) ;
var $typePoche = $ ( '#typePoche' ) ;
var $nbreTube = $ ( '#nbreTube' ) ;
var $step = $ ( '#step' ) ;
var $indication = $ ( '#indication' ) ;
var $evolution = $ ( '#evolution' ) ;
var $label = $ ( '#label' ) ;
var $type = $ ( '#type' ) ;
var $current = $ ( '#current' ) ;
var $todo = $ ( '#todo' ) ;
var $picturePoche = $ ( '#picturePoche' ) ;
var $pictureTube = $ ( '#pictureTube' ) ;
var $input = $ ( '#inputRange' ) ;
var $displayError = $ ( '.error' ) ;
var $displaySuccess = $ ( '.displaySuccess' ) ;
document . addEventListener ( 'keydown' , function ( event ) {
saisie . focus ( ) ;
if ( event . code == 'Tab' ) {
value = saisie . val ( ) ;
saisie . val ( '' ) ;
$ . ajax ( {
url : '/api/get-code-barre-type' ,
method : "POST" ,
dataType : "json" ,
data : {
'codeBarre' : value
} ,
success : function success ( response ) {
switch ( response . data . step ) {
case '0' :
if ( response . data . status == 'success' ) {
$don . html ( response . data . codeBarre ) ;
$nom . html ( response . data . nom ) ;
$prenom . html ( response . data . prenom ) ;
$naissance . html ( new Date ( response . data . birthdate ) . toLocaleDateString ( ) ) ;
$typeDon . html ( response . data . type _don ) ;
$nbreTube . html ( response . data . nbre _tube ) ;
$step . html ( 'Pour passer à la suite' ) ;
$indication . html ( 'Scannez le DMU' ) ;
$pictureTube . css ( 'display' , 'none' ) ;
$picturePoche . css ( 'display' , 'flex' ) ;
$info . css ( 'visibility' , 'visible' ) ;
saisie . focus ( ) ;
}
if ( response . data . status == 'init' ) {
2023-05-24 18:15:23 +02:00
var pochesImg = $ ( '.sang' ) ;
_toConsumableArray ( pochesImg ) . forEach ( function ( sang ) {
sang . remove ( ) ;
} ) ;
2023-01-07 22:07:15 +01:00
$don . html ( response . data . codeBarre ) ;
$nom . html ( response . data . nom ) ;
$prenom . html ( response . data . prenom ) ;
$naissance . html ( new Date ( response . data . birthdate ) . toLocaleDateString ( ) ) ;
$typeDon . html ( response . data . type _don ) ;
$nbreTube . html ( response . data . nbre _tube ) ;
$step . html ( 'Pour passer à la suite' ) ;
$indication . html ( 'Scannez le DMU' ) ;
$typePoche . html ( '' ) ;
$info . css ( 'visibility' , 'visible' ) ;
$evolution . css ( 'visibility' , 'hidden' ) ;
saisie . focus ( ) ;
}
if ( response . data . status == 'error' ) {
saisie . focus ( ) ;
$displayError . css ( 'display' , "flex" ) ;
setTimeout ( function ( ) {
$displayError . css ( 'display' , 'none' ) ;
} , 5000 ) ;
}
break ;
case '1' :
if ( response . data . status == 'success' ) {
$typePoche . html ( response . data . nbre _poche ) ;
$step . html ( 'ETAPE 1 / 2' ) ;
$indication . html ( 'Scannez les étiquettes des poches' ) ;
saisie . focus ( ) ;
$evolution . css ( 'visibility' , 'visible' ) ;
}
if ( response . data . status == 'error_donneur' ) {
$displayError . html ( 'erreur donneur' ) ;
$displayError . css ( 'display' , "flex" ) ;
setTimeout ( function ( ) {
$displayError . css ( 'display' , 'none' ) ;
} , 5000 ) ;
saisie . focus ( ) ;
}
if ( response . data . status == 'error_doublon' ) {
$displayError . html ( 'erreur doublon' ) ;
$displayError . css ( 'display' , "flex" ) ;
setTimeout ( function ( ) {
$displayError . css ( 'display' , 'none' ) ;
} , 5000 ) ;
saisie . focus ( ) ;
}
case '2' :
if ( response . data . status == 'success' ) {
2023-05-24 18:15:23 +02:00
console . log ( 'step 2 success !!' ) ;
2023-01-07 22:07:15 +01:00
$typePoche . html ( response . data . nbre _poche ) ;
$current . html ( response . data . nbre _poche ) ;
$type . html ( 'Poches' ) ;
$todo . html ( response . data . nbre _poche _max ) ;
$input . attr ( 'max' , response . data . nbre _poche _max ) ;
$input . attr ( 'value' , response . data . nbre _poche ) ;
2023-05-24 18:15:23 +02:00
if ( response . data . nbre _poche != response . data . nbre _poche _max && response . data . nbre _poche != 0 ) {
$picturePoche . append ( '<div class="sang"><img src="/poches/Poche_sang2.png"></div>' ) ;
2023-01-07 22:07:15 +01:00
}
saisie . focus ( ) ;
}
if ( response . data . status == 'final' ) {
$typePoche . html ( response . data . nbre _poche ) ;
$current . html ( response . data . nbre _poche ) ;
$input . attr ( 'max' , response . data . nbre _poche _max ) ;
$input . attr ( 'value' , response . data . nbre _poche ) ;
2023-05-24 18:15:23 +02:00
$indication . html ( 'validez avec un scan de poche!' ) ;
$picturePoche . append ( '<div class="sang"><img src="/poches/Poche_sang2.png"></div>' ) ;
2023-01-07 22:07:15 +01:00
saisie . focus ( ) ;
}
if ( response . data . status == 'error_scan' ) {
$displayError . html ( "Mauvais type d'étiquette" ) ;
$displayError . css ( 'display' , "flex" ) ;
setTimeout ( function ( ) {
$displayError . css ( 'display' , 'none' ) ;
} , 5000 ) ;
saisie . focus ( ) ;
}
if ( response . data . status == 'error_doublon' ) {
$displayError . html ( 'Etiquette déjà scannée' ) ;
$displayError . css ( 'display' , "flex" ) ;
setTimeout ( function ( ) {
$displayError . css ( 'display' , 'none' ) ;
} , 5000 ) ;
saisie . focus ( ) ;
}
if ( response . data . status == 'error_donneur' ) {
$displayError . html ( 'Ne correspond pas au donneur' ) ;
$displayError . css ( 'display' , "flex" ) ;
setTimeout ( function ( ) {
$displayError . css ( 'display' , 'none' ) ;
} , 5000 ) ;
saisie . focus ( ) ;
}
break ;
case '3' :
if ( response . data . status == "success" ) {
$picturePoche . css ( 'display' , 'none' ) ;
2023-05-24 18:15:23 +02:00
var _pochesImg = $ ( '.sang' ) ;
_toConsumableArray ( _pochesImg ) . forEach ( function ( sang ) {
sang . remove ( ) ;
} ) ;
2023-01-07 22:07:15 +01:00
$pictureTube . css ( 'display' , 'flex' ) ;
$indication . html ( 'Scannez les étiquettes de tubes!' ) ;
$input . attr ( 'max' , response . data . nbre _tube _max ) ;
$todo . html ( response . data . nbre _tube _max ) ;
2023-05-24 18:15:23 +02:00
$input . attr ( 'value' , 0 ) ;
$current . html ( 0 ) ;
2023-01-07 22:07:15 +01:00
$type . html ( 'Tubes' ) ;
}
if ( response . data . status == "error_scan" ) {
$displayError . html ( "Mauvais type d'étiquette" ) ;
$displayError . css ( 'display' , "flex" ) ;
setTimeout ( function ( ) {
$displayError . css ( 'display' , 'none' ) ;
} , 5000 ) ;
}
break ;
case '4' :
if ( response . data . status == 'success' ) {
$step . html ( 'ETAPE 2 / 2' ) ;
$nbreTube . html ( response . data . nbre _tube ) ;
$current . html ( response . data . nbre _tube ) ;
$input . attr ( 'max' , response . data . nbre _tube _max ) ;
$type . html ( 'Tubes' ) ;
$todo . html ( response . data . nbre _tube _max ) ;
$input . attr ( 'value' , response . data . nbre _tube ) ;
2023-05-24 18:15:23 +02:00
console . log ( response . data . nbre _tube ) ;
$pictureTube . append ( '<div class="sang"><img src="/tubes/Tube' + response . data . nbre _tube + '_check.png"></div>' ) ;
2023-01-07 22:07:15 +01:00
saisie . focus ( ) ;
}
if ( response . data . status == 'final' ) {
$nbreTube . html ( response . data . nbre _tube ) ;
2023-05-24 18:15:23 +02:00
$current . html ( response . data . nbre _tube _max ) ;
2023-01-07 22:07:15 +01:00
$input . attr ( 'max' , response . data . nbre _tube _max ) ;
$type . html ( 'Tubes' ) ;
$todo . html ( response . data . nbre _tube _max ) ;
$input . attr ( 'value' , response . data . nbre _tube ) ;
2023-05-24 18:15:23 +02:00
$pictureTube . append ( '<div class="sang"><img src="/tubes/Tube' + response . data . nbre _tube + '_check.png"></div>' ) ;
$displaySuccess . html ( 'Patient ' + response . data . prenom + ' ' + response . data . nom + ' traité avec succès' ) ;
2023-01-07 22:07:15 +01:00
$displaySuccess . css ( 'display' , 'flex' ) ;
setTimeout ( function ( ) {
2023-05-24 18:15:23 +02:00
location . reload ( ) ;
2023-01-07 22:07:15 +01:00
$displaySuccess . css ( 'display' , 'none' ) ;
} , 5000 ) ;
saisie . focus ( ) ;
}
if ( response . data . status == 'error_scan' ) {
$displayError . html ( "Mauvais type d'étiquette" ) ;
$displayError . css ( 'display' , "flex" ) ;
setTimeout ( function ( ) {
$displayError . css ( 'display' , 'none' ) ;
} , 5000 ) ;
saisie . focus ( ) ;
}
if ( response . data . status == 'error_doublon' ) {
$displayError . html ( 'Etiquette déjà scannée' ) ;
$displayError . css ( 'display' , "flex" ) ;
setTimeout ( function ( ) {
$displayError . css ( 'display' , 'none' ) ;
} , 5000 ) ;
saisie . focus ( ) ;
}
if ( response . data . status == 'error_donneur' ) {
$displayError . html ( 'Ne correspond pas au donneur' ) ;
$displayError . css ( 'display' , "flex" ) ;
setTimeout ( function ( ) {
$displayError . css ( 'display' , 'none' ) ;
} , 5000 ) ;
saisie . focus ( ) ;
}
break ;
}
}
} ) ;
}
} ) ;
}
} ] ) ;
return GetEvent ;
} ( ) ;
/***/ } )
} ,
/******/ _ _webpack _require _ _ => { // webpackRuntimeModules
/******/ var _ _webpack _exec _ _ = ( moduleId ) => ( _ _webpack _require _ _ ( _ _webpack _require _ _ . s = moduleId ) )
2023-05-24 18:15:23 +02:00
/******/ _ _webpack _require _ _ . O ( 0 , [ "vendors-node_modules_core-js_modules_es_array_for-each_js-node_modules_core-js_modules_es_arr-9c7bdc" ] , ( ) => ( _ _webpack _exec _ _ ( "./assets/app.js" ) ) ) ;
2023-01-07 22:07:15 +01:00
/******/ var _ _webpack _exports _ _ = _ _webpack _require _ _ . O ( ) ;
/******/ }
] ) ;
2023-05-24 18:15:23 +02:00
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ2dCO0FBQ2hCO0FBQ3lDO0FBRXpDQyxDQUFDLENBQUNDLFFBQVEsQ0FBQyxDQUFDQyxLQUFLLENBQUMsWUFBSTtFQUNsQkMsVUFBVSxDQUFDLFlBQUk7SUFDWDtJQUNBSiw2REFBYSxFQUFFO0VBRW5CLENBQUMsRUFBRSxHQUFHLENBQUM7QUFDWCxDQUFDLENBQUM7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQ2xCbUJBLFFBQVE7RUFBQTtJQUFBO0VBQUE7RUFBQTtJQUFBO0lBQUEsT0FDekIsZ0JBQWE7TUFDVCxJQUFJLENBQUNNLFFBQVEsRUFBRTtJQUNuQjtF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