12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712 |
- import {
- Component,
- OnInit,
- TemplateRef,
- ViewChild,
- ElementRef,
- } 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 } 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,
- ) {}
- validateFormZy!: FormGroup;
- validateFormQt!: FormGroup;
-
- noWorkerPhone = false;
- patientList;
- isLoading: Boolean = false;
- disX = 0;
- disStep = 0;
- applicationDepartmentList = [];
- callNumber = "";
- workTypes = [];
- workTypesArrange = {};
- workTypesFlag = false;
- currentTabIndex = "";
- radioValueZy: any = "";
- deptZyList: any = {};
- startDeptZy = "";
- endDeptZy = "";
- patientZy = "";
- radioValueQt: any = "";
- deptQtList: any = {};
- startDeptQt = "";
- endDeptQt = "";
- workOrderRemark = "";
-
- newOrderShow = false;
- newOrderShowOpen = false;
- isOkLoading = false;
- applyDept;
- applyDeptMiddle;
- taskBuild;
- targetDept;
- noArrives = [];
- newLoading = false;
-
- changeInpSubject = new Subject();
- changeCommonInpSubject = new Subject();
- onSearchTaskBuildSubject = new Subject();
- searchHosDepartmentSubject = new Subject();
- searchHosDepartmentQtSubject = new Subject();
- searchPatientListSubject = 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 == '255'){
- 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,
- },
- };
- 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 = data["phone"];
- this.showPromptModal("建单", true, "", "closeGo");
- } else {
- this.showPromptModal("建单", true, "", "close");
- }
- } else {
- this.showPromptModal("建单", false, data["msg"]);
- }
- });
- }
- }
-
- submitFormBbps(go?) {
- let postData = {
- workOrder: {
- sourceId: SourceId.fuwutai,
- taskType: {
- id: this.workTypesArrange[this.currentTabIndex][0].taskType.id,
- },
- 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 = data["phone"];
- this.showPromptModal("建单", true, "", "closeGo");
- } else {
- 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 == '259'){
- 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 = data["phone"];
- this.showPromptModal("建单", true, "", "closeGo");
- } else {
- 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.coopBtns = this.tool.initCoopBtns(this.route);
-
- this.changeInpSubject.pipe(debounceTime(500)).subscribe((v) => {
- v[1] !== '' && this.searchApplicationDepartment(v[0], v[1]);
- });
- this.changeCommonInpSubject.pipe(debounceTime(500)).subscribe((v) => {
- if(v[1] !== ''){
- 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]);
- }
- }
- });
- 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]],
- startDept: [null, [Validators.required]],
- endDepts: [null, [Validators.required]],
- patient: [null, [Validators.required]],
-
- goods: [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.getOrderList(1);
- this.getOrderList(2);
- this.getOrderList(3);
- this.getVisitList();
- this.getMessageList();
- this.initControlView();
- this.moveMenu("fixedMenu");
- this.moveMenu("fixedMenuLeft");
- this.getPhoneNum();
- this.getUnassignedBuilding2();
- this.getInspectAndPatientTransportConfigTasktype();
- }
- 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));
- }
-
- quickShowNewOrder(e){
- if (e.ctrlKey && e.key == "s") {
- this.showNewOrder();
- e.preventDefault();
- }
- }
- unassignedSearchCon: string = "";
- arriveSearchCon: string = "";
- executionSearchCon: string = "";
- workerMessage: any = [];
-
- patientCareCol: number = 6;
- 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,
- }
- 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.incomingService.closeWs(true);
- this.getPhoneNum(false);
- this.user.user.scope = data.data;
- localStorage.setItem("user", JSON.stringify(this.user));
- this.initOrderScope();
- this.initControlView();
- } else {
- this.showPromptModal("保存", false, data.msg);
- }
- }
-
- showInitModal: boolean = false;
- cancelOrderScope() {
- this.showInitModal = false;
- }
- showOrderScope() {
- this.showInitModal = true;
- }
-
- showBindExtensionNumberModal: boolean = false;
- cancelBindExtensionNumber() {
- this.showBindExtensionNumberModal = false;
- }
- showBindExtensionNumber() {
- this.showBindExtensionNumberModal = true;
- }
-
- checkIn(phoneNumber){
- this.incomingService.setPhoneNumber(phoneNumber);
- this.incomingService.closeWs(true);
- this.getWebsocketPhone();
- }
-
- 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() {
- this.websocketLoading = true;
- const sign = this.incomingService.getSign();
- if(sign === 'box'){
-
- this.incomingService.connectWs().subscribe((data) => {
-
- console.log(data);
- this.websocketLoading = false;
- this.incidentModel.callID = data.callId || undefined;
- if (data.status == 200 && data.phone) {
- this.msg.info('签入成功');
- this.cancelBindExtensionNumber();
- } else if (data.status == 201 && data.phone) {
- this.incidentModel.incomingPhone = this.callNumber = data.phone;
- this.searchBxDept();
- } else if (data.status == 201 && data.phone === "") {
-
- if (!this.newOrderShow && !this.newOrderShowOpen) {
- this.applyDept = null;
- this.showNewOrder("no", data.phone, true);
- }
- }
- });
- }else if(sign === 'callCenter'){
-
- let _this = this;
- _this.websocketLoading = false;
- _this.preState = '';
-
- tlwsa.tlaOpen(_this.incomingService.getSocketUrl());
-
-
-
-
-
-
-
- TLWSA.onOpenreturn = (err) => {
- err = Number(err);
- if (!err) {
- _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);
- console.log('与服务器网络连接中断-----seimin');
- _this.msg.info('与服务器网络连接中断,2分钟后重连')
- console.log('2分钟后自动重连-----seimin')
- clearTimeout(timer);
- timer = setTimeout(function () {
-
- tlwsa.tlaOpen(_this.incomingService.getSocketUrl());
- }, 120000)
- }
-
- 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.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('转接坐席结果失败')
- }
- }
-
- }
- }
-
- searchBxDept(){
- let dataObj = {
- idx: 0,
- sum: 10,
- department: {
- searchType: 2,
- phone: this.incidentModel.incomingPhone,
- },
- };
- this.mainService
- .getFetchDataList("data", "department", dataObj)
- .subscribe((result) => {
- if (result.status == 200) {
- console.log(result);
- if (result.list.length > 0) {
-
- if (!this.newOrderShow && !this.newOrderShowOpen) {
- this.applyDeptMiddle = result.list[0];
- this.showNewOrder("yes", this.incidentModel.incomingPhone, true);
- }
- } else {
-
- console.log(this.newOrderShow);
- 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: {
- 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: {
- category: 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(){
- let postData: any = {
- idx: 0,
- sum: 1,
- incident: {
- "groupIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.scopeGroups.map(v => v.id).toString() || undefined),
- "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(){
- 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 = {};
-
- 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 = {
- "groupIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.scopeGroups.map(v => v.id).toString() || undefined),
- "dutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
- "urgentType": +this.itsmData.orderScopeRadio + 1,
- "queryTask": "storageAccept",
- "assignee": this.tool.getCurrentUserId(),
- "deleteFlag": 0,
- }
- }else if(stateId == 2){
- postData.incidentQuery.incident = {
- "groupIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.scopeGroups.map(v => v.id).toString() || undefined),
- "dutyIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.checkedHos.map(v => v.id).toString() || undefined),
- "urgentType": +this.itsmData.orderScopeRadio + 1,
- "queryTask": "todoReassign",
- "deleteFlag": 0,
- }
- }else if(stateId == 3){
- postData.incidentQuery.incident = {
- "groupIds": this.itsmData.allDuty == 1 ? undefined : (this.itsmData.scopeGroups.map(v => v.id).toString() || undefined),
- "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,
- }
- }
- }
- console.log(postData);
- this.mainService.orderList(postData).subscribe((data:any) => {
- if (stateId == 1) {
-
- let unassignedList = data.data || [];
- unassignedList.forEach((item) => {
- item.checked = false;
- });
- 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)
- }
- });
- 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)
- }
- });
- 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();
- 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.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;
- }
- }
-
- changPatientCareCol(e) {
- this.initTopCount();
- }
-
- getConfigTasktypeLoading: boolean = false;
- getConfigTasktype() {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- let postData = {
- idx: 0,
- sum: 1,
- hospitalConfig: {
- hosId: this.checkedHos,
- key: "transDeptTypeId",
- },
- };
- 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('请求数据失败');
- }
- });
- }
-
- deathTasktypeId;
- deathTasktypeIdPatient;
- async showNewOrder(des = '', phone = '', isInit = false, buildType = '') {
- this.buildType = buildType;
- if(this.itsmData.mdv2Switch){
- this.searchApplicationHospital();
- this.searchApplicationCategory();
- this.searchApplicationPriority();
- this.searchApplicationSource();
- isInit ? this.searchApplicationDepartment('itsm', undefined, undefined, undefined, true) : this.searchApplicationDepartment('itsm');
- isInit && ((this.isRelatedDepartment && this.incidentModel.department) || (!this.isRelatedDepartment && this.incidentModel.hosId) ) && this.incidentModel.hosId && this.searchApplicationBuilding();
- isInit && this.incidentModel.area && this.searchApplicationFloor();
- if(!this.hsmsData.hsmsSwitch){
- this.taskBuild = null;
- this.newOrderShow = true;
- this.newOrderShowOpen = true;
- this.fixedTab = "newOrder";
- this.currentRTab = 0;
- this.rightTitle_tab = [];
- this.incidentModel = isInit ? this.incidentModel : {};
- this.incidentMsg = isInit ? this.incidentMsg : {};
- this.isBuildOrderAgagin = false;
- this.applyDept = null;
- this.incidentModel.department = isInit ? this.incidentModel.department : null;
-
- this.getAutoWorkTypes(false);
- return;
- }
- }
-
- this.yyDateZy = new Date();
- this.yyDate = new Date();
- this.yyTimeZy = null;
- this.yyTime = null;
- this.isYyInspect = false;
- this.clickYYZyFlag = false;
- this.clickYYFlag = false;
- if(!isInit && this.hsmsData.hsmsSwitch){
- if(!this.deathTasktypeId){
-
- this.msg.error('【送病人回病房】未配置');
- return;
- }
- if(!this.deathTasktypeIdPatient){
-
- this.msg.error('【转出院记录】未配置');
- return;
- }
- }
- this.taskBuild = null;
- this.newOrderShow = true;
- this.newOrderShowOpen = true;
- this.fixedTab = "newOrder";
- this.currentRTab = 0;
- this.rightTitle_tab = [];
- this.incidentModel = isInit ? this.incidentModel : {};
- this.incidentMsg = isInit ? this.incidentMsg : {};
- this.isBuildOrderAgagin = false;
- this.applyDept = null;
- 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;
- });
- this.getAutoWorkTypes(true);
- }
- });
- }
-
- searchTaskList;
- searchTaskLoading = false;
- getSearchTaskList(keyword) {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- this.searchTaskLoading = true;
- return this.mainService.getTaskTypeBySearchKey({
- searchKey: keyword,
- hosId: this.checkedHos,
- });
- }
- getPhoneNum(flag = true) {
- if (!flag) {
-
- this.incomingService.removePhoneNumber();
- }
- if (this.incomingService.getPhoneNumber()) {
- this.getWebsocketPhone();
- }
- }
-
- tabClick(key) {
- let preCurrentTabIndex = this.currentTabIndex;
- this.currentTabIndex = key;
- this.radioValueQt = null;
- this.startDeptQt = null;
- this.endDeptQt = null;
- this.radioValueZy = null;
- this.startDeptZy = null;
- this.endDeptZy = null;
- this.patientZy = null;
- this.goodsNow = [];
- this.workOrderRemark = "";
- 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 === '99999'){
- 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);
- }
-
- let source = this.applicationSourceList.find(v => v.value === 'phone');
- if(!this.incidentModel.source && source){
- this.incidentModel.source = source.id;
- }
- }else if(this.currentTabIndex === '99999'){
- 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){
- 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) {
- 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"];
- if (this.patientList.length) {
- this.patientList = this.patientList.filter((item) => !!item.bednum);
- }
- }
- });
- }
-
- toLeft() {
- let maxStep = Object.keys(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.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){
- 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();
- }
- });
- }
- }
-
- applicationRequesterList:any[] = [];
- isRelatedDepartment:boolean = true;
- searchApplicationRequester(keyWord?) {
- 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 postData = {
- category: {
- category: keyWord,
- selectType: 'mutlQuery',
- hierarchy: 3,
- dutyIds: this.itsmData.checkedHos.length ? (this.itsmData.checkedHos.map(v => v.id).toString() || undefined) : undefined,
- },
- };
- 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){
- console.log(e)
-
- this.getKnowageList();
-
- if(this.incidentModel.hosId && e){
-
- 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;
- }
- 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();
- }
- });
- }
- }
-
- 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,
- "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,
- "title": category.mutiCategory,
- "description": this.incidentModel.description,
- "directProcess": 1,
- "handleDescription": this.incidentModel.handleDescription,
- "handlingPersonnelUser": {id: this.tool.getCurrentUserId()},
- "yyTime": this.incidentModel.yyTime ? format(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;
- }
- 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('直接解决失败');
- }
- });
- }
-
- 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?) {
- let postData = {
- idx: 0,
- sum: 20,
- group2: {
- groupName: keyWord,
- hospitals: this.incidentModel.duty ? this.incidentModel.duty.id.toString() : undefined,
- type: 1,
- },
- };
- 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,
- hospital: this.incidentModel.duty ? { id: this.incidentModel.duty.id } : undefined,
- 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;
- }
- });
- }
-
- applicationSourceList:any[] = [];
- searchApplicationSource(keyWord?) {
- this.mainService.getDictionary("list", "incident_source").subscribe((data) => {
- this.applicationSourceList = data || [];
- });
- }
-
- applicationBuildingList:any[] = [];
- searchApplicationBuilding(keyWord?) {
- 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;
- }
- });
- }
-
- changeApplyBuilding(e){
- console.log(e)
- this.incidentModel.place = undefined;
- this.searchApplicationFloor();
- }
-
- applicationFloorList:any[] = [];
- searchApplicationFloor(keyWord?) {
- let postData = {
- idx: 0,
- sum: 9999,
- floor: {
- buildId: 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;
- }
- });
- }
-
- 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}))
- deptId && this.changeApplyDept(deptId);
- }
- }
- });
- }
- openChangeApply(flag){
- flag && this.searchApplicationDepartment('hsms')
- }
- openChangeApplyDept(flag){
- flag && this.searchApplicationDepartment('itsm');
- }
- openChangeApplyGroup(flag){
- flag && this.searchApplicationGroup()
- }
- openChangeApplyUser(flag){
- flag && this.searchApplicationUser()
- }
-
- changeApply(e) {
- console.log(e, this.applicationDepartmentList);
- this.changeApplicationDepartment("&same&");
- if(this.applyDept && this.currentTabIndex !== '99999'){
- 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 === '99999'){
- 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;
- this.incidentModel.area = deptObj.building ? deptObj.building.id : undefined;
- this.incidentModel.area && this.searchApplicationBuilding();
- this.incidentModel.place = deptObj.floor ? deptObj.floor.id : undefined;
- this.incidentModel.place && this.searchApplicationFloor();
- this.incidentModel.houseNumber = deptObj.address;
- }
-
- if(this.buildType !== '报修转事件'){
- this.incidentModel.requester = undefined;
- }
- this.searchApplicationRequester();
-
- this.showGroupOrUser();
- }
-
- changeApplicationDepartment(phone?) {
- this.radioValueQt = null;
- this.startDeptQt = null;
- this.endDeptQt = null;
- this.radioValueZy = null;
- this.startDeptZy = null;
- this.endDeptZy = null;
- this.patientZy = null;
- this.goodsNow = [];
- this.patientList = [];
- this.workOrderRemark = "";
- 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 == "255") {
-
-
- 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 == "255") {
-
-
- 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 == "255") {
-
-
- 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.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.department){
- this.msg.warning('请选择申请科室!');
- return;
- }
- if(!this.incidentModel.contactsInformation){
- this.msg.warning('请填写联系电话!');
- return;
- }
- if(!this.incidentModel.priorityId){
- 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.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.department){
- this.msg.warning('请选择申请科室!');
- return;
- }
- if(!this.incidentModel.contactsInformation){
- this.msg.warning('请填写联系电话!');
- return;
- }
- if(!this.incidentModel.priorityId){
- this.msg.warning('请选择优先级!');
- return;
- }
- if(!this.incidentModel.description){
- this.msg.warning('请选择故障描述!');
- return;
- }
- if(!this.incidentModel.group){
- 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,
- "title": category.mutiCategory,
- "description": this.incidentModel.description,
- "yyTime": this.incidentModel.yyTime ? format(this.incidentModel.yyTime, 'yyyy-MM-dd HH:mm:ss') : undefined,
- "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : 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;
- }
- 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('建单并派单失败');
- }
- });
- }
-
- 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,
- "title": category ? category.mutiCategory : '',
- "description": this.incidentModel.description,
- "yyTime": this.incidentModel.yyTime ? format(this.incidentModel.yyTime, 'yyyy-MM-dd HH:mm:ss') : undefined,
- "requester": this.incidentModel.requester ? { id: this.incidentModel.requester } : 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;
- }
- 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('暂存失败');
- }
- });
- }
-
- isBuildOrderAgaginFn(){
- if(this.isBuildOrderAgagin){
-
- this.incidentModel.category = undefined;
- this.incidentModel.user = undefined;
- this.incidentModel.group = undefined;
- this.showPromptModal("操作", true, "", "");
- }else{
- this.newOrderShow = false;
- this.newOrderShowOpen = false;
- this.showPromptModal("操作", true, "", "");
- }
- }
-
- getAutoWorkTypes(isFirst) {
- this.workTypesArrange = {};
-
- if(this.itsmData.mdv2Switch){
- this.workTypesArrange = { 99999: [{associationTypeName: '故障报修'}] };
- if(!this.hsmsData.hsmsSwitch){
- console.log('workTypesArrange', this.workTypesArrange);
-
- this.workTypesFlag = Object.keys(this.workTypesArrange).length >= 5;
-
- if (Object.keys(this.workTypesArrange).length > 0) {
- this.tabClick(Object.keys(this.workTypesArrange)[0]);
- }
- }
- }
-
- if(this.hsmsData.hsmsSwitch){
- this.newLoading = true;
- this.mainService.getAutoWorkTypes(this.checkedHos).subscribe((data) => {
- this.newLoading = false;
- if (data["status"] == 200) {
- this.workTypes = data["data"];
-
- this.workTypes.forEach((item) => {
- if (this.workTypesArrange[item.associationTypeId]) {
- this.workTypesArrange[item.associationTypeId].push(item);
- } else {
- this.workTypesArrange[item.associationTypeId] = [];
- this.workTypesArrange[item.associationTypeId].push(item);
- }
- });
- console.log('workTypesArrange', this.workTypesArrange);
-
- let arr = Object.keys(this.workTypesArrange);
- this.workTypesFlag = arr.length >= 5;
-
- if (arr.length > 0) {
- isFirst ? this.tabClick(arr[0]) : this.tabClick(arr[arr.length - 1]);
- }
- }
- });
- }
- }
-
- endDeptZyChange() {
- if (!this.applyDept || !this.endDeptZy) {
- return;
- }
-
- if (this.radioValueZy == this.deathTasktypeId) {
-
- this.patientZy = null;
- this.getPatientList(this.endDeptZy, "");
- } else {
-
- console.log(this.deptZyList);
- if (
- this.deptZyList.startStatus != 206 &&
- this.deptZyList.endStatus != 206
- ) {
- this.patientZy = null;
- }
- this.getPatientList(this.applyDept, "");
- }
- }
-
- 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) {
-
- return;
- } else if (type === "end" && this.deptZyList["endStatus"] == 202) {
-
- 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) {
-
- return;
- } else if (type === "end" && this.deptQtList["endStatus"] == 202) {
-
- 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();
- }
- }
-
- goodsNow;
- yyDateZy = null;
- yyDate = null;
- yyTimeZy = null;
- yyTime = null;
- inspectAndPatientTransportConfig:any = {timeMod: 30};
- isYyInspect = false;
- clickYYZyFlag = false;
- clickYYFlag = false;
- currentTasktype = null;
- radioChangeZy(value) {
-
- if (value === "" || value === null) {
- return;
- }
- this.startDeptZy = null;
- this.endDeptZy = null;
- this.patientZy = null;
-
-
-
-
-
-
- this.mainService.getdeptList(value).subscribe((data:any) => {
- this.deptZyList = data;
-
- this.currentTasktype = data.taskType;
- this.isYyInspect = false;
- this.clickYYZyFlag = false;
- this.yyDateZy = new Date();
- this.yyTimeZy = null;
-
- console.log(this.deptZyList);
-
- 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 (
- (data["endStatus"] == 201 || data["endStatus"] == 203) &&
- this.radioValueZy == this.deathTasktypeId
- ) {
- if (this.currentTabIndex == "255") {
-
-
- this.getPatientList(this.endDeptZy, "");
- }
- }
- });
-
- let arr = this.workTypesArrange[this.currentTabIndex];
- 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 = [];
- }
- }
- radioChangeQt(value) {
-
- if (value === "" || value === null) {
- return;
- }
- this.startDeptQt = null;
- this.endDeptQt = null;
-
-
-
-
-
- this.mainService.getdeptList(value).subscribe((data:any) => {
- this.deptQtList = data;
-
- 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 {
- if (this.isYyInspect && this.currentTabIndex == '259') {
- this.clickYYFlag = true;
- } else {
- this.clickYYFlag = false;
- }
- if (this.isYyInspect && this.currentTabIndex == '255') {
- this.clickYYZyFlag = true;
- } else {
- this.clickYYZyFlag = false;
- }
- if (
- (!this.yyTime && this.currentTabIndex == '259' && this.isYyInspect) ||
- (!this.yyTimeZy && this.currentTabIndex == '255' && this.isYyInspect)
- ) {
- return;
- }
- if (go !== "&go&") {
- this.isOkLoading = true;
- } else {
- this.isGoLoading = true;
- }
- if (this.currentTabIndex == "255") {
-
- go === "&go&" ? this.submitFormZy(go) : this.submitFormZy();
- } else if (this.currentTabIndex == "256") {
-
- go === "&go&" ? this.submitFormBbps(go) : this.submitFormBbps();
- } else if (this.currentTabIndex == "259") {
-
- go === "&go&" ? this.submitFormQt(go) : this.submitFormQt();
- }
- }
- nucleicAcidPrintingCancel():void {
- this.fixedTab = '';
- }
- newOrderCancel(): void {
- 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.startDeptZy = null;
- this.endDeptZy = null;
- this.patientZy = null;
- this.goodsNow = [];
- this.patientList = [];
- this.workOrderRemark = "";
- 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 = {};
- initControlView() {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- let that = this;
- let postData = {
- controlView: {},
- idx: 0,
- sum: 1,
- };
- that.mainService
- .coopTypeConfig("fetchDataList", "controlView", postData)
- .subscribe((data) => {
- that.controlView = data.list[0] ? data.list[0] : [];
- if (!data.list.length) return;
- switch (data.list[0].workerNum) {
- case 1:
- that.patientCareCol = 6;
- break;
- case 2:
- that.patientCareCol = 7;
- break;
- case 3:
- that.patientCareCol = 4;
- break;
- }
- this.hurseInfoHiding = data.list[0].hurseInfoHiding ? "1" : "0";
- that.txtLabelCol = data.list[0].labelNum;
- that.orderRefreshTime = that.orderInfoTime = data.list[0].orderInfoTime;
- that.workerRefreshTime = that.workerInfoTime =
- data.list[0].workerInfoTime;
- that.audioNotDispatched = data.list[0].unsendOrderVoice !== false;
- that.checkTab(this.typeId);
- });
- }
-
- saveControlView() {
- if(!this.hsmsData.hsmsSwitch){
- return;
- }
- 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",
- },
- };
- 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.showPromptModal("保存", true, "");
- that.initControlView();
- } else {
- that.showPromptModal("保存", false, 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) {
- 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;
- };
- };
- }
- @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;
- });
- }
- });
- }
-
- changeTaskBuild(e) {
- let arr = e.split("_");
- this.currentTabIndex = arr[0];
- if (this.currentTabIndex == "255") {
-
- this.radioValueZy = +arr[1];
- } else if (this.currentTabIndex == "259") {
-
- this.radioValueQt = +arr[1];
- }
- }
-
- filterOrderList(type, state){
- this.flagList[`${type}Flag${state}`] = !this.flagList[`${type}Flag${state}`];
- this.getOrderList(state, state === 1);
- }
-
- 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(addDays(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);
- incidentModel.source && (incidentModel.source = incidentModel.source.id);
- incidentModel.area && (incidentModel.area = incidentModel.area.id);
- incidentModel.place && (incidentModel.place = incidentModel.place.id);
- this.incidentModel = incidentModel;
- this.incidentMsg = incidentMsg;
- 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);
- incidentModel.source && (incidentModel.source = incidentModel.source.id);
- incidentModel.area && (incidentModel.area = incidentModel.area.id);
- incidentModel.place && (incidentModel.place = incidentModel.place.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('不受理失败');
- }
- });
- }
-
- 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;
- }
-
- 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.info('签出成功');
- this.incomingService.closeWs(true);
- 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 = {
- idx: 0,
- sum: 10,
- department: {
- searchType: 2,
- phone: e.data.ano,
- },
- };
- this.maskFlag = this.msg.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- this.mainService
- .getFetchDataList("data", "department", postData)
- .subscribe((result) => {
- this.msg.remove(this.maskFlag);
- this.maskFlag = false;
- if (result.status == 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.list.length > 0) {
-
- incidentModel.department = result.list[0];
- 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;
- 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;
- }
- }
|