1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932 |
- import {
- Component,
- OnInit,
- TemplateRef,
- ViewChild,
- ElementRef,
- HostListener,
- } from "@angular/core";
- import { FormBuilder, FormGroup, Validators } from "@angular/forms";
- import { Router, ActivatedRoute } from "@angular/router";
- import { MainService } from "../../services/main.service";
- import { WebsocketPhoneService } from "../../services/websocket-phone.service";
- import { WebsocketSerService } from "../../services/websocket-ser.service";
- import http from "../../../assets/js/http";
- import { NzMessageService } from "ng-zorro-antd/message";
- import { NzNotificationService } from "ng-zorro-antd/notification";
- import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
- import { Subject, forkJoin } from "rxjs";
- import { debounceTime, filter, map } from "rxjs/operators";
- import { SourceId } from "src/app/type/types";
- import { ToolService } from 'src/app/services/tool.service';
- import { addDays, differenceInCalendarDays, getHours, getMinutes, setMinutes, parse, format, addHours, startOfDay, endOfDay } from 'date-fns';
- import { UploadFile } from 'ng-zorro-antd';
- import { HttpRequest, HttpClient, HttpResponse } from '@angular/common/http';
- import cloneDeep from 'lodash-es/cloneDeep'
- import { WebsocketIncomingService } from 'src/app/services/websocket-incoming.service';
- declare const tlwsa: any;
- declare const TLWSA: any;
- function range(start: number, end: number): number[] {
- const result: number[] = [];
- for (let i = start; i < end; i++) {
- result.push(i);
- }
- return result;
- }
- @Component({
- selector: "app-fuwutai",
- templateUrl: "./fuwutai.component.html",
- styleUrls: ["./fuwutai.component.less"],
- })
- export class FuwutaiComponent implements OnInit {
- @ViewChild('printBtn', { static: false }) printBtn: ElementRef<HTMLElement>;
- @ViewChild("remarksEle", { static: false }) remarksEle: ElementRef;
- @ViewChild("tabs", { static: false }) tabs: ElementRef;
- @ViewChild("tab", { static: false }) elementView: ElementRef;
- @ViewChild("osComponentRef7", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef7: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef8", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef8: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef9", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef9: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef10", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef10: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef11", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef11: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef12", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef12: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef13", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef13: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef14", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef14: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef15", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef15: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef16", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef16: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef17", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef17: OverlayScrollbarsComponent;
- constructor(
- private fb: FormBuilder,
- public router: Router,
- private mainService: MainService,
- private msg: NzMessageService,
- private notification: NzNotificationService,
- private phones: WebsocketPhoneService,
- private sers: WebsocketSerService,
- private tool: ToolService,
- private http: HttpClient,
- public route: ActivatedRoute,
- public incomingService: WebsocketIncomingService,
- ) {
-
- this.phones.getDataUpdate().subscribe(data => {
- this.websocketLoading = data;
- });
- }
- validateFormZy!: FormGroup;
- validateFormQt!: FormGroup;
-
- noWorkerPhone = false;
- patientList;
- isLoading: Boolean = false;
- disX = 0;
- disStep = 0;
- applicationDepartmentList = [];
- callNumber = "";
- workTypes = [];
- workTypesArrange = [];
- workTypesFlag = false;
- currentTabIndex = "";
- radioValueZy: any = "";
- radioValueZyPre: any = "";
- deptZyList: any = {};
- startDeptZy = "";
- endDeptZy = "";
- patientZy = "";
- radioValueQt: any = "";
- deptQtList: any = {};
- startDeptQt = "";
- endDeptQt = "";
- workOrderRemark = "";
- workOrderRemarkZy = "";
-
- newOrderShow = false;
- newOrderShowOpen = false;
- isOkLoading = false;
- applyDept;
- applyDeptMiddle;
- taskBuild;
- residenceNo;
- targetDept;
- noArrives = [];
- newLoading = false;
-
- changeInpSubject = new Subject();
- changeCommonInpSubject = new Subject();
- onSearchTaskBuildSubject = new Subject();
- searchHosDepartmentSubject = new Subject();
- searchHosDepartmentQtSubject = new Subject();
- searchPatientListSubject = new Subject();
- inspectSubject = new Subject();
-
- incidentModel:any = {};
- incidentMsg:any = {};
-
- coopBtns: any = {};
-
- isShowNucleicAcidPrinting = false;
- getHospitalConfigList(key) {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- let postData = { idx: 0, sum: 1, hospitalConfig: { hosId: this.checkedHos, key } };
- this.mainService.getFetchDataList("simple/data", "hospitalConfig", postData).subscribe(result=>{
- if(result.status == 200){
- this.isShowNucleicAcidPrinting = result.list[0].value == 1;
- }else{
- this.isShowNucleicAcidPrinting = false;
- }
- });
- }
-
- openChangeUnassignedBuilding(e) {
- if (e) {
- this.getUnassignedBuilding();
- }
- }
-
- unassignedBuildings = [];
- unassignedBuilding = [];
- bLoading = false;
- getUnassignedBuilding() {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- let postData: any = {
- hosId: this.checkedHos,
- unassignedOder: 1,
- };
- if (this.allUnassignedOrders) {
- postData.wokerIds = this.allUnassignedOrders;
- }
- this.bLoading = true;
- this.mainService
- .coopData("getBuildingOrFloor", "building", postData)
- .subscribe((result) => {
- this.bLoading = false;
- if (result.status == 200) {
- this.unassignedBuildings = result.data;
- }
- });
- }
- allUnassignedOrders = "";
- b2Loading = false;
- getUnassignedBuilding2() {
- if (this.user.user.scope) {
- this.user.user.scope.typeIds = this.user.user.scope.typeIds || [];
- } else {
- return;
- }
- let types = "";
- this.user.user.scope.typeIds.forEach((e) => {
- types += e.id + ",";
- });
- types = types.slice(0, types.length - 1);
- let postData = {
- workOrder: {
- serTaskTypes: types || undefined,
- serGdState: 1,
- range: this.orderScopeRadio,
- platform: 3,
- searchDays: 1,
- keyWord: "",
- },
- idx: 0,
- sum: 9999,
- };
- this.b2Loading = true;
- this.mainService
- .getFetchDataList("ser", "workOrder", postData)
- .subscribe((result) => {
- this.b2Loading = false;
- if (result.status == 200) {
- this.allUnassignedOrders = result.list
- .map((item) => item.id)
- .toString();
- }
- });
-
- }
-
- changeAllUnassignedList(e) {
- this.unassignedList.forEach((v) => (v.checked = e));
- this.unassignedList.forEach((item1) => {
- this.unassignedListClone.forEach((item2) => {
- if (item1.data.id == item2.data.id) {
- item2.checked = item1.checked;
- }
- });
- });
- this.batchType = this.unassignedListClone.some((item) => item.checked);
- }
-
- changeAllArriveList(e) {
- this.arriveList.forEach((v) => (v.checked = e));
- this.arriveList.forEach((item1) => {
- this.arriveListClone.forEach((item2) => {
- if (item1.data.id == item2.data.id) {
- item2.checked = item1.checked;
- }
- });
- });
- this.batchType1 = this.arriveListClone.some((item) => item.checked);
- }
-
- addRemarks(item) {
- this.remarksEle.nativeElement.focus();
- this.workOrderRemark += item;
- }
-
- batchType = false;
- batchDispatch() {
- let ids_types = [];
- let stateIds = [];
- this.unassignedList.forEach((item) => {
- if (item.checked) {
- if (item.data.gdState.value == 2) {
-
- ids_types.push(`${item.data.id}_assign`);
- } else if (!item.data.worker && item.data.gdState.value != 2) {
- ids_types.push(`${item.data.id}_reassign`);
- }
- stateIds.push(item.data.gdState.id);
- }
- });
- this.router.navigateByUrl(
- "dispatchingDesk/allotWorker/" +
- ids_types.join("-") +
- "/" +
- stateIds.join("-") +
- "/2/" +
- this.checkedHos
- );
- }
-
- batchType1 = false;
- batchClickType1 = false;
- batchWithdrawal() {
- this.batchClickType1 = true;
- let ids = [];
- this.arriveList.forEach((item) => {
- if (item.checked) {
- ids.push(item.data.id);
- }
- });
- this.openRecallModal(ids.join("-"));
- }
-
- allUnassignedList = false;
- batchDispatchSelect(e, id, event?) {
- event && event.stopPropagation();
- this.unassignedList.forEach((item) => {
- if (item.data.id == id) {
- item.checked = e;
- }
- });
- this.unassignedList.forEach((item1) => {
- this.unassignedListClone.forEach((item2) => {
- if (item1.data.id == item2.data.id) {
- item2.checked = item1.checked;
- }
- });
- });
- this.batchType = this.unassignedListClone.some((item) => item.checked);
- if (this.unassignedListClone.length) {
- this.allUnassignedList = this.unassignedListClone.every(
- (item) => item.checked
- );
- } else {
- this.allUnassignedList = false;
- }
- }
-
- allArriveList = false;
- batchWithdrawalSelect(e, id, event?) {
- event && event.stopPropagation();
- this.arriveList.forEach((item) => {
- if (item.data.id == id) {
- item.checked = e;
- }
- });
- this.arriveList.forEach((item1) => {
- this.arriveListClone.forEach((item2) => {
- if (item1.data.id == item2.data.id) {
- item2.checked = item1.checked;
- }
- });
- });
- this.batchType1 = this.arriveListClone.some((item) => item.checked);
- if (this.arriveListClone.length) {
- this.allArriveList = this.arriveListClone.every((item) => item.checked);
- } else {
- this.allArriveList = false;
- }
- }
-
- applyStartDept;
-
- submitFormZy(go?): void {
- let newOrderShowFlag = true;
- for (const i in this.validateFormZy.controls) {
- this.validateFormZy.controls[i].markAsDirty();
- this.validateFormZy.controls[i].updateValueAndValidity();
- if (this.validateFormZy.controls[i].valid === false && i !== "goods") {
-
-
- newOrderShowFlag = false;
- }
- if (!this.validateFormZy.controls[i].valid) {
- this.isOkLoading = false;
- this.isGoLoading = false;
- }
- }
- if (newOrderShowFlag) {
- let goods = this.validateFormZy.controls.goods.value
- ? this.validateFormZy.controls.goods.value.filter(
- (item) => item.checked === true
- )
- : [];
- goods = goods.map((current) => current.value).join();
-
- let yyTime1;
- if(this.isYyInspect && this.currentTabIndex == '患者转运'){
- let yyDateZy = (typeof this.yyDateZy === 'object') ? new Date(this.yyDateZy) : parse(this.yyDateZy, 'yyyy-MM-dd HH:mm:ss', new Date());
- let yyTimeZy = (typeof this.yyTimeZy === 'object') ? new Date(this.yyTimeZy) : parse(this.yyTimeZy, 'yyyy-MM-dd HH:mm:ss', new Date());
- yyTime1 = format(yyDateZy, "yyyy-MM-dd") + " " + format(yyTimeZy, "HH:mm") + ":00";
- }
- let postData = {
- workOrder: {
- yyTime: yyTime1,
- sourceId: SourceId.fuwutai,
- taskType: {
- id: this.validateFormZy.controls.taskType.value,
- },
- startDept: {
- id: this.validateFormZy.controls.startDept.value,
- },
- createDept: this.applyDept,
- endDepts: [
- {
- id: this.validateFormZy.controls.endDepts.value,
- },
- ],
- patient: {
- patientCode: this.validateFormZy.controls.patient.value,
- },
- goods: goods,
- workOrderRemark: this.validateFormZy.controls.workOrderRemarkZy.value,
- },
- };
- if (!this.noWorkerPhone) {
- postData.workOrder["workOrderPhone"] = this.callNumber;
- }
- this.mainService.buildOrder(postData).subscribe((data) => {
- console.log(data);
- this.isOkLoading = false;
- this.isGoLoading = false;
- if (data["status"] == 200) {
- this.newOrderShow = false;
- if (go === "&go&") {
- this.applyDept = data["startDept"].id;
- this.applyStartDept = data["startDept"];
- this.incidentModel.incomingPhone = this.callNumber = this.incidentModel.contactsInformation = data["phone"];
- this.showPromptModal("建单", true, "", "closeGo");
- } else {
- if(this.incomingService.getSign() === 'callCenter' && this.incomingService.getPhoneNumber()){
- this.jry_shixian();
- }
- this.showPromptModal("建单", true, "", "close");
- }
- } else {
- this.showPromptModal("建单", false, data["msg"]);
- }
- });
- }
- }
-
- submitFormInspect(go?): void {
- let newOrderShowFlag = true;
- for (const i in this.validateFormZy.controls) {
- this.validateFormZy.controls[i].markAsDirty();
- this.validateFormZy.controls[i].updateValueAndValidity();
- if (this.validateFormZy.controls[i].valid === false && i !== "goods") {
-
-
- newOrderShowFlag = false;
- }
- if (!this.validateFormZy.controls[i].valid) {
- this.isOkLoading = false;
- this.isGoLoading = false;
- }
- }
- if (newOrderShowFlag) {
- let goods = this.validateFormZy.controls.goods.value ? this.validateFormZy.controls.goods.value.filter((item) => item.checked === true) : [];
- goods = goods.map((current) => current.value).join();
-
- let yyTime1;
- if(this.isYyInspect && this.currentTabIndex == '患者转运'){
- let yyDateZy = (typeof this.yyDateZy === 'object') ? new Date(this.yyDateZy) : parse(this.yyDateZy, 'yyyy-MM-dd HH:mm:ss', new Date());
- let yyTimeZy = (typeof this.yyTimeZy === 'object') ? new Date(this.yyTimeZy) : parse(this.yyTimeZy, 'yyyy-MM-dd HH:mm:ss', new Date());
- yyTime1 = format(yyDateZy, "yyyy-MM-dd") + " " + format(yyTimeZy, "HH:mm") + ":00";
- }
- let postData: any = {
- workOrder: {
- yyTime: yyTime1,
- sourceId: SourceId.fuwutai,
- taskType: { id: this.validateFormZy.controls.taskType.value },
- startDept: { id: this.applyDept },
-
- createDept: this.applyDept,
- patient: {
- patientCode: this.validateFormZy.controls.patient.value,
- },
- goods,
- workOrderRemark: this.validateFormZy.controls.workOrderRemarkZy.value,
- },
- };
- postData.workOrder.taskType.isHalfInspect = this.currentTasktype.isHalfInspect === 1 ? 1 : 0;
- let checkedArr = [];
- if (this.linkCheckLis && this.linkCheckLis.length) {
- this.linkCheckLis.forEach((e) => {
- if (e.checked) {
- checkedArr.push({ id: e.value });
- }
- });
- }
- postData.workOrder["checkList"] = checkedArr;
- postData.workOrder.isAccompany = 0;
- if (!this.noWorkerPhone) {
- postData.workOrder["workOrderPhone"] = this.callNumber;
- }
- this.mainService.buildOrder(postData).subscribe((data) => {
- console.log(data);
- this.isOkLoading = false;
- this.isGoLoading = false;
- if (data["status"] == 200) {
- this.newOrderShow = false;
- if (go === "&go&") {
- this.applyDept = data["startDept"].id;
- this.applyStartDept = data["startDept"];
- this.incidentModel.incomingPhone = this.callNumber = this.incidentModel.contactsInformation = data["phone"];
- this.showPromptModal("建单", true, "", "closeGo");
- } else {
- if(this.incomingService.getSign() === 'callCenter' && this.incomingService.getPhoneNumber()){
- this.jry_shixian();
- }
- this.showPromptModal("建单", true, "", "close");
- }
- } else if(data["status"] == 100042){
- this.newOrderShow = false;
- this.showPromptModal("建单", false, data["msg"]);
- } else {
- this.showPromptModal("建单", false, data["msg"]);
- }
- });
- }
- }
-
- submitFormBbps(go?) {
- let postData = {
- workOrder: {
- workOrderRemark: this.validateFormQt.controls.workOrderRemark.value,
- sourceId: SourceId.fuwutai,
- taskType: {
- id: this.validateFormQt.controls.taskTypeQt.value,
- },
- startDept: {
- id: this.applyDept,
- },
- },
- };
- if (!this.noWorkerPhone) {
- postData.workOrder["workOrderPhone"] = this.callNumber;
- }
- this.mainService.buildOrder(postData).subscribe((data) => {
- this.isOkLoading = false;
- this.isGoLoading = false;
- if (data["status"] == 200) {
- this.newOrderShow = false;
- if (go === "&go&") {
- this.applyDept = data["startDept"].id;
- this.applyStartDept = data["startDept"];
- this.incidentModel.incomingPhone = this.callNumber = this.incidentModel.contactsInformation = data["phone"];
- this.showPromptModal("建单", true, "", "closeGo");
- } else {
- if(this.incomingService.getSign() === 'callCenter' && this.incomingService.getPhoneNumber()){
- this.jry_shixian();
- }
- this.showPromptModal("建单", true, "", "close");
- }
- } else {
- this.showPromptModal("建单", false, data["msg"]);
- }
- });
- }
-
- submitFormQt(go?) {
- for (const i in this.validateFormQt.controls) {
- this.validateFormQt.controls[i].markAsDirty();
- this.validateFormQt.controls[i].updateValueAndValidity();
- if (!this.validateFormQt.controls[i].valid) {
- this.isOkLoading = false;
- this.isGoLoading = false;
- return;
- }
- }
-
- let yyTime1;
- if(this.isYyInspect && this.currentTabIndex == '物品配送'){
- let yyDate = (typeof this.yyDate === 'object') ? new Date(this.yyDate) : parse(this.yyDate, 'yyyy-MM-dd HH:mm:ss', new Date());
- let yyTime = (typeof this.yyTime === 'object') ? new Date(this.yyTime) : parse(this.yyTime, 'yyyy-MM-dd HH:mm:ss', new Date());
- yyTime1 = format(yyDate, "yyyy-MM-dd") + " " + format(yyTime, "HH:mm") + ":00";
- }
- let postData = {
- workOrder: {
- yyTime: yyTime1,
- sourceId: SourceId.fuwutai,
- workOrderRemark: this.validateFormQt.controls.workOrderRemark.value,
- taskType: {
- id: this.validateFormQt.controls.taskTypeQt.value,
- },
- startDept: {
- id: this.validateFormQt.controls.startDeptQt.value,
- },
- createDept: this.applyDept,
- endDepts: [
- {
- id: this.validateFormQt.controls.endDeptsQt.value,
- },
- ],
- },
- };
- if (!this.noWorkerPhone) {
- postData.workOrder["workOrderPhone"] = this.callNumber;
- }
- this.mainService.buildOrder(postData).subscribe((data) => {
- this.isOkLoading = false;
- this.isGoLoading = false;
- if (data["status"] == 200) {
- this.newOrderShow = false;
- if (go === "&go&") {
- this.applyDept = data["startDept"].id;
- this.applyStartDept = data["startDept"];
- this.incidentModel.incomingPhone = this.callNumber = this.incidentModel.contactsInformation = data["phone"];
- this.showPromptModal("建单", true, "", "closeGo");
- } else {
- if(this.incomingService.getSign() === 'callCenter' && this.incomingService.getPhoneNumber()){
- this.jry_shixian();
- }
- this.showPromptModal("建单", true, "", "close");
- }
- } else {
- this.showPromptModal("建单", false, data["msg"]);
- }
- });
- }
-
- submitFormOrdinary(go?) {
- for (const i in this.validateFormQt.controls) {
- this.validateFormQt.controls[i].markAsDirty();
- this.validateFormQt.controls[i].updateValueAndValidity();
- if (!this.validateFormQt.controls[i].valid) {
- this.isOkLoading = false;
- this.isGoLoading = false;
- return;
- }
- }
- let postData = {
- workOrder: {
- sourceId: SourceId.fuwutai,
- workOrderRemark: this.validateFormQt.controls.workOrderRemark.value,
- taskType: {
- id: this.validateFormQt.controls.taskTypeQt.value,
- },
- startDept: {
- id: this.validateFormQt.controls.startDeptQt.value,
- },
- createDept: this.applyDept,
- endDepts: [
- {
- id: this.validateFormQt.controls.endDeptsQt.value,
- },
- ],
- },
- };
- if (!this.noWorkerPhone) {
- postData.workOrder["workOrderPhone"] = this.callNumber;
- }
- this.mainService.buildOrder(postData).subscribe((data) => {
- this.isOkLoading = false;
- this.isGoLoading = false;
- if (data["status"] == 200) {
- this.newOrderShow = false;
- if (go === "&go&") {
- this.applyDept = data["startDept"].id;
- this.applyStartDept = data["startDept"];
- this.incidentModel.incomingPhone = this.callNumber = this.incidentModel.contactsInformation = data["phone"];
- this.showPromptModal("建单", true, "", "closeGo");
- } else {
- if(this.incomingService.getSign() === 'callCenter' && this.incomingService.getPhoneNumber()){
- this.jry_shixian();
- }
- this.showPromptModal("建单", true, "", "close");
- }
- } else {
- this.showPromptModal("建单", false, data["msg"]);
- }
- });
- }
-
- nucleicAcidLoading = false;
- nucleicAcidList: any = [];
-
-
-
-
- getNucleicAcidBuildingSummary(idx?) {
-
-
-
- this.nucleicAcidLoading = true;
- this.mainService.getNucleicAcidBuildingSummary({}).subscribe((data:any) => {
- this.nucleicAcidLoading = false;
- let nucleicAcidList = data.data || [];
- for (let i = 0; i < nucleicAcidList.length; i++) {
- if(nucleicAcidList[i].deptData && Array.isArray(nucleicAcidList[i].deptData)){
- nucleicAcidList[i].deptNames = nucleicAcidList[i].deptData.map(v=>v.deptName).toString();
- }else{
- nucleicAcidList[i].deptData = [];
- nucleicAcidList[i].deptNames = '';
- }
- }
- this.nucleicAcidList = nucleicAcidList;
- console.log(this.nucleicAcidList)
-
- })
- }
-
- mapQrcodes:any = {};
- printDate:number = Date.now();
- printAucleicAcid(){
- this.isOkLoading = true;
- this.mainService.printNucleicAcid({}).subscribe((data:any) => {
- this.isOkLoading = false;
- if(data.state == 200){
- let mapQrcodes = {};
- data.data.forEach(v=>{
- mapQrcodes[v.buildId] = v.qrcode;
- })
- this.mapQrcodes = mapQrcodes;
- this.nucleicAcidPrintingCancel();
- setTimeout(()=>{
- this.printBtn.nativeElement.click();
- },0)
- }else{
- this.msg.create('error', `操作失败!`);
- }
- })
- }
-
- getInspectAndPatientTransportConfigTasktype() {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- let postData = {
- idx: 0,
- sum: 10,
- taskType: {
- simpleQuery: true,
- hosId: {
- id: this.checkedHos
- },
- associationType: {
- key:"association_types",
- value: 'inspect'
- }
- }
- };
- this.mainService
- .getFetchDataList("simple/data", "taskType", postData)
- .subscribe((result) => {
- if (result.status == 200) {
- let tasktype:any = result.list[0] || {};
- this.getInspectAndPatientTransportConfig(tasktype);
- }
- });
- }
-
- getInspectAndPatientTransportConfig(tasktype) {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- let postData = {
- idx: 0,
- sum: 10,
- taskTypeConfig: {
- taskTypeDTO: {
- hosId: {
- id: this.checkedHos
- },
- associationType: tasktype.associationType
- }
- }
- };
- this.mainService
- .getFetchDataList("simple/data", "taskTypeConfig", postData)
- .subscribe((result) => {
- if (result.status == 200) {
- let inspectAndPatientTransportConfig = result.list[0] || {};
- this.inspectAndPatientTransportConfig = {...this.inspectAndPatientTransportConfig, ...inspectAndPatientTransportConfig};
- }
- });
- }
- ngOnInit() {
- this.websocketLoading = true;
- this.coopBtns = this.tool.initCoopBtns(this.route);
-
-
- this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
- this.searchApplicationDepartment(v[0], v[1]);
- });
- this.inspectSubject.pipe(debounceTime(500)).subscribe((v) => {
- this.refreshInspectList();
- });
- this.changeCommonInpSubject.pipe(debounceTime(500)).subscribe((v) => {
- if(v[0] === 'requester'){
- this.searchApplicationRequester(v[1]);
- }else if(v[0] === 'category'){
- this.searchApplicationCategory(v[1]);
- }else if(v[0] === 'group'){
- this.searchApplicationGroup(v[1]);
- }else if(v[0] === 'user'){
- this.searchApplicationUser(v[1]);
- }else if(v[0] === 'patient'){
- this.getPatientByResidenceNo(v[1]);
- }
- });
- this.onSearchTaskBuildSubject.pipe(debounceTime(500)).subscribe((v) => {
- this.getTasktypeByPhone(v);
- });
- this.searchHosDepartmentSubject.pipe(debounceTime(500)).subscribe((v) => {
- this.getHosDepartment(v[0], v[1], v[2]);
- });
- this.searchHosDepartmentQtSubject.pipe(debounceTime(500)).subscribe((v) => {
- this.getHosDepartmentQt(v[0], v[1], v[2]);
- });
- this.searchPatientListSubject.pipe(debounceTime(500)).subscribe((v) => {
- this.getPatientList(v[0], v[1]);
- });
-
- this.validateFormZy = this.fb.group({
- taskType: [null, [Validators.required]],
- linkCheck: [null, []],
- startDept: [null, [Validators.required]],
- endDepts: [null, [Validators.required]],
- patient: [null, [Validators.required]],
-
- goods: [null],
- workOrderRemarkZy: [null],
- });
-
- this.validateFormQt = this.fb.group({
- taskTypeQt: [null, [Validators.required]],
- startDeptQt: [null, [Validators.required]],
- endDeptsQt: [null, [Validators.required]],
- workOrderRemark: [null],
- });
- this.getWebsocketSer();
- this.initRole();
- this.initLogin();
- this.retract();
- this.refresh();
- this.initOrderScope();
- this.getVisitList();
- this.getMessageList();
- this.initControlView();
- this.moveMenu("fixedMenu");
- this.moveMenu("fixedMenuLeft");
- this.moveMenuAll("fixedMenuAll");
- if(this.incomingService.getSign() === 'box'){
- this.getPhoneNum();
- }else if(this.incomingService.getSign() === 'callCenter'){
- setTimeout(this.getPhoneNum.bind(this), 2000)
- }else{
- this.websocketLoading = false;
- }
- this.getUnassignedBuilding2();
- this.getInspectAndPatientTransportConfigTasktype();
- this.initCallCenter();
- }
- ngOnDestroy() {
- document.removeEventListener("keydown", this.quickShowNewOrder.bind(this));
- this.quickShowNewOrder = null;
- clearTimeout(this.refreshTimerId);
- this.incomingService.closeWs(true);
- this.sers.closeWs(true);
- }
- ngAfterViewInit() {
-
- document.addEventListener("keydown", this.quickShowNewOrder.bind(this));
- }
- requiredConfigChange(form: string, name: string, required: boolean): void {
- if (!required) {
- this[form].get(name)!.clearValidators();
- this[form].get(name)!.markAsPristine();
- } else {
- this[form].get(name)!.setValidators(Validators.required);
- this[form].get(name)!.markAsDirty();
- }
- this[form].get(name)!.updateValueAndValidity();
- }
-
- initCallCenter(){
- let _this = this;
-
-
-
-
-
-
-
- TLWSA.onOpenreturn = (err) => {
- err = Number(err);
- if (!err) {
- _this.incomingService.setPhoneNumber(TLWSA.phoneNumber);
- _this.websocketLoading = false;
- _this.cancelBindExtensionNumber();
- console.log('呼叫中心连接成功-----seimin');
- _this.getState(0);
- _this.msg.success('呼叫中心连接成功')
-
- if (_this.incomingService.getPhoneNumberPre()) {
-
- tlwsa.tlaKillworkid(+_this.incomingService.getPhoneNumberPre());
- }else{
-
- tlwsa.tlaLogin(_this.user.user.id, 1, -1);
- }
- } else {
- console.log('呼叫中心连接失败-----seimin');
- _this.getState(0);
- _this.msg.error('呼叫中心连接失败')
- }
- }
-
- TLWSA.onSetphonenumberreturn = function (err) {
- err = Number(err);
- if (!err) {
- console.log('绑定分机成功-----seimin');
- _this.msg.success('绑定分机成功')
- _this.incomingService.setPhoneNumberPre(_this.user.user.id);
- _this.qShimang(1);
- } else {
- console.log('绑定分机失败-----seimin');
- _this.getState(0);
- _this.msg.error('绑定分机失败')
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- let timer = null;
- TLWSA.onClosed = () => {
- _this.getState(0);
- clearTimeout(timer);
- if(location.hash === '#/dispatchingDesk'){
- console.log('与服务器网络连接中断-----seimin');
- if(this.incomingService.getPhoneNumber()){
- _this.msg.info('与服务器网络连接中断,2分钟后重连')
- console.log('2分钟后自动重连-----seimin')
- timer = setTimeout(function () {
-
- TLWSA.phoneNumber = _this.incomingService.getPhoneNumber();
- tlwsa.tlaOpen(_this.incomingService.getSocketUrl());
- }, 120000)
- }else{
- _this.websocketLoading = false;
- }
- }
- }
-
- TLWSA.onLoginreturn = function (err) {
- err = Number(err);
- if (!err) {
- console.log('签入成功-----seimin');
- _this.msg.success('签入成功')
- setTimeout(function () {
- console.log(_this.incomingService.getPhoneNumber(), 1111)
- var phoneNumber = _this.incomingService.getPhoneNumber();
- console.log('开始绑定分机【' + phoneNumber + '】-----seimin');
- tlwsa.tlaSetphonenumber(phoneNumber);
- }, 0)
- } else if (err == 9011) {
- console.log('签入失败,该分机已登录-----seimin');
- _this.msg.error('签入失败,该分机已登录')
- } else {
- console.log('签入失败-----seimin');
- _this.msg.error('签入失败')
- }
- }
-
- TLWSA.onKillreturn = function (err) {
- err = Number(err);
- if (!err) {
- console.log('强制签出成功-----seimin');
- _this.getState(0);
-
-
-
-
-
- } else {
- console.log('强制签出失败,该分机不是签入状态-----seimin');
-
-
-
-
-
- }
-
- if (_this.incomingService.getPhoneNumberPre()) {
-
- tlwsa.tlaLogin(+_this.incomingService.getPhoneNumberPre(), 1, -1);
- }
- }
-
- TLWSA.onLogoffreturn = function (err) {
- err = Number(err);
- if (!err) {
- console.log('签出成功-----seimin');
- _this.getState(0);
- _this.msg.success('签出成功')
- _this.incomingService.removePhoneNumberPre();
- _this.incomingService.removePhoneNumber();
- } else {
- console.log('签出失败-----seimin');
- _this.msg.error('签出失败')
- }
- }
-
- TLWSA.onAcwreturn = function (err) {
- err = Number(err);
- if (!err) {
- console.log('示忙成功-----seimin');
- if (location.href.includes('app/incident/editor') || location.href.includes('app/incident/chart')) {
- _this.isShixian = false;
- } else {
- _this.isShixian = true;
- }
- _this.getState(2);
- _this.preState = 2;
- _this.msg.success('示忙成功')
- } else {
- console.log('示忙失败-----seimin');
-
-
-
-
-
- }
- }
-
- TLWSA.onWcareturn = function (err) {
- err = Number(err);
- if (!err) {
- console.log('示闲成功-----seimin');
- _this.getState(1);
- _this.preState = 1;
- _this.msg.success('示闲成功')
- } else {
- console.log('示闲失败-----seimin');
- _this.msg.error('示闲失败')
- }
- }
-
- TLWSA.onCallreturn = function (err) {
- err = Number(err);
- if (!err) {
- console.log('呼叫成功,请摘机-----seimin');
- _this.getState(6);
- _this.msg.success('呼叫成功,请摘机')
- } else {
- console.log('呼叫失败-----seimin');
- _this.msg.error('呼叫失败')
- }
- }
-
- TLWSA.onCallresult = function (jso) {
- console.log(jso);
- var err = Number(jso.err);
- if (!err) {
- console.log('呼叫被接听成功-----seimin');
- _this.getState(5);
- _this.msg.success('呼叫被接听成功')
- } else {
- console.log('呼叫被接听失败-----seimin');
- _this.qShimang(1);
- _this.msg.error('呼叫被接听失败')
- }
- }
-
- TLWSA.onCallend = function (jso) {
- console.log(jso);
- if (jso) {
- console.log('挂断成功-----seimin');
- console.log('最近一次话机状态', _this.preState);
- _this.qShimang(_this.preState);
- _this.msg.success('挂断成功')
- } else {
- console.log('挂断失败-----seimin');
- _this.msg.error('挂断失败')
- }
- }
-
- TLWSA.onCallin = function (jso) {
- console.log(jso);
- _this.incidentModel = { repairIncidentType: 'dept' };
- _this.callNumber = _this.incidentModel.incomingPhone = jso.caller;
- _this.incidentModel.callID = jso.crs;
- if (jso) {
- console.log('呼入坐席成功,请摘机-----seimin');
- _this.getState(3);
- _this.msg.success('呼入坐席成功,请摘机')
- console.log('来电了!电话号码是【' + _this.incidentModel.incomingPhone + '】');
- } else {
- console.log('呼入坐席失败-----seimin');
- _this.msg.error('呼入坐席失败')
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TLWSA.onAnswer = function (err) {
- err = Number(err);
- if (!err) {
- console.log('呼入摘机应答成功-----seimin');
- _this.getState(5);
- _this.msg.success('呼入摘机应答成功')
-
- _this.searchBxDept();
- } else {
- console.log('呼入摘机应答失败-----seimin');
- _this.msg.error('呼入摘机应答失败')
- }
- }
-
- TLWSA.onMisscall = function (err) {
- err = Number(err);
- if (!err) {
- console.log('呼入未摘机应答成功-----seimin');
- _this.getState(1);
- _this.msg.success('呼入未摘机应答成功')
- } else {
- console.log('呼入未摘机应答失败-----seimin');
- _this.msg.error('呼入未摘机应答失败')
- }
- }
-
-
- TLWSA.onTransferreturn = function (err) {
- err = Number(err);
- if (!err) {
- console.log('转接坐席开始成功-----seimin');
- _this.getState(7);
- _this.msg.success('转接坐席开始成功')
- } else {
- console.log('转接坐席开始失败-----seimin');
- _this.msg.error('转接坐席开始失败')
- }
- }
-
- TLWSA.onTransferresult = function (err) {
- err = Number(err);
- if (!err) {
- console.log('转接坐席结果成功-----seimin');
- _this.getState(1);
- _this.msg.success('转接坐席结果成功')
- } else {
- console.log('转接坐席结果失败-----seimin');
- _this.msg.error('转接坐席结果失败')
- }
- }
-
- }
-
- quickShowNewOrder(e){
- if (e.ctrlKey && e.key == "s") {
- this.showNewOrder();
- e.preventDefault();
- }
- }
- unassignedSearchCon: string = "";
- arriveSearchCon: string = "";
- executionSearchCon: string = "";
- workerMessage: any = [];
-
- patientCareCol: number = 7;
- hurseInfoHiding = 1;
- txtLabelCol: number = 1;
- workerInfoTime: number = 60;
- orderInfoTime: number = 60;
- audioNotDispatched: boolean = true;
- cotHeight: number;
- unassignedList: any = [];
- arriveList: any = [];
- executionList: any = [];
- unassignedListClone: any = null;
- arriveListClone: any = null;
- executionListClone: any = null;
- workerRefreshTime: number = 30;
- orderRefreshTime: number = 30;
- recallOrderShow: boolean = false;
- delOrderShow: boolean = false;
- logoutModal: boolean = false;
- user = JSON.parse(localStorage.getItem("user"));
- promptContent: string;
- ifSuccess: boolean;
- promptInfo: string;
- promptModalShow: boolean;
- back = "";
- btnLoading: boolean = false;
- recDelLoading: boolean = false;
- saveLoading: boolean = false;
- flagList:any = {
- itsmFlag1: false,
- hsmsFlag1: false,
- itsmFlag2: false,
- hsmsFlag2: false,
- itsmFlag3: false,
- hsmsFlag3: false,
- }
- mainRole: boolean = false;
- initRole() {
-
- let menus = JSON.parse(localStorage.getItem("menu"));
- let that = this;
- console.log("菜单数量" + menus.length);
- if (menus.length >= 2) {
- that.mainRole = true;
- return;
- }
- }
-
- initLogin() {
- let that = this;
- if (!localStorage.getItem("user")) {
- that.msg.error("您的登录已失效,请重新登录!", {
- nzDuration: 3000,
- });
- setTimeout(() => {
- that.router.navigateByUrl("login");
- }, 2000);
- return;
- }
- }
-
- checkedHos;
- checkedHosDTO;
- scopeGroups = [];
- orderScopeRadio;
- itsmCheckedHos;
- itsmScopeGroups = [];
- itsmOrderScopeRadio;
- hsmsData: any = {
- checkedHos: undefined,
- scopeGroups: [],
- orderScopeRadio: '0',
- };
- itsmData: any = {
- checkedHos: [],
- scopeGroups: [],
- orderScopeRadio: '0',
- };
- initOrderScope() {
- if (!this.user || !this.user.user || !this.user.user.scope){
- this.showOrderScope();
- return;
- }
- let scopeInfo = this.user.user.scope;
- this.checkedHos = scopeInfo.hospitalId ? scopeInfo.hospitalId.id : undefined;
- this.checkedHosDTO = scopeInfo.hospitalId || undefined;
- this.orderScopeRadio = scopeInfo.range + "";
- let groupIds = scopeInfo.groupIds || [];
- let dutyGroupList = scopeInfo.dutyGroupList || [];
- this.scopeGroups = dutyGroupList.concat(groupIds);
- if(this.scopeGroups.length){
- this.typeId = this.scopeGroups[0].id;
- }
- this.hsmsData = {
- checkedHos: this.checkedHos,
- checkedHosDTO: this.checkedHosDTO,
- scopeGroups: this.scopeGroups,
- orderScopeRadio: this.orderScopeRadio || '0',
- hsmsSwitch: scopeInfo.hsmsSwitch === 1,
- }
- this.flagList.hsmsFlag1 = this.hsmsData.hsmsSwitch;
- this.flagList.hsmsFlag2 = this.hsmsData.hsmsSwitch;
- this.flagList.hsmsFlag3 = this.hsmsData.hsmsSwitch;
- this.itsmCheckedHos = scopeInfo.dutyList || [];
- this.itsmOrderScopeRadio = scopeInfo.dutyRange + "";
- this.itsmScopeGroups = scopeInfo.dutyGroupList || [];
- this.itsmData = {
- checkedHos: this.itsmCheckedHos,
- scopeGroups: this.itsmScopeGroups,
- orderScopeRadio: this.itsmOrderScopeRadio || '0',
- mdv2Switch: scopeInfo.mdv2Switch === 1,
- allDuty: scopeInfo.allDuty === undefined ? 1 : scopeInfo.allDuty,
- showReassign: scopeInfo.showReassign == null || scopeInfo.showReassign == 0 ? 0 : 1,
- }
- this.flagList.itsmFlag1 = this.itsmData.mdv2Switch;
- this.flagList.itsmFlag2 = this.itsmData.mdv2Switch;
- this.flagList.itsmFlag3 = this.itsmData.mdv2Switch;
- this.getHospitalConfigList('allowNucleicAcidPrinting');
- this.getConfigTasktype();
- this.patientLogTasktype();
- }
-
- confirmOrderScope(data){
- if (data.status == 200) {
-
- this.cancelOrderScope();
- this.showPromptModal("保存", true, "");
-
-
-
- this.user.user.scope = data.data;
- localStorage.setItem("user", JSON.stringify(this.user));
- this.initOrderScope();
- } else {
- this.showPromptModal("保存", false, data.msg);
- }
- }
-
- showInitModal: boolean = false;
- cancelOrderScope() {
- this.showInitModal = false;
- }
- showOrderScope() {
- console.log(1111,this.itsmData)
- this.showInitModal = true;
- }
-
- showDisplayFormModal: boolean = false;
- cancelDisplayForm() {
- this.showDisplayFormModal = false;
- }
- showDisplayForm() {
- this.showDisplayFormModal = true;
- }
- confirmDisplayForm(data){
- if (data.status == 200) {
- this.cancelDisplayForm();
- this.msg.success('保存成功');
- this.initControlView();
- } else {
- this.msg.error(data.msg || '保存失败');
- }
- }
-
- showBindExtensionNumberModal: boolean = false;
- cancelBindExtensionNumber() {
- this.showBindExtensionNumberModal = false;
- }
- showBindExtensionNumber() {
- this.showBindExtensionNumberModal = true;
- this.websocketLoading = false;
- }
-
- checkIn(phoneNumber){
- this.websocketLoading = true;
-
- this.incomingService.closeWs(true);
- this.getWebsocketPhone(phoneNumber);
- }
-
- checkOut(){
- this.showDelModal(undefined, undefined,'您确认要签出吗?','签出','checkout');
- }
-
- getWebsocketSer() {
- this.sers
- .connectWs(http.fwtWs, { userCount: this.user.user.account })
- .subscribe((result) => {
- console.log(result);
- if (result && result.content) {
- this.createBasicNotification(result);
- }
- });
- }
-
- websocketLoading:boolean = false;
- preState:any = '';
- isShixian = false;
- jry_state = '';
- jry_extnNumberObj = {
-
-
- }
- getWebsocketPhone(phoneNumber) {
- const sign = this.incomingService.getSign();
- if(sign === 'box'){
-
- this.incomingService.connectWs(phoneNumber).subscribe((data) => {
-
- console.log(data);
- console.log(this.incidentModel);
- this.websocketLoading = false;
-
- if (data.status == 200 && data.phone) {
- this.incomingService.setPhoneNumber(phoneNumber);
- this.incidentModel = { repairIncidentType: 'dept' };
- this.incidentMsg = {};
- this.incidentModel.callID = data.callId || undefined;
- this.msg.info('签入成功');
- this.cancelBindExtensionNumber();
- } else if (data.status == 201 && data.phone) {
- this.incidentModel = { repairIncidentType: 'dept' };
- this.incidentMsg = {};
- this.incidentModel.callID = data.callId || undefined;
- this.incidentModel.incomingPhone = this.callNumber = this.incidentModel.contactsInformation = data.phone;
- this.searchBxDept();
- } else if (data.status == 201 && data.phone === "") {
- this.incidentModel = { repairIncidentType: 'dept' };
- this.incidentMsg = {};
- this.incidentModel.callID = data.callId || undefined;
-
- if (!this.newOrderShow && !this.newOrderShowOpen) {
- this.applyDept = null;
- this.showNewOrder("no", data.phone, true, '来电弹屏');
- }
- } else if (data.status == 202) {
- this.msg.warning(data.msg);
- }
- });
- }else if(sign === 'callCenter'){
-
- this.preState = '';
-
- TLWSA.phoneNumber = phoneNumber;
- tlwsa.tlaOpen(this.incomingService.getSocketUrl());
- }else{
- this.websocketLoading = false;
- }
- }
-
- searchBxDept(){
- let dataObj = {
- hosId: this.tool.getCurrentHospital().id,
- phone: this.incidentModel.incomingPhone,
- };
- this.mainService
- .findPhoneDept(dataObj)
- .subscribe((result:any) => {
- if (result.state == 200) {
- console.log(result);
- if (result.data.length > 0) {
- let deptDTO;
- if(result.type === 'qrCode'){
- deptDTO = result.data[0].deptDTO;
- deptDTO.address = result.data[0].name;
- }else if(result.type === 'dept'){
- deptDTO = result.data[0];
- }
-
-
- let incidentModel:any = Object.assign({}, this.incidentModel);
- let incidentMsg:any = Object.assign({}, this.incidentMsg);
- incidentModel.department = deptDTO;
- incidentModel.department && incidentModel.department.hospital && (incidentModel.hosId = incidentModel.department.hospital.parent ? incidentModel.department.hospital.parent.id : incidentModel.department.hospital.id);
- incidentModel.department && incidentModel.department.building && (incidentModel.area = incidentModel.department.building.id);
- incidentModel.department && incidentModel.department.floor && (incidentModel.place = incidentModel.department.floor.id);
- incidentModel.department && incidentModel.department.address && (incidentModel.houseNumber = incidentModel.department.address);
- incidentModel.department && (incidentMsg.deptManyPhone = incidentModel.department.manyPhone);
- incidentModel.department && (incidentMsg.deptName = incidentModel.department.dept);
- incidentModel.department && (incidentModel.department = incidentModel.department.id);
- this.incidentModel = incidentModel;
- this.incidentMsg = incidentMsg;
- this.searchApplicationRequester();
- this.applyDeptMiddle = deptDTO;
- this.showNewOrder("yes", this.incidentModel.incomingPhone, true, '来电弹屏');
-
- } else {
-
- console.log(this.newOrderShow);
- console.log(this.incidentModel);
- console.log(this.incidentMsg);
- this.incidentMsg = {};
- if (!this.newOrderShow && !this.newOrderShowOpen) {
- this.applyDept = null;
- this.showNewOrder("no", this.incidentModel.incomingPhone, true, '来电弹屏');
- }
- }
- }
- });
- }
-
- qShimang(state) {
- if (location.href.includes('app/incident/editor') || location.href.includes('app/incident/chart')) {
-
-
- setTimeout(() => {
- tlwsa.tlaAcw();
- }, 0)
- } else {
- this.getState(state);
- }
- }
-
- getState(state) {
- switch (state) {
- case 0:
- this.jry_state = 'weiqianru';
- break;
- case 1:
- this.jry_state = 'shixian';
- break;
- case 2:
- this.jry_state = 'shimang';
- break;
- case 3:
- this.jry_state = 'laidian';
- break;
- case 5:
- this.jry_state = 'tonghuazhong';
- break;
- case 6:
- this.jry_state = 'zhengzaiwaihu';
- break;
- case 7:
- this.jry_state = 'zhengzaizhuanyi';
- break;
- }
- }
-
- jry_qianru = function () {
- if (!this.incomingService.getPhoneNumber()) {
- this.msg.warning('绑定分机不能为空')
- return;
- }
-
-
-
- tlwsa.tlaLogin(this.user.user.id, 1, -1);
- }
-
- jry_shixian = function () {
- tlwsa.tlaWca();
- }
-
- jry_shimang = function () {
- tlwsa.tlaAcw();
- }
-
- jry_qianchu = function () {
- tlwsa.tlaLogoff();
- }
-
-
-
-
-
- tlaCallout = function () {
-
- var reg1 = /^[0][1-9]{2,3}-[0-9]{5,10}$/;
- var reg2 = /^(0|9|90|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/;
- if (!reg1.test(this.jry_extnNumberObj.tel1) && !reg2.test(this.jry_extnNumberObj.tel1)) {
- this.msg.warning('请输入正确的手机号或座机号')
- return;
- }
-
- tlwsa.tlaCallout(this.jry_extnNumberObj.tel1, '3558177', 1);
- }
-
-
-
-
-
- tlaTransferout = function () {
-
- var reg1 = /^[0][1-9]{2,3}-[0-9]{5,10}$/;
- var reg2 = /^(0|9|90|86|17951)?(13[0-9]|15[012356789]|166|17[3678]|18[0-9]|14[57])[0-9]{8}$/;
- if (!reg1.test(this.jry_extnNumberObj.tel2) && !reg2.test(this.jry_extnNumberObj.tel2)) {
- this.msg.warning('请输入正确的手机号或座机号')
- return;
- }
- tlwsa.tlaTransferout(this.jry_extnNumberObj.tel2, '3558177', 1);
- }
-
- onChange(value: number): void {
- console.log(`onChange: ${value}`);
- }
- onAfterChange(value: number): void {
- console.log(`onAfterChange: ${value}`);
- }
-
-
- rightTitle_tab:any[] = [
-
-
-
-
- ]
- currentRTab:any;
- loading5 = false;
- patientLogList = [];
- getPatientLog(id) {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- if (id == -1 || id === null || id === undefined) {
- this.patientLogList = [];
- return;
- }
- let postData = {
- patientLog: {
- sqDept: { id },
- hosId: this.checkedHos,
- },
- idx: 0,
- sum: 10000,
- };
- this.loading5 = true;
- this.mainService
- .getFetchDataList("api", "patientLog", postData)
- .subscribe((result) => {
- this.loading5 = false;
- if (result.status == 200) {
- this.patientLogList = result.list;
- }
- });
- }
- rightTitleHandler(i) {
- this.currentRTab = i;
- if (i === 0) {
- this.getWorkOrders(this.applyDept);
- } else if (i === 1) {
- this.getPatientLog(this.applyDept);
- } else if (i === 2) {
- this.getItsmOrders(this.incidentModel.department);
- } else if (i === 3) {
- this.getDictionaryList();
- }
- }
-
- loading4 = false;
- getWorkOrders(id) {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- if (id == -1 || id === null || id === undefined) {
- this.noArrives = [];
- return;
- }
- let types = "";
- this.user.user.scope.typeIds.forEach((e) => {
- types += e.id + ",";
- });
- types = types.slice(0, types.length - 1);
- let dataObj = {
- workOrder: {
- serTaskTypes: types,
- serGdState: 4,
- range: "0",
- platform: 3,
- searchDays: 100,
- startDept: {
- id: id,
- },
- },
- idx: 0,
- sum: 5,
- };
- this.loading4 = true;
- this.mainService
- .getFetchDataList("data", "workOrder", dataObj)
- .subscribe((data) => {
- this.loading4 = false;
- if (data.status == 200) {
- this.noArrives = data.list;
- }
- });
- }
-
- loading6 = false;
- itsmOrders:any[] = [];
- getItsmOrders(id) {
- if(!this.itsmData.mdv2Switch){
- return;
- }
- if (id == -1 || id === null || id === undefined) {
- this.itsmOrders = [];
- return;
- }
- let postData = {
- incident: {
- "deleteFlag": 0,
- queryTask: 'all',
- department: {
- id,
- },
- },
- idx: 0,
- sum: 6,
- };
- this.loading6 = true;
- this.mainService
- .getFetchDataList("simple/data", "incident", postData)
- .subscribe((data) => {
- this.loading6 = false;
- if (data.status == 200) {
- this.itsmOrders = data.list;
- }
- });
- }
-
- getDictionaryList() {
- let solutionStatus$ = this.mainService.getDictionary('list', 'solution_status', true);
- let solutionType$ = this.mainService.getDictionary('list', 'solution_type', true);
- forkJoin(solutionStatus$, solutionType$).subscribe((data:any[]) => {
- let solutionStatusList = data[0] || [];
- let solutionTypeList = data[1] || [];
- this.solutionStatus = solutionStatusList.find(item => item.value == 3);
- console.log('this.solutionStatus:', this.solutionStatus)
- this.solutionType = solutionTypeList.find(item => item.value == 1);
- console.log('this.solutionType:', this.solutionType)
- this.getKnowageList();
- })
- }
- solutionStatus;
- solutionType;
-
- loading7 = false;
- knowageList:any[] = [];
- getKnowageList() {
- if(!this.itsmData.mdv2Switch){
- return;
- }
- if(!(this.incidentModel.category && this.solutionStatus && this.solutionType)){
- this.loading7 = false;
- this.knowageList = [];
- return;
- }
- this.loading7 = true;
- let postData:any = {
- idx: 0,
- sum: 9999,
- solution: {
- categoryId: this.incidentModel.category,
- status: this.solutionStatus,
- type: this.solutionType,
- },
- };
- this.mainService
- .getFetchDataList('simple/data', 'solution', postData)
- .subscribe((result) => {
- this.loading7 = false;
- if(result.status == 200){
- this.knowageList = result.list || [];
- }else{
- this.msg.error(result.msg || '请求数据失败!');
- }
- });
- }
-
- solutionId;
- importKnowage(item){
- console.log(item)
- this.incidentModel = {...this.incidentModel, description: `引用知识库解决,知识库编号:${item.solutionNumber}`};
- this.solutionId = item.id;
- }
-
- coopData:any = {};
- isShowKnowledge:boolean = false;
- showKnowledgeModal(data) {
- this.coopData = data || {};
- this.isShowKnowledge = true;
- }
- cancelKnowledgeModal(flag) {
- this.isShowKnowledge = false;
- }
-
- refreshTimerId;
- refresh() {
- clearTimeout(this.refreshTimerId);
- this.refreshTimerId = setTimeout(() => {
- this.refresh()
-
- if (!this.batchType && !this.batchType1) {
- this.orderRefreshTime--;
- }
- this.workerRefreshTime--;
- if (this.orderRefreshTime == 0) {
- this.getUnassignedBuilding2();
- this.getOrderList(1, true);
- this.getOrderList(2);
- this.getOrderList(3);
- this.getVisitList();
- this.getMessageList();
- if (this.currentRTab === 0) {
- this.getWorkOrders(this.applyDept);
- } else if (this.currentRTab === 1) {
- this.getPatientLog(this.applyDept);
- } else if (this.currentRTab === 2) {
- this.getItsmOrders(this.incidentModel.department);
- } else if (this.currentRTab === 3) {
- this.getDictionaryList();
- }
- this.orderRefreshTime = this.orderInfoTime;
- }
- if (this.workerRefreshTime == 0) {
- this.checkTab(this.typeId);
- this.workerRefreshTime = this.workerInfoTime;
- }
- }, 1000);
- }
- resetList() {
- this.unassignedListClone = null;
- this.arriveListClone = null;
- this.batchType = false;
- this.batchType1 = false;
- }
-
- refreshList(e) {
- if (!e.promptContent) {
- return;
- }
- this.getUnassignedBuilding2();
- this.resetList();
- this.getOrderList(1);
- this.getOrderList(2);
- this.getOrderList(3);
- this.getVisitList();
- this.getMessageList();
- if (this.currentRTab === 0) {
- this.getWorkOrders(this.applyDept);
- } else if (this.currentRTab === 1) {
- this.getPatientLog(this.applyDept);
- } else if (this.currentRTab === 2) {
- this.getItsmOrders(this.incidentModel.department);
- } else if (this.currentRTab === 3) {
- this.getDictionaryList();
- }
- }
-
-
- typeId;
- typeData;
- wLoading:boolean = false;
- checkTab(typeId) {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- let that = this;
- that.typeId = typeId;
- this.typeData = this.scopeGroups.find(v => v.id === typeId);
- if(this.typeData){
- let type = this.typeData.type;
-
- if(type === 1 || type === 2){
- let postData = {
- groups: [typeId],
- idx: 0,
- sum: 100,
- hosId: this.checkedHos,
- };
-
-
-
-
-
-
-
- if (this.hurseInfoHiding == 1){
- that.workerMessage = [];
- that.initTopCount();
- return;
- }
- this.wLoading = true;
- that.mainService.getSerInfo("getWorkInfo", postData).subscribe((data) => {
- this.wLoading = false;
- that.workerMessage = data.data ? data.data : [];
- that.initTopCount();
- });
- }
-
- if(type === 3){
- let postData = {
- groups: [typeId],
- };
- if (this.hurseInfoHiding == 1){
- that.workerMessage = [];
- that.initTopCount();
- return;
- }
- this.wLoading = true;
- that.mainService.incidentUserTaskCount(postData).subscribe((data:any) => {
- this.wLoading = false;
- that.workerMessage = data.data ? data.data : [];
- that.initTopCount();
- });
- }
- }
- }
-
- visitNum:any;
- getVisitList(){
- if(!this.itsmData.mdv2Switch){
- return;
- }
- let postData: any = {
- idx: 0,
- sum: 1,
- incident: {
-
- "dutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
- "urgentType": +this.itsmData.orderScopeRadio + 1,
- "queryTask": "callback",
- "assignee": this.tool.getCurrentUserId(),
- "deleteFlag": 0,
- },
- };
- this.mainService
- .getFetchDataList("simple/data", "incident", postData)
- .subscribe((result) => {
- this.visitNum = result.totalNum;
- });
- }
-
- messageNum:any;
- getMessageList(){
- if(!this.itsmData.mdv2Switch){
- return;
- }
- let postData: any = {
- idx: 0,
- sum: 1,
- hjzxRecord: {
- isExcute: 0,
- },
- };
- this.mainService
- .getFetchDataList("simple/data", "hjzxRecord", postData)
- .subscribe((result) => {
- this.messageNum = result.totalNum;
- });
- }
-
- trackById(index, item) {
- return item.type + item.data.id;
- }
-
- loading1 = true;
- loading2 = true;
- loading3 = true;
- getOrderList(stateId, isAudio?) {
- this[`loading${stateId}`] = true;
- let keyWords = "";
- let types = "";
- let postData:any = {
- orderType: this.orderType,
- };
-
- if(this.flagList['hsmsFlag' + stateId]){
- if (stateId == 1) {
- keyWords = this.unassignedSearchCon || "";
- } else if (stateId == 2) {
- keyWords = this.arriveSearchCon || "";
- } else if (stateId == 3) {
- keyWords = this.executionSearchCon || "";
- }
- if (this.user.user.scope) {
- this.user.user.scope.typeIds = this.user.user.scope.typeIds || [];
- }
- if (!this.user.user.scope || !this.user.user.scope.typeIds) {
- this.loading1 = this.loading2 = this.loading3 = false;
- }else{
- this.user.user.scope.typeIds.forEach((e) => {
- types += e.id + ",";
- });
- types = types.slice(0, types.length - 1);
- postData.workOrderQuery = {
- workOrder: {
- serTaskTypes: types || undefined,
- serGdState: stateId,
- range: this.orderScopeRadio,
- platform: 3,
- searchDays: 1,
- keyWord: keyWords
- },
- idx: 0,
- sum: 1
- }
- if (this.unassignedBuilding.length && stateId == 1) {
- postData.workOrderQuery.workOrder["deptIds"] = this.unassignedBuilding.toString();
- }
- }
- }
-
- if(this.flagList['itsmFlag' + stateId]){
- postData.incidentQuery = {
- idx: 0,
- sum: 1,
- }
- if(stateId == 1){
- postData.incidentQuery.incident = {
-
- "acceptDutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
- "urgentType": +this.itsmData.orderScopeRadio + 1,
- "queryTask": "storageAcceptReassign",
- "assignee": this.tool.getCurrentUserId(),
- "deleteFlag": 0,
- "showReassign":null
- }
- postData.incidentQuery.incident.showReassign = this.user.user.scope.showReassign==0 || !this.user.user.scope.showReassign ? undefined : this.user.user.scope.showReassign
- }else if(stateId == 2){
- postData.incidentQuery.incident = {
-
- "dutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
- "urgentType": +this.itsmData.orderScopeRadio + 1,
- "queryTask": "todoState",
- "deleteFlag": 0,
- }
- }else if(stateId == 3){
- postData.incidentQuery.incident = {
-
- "dutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
- "urgentType": +this.itsmData.orderScopeRadio + 1,
- "queryTask": "doing",
- "assignee": this.tool.getCurrentUserId(),
- "deleteFlag": 0,
- "platform": 3,
- }
- }
- }
- console.log(postData);
- this.mainService.orderList(postData).subscribe((data:any) => {
- if (stateId == 1) {
-
- let unassignedList = data.data || [];
- unassignedList.forEach((item) => {
- item.checked = false;
- if(item.type === 'mdv2'){
- item.computedSubstitutionFlag = this.computedSubstitution(item.data)
- item.computedReceiveFlag = this.computedReceive(item.data)
- item.computedEditFlag = this.computedEdit(item.data)
- }
- });
- this.unassignedList = unassignedList;
- this.batchType = false;
- this.allUnassignedList = false;
- this.unassignedListClone = cloneDeep(this.unassignedList);
- if (this.audioNotDispatched && this.unassignedList.length > 0 && isAudio) {
-
- let audio = document.createElement("audio");
- audio.src = "./../../assets/audio/audioNotDispatched.mp3";
- audio.addEventListener("canplay", function () {
-
- audio.play();
- });
- }
- this.loading1 = false;
- } else if (stateId == 2) {
-
- let arriveList = data.data || [];
- arriveList.forEach((item) => {
- item.checked = false;
- if(item.type === 'mdv2'){
- item.computedSubstitutionFlag = this.computedSubstitution(item.data)
- item.computedReceiveFlag = this.computedReceive(item.data)
- item.computedEditFlag = this.computedEdit(item.data)
- }
- });
- this.arriveList = arriveList;
- this.batchType1 = false;
- this.allArriveList = false;
- this.arriveListClone = cloneDeep(this.arriveList);
- this.loading2 = false;
- } else if (stateId == 3) {
-
- let executionList = data.data || [];
- executionList.forEach((item) => {
- if(item.type === 'mdv2'){
- item.computedSubstitutionFlag = this.computedSubstitution(item.data)
- item.computedHandleFlag = this.computedHandle(item.data)
- item.computedEditFlag = this.computedEdit(item.data)
- }
- });
- this.executionList = executionList;
- this.loading3 = false;
- }
- if (keyWords) {
- this.loading1 = this.loading2 = this.loading3 = false;
- }
- });
- }
-
- showRowNum: number;
- maxNum: number;
- initTopCount() {
- let that = this;
- that.maxNum = Math.ceil(that.workerMessage.length / that.patientCareCol);
- that.showRowNum = that.patientCareCol == 6 ? 4 : 2;
- console.log(that.maxNum, that.showRowNum);
- that.cotHeight = 140;
- }
-
- unfold() {
- if (this.showRowNum < this.maxNum && this.patientCareCol != 6) {
- this.cotHeight += 70;
- this.showRowNum++;
- } else if (this.showRowNum < this.maxNum && this.patientCareCol == 6) {
- this.cotHeight += 35;
- this.showRowNum++;
- } else {
- return;
- }
- }
-
- retract() {
- this.showRowNum = this.patientCareCol == 6 ? 4 : 2;
- this.cotHeight = 140;
- }
-
- openDetails(data) {
- if (data.taskType.associationType.value == 'specimen' || data.taskType.associationType.value == 'specimenPlan') {
-
- this.router.navigateByUrl("dispatchingDesk/detailSample/" + data.id);
- } else if (data.taskType.associationType.value == 'inspect' || data.taskType.associationType.value == 'patientTransport') {
-
- this.router.navigateByUrl("dispatchingDesk/detailPatients/" + data.id);
- } else if (data.taskType.associationType.value == 'drugsBag' || data.taskType.associationType.value == 'jPBag') {
-
- this.router.navigateByUrl("dispatchingDesk/detailDrug/" + data.id);
- } else if (data.taskType.associationType.value == 'ordinary') {
-
- this.router.navigateByUrl("dispatchingDesk/detailOrdinary/" + data.id);
- } else {
-
- this.router.navigateByUrl("dispatchingDesk/detailOthers/" + data.id);
- }
- }
-
- detailModalShow = false;
- openItsmDetails(data) {
- this.coopData = data;
- this.detailModalShow = true;
- }
-
- closeDetailModelOrder(e) {
- this.detailModalShow = JSON.parse(e).show;
- }
-
- confirmDetailModelOrder(e){
- console.log(e);
- this.detailModalShow = false;
- }
-
- changeUnassignedBuilding(e) {
- this.getOrderList(1);
- }
-
- searchUnassigned() {
- this.getOrderList(1);
- }
-
- searchArrive() {
- this.getOrderList(2);
- }
-
- searchExecution() {
- this.getOrderList(3);
- }
-
- allotWorker(id, stateId, flag?) {
- if (flag == 1) {
- this.router.navigateByUrl(
- "dispatchingDesk/allotWorker/" +
- id +
- "/" +
- stateId +
- "/1/" +
- this.checkedHos
- );
- } else {
- this.router.navigateByUrl(
- "dispatchingDesk/allotWorker/" +
- id +
- "/" +
- stateId +
- "/0/" +
- this.checkedHos
- );
- }
- }
-
- showLastItems: boolean = false;
-
- fixedMenuXiala() {
- this.showLastItems = true;
- }
-
- fixedMenuShangla() {
- this.showLastItems = false;
- this.fixedTab = "";
- }
-
- logOut(): void {
- this.logoutModal = true;
- }
-
- confirmLogout() {
- this.btnLoading = true;
-
- this.btnLoading = false;
- this.closeLogoutModal();
- let hospital = this.tool.getCurrentHospital();
- if(hospital){
- this.router.navigate(["login", hospital.id]);
- }else{
- this.router.navigateByUrl("login");
- }
- localStorage.removeItem("user");
- localStorage.removeItem("menu");
- this.incomingService.removePhoneNumber();
- this.incomingService.removePhoneNumberPre();
- this.incomingService.removeSocketUrl();
- this.incomingService.removeSign();
- this.incomingService.removePhoneNumberPre();
- localStorage.removeItem("index");
-
- this.mainService.logOut().subscribe((data) => {
- this.btnLoading = false;
- this.closeLogoutModal();
- if (data.status == 200) {
- if(hospital){
- this.router.navigate(["login", hospital.id]);
- }else{
- this.router.navigateByUrl("login");
- }
- localStorage.removeItem("user");
- localStorage.removeItem("menu");
- this.incomingService.removePhoneNumber();
- this.incomingService.removeSocketUrl();
- this.incomingService.removeSign();
- this.incomingService.removePhoneNumberPre();
- localStorage.removeItem("index");
- }
- });
- }
-
- closeLogoutModal() {
- this.logoutModal = false;
- }
-
- fixedTab: string = "";
- checkFixedTab(type: string) {
- if (type == "toSystem") {
- this.router.navigateByUrl("main");
- return;
- }
- if (type == "logout") {
- this.logOut();
- }
- if (type == "nucleicAcidPrinting") {
- this.getNucleicAcidBuildingSummary();
- }
- if (this.fixedTab == type) {
- this.fixedTab = "";
- } else {
- this.fixedTab = type;
- }
- }
-
-
-
-
-
- getConfigTasktypeLoading: boolean = false;
- getConfigTasktype() {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- let postData = {
- idx: 0,
- sum: 1,
- hospitalConfig: {
- hosId: this.checkedHos,
- key: "rebackPatientTypeId",
- },
- };
- this.getConfigTasktypeLoading = true;
- this.mainService.getFetchDataList("simple/data", "hospitalConfig", postData).subscribe(res => {
- this.getConfigTasktypeLoading = false;
- if (res && res.status == 200) {
- this.deathTasktypeId = res.list.length ? res.list[0].value : undefined;
- } else {
- this.msg.error('请求数据失败');
- }
- });
- }
-
- patientLogTasktypeLoading: boolean = false;
- patientLogTasktype() {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- let postData = {
- idx: 0,
- sum: 1,
- systemConfiguration: {
- keyconfig: "transDeptTypeId",
- },
- };
- this.patientLogTasktypeLoading = true;
- this.mainService.getFetchDataList("simple/data", "systemConfiguration", postData).subscribe(res => {
- this.patientLogTasktypeLoading = false;
- if (res.status == 200) {
- this.deathTasktypeIdPatient = res.list.length ? res.list[0].valueconfig : undefined;
- } else {
- this.msg.error('请求数据失败');
- }
- });
- }
-
- resetOrderData(){
- this.applicationRequesterList = [];
- this.fileList = [];
- this.repairImgs = [];
- this.isRelatedDepartment = true;
- this.solutionId = undefined;
- delete this.incidentMsg.requesterPhone;
- }
-
- resetOrderData2(){
- this.fileList = [];
- this.repairImgs = [];
- if(this.incidentModel.repairIncidentType === 'public'){
- this.isRelatedDepartment = false;
- }else{
- this.isRelatedDepartment = true;
- }
- }
-
- deathTasktypeId;
- deathTasktypeIdPatient;
- async showNewOrder(des = '', phone = '', isInit = false, buildType = '') {
- if(this.incomingService.getSign() === 'callCenter' && this.incomingService.getPhoneNumber()){
-
- setTimeout(()=>{
- tlwsa.tlaAcw();
- },0)
- }
- this.buildType = buildType;
- if(this.itsmData.mdv2Switch){
- if(this.buildType !== '继续建单' && this.buildType !== '编辑事件' && this.buildType !== '报修转事件'){
- this.resetOrderData();
- }else{
- this.resetOrderData2();
- }
- this.searchApplicationHospital();
- this.searchApplicationCategory();
- this.searchApplicationPriority();
- this.searchApplicationSource();
- this.getRepairIncidentType();
- isInit ? this.searchApplicationDepartment('itsm', undefined, undefined, undefined, true) : this.searchApplicationDepartment('itsm');
- isInit && ((this.isRelatedDepartment && this.incidentModel.department) || (!this.isRelatedDepartment && this.incidentModel.hosId) || this.buildType === '报修转事件' ) && this.incidentModel.hosId && this.searchApplicationBuilding();
- isInit && this.incidentModel.area && this.searchApplicationFloor();
- if(!this.hsmsData.hsmsSwitch){
- this.taskBuild = null;
- this.residenceNo = null;
- this.newOrderShow = true;
- this.newOrderShowOpen = true;
- this.fixedTab = "newOrder";
- this.currentRTab = 0;
- this.rightTitle_tab = [];
- this.incidentModel = isInit ? this.incidentModel : { repairIncidentType: 'dept' };
- this.incidentMsg = isInit ? this.incidentMsg : {};
- this.isBuildOrderAgagin = false;
- this.applyDept = null;
- this.countRemarkIndex = -1;
- this.incidentModel.department = isInit ? this.incidentModel.department : null;
-
- this.getAutoWorkTypes(false, isInit);
- return;
- }
- }
-
- this.yyDateZy = new Date();
- this.yyDate = new Date();
- this.yyTimeZy = null;
- this.yyTime = null;
- this.isYyInspect = false;
- this.clickYYZyFlag = false;
- this.clickYYFlag = false;
- this.inspectToday = new Date();
- if(!isInit && this.hsmsData.hsmsSwitch){
- if(!this.deathTasktypeId){
-
- this.msg.error('【送病人回病房】未配置');
- return;
- }
- if(!this.deathTasktypeIdPatient){
-
- this.msg.error('【转出院记录】未配置');
- return;
- }
- }
- this.taskBuild = null;
- this.residenceNo = null;
- this.newOrderShow = true;
- this.newOrderShowOpen = true;
- this.fixedTab = "newOrder";
- this.currentRTab = 0;
- this.rightTitle_tab = [];
- this.incidentModel = isInit ? this.incidentModel : { repairIncidentType: 'dept' };
- this.incidentMsg = isInit ? this.incidentMsg : {};
- this.isBuildOrderAgagin = false;
- this.applyDept = null;
- this.countRemarkIndex = -1;
- this.incidentModel.department = isInit ? this.incidentModel.department : null;
- console.log(des);
- if (des === "no") {
-
- this.searchApplicationDepartment("hsms", "", phone);
- this.noWorkerPhone = false;
- } else if (des === "yes") {
-
- this.searchApplicationDepartment("hsms", "&ks&");
- this.noWorkerPhone = false;
- } else if (des === "&go&") {
-
- this.searchApplicationDepartment("hsms", "&go&");
- this.noWorkerPhone = false;
- } else {
-
- this.searchApplicationDepartment("hsms");
- this.noWorkerPhone = true;
- }
- this.getSearchTaskList("").subscribe((result) => {
- if (result.status == 200) {
- this.searchTaskLoading = false;
- this.searchTaskList = result.data;
- this.searchTaskList.forEach((item) => {
- item.sid = item.associationTypeId + "_" + item.id + "_" + item.associationTypeValue;
- });
-
-
-
-
-
- this.getAutoWorkTypes(false, isInit);
- }
- });
- }
-
- searchTaskList;
- searchTaskLoading = false;
- getSearchTaskList(keyword, countRemark = '') {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- this.searchTaskLoading = true;
- return this.mainService.getTaskTypeBySearchKey({
- searchKey: keyword || undefined,
- countRemark: countRemark || undefined,
- hosId: this.checkedHos,
- });
- }
- getPhoneNum(flag = true) {
- if (!flag) {
-
- this.incomingService.removePhoneNumber();
- }
- if (this.incomingService.getPhoneNumber()) {
- this.getWebsocketPhone(this.incomingService.getPhoneNumber());
- }else{
- this.websocketLoading = false;
- }
- }
-
- defaultInspectFn(){
- if(this.currentTabIndex === '患者转运'){
- console.log(this.workTypesArrange);
- let obj = this.workTypesArrange.find(v => v.key == this.currentTabIndex);
- let tabIndex = this.workTypesArrange.findIndex(v => v.key == this.currentTabIndex);
- let arr = obj.value || [];
- let index = arr.findIndex(v => v.associationTypeValue === 'inspect');
- let o = arr.find(v => v.associationTypeValue === 'inspect');
- o && this.radioChangeZy(o.id, tabIndex);
- }
- }
-
- tabClick(key, isInit = false, patient?) {
- let preCurrentTabIndex = this.currentTabIndex;
- this.currentTabIndex = key;
- this.radioValueQt = null;
- this.startDeptQt = null;
- this.endDeptQt = null;
- this.radioValueZy = null;
- this.radioValueZyPre = null;
- this.defaultInspectFn();
- if(this.currentTabIndex === '患者转运'){
- this.getPatientList(this.applyDept, "", patient);
- }
- this.startDeptZy = null;
- this.endDeptZy = null;
- this.patientZy = null;
- this.goodsNow = [];
- this.workOrderRemark = "";
- this.workOrderRemarkZy = "";
- this.deptZyList["startDept"] = [];
- this.deptZyList["endDept"] = [];
- this.deptZyList["startStatus"] = 0;
- this.deptZyList["endStatus"] = 0;
- this.deptQtList["startDept"] = [];
- this.deptQtList["endDept"] = [];
- this.deptQtList["startStatus"] = 0;
- this.deptQtList["endStatus"] = 0;
- if(preCurrentTabIndex === '故障报修'){
- if(this.applyDept){
- this.rightTitle_tab = [
- { id: 0, name: '近期配送' },
- { id: 1, name: '转出院记录' },
- ]
- this.rightTitleHandler(this.rightTitle_tab[0].id);
- }
- let deptObj = this.applicationDeptList.find(v => v.id == this.incidentModel.department);
- if(this.applyDept != this.incidentModel.department){
- this.applyDept = this.incidentModel.department;
- this.searchApplicationDepartment('hsms', deptObj ? deptObj.dept : '', undefined, this.incidentModel.department);
- }
- }else if(this.currentTabIndex === '故障报修'){
- if(this.incidentModel.department){
- this.rightTitle_tab = [
- { id: 2, name: '近期维修' },
- { id: 3, name: '知识库' },
- ]
- this.rightTitleHandler(this.rightTitle_tab[0].id);
- }
- let deptObj = this.applicationDepartmentList.find(v => v.id == this.applyDept);
- if(this.incidentModel.department != this.applyDept && (!isInit || !this.buildType)){
- this.incidentModel.department = this.applyDept;
- this.searchApplicationDepartment('itsm', deptObj ? deptObj.dept : '', undefined, this.applyDept);
- }
- }
- }
-
- searchPatientList(id, searchWords) {
- this.searchPatientListSubject.next([id, searchWords]);
- }
-
- isLoadingPatient: boolean = false;
- getPatientList(id, searchWords, patient?) {
- if(patient){
- this.patientList = [patient];
- return;
- }
- if(!id){
- this.patientList = [];
- return;
- }
- let dataObj = { searchWords, deptId: id };
- this.isLoadingPatient = true;
- this.mainService.getPatientList(dataObj).subscribe((result) => {
- this.isLoadingPatient = false;
- if (result["state"] == 200) {
- this.patientList = result["data"];
-
-
-
- }
- });
- }
-
- getPatientByResidenceNo(residenceNo) {
- let postData = {
- residenceNo,
- hosId: this.checkedHos,
- idx: 0,
- sum: 2,
- };
- this.mainService.listMsgByMain('listPatient',postData).subscribe((result) => {
- if (result["status"] == 200) {
- let patientList = result["list"];
- if (patientList.length) {
- patientList = patientList.filter((item) => !!item.bedNum);
- }
- if(patientList.length === 1){
- let patient = patientList[0];
- patient.bednum = patient.bedNum;
- patient.patientname = patient.patientName;
- patient.department && (this.applicationDepartmentList = [patient.department]);
- patient.department && (this.applyDept = patient.department.id);
- patient.department && this.tabClick('患者转运', false, patient);
-
- patient.department && (this.patientZy = patient.patientCode);
- console.log(this.patientList)
- }else{
- this.msg.warning('未查询到患者');
- }
- }
- });
- }
-
- toLeft() {
- let maxStep = this.workTypesArrange.length - 5;
- this.disStep = Math.max(-maxStep, --this.disStep);
- this.disX = (this.disStep * this.elementView.nativeElement.offsetWidth) / 5;
- }
-
- toRight() {
- this.disStep = Math.min(0, ++this.disStep);
- this.disX = (this.disStep * this.elementView.nativeElement.offsetWidth) / 5;
- }
-
-
- WSNum = 0;
- changeInp(type, e) {
- this.changeInpSubject.next([type, e]);
- }
- changeCommonInp(type, e) {
- this.changeCommonInpSubject.next([type, e]);
- }
-
- applicationHospitalList:any[] = [];
- searchApplicationHospital() {
- let dataObj = {
- idx: 0,
- sum: 9999,
- hospital: {
- selectType:'level1',
- },
- };
- this.isLoading = true;
- this.mainService
- .getFetchDataList("data", "hospital", dataObj)
- .subscribe((data) => {
- this.isLoading = false;
- if (data.status == 200) {
- this.applicationHospitalList = data.list;
- }
- });
- }
-
- changeApplyHospital(e){
- console.log(e);
- this.incidentModel.department = undefined;
- this.searchApplicationDepartment('itsm');
- if(this.buildType !== '报修转事件'){
- this.incidentModel.requester = undefined;
- this.searchApplicationRequester();
- }
- this.applicationRequesterList = [];
- this.incidentModel.area = undefined;
- this.searchApplicationBuilding();
- this.incidentModel.place = undefined;
- this.applicationFloorList = [];
- this.incidentModel.houseNumber = undefined;
- this.incidentModel.duty = undefined;
-
- if(this.incidentModel.category && e && this.buildType !== '编辑事件'){
- let postData = {
- idx: 0,
- sum: 9999,
- incidentCategoryConfig: {
- categoryId: this.incidentModel.category,
- hosId: e,
- },
- };
- console.log(postData);
-
- this.isLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "incidentCategoryConfig", postData)
- .subscribe((data) => {
- this.isLoading = false;
- if (data.status == 200) {
- let list = data.list || [];
- if(list.length > 0){
- console.log(list[0]);
- this.incidentCategoryConfig = list[0];
- }else{
- this.incidentCategoryConfig = {};
- }
-
- this.incidentModel.duty = this.incidentCategoryConfig.dutyDTO;
- this.incidentModel.priorityId = this.incidentCategoryConfig.priority;
-
- this.showGroupOrUser();
- }
- });
- }else{
- this.incidentModel.group = undefined;
- this.applicationGroupList = [];
- this.incidentModel.user = undefined;
- this.applicationUserList = [];
- }
- }
-
- applicationRequesterList:any[] = [];
- isRelatedDepartment:boolean = true;
- searchApplicationRequester(keyWord?) {
-
- if(this.isRelatedDepartment && !this.incidentModel.department){
- this.applicationRequesterList = [];
- return;
- }
-
- if(!this.isRelatedDepartment && !this.incidentModel.hosId){
- this.applicationRequesterList = [];
- return;
- }
- let postData = {
- idx: 0,
- sum: 20,
- user: {
- hospital: this.isRelatedDepartment ? undefined : { id: this.incidentModel.hosId },
- dept: this.isRelatedDepartment ? { id: this.incidentModel.department } : undefined,
- name: keyWord,
-
- },
- };
- this.isLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "user", postData)
- .subscribe((data) => {
- this.isLoading = false;
- if (data.status == 200) {
- this.applicationRequesterList = data.list;
- }
- });
- }
-
- changeApplyRequester(e){
- console.log(e)
- let userObj = this.applicationRequesterList.find(v => v.id == e);
-
- if(userObj){
- this.incidentMsg.requesterPhone = userObj.phone;
- }
- }
-
- applicationCategoryList:any[] = [];
- searchApplicationCategory(keyWord?) {
- let dutyIds;
- if(this.buildType === '编辑事件'){
- dutyIds = this.incidentModel.duty.id.toString();
- }else{
- dutyIds = this.itsmData.checkedHos.length ? (this.itsmData.checkedHos.map(v => v.id).toString() || undefined) : undefined;
- }
- let postData = {
- category: {
- category: keyWord,
- selectType: 'mutlQuery',
- hierarchy: 3,
- dutyIds,
- },
- };
- console.log(postData);
-
- this.isLoading = true;
- this.mainService
- .incidentPost("listIncidentCategory", postData)
- .subscribe((data) => {
- this.isLoading = false;
- if (data.status == 200) {
- this.applicationCategoryList = data.data;
- }
- });
- }
-
- incidentCategoryConfig:any = {};
- changeApplyCategory(e, isCoverage = false){
- console.log(e)
-
- this.getKnowageList();
- if(e && !isCoverage){
-
- if(this.incidentModel.description){
- this.incidentModel.description = this.incidentModel.description + ';' + this.applicationCategoryList.find(v => v.id == e).mutiCategory;
- }else{
- this.incidentModel.description = this.applicationCategoryList.find(v => v.id == e).mutiCategory;
- }
- }
-
- if(this.incidentModel.hosId && e && this.buildType !== '编辑事件'){
- let postData = {
- idx: 0,
- sum: 9999,
- incidentCategoryConfig: {
- categoryId: e,
- hosId: this.incidentModel.hosId,
- },
- };
- console.log(postData);
-
- this.isLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "incidentCategoryConfig", postData)
- .subscribe((data) => {
- this.isLoading = false;
- if (data.status == 200) {
- let list = data.list || [];
- if(list.length > 0){
- console.log(list[0]);
- this.incidentCategoryConfig = list[0];
- }else{
- this.incidentCategoryConfig = {};
- }
-
- this.incidentModel.duty = this.incidentCategoryConfig.dutyDTO;
- this.incidentModel.priorityId = this.incidentCategoryConfig.priority;
-
- this.showGroupOrUser();
- }
- });
- }else{
- this.incidentModel.group = undefined;
- this.applicationGroupList = [];
- this.incidentModel.user = undefined;
- this.applicationUserList = [];
- }
- }
-
- directOrderModalShow = false;
- showDirectOrder() {
- this.directOrderModalShow = true;
- }
-
- closeDirectOrderModelOrder(e) {
- this.directOrderModalShow = JSON.parse(e).show;
- }
-
- confirmDirectOrderModelOrder(incidentModel){
- console.log(incidentModel);
- this.maskFlag = this.msg.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- this.incidentModel = {...this.incidentModel, ...incidentModel};
- let category = this.applicationCategoryList.find(v => v.id == this.incidentModel.category);
- let postData:any = {
- solutionId: this.solutionId,
- "incident": {
- "id": this.incidentModel.id || undefined,
- "deleteFlag": 0,
- "duty": this.incidentModel.duty ? { id: this.incidentModel.duty.id } : undefined,
- "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
- "repairIncidentType": this.incidentModel.repairIncidentType ? this.repairIncidentTypeList.find(v => v.value === this.incidentModel.repairIncidentType) : undefined,
- "alarmType": false,
- "department": this.incidentModel.department ? { id: this.incidentModel.department } : undefined,
- "contactsInformation": this.incidentModel.contactsInformation,
- "contacts": this.incidentModel.contacts,
- "hosId": this.incidentModel.hosId || undefined,
- "area": this.incidentModel.area ? { id: this.incidentModel.area } : undefined,
- "place": this.incidentModel.place ? { id: this.incidentModel.place } : undefined,
- "houseNumber": this.incidentModel.houseNumber,
- "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
- "priorityId": this.incidentModel.priorityId || undefined,
- "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
-
- "description": this.incidentModel.description,
- "directProcess": 1,
- "handleDescription": this.incidentModel.handleDescription,
- "handlingPersonnelUser": {id: this.tool.getCurrentUserId()},
- "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
- "closecode": this.incidentModel.closecode ? { id: this.incidentModel.closecode } : undefined,
- "acceptUser": { id: this.tool.getCurrentUserId() },
- "callID": this.incidentModel.callID || undefined,
- "incomingPhone": this.incidentModel.incomingPhone || undefined,
- "hjzxRecordId": this.incidentModel.hjzxRecordId || undefined,
- },
- };
- if(this.buildType){
- if(this.buildType === '报修转事件'){
- postData.incident.fromWx = true;
- }
- if(this.buildType !== '继续建单' && this.buildType !== '编辑事件' && this.buildType !== '报修转事件'){
- postData.incident = Object.assign({}, postData.incident);
- }else{
- postData.incident = Object.assign({}, this.editOrder, postData.incident);
- }
- }
- this.mainService
- .flowPost("incident/task/accept", postData)
- .subscribe((result) => {
- this.msg.remove(this.maskFlag);
- this.maskFlag = false;
- if (result.state == 200) {
-
- if(this.fileList.length){
- console.log(this.fileList.map(v => v.originFileObj));
- this.fileList.map(v => v.originFileObj).forEach(async file => {
- await this.uploadImages(file, result.data.id);
- })
- }
- this.directOrderModalShow = false;
-
- this.isBuildOrderAgaginFn();
- } else {
- this.msg.error(result.msg || '直接解决失败');
- }
- });
- }
-
- showGroupOrUser(){
-
- if(this.incidentModel.department && this.incidentModel.category && this.incidentModel.duty){
- let postData = {
- idx: 0,
- sum: 10,
- incidentAssignManager: {
- deptId: this.incidentModel.department,
- categoryId: this.incidentModel.category,
- hosId: this.incidentModel.duty.id,
- operationType: 'queryConfig',
- },
- };
- this.mainService
- .getFetchDataList("simple/data", "incidentAssignManager", postData)
- .subscribe((result) => {
- if (result.status == 200) {
- var deptBinduserConfig = result.list.length ? result.list[0] : null;
- if(deptBinduserConfig){
- console.log('deptBinduserConfig:', deptBinduserConfig)
-
- if(deptBinduserConfig.handleGroupDTO){
- this.incidentModel.group = deptBinduserConfig.handleGroupDTO.id;
- this.applicationGroupList = [deptBinduserConfig.handleGroupDTO];
- }else{
- this.incidentModel.group = undefined;
- this.applicationGroupList = [];
- }
- if(deptBinduserConfig.handleUserDTO){
- this.incidentModel.user = deptBinduserConfig.handleUserDTO.id;
- this.applicationUserList = [deptBinduserConfig.handleUserDTO];
- }else{
- this.incidentModel.user = undefined;
- this.applicationUserList = [];
- }
- }else{
- if(this.incidentModel.category){
-
- if(this.incidentCategoryConfig.groupId && this.incidentCategoryConfig.groupDTO){
- this.incidentModel.group = this.incidentCategoryConfig.groupId;
- this.applicationGroupList = [this.incidentCategoryConfig.groupDTO];
- }else{
- this.incidentModel.group = undefined;
- this.applicationGroupList = [];
- }
- if(this.incidentCategoryConfig.userId && this.incidentCategoryConfig.userDTO){
- this.incidentModel.user = this.incidentCategoryConfig.userId;
- this.applicationUserList = [this.incidentCategoryConfig.userDTO];
- }else{
- this.incidentModel.user = undefined;
- this.applicationUserList = [];
- }
- }
- }
- }
- });
- }else{
- if(this.incidentModel.category){
-
- if(this.incidentCategoryConfig.groupId && this.incidentCategoryConfig.groupDTO){
- this.incidentModel.group = this.incidentCategoryConfig.groupId;
- this.applicationGroupList = [this.incidentCategoryConfig.groupDTO];
- }else{
- this.incidentModel.group = undefined;
- this.applicationGroupList = [];
- }
- if(this.incidentCategoryConfig.userId && this.incidentCategoryConfig.userDTO){
- this.incidentModel.user = this.incidentCategoryConfig.userId;
- this.applicationUserList = [this.incidentCategoryConfig.userDTO];
- }else{
- this.incidentModel.user = undefined;
- this.applicationUserList = [];
- }
- }
- }
- }
-
- showUploadList = {
- showPreviewIcon: true,
- showRemoveIcon: true,
- hidePreviewIconInNonImage: true
- };
- fileList = [
-
-
-
-
-
-
- ];
- previewImage: string | undefined = '';
- previewVisible = false;
- handlePreview = (file: UploadFile) => {
- console.log('file1:', file)
- this.previewImage = file.url || file.thumbUrl;
- this.previewVisible = true;
- };
- beforeUpload = (file: UploadFile): boolean => {
- console.log('file2:', file)
- this.fileList = [...this.fileList, file];
- setTimeout(async () => {
- file.url = await this.getBase64(file);
- }, 0);
- console.log('this.fileList:', this.fileList)
- return true;
- };
- getBase64(file: any): Promise<any> {
- return new Promise((resolve, reject) => {
- const reader = new FileReader();
- reader.readAsDataURL(file);
- reader.onload = () => resolve(reader.result);
- reader.onerror = error => reject(error);
- });
- }
-
- temporarilyUrl = this.mainService.returnUploadUrl('temporarily', 0);
-
- applicationGroupList:any[] = [];
- searchApplicationGroup(keyWord?) {
- if(!this.incidentModel.duty){
- this.incidentModel.group = undefined;
- this.applicationGroupList = [];
- this.incidentModel.user = undefined;
- this.applicationUserList = [];
- return;
- }
- let postData = {
- idx: 0,
- sum: 20,
- group2: {
- groupName: keyWord,
- hospitals: this.incidentModel.duty ? this.incidentModel.duty.id.toString() : undefined,
- type: 3,
- },
- };
- this.isLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "group2", postData)
- .subscribe((data) => {
- this.isLoading = false;
- if (data.status == 200) {
- this.applicationGroupList = data.list;
- }
- });
- }
-
- changeApplyGroup(e){
- console.log(e);
- this.incidentModel.user = undefined;
- this.searchApplicationUser();
- }
-
- applicationUserList:any[] = [];
- searchApplicationUser(keyWord?) {
- let postData = {
- idx: 0,
- sum: 20,
- user: {
- name:keyWord,
- groupdata: this.incidentModel.group ? { id: this.incidentModel.group } : undefined,
- roleCodes: 'first-line support',
- engineer: 1,
- simpleQuery: true,
- },
- };
- this.isLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "user", postData)
- .subscribe((data) => {
- this.isLoading = false;
- if (data.status == 200) {
- this.applicationUserList = data.list;
- }
- });
- }
-
- applicationPriorityList:any[] = [];
- searchApplicationPriority(keyWord?) {
- let postData = {
- idx: 0,
- sum: 9999,
- priority: {},
- };
- this.isLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "priority", postData)
- .subscribe((data) => {
- this.isLoading = false;
- if (data.status == 200) {
- this.applicationPriorityList = data.list;
-
- let source = this.applicationSourceList.find(v => v.value === 'phone');
- if(!this.incidentModel.source && source){
- this.incidentModel.source = source.id;
- }
- }
- });
- }
-
- applicationSourceList:any[] = [];
- searchApplicationSource(keyWord?) {
- this.mainService.getDictionary("list", "incident_source").subscribe((data) => {
- this.applicationSourceList = data || [];
- });
- }
-
- repairIncidentTypeList:any[] = [];
- getRepairIncidentType() {
- this.mainService.getDictionary("list", "repair_incident_type").subscribe((data) => {
- this.repairIncidentTypeList = data || [];
- });
- }
-
- changeRepairIncidentType(value){
- this.incidentModel.department = undefined;
- this.incidentMsg.deptManyPhone = '';
- this.isRelatedDepartment = value !== 'public';
- this.changeApplyRelatedDepartment(this.isRelatedDepartment);
- }
-
- applicationBuildingList:any[] = [];
- searchApplicationBuilding(keyWord?, buildingId?) {
- let postData = {
- idx: 0,
- sum: 9999,
- building: {
- cascadeHosId: this.incidentModel.hosId,
- },
- };
- this.isLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "building", postData)
- .subscribe((data) => {
- this.isLoading = false;
- if (data.status == 200) {
- this.applicationBuildingList = data.list;
- if(buildingId){
- let hasBuildingId = this.applicationBuildingList.some(v => v.id == buildingId);
- if(hasBuildingId){
- this.incidentModel.area = buildingId;
- }else{
- this.incidentModel.area = undefined;
- }
- }
- }
- });
- }
-
- changeApplyBuilding(e){
- console.log(e)
- this.incidentModel.place = undefined;
- this.searchApplicationFloor();
- }
-
- applicationFloorList:any[] = [];
- searchApplicationFloor(keyWord?, floorId?, buildingId?) {
- let postData = {
- idx: 0,
- sum: 9999,
- floor: {
- buildId: buildingId || this.incidentModel.area || undefined,
- hosId: this.incidentModel.hosId,
- },
- };
- this.isLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "floor", postData)
- .subscribe((data) => {
- this.isLoading = false;
- if (data.status == 200) {
- this.applicationFloorList = data.list;
- if(floorId){
- let hasFloorId = this.applicationFloorList.some(v => v.id == floorId);
- if(hasFloorId){
- this.incidentModel.place = floorId;
- }else{
- this.incidentModel.place = undefined;
- }
- }
- }
- });
- }
-
- changeApplyRelatedDepartment(e){
- if(this.buildType !== '报修转事件'){
- this.incidentModel.requester = undefined;
- }
- this.searchApplicationRequester();
- }
-
- isLoadingApply: boolean = false;
- applicationDeptList:any[] = [];
- searchApplicationDepartment(type, e?, phone?, deptId?, isInit?) {
- if(!this.hsmsData.hsmsSwitch && !this.itsmData.mdv2Switch){
- return;
- }
- let keyWord = "";
- if (e && e !== "&ks&" && e !== "&go&") {
- keyWord = e;
- }
- let cascadeHosId;
- if(type == 'itsm'){
- cascadeHosId = this.incidentModel.hosId || undefined;
- }else{
- cascadeHosId = this.checkedHos;
- }
- let dataObj = {
- idx: 0,
- sum: 20,
- department: {
- searchType: type == 'itsm' ? undefined : 1,
- cascadeHosId,
- keyWord: keyWord,
- flag: 1,
- },
- };
- this.WSNum++;
- this.isLoadingApply = true;
- this.mainService
- .getFetchDataList("data", "department", dataObj)
- .subscribe((data) => {
- this.WSNum--;
- if (this.WSNum === 0) {
- this.isLoadingApply = false;
- }
- if (data.status == 200) {
- if(type == 'hsms'){
- this.applicationDepartmentList = data.list;
- deptId && this.changeApply(deptId);
- if (e === undefined) {
-
- this.changeApplicationDepartment();
- } else if (e === "&ks&") {
-
-
- let obj = this.applicationDepartmentList.find(
- (item) => item.id == this.applyDeptMiddle.id
- );
- if (!obj) {
- this.applicationDepartmentList.push(this.applyDeptMiddle);
- }
- this.applyDept = this.applyDeptMiddle.id;
- this.changeApplicationDepartment("&ks&");
-
- } else if (e === "&go&") {
-
- let obj = this.applicationDepartmentList.find(
- (item) => item.id == this.applyStartDept.id
- );
- if (!obj) {
- this.applicationDepartmentList.push(this.applyStartDept);
- }
- this.applyDept = this.applyStartDept.id;
- this.changeApplicationDepartment("&go&");
- } else if (e === "") {
-
- this.changeApplicationDepartment(phone);
- }
- }else if(type == 'itsm'){
- this.applicationDeptList = data.list;
- let ids = this.applicationDeptList.map(v => v.id);
- isInit && !ids.includes(this.incidentModel.department) && (this.applicationDeptList.unshift({id: this.incidentModel.department, dept: this.incidentMsg.deptName}))
- console.log(this.applicationDeptList);
- console.log(this.incidentModel);
- console.log(this.incidentMsg);
- deptId && this.changeApplyDept(deptId);
- }
- }
- });
- }
- openChangeApply(flag){
- flag && this.searchApplicationDepartment('hsms')
- }
- openChangeApplyDept(flag){
- flag && this.searchApplicationDepartment('itsm');
- }
- openChangeApplyRequester(flag){
- flag && this.searchApplicationRequester();
- }
- openChangeApplyCategory(flag){
- flag && this.searchApplicationCategory();
- }
- openChangeApplyGroup(flag){
- flag && this.searchApplicationGroup()
- }
- openChangeApplyUser(flag){
- flag && this.searchApplicationUser()
- }
-
- changeApply(e) {
- console.log(e, this.applicationDepartmentList);
- this.changeApplicationDepartment("&same&");
- this.defaultInspectFn();
- if(this.applyDept && this.currentTabIndex !== '故障报修'){
- this.rightTitle_tab = [
- { id: 0, name: '近期配送' },
- { id: 1, name: '转出院记录' },
- ]
- this.rightTitleHandler(this.rightTitle_tab[0].id);
- }
- let deptObj = this.applicationDepartmentList.find(v => v.id == e);
- if(this.incidentModel.department != e){
- this.incidentModel.department = e;
- this.searchApplicationDepartment('itsm', deptObj ? deptObj.dept : '', undefined, e);
- }
- }
-
- changeApplyDept(e) {
- console.log(e, this.applicationDeptList);
- if(this.incidentModel.department && this.currentTabIndex === '故障报修'){
- this.rightTitle_tab = [
- { id: 2, name: '近期维修' },
- { id: 3, name: '知识库' },
- ]
- this.rightTitleHandler(this.rightTitle_tab[0].id);
- }
- let deptObj = this.applicationDeptList.find(v => v.id == e);
- if(this.applyDept != e){
- this.applyDept = e;
- this.searchApplicationDepartment('hsms', deptObj ? deptObj.dept : '', undefined, e);
- }
-
- if(!this.incidentModel.hosId){
- if(deptObj){
- this.incidentModel.hosId = deptObj.hospital.parent ? deptObj.hospital.parent.id : deptObj.hospital.id;
- }
- this.incidentModel.area = undefined;
- this.searchApplicationBuilding();
- this.incidentModel.place = undefined;
- this.applicationFloorList = [];
- }
-
- if(deptObj){
- console.log('deptObj:', deptObj)
- this.incidentMsg.deptManyPhone = deptObj.manyPhone;
- let buildingId = deptObj.building ? deptObj.building.id : undefined;
- buildingId && this.searchApplicationBuilding('', buildingId);
- let floorId = deptObj.floor ? deptObj.floor.id : undefined;
- buildingId && floorId && this.searchApplicationFloor('', floorId, buildingId);
- this.incidentModel.houseNumber = deptObj.address;
- }
-
- if(this.buildType !== '报修转事件'){
- this.incidentModel.requester = undefined;
- }
- this.searchApplicationRequester();
-
- if(this.incidentModel.category && this.incidentModel.hosId && this.buildType !== '编辑事件'){
- let postData = {
- idx: 0,
- sum: 9999,
- incidentCategoryConfig: {
- categoryId: this.incidentModel.category,
- hosId: this.incidentModel.hosId,
- },
- };
- console.log(postData);
-
- this.isLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "incidentCategoryConfig", postData)
- .subscribe((data) => {
- this.isLoading = false;
- if (data.status == 200) {
- let list = data.list || [];
- if(list.length > 0){
- console.log(list[0]);
- this.incidentCategoryConfig = list[0];
- }else{
- this.incidentCategoryConfig = {};
- }
-
- this.incidentModel.duty = this.incidentCategoryConfig.dutyDTO;
- this.incidentModel.priorityId = this.incidentCategoryConfig.priority;
-
- this.showGroupOrUser();
- }
- });
- }else{
-
- this.showGroupOrUser();
- }
- }
-
- changeApplicationDepartment(phone?) {
- this.radioValueQt = null;
- this.startDeptQt = null;
- this.endDeptQt = null;
- this.radioValueZy = null;
- this.radioValueZyPre = null;
- this.startDeptZy = null;
- this.endDeptZy = null;
- this.patientZy = null;
- this.goodsNow = [];
-
- this.workOrderRemark = "";
- this.workOrderRemarkZy = "";
- this.deptZyList["startDept"] = [];
- this.deptZyList["endDept"] = [];
- this.deptZyList["startStatus"] = 0;
- this.deptZyList["endStatus"] = 0;
- this.deptQtList["startDept"] = [];
- this.deptQtList["endDept"] = [];
- this.deptQtList["startStatus"] = 0;
- this.deptQtList["endStatus"] = 0;
- console.log(phone);
- if (
- phone !== undefined &&
- phone !== "&same&" &&
- phone !== "&ks&" &&
- phone !== "&go&"
- ) {
-
- this.applyDept = null;
- this.noArrives = [];
- } else if (phone === "&ks&") {
- let filter = this.applicationDepartmentList.filter(
- (item) => item.id == this.applyDept
- );
- console.log('filter', filter)
-
- console.log(this.callNumber);
- if (this.currentTabIndex == "患者转运") {
-
-
- this.getPatientList(this.applyDept, "");
- }
- if (this.currentRTab === 0) {
- this.getWorkOrders(this.applyDept);
- } else if (this.currentRTab === 1) {
- this.getPatientLog(this.applyDept);
- } else if (this.currentRTab === 2) {
- this.getItsmOrders(this.incidentModel.department);
- } else if (this.currentRTab === 3) {
- this.getDictionaryList();
- }
- } else if (phone === "&go&") {
- if (this.currentTabIndex == "患者转运") {
-
-
- this.getPatientList(this.applyDept, "");
- }
- if (this.currentRTab === 0) {
- this.getWorkOrders(this.applyDept);
- } else if (this.currentRTab === 1) {
- this.getPatientLog(this.applyDept);
- } else if (this.currentRTab === 2) {
- this.getItsmOrders(this.incidentModel.department);
- } else if (this.currentRTab === 3) {
- this.getDictionaryList();
- }
- } else if (phone === "&same&") {
- if (this.currentTabIndex == "患者转运") {
-
-
- this.getPatientList(this.applyDept, "");
- }
- if (this.currentRTab === 0) {
- this.getWorkOrders(this.applyDept);
- } else if (this.currentRTab === 1) {
- this.getPatientLog(this.applyDept);
- } else if (this.currentRTab === 2) {
- this.getItsmOrders(this.incidentModel.department);
- } else if (this.currentRTab === 3) {
- this.getDictionaryList();
- }
- }
- }
-
- importPhone(phone, isTransform){
- if(isTransform){
- this.incidentModel.contactsInformation = phone.split(',')[0];
- }else{
- this.incidentModel.contactsInformation = phone;
- }
- }
-
- isBuildOrderAgagin:boolean = false;
- maskFlag:any = false;
-
- directOrder(){
- if(this.incidentModel.repairIncidentType === 'public' && !this.incidentModel.requester){
- this.msg.warning('请选择申请人!');
- return;
- }
- if(!this.incidentModel.category){
- this.msg.warning('请选择故障现象!');
- return;
- }
- let category = this.applicationCategoryList.find(v => v.id == this.incidentModel.category);
- if(!this.incidentModel.duty){
- this.msg.warning(`故障现象【${category.mutiCategory}】没有设置责任部门!`);
- return;
- }
- if(this.incidentModel.repairIncidentType === 'dept' && !this.incidentModel.department){
- this.msg.warning('请选择申请科室!');
- return;
- }
- if(!this.incidentModel.contactsInformation){
- this.msg.warning('请填写联系电话!');
- return;
- }
- if(!this.incidentModel.priorityId){
- this.msg.warning('请选择优先级!');
- return;
- }
- if(!this.incidentModel.source){
- this.msg.warning('请选择事件来源!');
- return;
- }
- if(!this.incidentModel.description){
- this.msg.warning('请选择故障描述!');
- return;
- }
- this.showDirectOrder();
- }
-
- uploadImages(file, id){
- const formData = new FormData();
- formData.append('file', file);
- formData.append('fileName', file.name);
- const req = new HttpRequest('Post', this.mainService.returnUploadUrl('wechatRequesterIncident', id), formData, {
- reportProgress: true
- });
- return this.http.request(req).pipe(filter(e => e instanceof HttpResponse)).toPromise();
- }
-
- assignOrder(){
- if(this.incidentModel.repairIncidentType === 'public' && !this.incidentModel.requester){
- this.msg.warning('请选择申请人!');
- return;
- }
- if(!this.incidentModel.category){
- this.msg.warning('请选择故障现象!');
- return;
- }
- let category = this.applicationCategoryList.find(v => v.id == this.incidentModel.category);
- console.log('故障现象对象=>>>>>',category)
- if(!this.incidentModel.duty){
- this.msg.warning(`故障现象【${category.mutiCategory}】没有设置责任部门!`);
- return;
- }
- if(this.incidentModel.repairIncidentType === 'dept' && !this.incidentModel.department){
- this.msg.warning('请选择申请科室!');
- return;
- }
- if(!this.incidentModel.contactsInformation){
- this.msg.warning('请填写联系电话!');
- return;
- }
- if(!this.incidentModel.priorityId){
- this.msg.warning('请选择优先级!');
- return;
- }
- if(!this.incidentModel.source){
- this.msg.warning('请选择事件来源!');
- return;
- }
- if(!this.incidentModel.description){
- this.msg.warning('请选择故障描述!');
- return;
- }
- if(!this.incidentModel.group && this.buildType !== '编辑事件'){
- this.msg.warning('请选择处理组!');
- return;
- }
- this.maskFlag = this.msg.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- let postData:any = {
- solutionId: this.solutionId,
- "incident": {
- "id": this.incidentModel.id || undefined,
- "deleteFlag": 0,
- "duty": this.incidentModel.duty ? { id: this.incidentModel.duty.id } : undefined,
- "department": this.incidentModel.department ? { id: this.incidentModel.department } : undefined,
- "contactsInformation": this.incidentModel.contactsInformation,
- "contacts": this.incidentModel.contacts,
- "hosId": this.incidentModel.hosId || undefined,
- "area": this.incidentModel.area ? { id: this.incidentModel.area } : undefined,
- "place": this.incidentModel.place ? { id: this.incidentModel.place } : undefined,
- "houseNumber": this.incidentModel.houseNumber,
- "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
- "priorityId": this.incidentModel.priorityId || undefined,
- "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
-
- "description": this.incidentModel.description,
- "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
- "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
- "repairIncidentType": this.incidentModel.repairIncidentType ? this.repairIncidentTypeList.find(v => v.value === this.incidentModel.repairIncidentType) : undefined,
- "acceptUser": { id: this.tool.getCurrentUserId() },
- "callID": this.incidentModel.callID || undefined,
- "incomingPhone": this.incidentModel.incomingPhone || undefined,
- "candidateGroups": this.incidentModel.group || undefined,
- "assignee": this.incidentModel.user || undefined,
- "hjzxRecordId": this.incidentModel.hjzxRecordId || undefined,
- }
- };
- if(this.buildType){
- if(this.buildType === '报修转事件'){
- postData.incident.fromWx = true;
- }
- if(this.buildType !== '继续建单' && this.buildType !== '编辑事件' && this.buildType !== '报修转事件'){
- postData.incident = Object.assign({}, postData.incident);
- }else{
- postData.incident = Object.assign({}, this.editOrder, postData.incident);
- }
- }
- console.log(postData);
-
- this.mainService
- .flowPost("incident/task/accept", postData)
- .subscribe((result) => {
- this.msg.remove(this.maskFlag);
- this.maskFlag = false;
- if (result.state == 200) {
-
- if(this.fileList.length){
- console.log(this.fileList.map(v => v.originFileObj));
- this.fileList.map(v => v.originFileObj).forEach(async file => {
- await this.uploadImages(file, result.data.id);
- })
- }
-
- this.isBuildOrderAgaginFn();
- } else {
- this.msg.error(result.msg || '建单并派单失败');
- }
- });
- }
-
- temporaryStorage(){
- this.maskFlag = this.msg.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- let category;
- if(this.incidentModel.category){
- category = this.applicationCategoryList.find(v => v.id == this.incidentModel.category);
- }
- let postData:any = {
- solutionId: this.solutionId,
- "incident": {
- "id": this.incidentModel.id || undefined,
- "deleteFlag": 0,
- "duty": this.incidentModel.duty ? { id: this.incidentModel.duty.id } : undefined,
- "department": this.incidentModel.department ? { id: this.incidentModel.department } : undefined,
- "contactsInformation": this.incidentModel.contactsInformation,
- "contacts": this.incidentModel.contacts,
- "hosId": this.incidentModel.hosId || undefined,
- "area": this.incidentModel.area ? { id: this.incidentModel.area } : undefined,
- "place": this.incidentModel.place ? { id: this.incidentModel.place } : undefined,
- "houseNumber": this.incidentModel.houseNumber,
- "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
- "priorityId": this.incidentModel.priorityId || undefined,
- "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
-
- "description": this.incidentModel.description,
- "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
- "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
- "repairIncidentType": this.incidentModel.repairIncidentType ? this.repairIncidentTypeList.find(v => v.value === this.incidentModel.repairIncidentType) : undefined,
- "acceptUser": { id: this.tool.getCurrentUserId() },
- "callID": this.incidentModel.callID || undefined,
- "incomingPhone": this.incidentModel.incomingPhone || undefined,
- "candidateGroups": this.incidentModel.group || undefined,
- "assignee": this.incidentModel.user || undefined,
- "hjzxRecordId": this.incidentModel.hjzxRecordId || undefined,
- }
- };
- if(this.buildType){
- if(this.buildType === '报修转事件'){
- postData.incident.fromWx = true;
- }
- if(this.buildType !== '继续建单' && this.buildType !== '编辑事件' && this.buildType !== '报修转事件'){
- postData.incident = Object.assign({}, postData.incident);
- }else{
- postData.incident = Object.assign({}, this.editOrder, postData.incident);
- }
- }
- console.log(postData);
-
- this.mainService
- .flowPost("incident/task/storage", postData)
- .subscribe((result) => {
- this.msg.remove(this.maskFlag);
- this.maskFlag = false;
- if (result.state == 200) {
-
- if(this.fileList.length){
- console.log(this.fileList.map(v => v.originFileObj));
- this.fileList.map(v => v.originFileObj).forEach(async file => {
- await this.uploadImages(file, result.data.id);
- })
- }
-
- this.isBuildOrderAgaginFn();
- } else {
- this.msg.error(result.msg || '暂存失败');
- }
- });
- }
-
- saveOrder(){
- if(this.incidentModel.repairIncidentType === 'public' && !this.incidentModel.requester){
- this.msg.warning('请选择申请人!');
- return;
- }
- if(!this.incidentModel.category){
- this.msg.warning('请选择故障现象!');
- return;
- }
- let category = this.applicationCategoryList.find(v => v.id == this.incidentModel.category);
- if(!this.incidentModel.duty){
- this.msg.warning(`故障现象【${category.mutiCategory}】没有设置责任部门!`);
- return;
- }
- if(this.incidentModel.repairIncidentType === 'dept' && !this.incidentModel.department){
- this.msg.warning('请选择申请科室!');
- return;
- }
- if(!this.incidentModel.contactsInformation){
- this.msg.warning('请填写联系电话!');
- return;
- }
- if(!this.incidentModel.priorityId){
- this.msg.warning('请选择优先级!');
- return;
- }
- if(!this.incidentModel.source){
- this.msg.warning('请选择事件来源!');
- return;
- }
- if(!this.incidentModel.description){
- this.msg.warning('请选择故障描述!');
- return;
- }
- this.maskFlag = this.msg.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- let postData:any = {
- solutionId: this.solutionId,
- "incident": {
- "id": this.incidentModel.id || undefined,
- "deleteFlag": 0,
- "duty": this.incidentModel.duty ? { id: this.incidentModel.duty.id } : undefined,
- "department": this.incidentModel.department ? { id: this.incidentModel.department } : undefined,
- "contactsInformation": this.incidentModel.contactsInformation,
- "contacts": this.incidentModel.contacts,
- "hosId": this.incidentModel.hosId || undefined,
- "area": this.incidentModel.area ? { id: this.incidentModel.area } : undefined,
- "place": this.incidentModel.place ? { id: this.incidentModel.place } : undefined,
- "houseNumber": this.incidentModel.houseNumber,
- "category": this.incidentModel.category ? { id: this.incidentModel.category } : undefined,
- "priorityId": this.incidentModel.priorityId || undefined,
- "source": this.incidentModel.source ? { id: this.incidentModel.source } : undefined,
-
- "description": this.incidentModel.description,
- "yyTime": this.incidentModel.yyTime ? format(new Date(this.incidentModel.yyTime), 'yyyy-MM-dd HH:mm:ss') : undefined,
- "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : undefined,
- "repairIncidentType": this.incidentModel.repairIncidentType ? this.repairIncidentTypeList.find(v => v.value === this.incidentModel.repairIncidentType) : undefined,
- "acceptUser": { id: this.tool.getCurrentUserId() },
- "callID": this.incidentModel.callID || undefined,
- "incomingPhone": this.incidentModel.incomingPhone || undefined,
- "hjzxRecordId": this.incidentModel.hjzxRecordId || undefined,
- }
- };
- if(this.buildType){
- postData.incident = Object.assign({}, this.editOrder, postData.incident);
- }
- console.log(postData);
-
- this.mainService
- .flowPost("incident/task/edit", postData)
- .subscribe((result) => {
- this.msg.remove(this.maskFlag);
- this.maskFlag = false;
- if (result.state == 200) {
-
- if(this.fileList.length){
- console.log(this.fileList.map(v => v.originFileObj));
- this.fileList.map(v => v.originFileObj).forEach(async file => {
- await this.uploadImages(file, result.data.id);
- })
- }
-
- this.isBuildOrderAgaginFn();
- } else {
- this.msg.error(result.msg || '编辑失败');
- }
- });
- }
-
- isBuildOrderAgaginFn(){
- if(this.isBuildOrderAgagin){
-
- this.incidentModel.category = undefined;
- this.incidentModel.user = undefined;
- this.incidentModel.group = undefined;
- this.showPromptModal("操作", true, "", "");
- }else{
- if(this.incomingService.getSign() === 'callCenter' && this.incomingService.getPhoneNumber()){
- this.jry_shixian();
- }
- this.newOrderShow = false;
- this.newOrderShowOpen = false;
- this.showPromptModal("操作", true, "", "");
- }
- }
-
- countRemarkIndex:number = -1;
- addCountRemark(countRemark, index, i){
- if(this.countRemarkIndex == i){
- this.countRemarkIndex = -1;
- }else{
- this.countRemarkIndex = i;
- }
- this.getSearchTaskList('', this.countRemarkIndex > -1 ? countRemark : '').subscribe((result) => {
- if (result.status == 200) {
- this.searchTaskLoading = false;
- this.workTypes = result['data'] || [];
-
- this.isShowResidenceNo = false;
- this.workTypesArrange[index].value = [];
-
-
-
- this.workTypes.forEach((item) => {
- if(item.associationTypeValue === 'patientTransport' || item.associationTypeValue === 'inspect'){
-
-
-
-
-
-
-
-
- }else if(item.associationTypeValue === 'other' || item.associationTypeValue === 'specimen' || item.associationTypeValue === 'ordinary'){
-
- let obj = this.workTypesArrange.find(v => v.key === '物品配送');
- if(obj){
- obj.value.push(item);
- }else{
- this.workTypesArrange.unshift({ key: '物品配送', value: [item] });
- }
- }
- });
- console.log('workTypesArrange', this.workTypesArrange);
-
- let arr = this.workTypesArrange;
- this.workTypesFlag = arr.length >= 5;
- }
- });
- }
-
- countRemarkList:any[] = [];
- isShowResidenceNo = false;
- getAutoWorkTypes(isFirst, isInit) {
- this.workTypesArrange = [];
-
- if(this.itsmData.mdv2Switch){
- this.workTypesArrange = [{key:'故障报修', value: []}];
- if(!this.hsmsData.hsmsSwitch){
- console.log('workTypesArrange', this.workTypesArrange);
-
- this.workTypesFlag = this.workTypesArrange.length >= 5;
-
- if (this.workTypesArrange.length > 0) {
- this.tabClick(this.workTypesArrange[0].key, isInit);
- }
- }
- }
-
- if(this.hsmsData.hsmsSwitch){
- this.newLoading = true;
- this.mainService.getTaskTypeBySearchKey({
- hosId: this.checkedHos,
- }).subscribe((data) => {
- this.newLoading = false;
- if (data["status"] == 200) {
- this.workTypes = data["data"];
-
- this.isShowResidenceNo = false;
- this.workTypes.forEach((item) => {
- if(item.associationTypeValue === 'patientTransport' || item.associationTypeValue === 'inspect'){
-
- let obj = this.workTypesArrange.find(v => v.key === '患者转运');
- if(obj){
- obj.value.push(item);
- }else{
- this.workTypesArrange.unshift({ key: '患者转运', value: [item] });
- this.isShowResidenceNo = true;
- }
- }else if(item.associationTypeValue === 'other' || item.associationTypeValue === 'specimen' || item.associationTypeValue === 'ordinary'){
-
- let obj = this.workTypesArrange.find(v => v.key === '物品配送');
- if(obj){
- obj.value.push(item);
- }else{
- this.workTypesArrange.unshift({ key: '物品配送', value: [item] });
- }
- }
- });
- console.log('workTypesArrange', this.workTypesArrange);
-
- let arr = this.workTypesArrange;
- this.workTypesFlag = arr.length >= 5;
-
- if (arr.length > 0) {
- isFirst ? this.tabClick(arr[0].key, isInit) : this.tabClick(arr[arr.length - 1].key, isInit);
- }
- }
- });
- this.getTaskTypeCountRemarkList();
- }
- }
-
- getTaskTypeCountRemarkList(){
- this.mainService.getTaskTypeCountRemarkList({
- hosId: this.checkedHos,
- typeValues: 'other,specimen,ordinary',
- }).subscribe((data) => {
- if (data["status"] == 200){
- this.countRemarkList = data.data || [];
- }
- })
- }
-
- endDeptZyChange() {
- if (!this.applyDept || !this.endDeptZy) {
- return;
- }
-
- if (this.radioValueZy == this.deathTasktypeId) {
-
- this.patientZy = null;
- this.getPatientList(this.endDeptZy, "");
- }
- }
-
- searchHosDepartment(id, type, dept?) {
- if (dept) {
- this.searchHosDepartmentSubject.next([id, type, dept]);
- } else {
- this.searchHosDepartmentSubject.next([id, type]);
- }
- }
-
- getHosDepartment(id, type, dept?) {
-
- let value = "";
- if (dept) {
- value = dept;
- }
- if (type === "start" && this.deptZyList["startStatus"] == 202) {
-
- this.mainService.getdeptList(this.radioValueZy).subscribe((data:any) => {
- let arr = data;
- if(value!=''){
- data = arr.startDept.filter(i=>i.dept.indexOf(value) !=-1)
- this.deptZyList.startDept = data
- }else{
- this.deptZyList.startDept = arr.startDept
- }
- })
- return;
- } else if (type === "end" && this.deptZyList["endStatus"] == 202) {
-
- this.mainService.getdeptList(this.radioValueZy).subscribe((data:any) => {
- let arr = data;
- if(value!=''){
- data = arr.endDept.filter(i=>i.dept.indexOf(value) !=-1)
- this.deptZyList.endDept = data
- }else{
- this.deptZyList.endDept = arr.endDept
- }
- })
- return;
- }
- let postData = {
- idx: 0,
- sum: 10,
- department: {
- dept: value,
- cascadeHosId: id
- },
- };
- if (type == "start" && this.deptZyList["startStatus"] == 205) {
- postData.department["type"] = { id: this.deptZyList["startTypeId"] };
- } else if (type == "end" && this.deptZyList["endStatus"] == 205) {
- postData.department["type"] = { id: this.deptZyList["endTypeId"] };
- }
- this.isLoading = true;
- this.mainService
- .getFetchDataList("data", "department", postData)
- .subscribe((data) => {
- this.isLoading = false;
- if (data["status"] == 200) {
- if (type === "start") {
- this.deptZyList["startDept"] = data.list;
- } else if (type === "end") {
- this.deptZyList["endDept"] = data.list;
- }
- }
- });
- }
-
- searchHosDepartmentQt(id, type, dept?) {
- if (dept) {
- this.searchHosDepartmentQtSubject.next([id, type, dept]);
- } else {
- this.searchHosDepartmentQtSubject.next([id, type]);
- }
- }
-
- getHosDepartmentQt(id, type, dept?) {
-
- let value = "";
- if (dept) {
- value = dept;
- }
- if (type === "start" && this.deptQtList["startStatus"] == 202) {
-
- this.mainService.getdeptList(this.psValue).subscribe((data:any) => {
- let arr = data;
- if(value!=''){
- data = arr.startDept.filter(i=>i.dept.indexOf(value) !=-1)
- this.deptQtList.startDept = data
- }else{
- this.deptQtList.startDept = arr.startDept
- }
- })
- return;
- } else if (type === "end" && this.deptQtList["endStatus"] == 202) {
-
- this.mainService.getdeptList(this.psValue).subscribe((data:any) => {
- let arr = data;
- if(value!=''){
- data = arr.endDept.filter(i=>i.dept.indexOf(value) !=-1)
- this.deptQtList.endDept = data
- }else{
- this.deptQtList.endDept = arr.endDept
- }
- })
- return;
- }
- let postData = {
- idx: 0,
- sum: 10,
- department: {
- dept: value,
- cascadeHosId: id
- },
- };
- if (type == "start" && this.deptQtList["startStatus"] == 205) {
- postData.department["type"] = { id: this.deptQtList["startTypeId"] };
- } else if (type == "end" && this.deptQtList["endStatus"] == 205) {
- postData.department["type"] = { id: this.deptQtList["endTypeId"] };
- }
- this.isLoading = true;
- this.mainService
- .getFetchDataList("data", "department", postData)
- .subscribe((data) => {
- this.isLoading = false;
- if (data["status"] == 200) {
- if (type === "start") {
- this.deptQtList["startDept"] = data.list;
- } else if (type === "end") {
- this.deptQtList["endDept"] = data.list;
- }
- }
- });
- }
-
- getLgNumber(x: number, n:number): number{
- for(let i = x; i < 60; i++){
- if(i % n === 0){
- return i;
- }
- }
- return 0;
- }
-
- disabledHours = (): number[] => {
- let now = new Date();
- let nHour = now.getHours();
- let nMinute = now.getMinutes();
- if (nMinute > (60 - this.inspectAndPatientTransportConfig.timeMod)) {
- return range(0, nHour + 1);
- } else {
- return range(0, nHour);
- }
- }
-
- disabledMinutes = (hour: number): number[] => {
- let now = new Date();
- let nHour = now.getHours();
- let nMinute = now.getMinutes();
- if (hour === nHour || hour === undefined) {
- return this.integralDivision(0, nMinute, this.inspectAndPatientTransportConfig.timeMod);
- } else {
- return [];
- }
- }
-
- integralDivision(start:number, end:number, n:number): number[]{
- let arr = [];
- for(let i = start; i <= end; i++){
- if(i % n === 0){
- arr.push(i);
- }
- }
- return arr;
- }
-
- yyDateChange(e) {
-
- let yyDate = new Date(e);
- let year = yyDate.getFullYear();
- let month = yyDate.getMonth();
- let date = yyDate.getDate();
-
- let now = new Date();
- let nYear = now.getFullYear();
- let nMonth = now.getMonth();
- let nDate = now.getDate();
- if (year != nYear || month != nMonth || date != nDate) {
- this.disabledHours = () => [];
- this.disabledMinutes = (hour) => [];
- } else {
-
- this.disabledHours = () => {
- let now = new Date();
- let nHour = now.getHours();
- let nMinute = now.getMinutes();
- if (nMinute > (60 - this.inspectAndPatientTransportConfig.timeMod)) {
- return range(0, nHour + 1);
- } else {
- return range(0, nHour);
- }
- };
-
- this.disabledMinutes = (hour) => {
- let now = new Date();
- let nHour = now.getHours();
- let nMinute = now.getMinutes();
- if (hour === nHour || hour === undefined) {
- return this.integralDivision(0, nMinute, this.inspectAndPatientTransportConfig.timeMod);
- } else {
- return [];
- }
- };
- }
- }
-
- nextDayZy() {
- this.yyDateZy = addDays(this.yyDateZy, 1);
- this.yyDateChange(this.yyDateZy);
- }
-
- nextDay() {
- this.yyDate = addDays(this.yyDate, 1);
- this.yyDateChange(this.yyDate);
- }
-
- disabledyyDateZy = (current: Date): boolean => {
- return differenceInCalendarDays(current, new Date()) < 0;
- };
-
- disabledyyDate = (current: Date): boolean => {
- return differenceInCalendarDays(current, new Date()) < 0;
- };
- yyTimeZyChange(e) {
- if (this.yyTimeZy) {
- let now = new Date();
-
- if (getHours(this.yyTimeZy) < getHours(now)) {
- this.disabledyyDateZy = (current: Date): boolean => {
- return differenceInCalendarDays(current, new Date()) < 1;
- };
- } else {
- this.disabledyyDateZy = (current: Date): boolean => {
- return differenceInCalendarDays(current, new Date()) < 0;
- };
- }
- let end = this.getLgNumber(getMinutes(this.yyTimeZy), this.inspectAndPatientTransportConfig.timeMod);
- this.yyTimeZy = setMinutes(this.yyTimeZy, end);
- }
- this.clickYYZyFlag = false;
- }
- yyTimeChange(e) {
- if (this.yyTime) {
- let now = new Date();
-
- if (getHours(this.yyTime) < getHours(now)) {
- this.disabledyyDate = (current: Date): boolean => {
- return differenceInCalendarDays(current, new Date()) < 1;
- };
- } else {
- this.disabledyyDate = (current: Date): boolean => {
- return differenceInCalendarDays(current, new Date()) < 0;
- };
- }
- let end = this.getLgNumber(getMinutes(this.yyTime), this.inspectAndPatientTransportConfig.timeMod);
- this.yyTime = setMinutes(this.yyTime, end);
- }
- this.clickYYFlag = false;
- }
-
- yyInspectChange(e) {
- if (this.currentTasktype.associationType.value === "other") {
-
- this.yyTime = null;
- this.yyDate = new Date();
- console.log(this.isYyInspect);
- } else if (this.currentTasktype.associationType.value === "patientTransport") {
-
- this.yyTimeZy = null;
- this.yyDateZy = new Date();
- }else if (this.currentTasktype.associationType.value === "inspect") {
-
- let obj = this.filterLinkCheckLis.find((item) => {
- return (parse(item.yyTime, 'yyyy-MM-dd HH:mm:ss', new Date()).getTime() - new Date().getTime() > 0);
- });
- if (obj) {
- this.showDateTime();
- } else {
- this.yyTimeZy = null;
- this.yyDateZy = new Date();
- console.log(this.isYyInspect);
- }
- }
- }
-
- showDateTime() {
-
- let isYyInspect = this.filterLinkCheckLis.every((item) => {
- return (parse(item.yyTime, 'yyyy-MM-dd HH:mm:ss', new Date()).getTime() - new Date().getTime() > 0);
- });
-
- if (isYyInspect) {
-
- let timeList = this.filterLinkCheckLis
- .map((item) => parse(item.yyTime, 'yyyy-MM-dd HH:mm:ss', new Date()).getTime())
- .sort();
- this.yyTimeZy = new Date(timeList[0] - 0);
- this.yyDateZy = new Date(timeList[0] - 0);
- this.yyDateChange(this.yyTimeZy);
- } else {
- this.yyTimeZy = null;
- this.yyDateZy = null;
- }
- }
-
- linkCheckLisTrue = false;
- filterLinkCheckLis = [];
- isInspects = false;
- linkCheckLisChange(e) {
- let flag = false;
- let arr = [];
-
- if (this.currentTasktype.isMoreDept === 0) {
- let arr = e.map((item) => item.execDeptId);
- arr = Array.from(new Set(arr));
- this.isInspects = arr.length > 1;
- }
- this.linkCheckLis.forEach((item, index) => {
- if (e.length) {
-
- e.forEach((v) => {
-
- if (v.priority == 1) {
- flag = true;
- }
-
- if (v.value == item.value) {
- arr.push(index);
- }
- });
- } else {
- item.checked = false;
- }
- });
- this.linkCheckLis.forEach((item, index) => {
- item.checked = arr.includes(index);
- });
- console.log(e, this.linkCheckLis);
- this.clickYYFlag = false;
-
- this.filterLinkCheckLis = this.linkCheckLis.filter(
- (item) => Boolean(item.yyTime) && item.checked
- );
-
- if (this.filterLinkCheckLis.length) {
-
- this.isYyInspect = this.filterLinkCheckLis.every((item) => {
- return (parse(item.yyTime, 'yyyy-MM-dd HH:mm:ss', new Date()).getTime() - new Date().getTime() > 0);
- });
-
- this.showDateTime();
- } else {
-
- this.isYyInspect = false;
- this.yyTimeZy = null;
- this.yyDateZy = null;
- }
- this.linkCheckLisTrue = e.length > 0;
- }
-
- goodsNow;
- yyDateZy = null;
- yyDate = null;
- yyTimeZy = null;
- yyTime = null;
- inspectAndPatientTransportConfig:any = {timeMod: 30};
- isYyInspect = false;
- clickYYZyFlag = false;
- clickYYFlag = false;
- currentTasktype = null;
- isTaskTypeInspect:boolean = false;
- linkCheckLis:any[] = [];
- tabIndex;
- isStartFixedType:boolean = false;
- isEndFixedType:boolean = false;
- radioChangeZy(value, index) {
- this.radioValueZyPre = this.radioValueZy;
- this.radioValueZy = value;
- this.tabIndex = index;
-
- if (value === "" || value === null) {
- return;
- }
- this.linkCheckLisTrue = false;
- this.startDeptZy = null;
- this.endDeptZy = null;
-
- console.log(this.workTypesArrange[index].value);
- let taskType = this.workTypesArrange[index].value.find(v => v.id == value);
- let patientCode;
- if(taskType.associationTypeValue === 'inspect'){
- patientCode = this.patientZy;
- this.requiredConfigChange('validateFormZy', 'startDept', false);
- this.requiredConfigChange('validateFormZy', 'endDepts', false);
- this.isTaskTypeInspect = true;
- }else{
- patientCode = undefined;
- this.requiredConfigChange('validateFormZy', 'startDept', true);
- this.requiredConfigChange('validateFormZy', 'endDepts', true);
- this.isTaskTypeInspect = false;
- }
-
-
-
-
-
-
- this.mainService.getdeptList(value, patientCode, (taskType.associationTypeValue === 'inspect' ? format(startOfDay(this.inspectToday), 'yyyy-MM-dd HH:mm:ss') : undefined), (taskType.associationTypeValue === 'inspect' ? format(endOfDay(this.inspectToday), 'yyyy-MM-dd HH:mm:ss') : undefined)).subscribe((data:any) => {
- this.deptZyList = data;
- if(data.startStatus==202 || data.startStatus==204 || data.startStatus==205){
- this.isStartFixedType = true
- }else{
- this.isStartFixedType = false
- }
- if(data.endStatus==202 || data.endStatus==204 || data.endStatus==205){
- this.isEndFixedType = true
- }else{
- this.isEndFixedType = false
- }
-
- this.currentTasktype = data.taskType;
- this.isYyInspect = false;
- this.clickYYZyFlag = false;
- this.yyDateZy = new Date();
- this.yyTimeZy = null;
-
- console.log(this.deptZyList);
-
- if(taskType.associationTypeValue === 'inspect'){
- this.linkCheckLis = [];
- if (data.data && Array.isArray(data.data.data) && data.data.data.length) {
- let arr = [];
- data.data.data.forEach((e) => {
- arr.push({
- execDeptId: e.execDept.id,
- yyTime: e.yyTime,
- priority: e.priority,
- label: (e.yyTime || "") + " " + e.execDept.dept + " 进行 " + (e.inspectName || "检查"),
- value: e["id"],
- checked: false,
- });
- });
- this.linkCheckLis = arr;
- }
- return;
- }
-
- if (data["startStatus"] == 201 || data["startStatus"] == 206) {
- if (this.applyDept) {
-
- this.deptZyList["startDept"] = this.applicationDepartmentList.filter(
- (item) => item.id == this.applyDept
- );
- this.startDeptZy = this.applyDept;
- }
- } else if (data["startStatus"] == 203) {
- this.startDeptZy = data["startDept"][0]["id"];
- } else if (data["startStatus"] == 204 || data["startStatus"] == 205) {
- this.getHosDepartment(this.checkedHos, "start", "");
- }
-
- if (data["endStatus"] == 201 || data["endStatus"] == 206) {
- if (this.applyDept) {
-
- this.deptZyList["endDept"] = this.applicationDepartmentList.filter(
- (item) => item.id == this.applyDept
- );
- this.endDeptZy = this.applyDept;
- }
- } else if (data["endStatus"] == 203) {
- this.endDeptZy = data["endDept"][0]["id"];
- } else if (data["endStatus"] == 204 || data["endStatus"] == 205) {
- this.getHosDepartment(this.checkedHos, "end", "");
- }
- if (this.currentTabIndex == "患者转运") {
-
- if (this.endDeptZy && this.radioValueZy == this.deathTasktypeId) {
-
- this.patientZy = null;
- this.getPatientList(this.endDeptZy, "");
- } else if(this.applyDept && this.radioValueZyPre == this.deathTasktypeId) {
-
- this.patientZy = null;
- this.getPatientList(this.applyDept, "");
- }
- }
- });
- setTimeout(() => {
-
- let arrObj = this.workTypesArrange.find(v => v.key === this.currentTabIndex);
- let arr = arrObj.value;
- this.goodsNow = arr.filter(
- (item) => item.id == value
- )[0].taskType.carryEquipmentIds;
- if (this.goodsNow) {
- this.goodsNow = this.goodsNow.map((item) => {
- return {
- label: item.name,
- value: item.id,
- checked: false,
- };
- });
- } else {
- this.goodsNow = [];
- }
- }, 0)
- }
- psValue:any;
- radioChangeQt(value) {
-
- if (value === "" || value === null) {
- return;
- }
- this.psValue = value
- this.startDeptQt = null;
- this.endDeptQt = null;
-
-
-
-
-
- this.mainService.getdeptList(value).subscribe((data:any) => {
- this.deptQtList = data;
- if(data.startStatus==202 || data.startStatus==204 || data.startStatus==205){
- this.isStartFixedType = true
- }else{
- this.isStartFixedType = false
- }
- if(data.endStatus==202 || data.endStatus==204 || data.endStatus==205){
- this.isEndFixedType = true
- }else{
- this.isEndFixedType = false
- }
-
- this.currentTasktype = data.taskType;
- this.isYyInspect = false;
- this.clickYYFlag = false;
- this.yyDate = new Date();
- this.yyTime = null;
-
- this.deptQtList.taskType.customRemarks = this.deptQtList.taskType.customRemarks ? this.deptQtList.taskType.customRemarks.split("$") : [];
-
- if (data["startStatus"] == 201) {
- if (this.applyDept) {
-
- this.deptQtList["startDept"] = this.applicationDepartmentList.filter(
- (item) => item.id == this.applyDept
- );
- this.startDeptQt = this.applyDept;
- }
- } else if (data["startStatus"] == 203) {
- this.startDeptQt = data["startDept"][0]["id"];
- } else if (data["startStatus"] == 204 || data["startStatus"] == 205) {
- this.getHosDepartmentQt(this.checkedHos, "start", "");
- }
-
- if (data["endStatus"] == 201) {
- if (this.applyDept) {
-
- this.deptQtList["endDept"] = this.applicationDepartmentList.filter(
- (item) => item.id == this.applyDept
- );
- this.endDeptQt = this.applyDept;
- }
- } else if (data["endStatus"] == 203) {
- this.endDeptQt = data["endDept"][0]["id"];
- } else if (data["endStatus"] == 204 || data["endStatus"] == 205) {
- this.getHosDepartmentQt(this.checkedHos, "end", "");
- }
- });
- }
-
- isGoLoading = false;
- newOrderOk(go?): void {
- console.log(this.radioValueQt);
- let arr = this.workTypesArrange.find(v => v.key === this.currentTabIndex);
- let objQt = arr.value.find(v => v.id == this.radioValueQt);
- let objZy = arr.value.find(v => v.id == this.radioValueZy);
- if (this.isYyInspect && objQt && objQt.associationTypeValue === 'other') {
- this.clickYYFlag = true;
- } else {
- this.clickYYFlag = false;
- }
- if (this.isYyInspect && objZy && (objZy.associationTypeValue === 'patientTransport' || objZy.associationTypeValue === 'inspect')) {
- this.clickYYZyFlag = true;
- } else {
- this.clickYYZyFlag = false;
- }
- if (
- (!this.yyTime && objQt && objQt.associationTypeValue === 'other' && this.isYyInspect) ||
- (!this.yyTimeZy && objZy && (objZy.associationTypeValue === 'patientTransport' || objZy.associationTypeValue === 'inspect') && this.isYyInspect)
- ) {
- return;
- }
- if (go !== "&go&") {
- this.isOkLoading = true;
- } else {
- this.isGoLoading = true;
- }
- if (objZy && objZy.associationTypeValue === 'patientTransport') {
-
- go === "&go&" ? this.submitFormZy(go) : this.submitFormZy();
- }if (objZy && objZy.associationTypeValue === 'inspect') {
-
- go === "&go&" ? this.submitFormInspect(go) : this.submitFormInspect();
- } else if (objQt && objQt.associationTypeValue === 'specimen') {
-
- go === "&go&" ? this.submitFormBbps(go) : this.submitFormBbps();
- } else if (objQt && objQt.associationTypeValue === 'other') {
-
- go === "&go&" ? this.submitFormQt(go) : this.submitFormQt();
- } else if (objQt && objQt.associationTypeValue === 'ordinary') {
-
- go === "&go&" ? this.submitFormOrdinary(go) : this.submitFormOrdinary();
- }
- }
- nucleicAcidPrintingCancel():void {
- this.fixedTab = '';
- }
-
- newOrderCancel(): void {
- if(this.incomingService.getSign() === 'callCenter' && this.incomingService.getPhoneNumber()){
- this.jry_shixian();
- }
- this.newOrderShow = false;
- this.newOrderShowOpen = false;
- this.currentTabIndex = "";
- this.fixedTab = "";
- this.fixedMenuShangla();
- this.radioValueQt = null;
- this.startDeptQt = null;
- this.endDeptQt = null;
- this.radioValueZy = null;
- this.radioValueZyPre = null;
- this.startDeptZy = null;
- this.endDeptZy = null;
- this.patientZy = null;
- this.goodsNow = [];
- this.patientList = [];
- this.workOrderRemark = "";
- this.workOrderRemarkZy = "";
- this.deptZyList["startDept"] = [];
- this.deptZyList["endDept"] = [];
- this.deptZyList["startStatus"] = 0;
- this.deptZyList["endStatus"] = 0;
- this.deptQtList["startDept"] = [];
- this.deptQtList["endDept"] = [];
- this.deptQtList["startStatus"] = 0;
- this.deptQtList["endStatus"] = 0;
- }
-
- changeGoods(value: object[]): void {
- console.log(value);
- }
-
-
- openRecallModal(id) {
- this.coopId = id;
- this.recallOrderShow = true;
- }
-
- confirmRec() {
- let that = this;
- that.btnLoading = true;
- let postData: any = {};
- let flags = "";
- this.coopId = this.coopId + "";
- if (this.coopId.includes("-")) {
-
- flags = "batchExcuteWorkOrder";
- let ids = this.coopId.split("-");
- postData.workOrders = [];
- ids.forEach((item) => {
- postData.workOrders.push({ id: item, type: "recall" });
- });
- } else {
- flags = "excuteWorkOrder/recall";
- postData = {
- workOrder: {
- id: this.coopId,
- },
- };
- }
- that.mainService.coopWorkerOrder(flags, postData).subscribe((data) => {
- that.btnLoading = false;
- that.closeRecallOrderModal();
- if (data.status == 200) {
- that.showPromptModal("撤回", true, "");
- } else {
- that.showPromptModal("撤回", false, data.msg);
- }
- });
- }
-
- recAndDel() {
- let that = this;
- that.recDelLoading = true;
- that.mainService.delOrder(that.coopId).subscribe((data) => {
- that.recDelLoading = false;
- console.log(data);
- that.closeRecallOrderModal();
- if (data.status == 200) {
- that.showPromptModal("删除", true, "");
- } else {
- that.showPromptModal("删除", false, data.msg);
- }
- });
- }
-
- closeRecallOrderModal() {
- this.recallOrderShow = false;
- this.batchClickType1 = false;
- }
-
-
- coopId;
- coopType;
- openDelModal(id, type) {
- this.coopId = id;
- this.coopType = type;
- this.delOrderShow = true;
- }
-
- confirmDel() {
- let that = this;
- that.btnLoading = true;
- if(this.coopType === 'hsms'){
- that.mainService.delOrder(that.coopId).subscribe((data) => {
- that.btnLoading = false;
- console.log(data);
- that.closeDelOrderModal();
- if (data.status == 200) {
- that.showPromptModal("删除", true, "");
- } else {
- that.showPromptModal("删除", false, data.msg);
- }
- });
- }else if(this.coopType === 'itsm'){
- that.mainService.simplePost("rmvData", "incident", [this.coopId]).subscribe((data) => {
- that.btnLoading = false;
- console.log(data);
- that.closeDelOrderModal();
- if (data.status == 200) {
- that.showPromptModal("删除", true, "");
- } else {
- that.showPromptModal("删除", false, data.msg);
- }
- });
- }
- }
-
- closeDelOrderModal() {
- this.delOrderShow = false;
- }
-
-
- submitFormHand(id) {
-
- this.createLoading = true;
- let postData = {
- workOrder: {
- sourceId: SourceId.fuwutai,
- taskType: {
- id: this.deathTasktypeIdPatient,
- },
- startDept: {
-
- id: this.createOrderObj.sqDept.id,
- },
- createDept: this.applyDept,
- endDepts: [
-
- {
- id: id,
- },
- ],
- patient: {
- patientCode: this.createOrderObj.patient.patientCode,
- },
- },
- };
- this.mainService.buildOrder(postData).subscribe((result) => {
- this.createLoading = false;
- this.deptFlag = false;
- if (result["status"] == 200) {
- this.showPromptModal("建单", true, "");
- } else {
- this.showPromptModal("建单", false, result["msg"]);
- }
- });
- }
-
- deptFlagHand(e) {
- this.deptFlag = false;
- }
-
- createOrderObj;
- createLoading = false;
- deptFlag = false;
- patientLogBuild(obj) {
- this.createOrderObj = obj;
- this.deptFlag = true;
- }
-
- controlView:any = {};
- initControlView() {
- let postData = {
- controlView: {},
- idx: 0,
- sum: 1,
- };
- this.mainService
- .coopTypeConfig("fetchDataList", "controlView", postData)
- .subscribe((data) => {
- this.controlView = data.list[0] ? data.list[0] : {
- hurseInfoHiding: 1,
- orderInfoTime: 60,
- workerInfoTime: 60,
- unsendOrderVoice: true,
- orderType: 'priority',
- };
- this.patientCareCol = 7;
- this.hurseInfoHiding = this.controlView.hurseInfoHiding ? 1 : 0;
- this.txtLabelCol = 1;
- this.orderRefreshTime = this.orderInfoTime = this.controlView.orderInfoTime;
- this.workerRefreshTime = this.workerInfoTime = this.controlView.workerInfoTime;
- this.audioNotDispatched = this.controlView.unsendOrderVoice !== false;
- this.orderType = this.controlView.orderType || 'priority';
- this.checkTab(this.typeId);
- this.getOrderList(1);
- this.getOrderList(2);
- this.getOrderList(3);
- });
- }
-
- saveControlView() {
- let that = this;
- that.saveLoading = true;
- let wn;
- switch (that.patientCareCol) {
- case 6:
- wn = 1;
- break;
- case 7:
- wn = 2;
- break;
- case 4:
- wn = 3;
- break;
- }
- let postData = {
- controlView: {
- workerNum: wn,
- labelNum: that.txtLabelCol,
- workerInfoTime: that.workerInfoTime,
- orderInfoTime: that.orderInfoTime,
- unsendOrderVoice: that.audioNotDispatched,
- hurseInfoHiding: that.hurseInfoHiding === 1,
- orderType: this.orderType,
- },
- };
- if (that.controlView["id"]) {
- postData.controlView["id"] = that.controlView["id"];
- }
- console.log(postData);
- that.mainService
- .coopTypeConfig("addData", "controlView", postData)
- .subscribe((data) => {
- that.saveLoading = false;
- if (data.status == 200) {
- that.msg.success('排序成功');
- this.initControlView();
- } else {
- that.msg.error(data.msg || '排序失败');
- }
- });
- }
- closeModel(e) {
- if (e === "close") {
- this.newOrderShowOpen = false;
- } else if (e === "closeGo") {
- this.showNewOrder("&go&");
- }
- }
-
- showPromptModal(con, success, promptInfo?, back?) {
- this.promptModalShow = false;
- this.promptContent = con;
- this.ifSuccess = success;
- this.promptInfo = promptInfo;
- this.back = back || "";
- setTimeout(() => {
- this.showPromptModalRefresh();
- this.promptModalShow = true;
- }, 100);
- }
- showPromptModalRefresh(){
- this.getUnassignedBuilding2();
- this.resetList();
- this.getOrderList(1);
- this.getOrderList(2);
- this.getOrderList(3);
- this.getVisitList();
- this.getMessageList();
- if (this.currentRTab === 0) {
- this.getWorkOrders(this.applyDept);
- } else if (this.currentRTab === 1) {
- this.getPatientLog(this.applyDept);
- } else if (this.currentRTab === 2) {
- this.getItsmOrders(this.incidentModel.department);
- } else if (this.currentRTab === 3) {
- this.getDictionaryList();
- }
- this.fixedTab = "";
- this.fixedMenuShangla();
- }
-
-
- formatTime(time) {
- let timeStr = "";
- if (time >= 0 && time < 60) {
-
- timeStr = time + "秒";
- } else if (time >= 60 && time < 3600) {
-
- timeStr = Math.floor(time / 60) + "分钟";
- } else if (time >= 3600) {
-
- let h = "";
- let m = "";
- h = Math.floor(time / 3600) + "小时";
- m = time % 3600 >= 60 ? Math.floor((time % 3600) / 60) + "分钟" : "";
- timeStr = h + m;
- }
- return timeStr;
- }
-
- moveMenu(nodeId) {
- let fixedMenu = document.getElementById(nodeId);
- if (!fixedMenu) return;
- fixedMenu.onmousedown = function (e) {
- fixedMenu.classList.remove('maskFull');
- let y = e.clientY - fixedMenu.offsetTop;
- document.onmousemove = function (ev) {
- fixedMenu.classList.add('maskFull');
- var _y = ev.clientY - y > 0 ? ev.clientY - y : 0;
- var wh = window.innerHeight;
- if (_y > wh - fixedMenu.clientHeight) {
- _y = wh - fixedMenu.clientHeight;
- }
- fixedMenu.style.top = _y + "px";
- };
- document.onmouseup = function () {
- fixedMenu.classList.remove('maskFull');
- document.onmousemove = null;
- document.onmouseup = null;
- };
- };
- }
-
- transferSynergetic(incidentData){
- let str = incidentData.groupORHandlerUser || "";
- if(incidentData.synergetic && incidentData.synergetic.length){
- str += ',' + incidentData.synergetic.map(v => v.name).join(',');
- }
- return str;
- }
-
- moveMenuAll(nodeId) {
- let fixedMenu = document.getElementById(nodeId);
- if (!fixedMenu) return;
- fixedMenu.onmousedown = function (e) {
- fixedMenu.classList.remove('maskFull');
- let x = e.clientX - fixedMenu.offsetLeft;
- let y = e.clientY - fixedMenu.offsetTop;
- document.onmousemove = function (ev) {
- fixedMenu.classList.add('maskFull');
- var _y = ev.clientY - y > 0 ? ev.clientY - y : 0;
- var h = window.innerHeight;
- if (_y > h - fixedMenu.clientHeight) {
- _y = h - fixedMenu.clientHeight;
- }
- fixedMenu.style.top = _y + "px";
- var _x = ev.clientX - x > 0 ? ev.clientX - x : 0;
- var w = window.innerWidth;
- if (_x > w - fixedMenu.clientWidth) {
- _x = w - fixedMenu.clientWidth;
- }
- fixedMenu.style.right = w - _x - fixedMenu.clientWidth + "px";
- };
- document.onmouseup = function () {
- fixedMenu.classList.remove('maskFull');
- document.onmousemove = null;
- document.onmouseup = null;
- };
- };
- }
- @ViewChild("msgTemplate", { static: false }) msgTemplate: TemplateRef<any>;
-
- createBasicNotification(msgs): void {
- this.notification.template(this.msgTemplate, {
- nzDuration: 0,
- nzData: msgs,
- });
- }
-
- disXHead = 0;
- headToLeft() {
- let num = Math.floor(this.tabs.nativeElement.offsetWidth / 126);
- let maxStep = this.scopeGroups.length - (num - 1);
- this.disStep = Math.max(-maxStep, --this.disStep);
- this.disXHead = this.disStep * 126;
- }
-
- headToRight() {
- this.disStep = Math.min(0, ++this.disStep);
- this.disXHead = this.disStep * 126;
- }
-
- onSearchTaskBuild(e) {
- this.onSearchTaskBuildSubject.next(e);
- }
-
- getTasktypeByPhone(e) {
- this.getSearchTaskList(e).subscribe((result) => {
- if (result.status == 200) {
- this.searchTaskLoading = false;
- this.searchTaskList = result.data;
- this.searchTaskList.forEach((item) => {
- item.sid = item.associationTypeId + "_" + item.id + "_" + item.associationTypeValue;
- });
- }
- });
- }
-
- changeTaskBuild(e) {
- let arr = e.split("_");
- if(arr[2] === 'other' || arr[2] === 'specimen' || arr[2] === 'ordinary'){
- this.currentTabIndex = '物品配送';
- }else if(arr[2] === 'patientTransport'){
- this.currentTabIndex = '患者转运';
- }
- if (this.currentTabIndex == "患者转运") {
-
- this.radioValueZy = +arr[1];
- } else if (this.currentTabIndex == "物品配送") {
-
- this.radioValueQt = +arr[1];
- }
- }
-
- changeResidenceNo(e){
- console.log(e);
- this.changeCommonInpSubject.next(['patient', e]);
- }
-
- filterOrderList(type, state){
- if(!this.itsmData.mdv2Switch && this.hsmsData.hsmsSwitch){
- return;
- }
- if(this.itsmData.mdv2Switch && !this.hsmsData.hsmsSwitch){
- return;
- }
- this.flagList[`${type}Flag${state}`] = !this.flagList[`${type}Flag${state}`];
- this.getOrderList(state, state === 1);
- }
-
- orderType: string = 'priority';
- orderList(){
- this.orderType = this.orderType === 'priority' ? 'time' : 'priority';
- this.saveControlView();
- }
-
- priorityColor(priorityId) {
-
- if(priorityId == 1 || priorityId == 2){
- return '';
- } else if(priorityId == 3){
- return 'yellow';
- } else if(priorityId == 4 || priorityId == 5){
- return 'red';
- }
- }
-
- transferHandlerLog = function (currentLog) {
- if(!currentLog){
- return '';
- }
- currentLog = cloneDeep(currentLog);
- if(currentLog.extra1DTO && currentLog.extra2 && currentLog.startTime){
- if(currentLog.extra2==0.5){
- currentLog.extra2 = 4;
- return currentLog.extra1DTO.name+"<br>"+ format(addHours(currentLog.startTime, +currentLog.extra2), "MM月dd日")+"<br>"+ format(addHours(currentLog.startTime, +currentLog.extra2), "HH时mm分前完成");
- }else{
- return currentLog.extra1DTO.name+"<br>"+ format(addDays(currentLog.startTime, +currentLog.extra2), "MM月dd日前完成");
- }
- }else{
- return '';
- }
- }
-
- buildType;
- editOrder;
- generateOrder(data){
- this.editOrder = cloneDeep(data);
- let incidentModel = cloneDeep(data);
- let incidentMsg:any = {};
- console.log('data:', data)
-
- incidentModel.department && (incidentMsg.deptManyPhone = incidentModel.department.manyPhone);
- incidentModel.department && (incidentMsg.deptName = incidentModel.department.dept);
- incidentModel.department && (incidentModel.department = incidentModel.department.id);
- incidentModel.requester && (this.applicationRequesterList = [cloneDeep(incidentModel.requester)]);
- incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
- incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
- incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
- if(incidentModel.repairIncidentType){
- incidentModel.repairIncidentType = incidentModel.repairIncidentType.value
- this.changeRepairIncidentType(incidentModel.repairIncidentType);
- }
- incidentModel.source && (incidentModel.source = incidentModel.source.id);
- incidentModel.area && (incidentModel.area = incidentModel.area.id);
- incidentModel.place && (incidentModel.place = incidentModel.place.id);
- incidentModel.category && (this.applicationCategoryList = [cloneDeep(incidentModel.category)]);
- incidentModel.category && (incidentModel.category = incidentModel.category.id);
- this.incidentModel = incidentModel;
- this.incidentMsg = incidentMsg;
- this.incidentModel.category && this.changeApplyCategory(this.incidentModel.category, true);
- console.log('this.applicationDeptList:', this.applicationDeptList)
- console.log('incidentModel:', incidentModel)
- this.showNewOrder('', '', true, '报修转事件');
-
- this.getRepairImgs(data.id);
- }
-
- storageSj(data){
- this.editOrder = cloneDeep(data);
- let incidentModel = cloneDeep(data);
- let incidentMsg:any = {};
- console.log('data:', data)
-
- incidentModel.department && (incidentMsg.deptManyPhone = incidentModel.department.manyPhone);
- incidentModel.department && (incidentMsg.deptName = incidentModel.department.dept);
- incidentModel.department && (incidentModel.department = incidentModel.department.id);
- incidentModel.requester && (this.applicationRequesterList = [cloneDeep(incidentModel.requester)]);
- incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
- incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
- incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
- if(incidentModel.repairIncidentType){
- incidentModel.repairIncidentType = incidentModel.repairIncidentType.value
- this.changeRepairIncidentType(incidentModel.repairIncidentType);
- }
- incidentModel.source && (incidentModel.source = incidentModel.source.id);
- incidentModel.area && (incidentModel.area = incidentModel.area.id);
- incidentModel.place && (incidentModel.place = incidentModel.place.id);
- incidentModel.category && (this.applicationCategoryList = [cloneDeep(incidentModel.category)]);
- incidentModel.category && (incidentModel.category = incidentModel.category.id);
- this.incidentModel = incidentModel;
- this.incidentMsg = incidentMsg;
- console.log('this.applicationDeptList:', this.applicationDeptList)
- console.log('incidentModel:', incidentModel)
- this.showNewOrder('', '', true, '继续建单');
-
- this.getRepairImgs(data.id);
- }
-
- repairImgs:any[] = [];
- getRepairImgs(incidentId) {
- this.mainService
- .getPreviewImage('wechatRequesterIncident', incidentId)
- .subscribe((res:any) => {
- res.data = res.data || [];
- res.data.forEach(v => {
- v.previewUrl = location.origin + "/file" + v.relativeFilePath;
- v.thumbFilePath = location.origin + "/file" + v.thumbFilePath;
- })
- this.repairImgs = res.data;
- });
- }
-
- imgs = [];
- isPreview = false;
- initialViewIndex:number = 0;
- previewImageHandler(data = [], index = 0) {
- this.initialViewIndex = index;
- console.log(index)
- this.isPreview = false;
- data = data || [];
- this.imgs = data.map((v) => location.origin + '/file' + v.relativeFilePath);
- setTimeout(() => {
- this.isPreview = true;
- }, 0)
- }
-
- rejectModalShow = false;
- rejectFn(data) {
- this.coopData = data;
- this.rejectModalShow = true;
- }
-
- closeRejectModelOrder(e) {
- this.rejectModalShow = JSON.parse(e).show;
- }
-
- confirmRejectModelOrder(rejectRemark){
- this.maskFlag = this.msg.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- let postData = {
- incident: {
- ...this.coopData,
- rejectRemark,
- },
- }
- console.log(postData);
-
- this.mainService
- .flowPost("incident/task/reject", postData)
- .subscribe((result) => {
- this.msg.remove(this.maskFlag);
- this.maskFlag = false;
- if (result.state == 200) {
- this.rejectModalShow = false;
- this.showPromptModal("不受理", true, "", "");
- } else {
- this.msg.error(result.msg || '不受理失败');
- }
- });
- }
-
- edit(data){
- this.editOrder = cloneDeep(data);
- let incidentModel = cloneDeep(data);
- let incidentMsg:any = {};
- console.log('data:', data)
- incidentModel.department && (incidentMsg.deptManyPhone = incidentModel.department.manyPhone);
- incidentModel.department && (incidentMsg.deptName = incidentModel.department.dept);
- incidentModel.department && (incidentModel.department = incidentModel.department.id);
- incidentModel.requester && (this.applicationRequesterList = [cloneDeep(incidentModel.requester)]);
- incidentModel.requester && (incidentMsg.requesterPhone = incidentModel.requester.phone);
- incidentModel.requester && (incidentMsg.requesterName = incidentModel.requester.name);
- incidentModel.requester && (incidentModel.requester = incidentModel.requester.id);
- if(incidentModel.repairIncidentType){
- incidentModel.repairIncidentType = incidentModel.repairIncidentType.value
- this.changeRepairIncidentType(incidentModel.repairIncidentType);
- }
- incidentModel.source && (incidentModel.source = incidentModel.source.id);
- incidentModel.area && (incidentModel.area = incidentModel.area.id);
- incidentModel.place && (incidentModel.place = incidentModel.place.id);
- incidentModel.category && (this.applicationCategoryList = [cloneDeep(incidentModel.category)]);
- incidentModel.category && (incidentModel.category = incidentModel.category.id);
- this.incidentModel = incidentModel;
- this.incidentMsg = incidentMsg;
- console.log('this.applicationRequesterList:', this.applicationRequesterList)
- console.log('this.applicationDeptList:', this.applicationDeptList)
- console.log('incidentModel:', incidentModel)
- this.showNewOrder('', '', true, '编辑事件');
-
- this.getRepairImgs(data.id);
- }
-
- substitutionModalShow = false;
- substitution(data) {
- this.coopData = data;
- this.substitutionModalShow = true;
- }
-
- closeSubstitutionModelOrder(e) {
- this.substitutionModalShow = JSON.parse(e).show;
- }
-
- confirmSubstitutionModelOrder(e){
- console.log(e);
- this.substitutionModalShow = false;
- this.showPromptModalRefresh();
- }
-
- computedReceive(data){
- let inUser = data.currentLog && data.currentLog.workerId == this.tool.getCurrentUserId();
- let inGroup = false;
- let groupList = this.tool.getCurrentGroupList();
- groupList.forEach(item => {
- if(data.currentLog){
- if (item.id == data.currentLog.groupId) {
- inGroup = true;
- }
- }
- })
- return data.state.value === 'pending' && (inUser || inGroup) && this.coopBtns.receive && data.deleteFlag !== 1;
- }
-
- computedSubstitution(data){
- return (data.state.value === 'pending' || data.state.value === 'handler' || (data.state.value === 'reassign' && this.coopBtns.assign)) && data.deleteFlag !== 1;
- }
-
- computedEdit(data){
- return (data.state.value === 'pending' || data.state.value === 'reassign' || data.state.value === 'handler' || data.state.value === 'close') && this.coopBtns.edit && data.deleteFlag !== 1;
- }
-
- computedHandle(data){
- return this.coopBtns.handle && data.state.value === 'handler' && data.handlingPersonnelUser && data.handlingPersonnelUser.id == this.tool.getCurrentUserId() && data.deleteFlag !== 1;
- }
- delModal: boolean = false;
- tipsMsg1: string;
- tipsMsg2: string;
- confirmDelType: string;
- showDelModal(
- e,
- data,
- tipsMsg1: string,
- tipsMsg2: string,
- type: string,
- ) {
- e && e.stopPropagation();
- this.confirmDelType = type;
- this.delModal = true;
- this.coopData = data;
- this.tipsMsg1 = tipsMsg1;
- this.tipsMsg2 = tipsMsg2;
- }
-
- hideDelModal() {
- this.delModal = false;
- }
-
- confirmDelFn() {
- this.btnLoading = true;
- if (this.confirmDelType === "del") {
-
- this.mainService
- .simplePost("rmvData", "incident", [this.coopData.id])
- .subscribe((data) => {
- this.btnLoading = false;
- this.delModal = false;
- if (data.status == 200) {
- this.showPromptModal(this.tipsMsg2, true, "");
- } else {
- this.showPromptModal(this.tipsMsg2, false, data.msg);
- }
- });
- }else if (this.confirmDelType === "receive") {
-
- this.mainService
- .flowPost("incident/task/receive", { incident: this.coopData })
- .subscribe((data) => {
- this.btnLoading = false;
- this.delModal = false;
- if (data.state == 200) {
- this.showPromptModal(this.tipsMsg2, true, "");
- } else {
- this.showPromptModal(this.tipsMsg2, false, data.msg);
- }
- });
- }else if (this.confirmDelType === "checkout") {
-
- this.btnLoading = false;
- this.delModal = false;
- this.msg.success('签出成功');
- if(this.incomingService.getSign() === 'box'){
- this.incomingService.closeWs(true);
- this.incomingService.removeSign();
- }if(this.incomingService.getSign() === 'callCenter'){
- this.incomingService.closeWs(true);
- this.incomingService.removeSign();
- this.incomingService.removeSocketUrl();
- }
- this.incomingService.removePhoneNumber();
- }
- }
-
- handleModalShow = false;
- handle(data) {
- this.coopData = data;
- this.handleModalShow = true;
- }
-
- closeHandleModelOrder(e) {
- this.handleModalShow = JSON.parse(e).show;
- }
-
- confirmHandleModelOrder(e){
- console.log(e);
- this.handleModalShow = false;
- this.showPromptModalRefresh();
- }
-
- visitShow = false;
- visitOrder() {
- this.visitShow = true;
- }
-
- closeVisit(e) {
- this.visitShow = JSON.parse(e).show;
- }
-
- messageShow = false;
- messageOrder() {
- this.messageShow = true;
- }
-
- closeMessage(e) {
- this.messageShow = e.show;
- if(e.data){
-
- let postData = {
- hosId: this.tool.getCurrentHospital().id,
- phone: e.data.ano,
- };
- this.maskFlag = this.msg.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- this.mainService
- .findPhoneDept(postData)
- .subscribe((result:any) => {
- this.msg.remove(this.maskFlag);
- this.maskFlag = false;
- if (result.state == 200) {
- this.mainService.getDictionary("list", "incident_source").subscribe((res) => {
- let sourceList = res || [];
- let incidentModel:any = {
- hjzxRecordId: e.data.id,
- incomingPhone: e.data.ano,
- };
- let incidentMsg:any = {};
- let source = sourceList.find(v => v.value === 'record');
- source && (incidentModel.source = source.id);
- if (result.data.length > 0) {
-
- let deptDTO;
- if(result.type === 'qrCode'){
- deptDTO = result.data[0].deptDTO;
- deptDTO.address = result.data[0].name;
- }else if(result.type === 'dept'){
- deptDTO = result.data[0];
- }
- incidentModel.department = deptDTO;
- incidentModel.department && incidentModel.department.hospital && (incidentModel.hosId = incidentModel.department.hospital.parent ? incidentModel.department.hospital.parent.id : incidentModel.department.hospital.id);
- incidentModel.department && incidentModel.department.building && (incidentModel.area = incidentModel.department.building.id);
- incidentModel.department && incidentModel.department.floor && (incidentModel.place = incidentModel.department.floor.id);
- incidentModel.department && incidentModel.department.address && (incidentModel.houseNumber = incidentModel.department.address);
- incidentModel.department && (incidentMsg.deptManyPhone = incidentModel.department.manyPhone);
- incidentModel.department && (incidentMsg.deptName = incidentModel.department.dept);
- incidentModel.department && (incidentModel.department = incidentModel.department.id);
- incidentModel.repairIncidentType = 'dept';
- this.changeRepairIncidentType(incidentModel.repairIncidentType);
- this.incidentModel = incidentModel;
- console.log('this.incidentModel:', this.incidentModel)
- this.incidentMsg = incidentMsg;
- this.showNewOrder('', '', true, '留言转事件');
- } else {
-
- this.incidentModel = incidentModel;
- this.incidentMsg = incidentMsg;
- this.showNewOrder('', '', true, '留言转事件');
- }
- });
- }
- });
- }
- }
-
- callShow = false;
- callOrder() {
- this.callShow = true;
- }
-
- closeCall(e) {
- this.callShow = e.show;
- }
-
- isShowAddressList:boolean = false;
- focusAddress(){
- this.isShowAddressList = true;
- this.getAddressList();
- }
-
- clickExtra(e){
- if(document.documentElement.contains(document.querySelector('.addressList')) && e.target !== document.querySelector('.addressFocus')){
- this.isShowAddressList = false;
- }
- if(document.documentElement.contains(document.querySelector('.noteList')) && e.target !== document.querySelector('.noteFocus')){
- this.isShowNoteList = false;
- }
- }
-
- selectAddress(name){
- this.incidentModel.houseNumber = name;
- this.isShowAddressList = false;
- }
-
- addressList:any[] = [];
- addressLoading:boolean = false;
- getAddressList() {
- if(!this.incidentModel.department){
- this.addressList = [];
- return;
- }
- let postData = {
- idx: 0,
- sum: 99999,
- qrCode: {
- deptId: this.incidentModel.department,
- }
- };
- this.addressLoading = true;
- this.mainService.getFetchDataList("simple/data", "qrCode", postData).subscribe(result=>{
- this.addressLoading = false;
- if(result.status == 200){
- this.addressList = result.list || [];
- }else{
- this.addressList = [];
- }
- });
- }
-
- selectPatientZy(e){
- let patient = this.patientList.find(v => v.patientCode === e);
- if(patient){
- this.workOrderRemarkZy = patient.remark || '';
- }else{
- this.workOrderRemarkZy = '';
- }
- if(this.tabIndex !== undefined && this.currentTasktype && this.currentTasktype.associationType.value === 'inspect'){
- let index = this.tabIndex;
- let value = this.currentTasktype.id;
- let taskType = this.workTypesArrange[index].value.find(v => v.id == value);
- let patientCode;
- if(taskType.associationTypeValue === 'inspect'){
- patientCode = this.patientZy;
- }else{
- patientCode = undefined;
- }
- this.mainService.getdeptList(value, patientCode, (taskType.associationTypeValue === 'inspect' ? format(startOfDay(this.inspectToday), 'yyyy-MM-dd HH:mm:ss') : undefined), (taskType.associationTypeValue === 'inspect' ? format(endOfDay(this.inspectToday), 'yyyy-MM-dd HH:mm:ss') : undefined)).subscribe((data:any) => {
- this.linkCheckLis = [];
- if(data.data && Array.isArray(data.data.data) && data.data.data.length) {
- let arr = [];
- data.data.data.forEach((e) => {
- arr.push({
- execDeptId: e.execDept.id,
- yyTime: e.yyTime,
- priority: e.priority,
- label: (e.yyTime || "") + " " + e.execDept.dept + " 进行 " + (e.inspectName || "检查"),
- value: e["id"],
- checked: false,
- });
- });
- this.linkCheckLis = arr;
- }
- })
- }
- }
-
- isShowNoteList:boolean = false;
- focusNote(){
- this.isShowNoteList = true;
- this.getNoteList();
- }
-
- selectNote(name){
- this.workOrderRemarkZy = name;
- this.isShowNoteList = false;
- }
-
- noteList:any[] = [];
- noteLoading:boolean = false;
- getNoteList() {
- this.noteLoading = true;
- this.mainService.getDictionary('list', 'inspect_notes',).subscribe(result=>{
- this.noteLoading = false;
- this.noteList = result || [];
- });
- }
-
- inspectToday:Date = new Date();
-
- previousDayNew(){
- this.inspectToday = addDays(this.inspectToday, -1);
- this.inspectSubject.next();
- }
-
- todayNew(){
- this.inspectToday = new Date();
- this.inspectSubject.next();
- }
-
- nextDayNew(){
- this.inspectToday = addDays(this.inspectToday, 1);
- this.inspectSubject.next();
- }
- refreshInspectList(){
- this.linkCheckLis = [];
- this.mainService.getdeptList(this.radioValueZy, this.patientZy, format(startOfDay(this.inspectToday), 'yyyy-MM-dd HH:mm:ss'), format(endOfDay(this.inspectToday), 'yyyy-MM-dd HH:mm:ss')).subscribe((data:any) => {
- if (data.data && Array.isArray(data.data.data) && data.data.data.length) {
- let arr = [];
- data.data.data.forEach((e) => {
- arr.push({
- execDeptId: e.execDept.id,
- yyTime: e.yyTime,
- priority: e.priority,
- label: (e.yyTime || "") + " " + e.execDept.dept + " 进行 " + (e.inspectName || "检查"),
- value: e["id"],
- checked: false,
- });
- });
- this.linkCheckLis = arr;
- }
- });
- }
-
- isShowBuildQuickConfirm:boolean = false;
- buildQuickConfirmData:any = {};
- buildQuick(data){
- this.buildQuickConfirmData = data || {};
- this.isShowBuildQuickConfirm = true;
- }
- cancelBuildQuickConfirm(e){
- this.isShowBuildQuickConfirm = false;
- }
- loadingQuick:boolean = false;
- confirmBuildQuickConfirm(options){
- let { workOrderRemark} = options;
- this.maskFlag = this.msg.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- let postData:any = {
- orderId: this.buildQuickConfirmData.id,
- workOrderRemark,
- };
- this.mainService.coopWorkerOrder("editOrder", postData)
- .subscribe((result) => {
- this.msg.remove(this.maskFlag);
- this.maskFlag = false;
- if (result.state == 200) {
- this.isShowBuildQuickConfirm = false;
- this.showPromptModal("修改备注", true, "");
- } else {
- this.showPromptModal("修改备注", false, result.msg || '');
- }
- });
- }
- }
|