1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780 |
- import {
- Component,
- ElementRef,
- OnInit,
- TemplateRef,
- ViewChild,
- } from "@angular/core";
- import {
- FormBuilder,
- Validators,
- FormGroup,
- FormControl,
- } from "@angular/forms";
- import { Router, ActivatedRoute } from "@angular/router";
- import http from "../../../assets/js/http";
- import { MainService } from "../../services/main.service";
- import { WebsocketNurseService } from "../../services/websocket-nurse.service";
- import { NzMessageService } from "ng-zorro-antd";
- import { NzNotificationService } from "ng-zorro-antd/notification";
- import { OverlayScrollbarsComponent } from "overlayscrollbars-ngx";
- import { ToolService } from "../../services/tool.service";
- import { Subject } from "rxjs";
- import { debounceTime } from "rxjs/operators";
- import {
- format,
- getMinutes,
- setMinutes,
- addDays,
- differenceInCalendarDays,
- getHours,
- startOfDay,
- endOfDay,
- parse,
- } from "date-fns";
- import { SourceId } from "src/app/type/types";
- import cloneDeep from 'lodash-es/cloneDeep'
- // 日期禁用
- 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-hushijiandan",
- templateUrl: "./hushijiandan.component.html",
- styleUrls: ["./hushijiandan.component.less"],
- })
- export class HushijiandanComponent implements OnInit {
- @ViewChild('printBtn', { static: false }) printBtn: ElementRef<HTMLElement>;
- @ViewChild("remarksEle", { static: false }) remarksEle: ElementRef;
- @ViewChild("remarksEle1", { static: false }) remarksEle1: ElementRef;
- @ViewChild("remarksEle2", { static: false }) remarksEle2: ElementRef;
- @ViewChild("osComponentRef1", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef1: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef2", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef2: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef3", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef3: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef4", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef4: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef5", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef5: OverlayScrollbarsComponent;
- @ViewChild("osComponentRef6", {
- read: OverlayScrollbarsComponent,
- static: false,
- })
- osComponentRef6: OverlayScrollbarsComponent;
- @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;
- othersListOptions: any;
- sortableTimer = null;
- searchAccountSubject = new Subject(); //查工号防抖
- searchTabInpSubject = new Subject(); //左侧查患者信息和检查信息防抖
- otherSearchChangeSubject = new Subject(); //其他建单搜索防抖
- isYyInspect = false; //需要预约检查
- inspectAndPatientTransportConfig:any = {timeMod: 30};
- constructor(
- private message: NzMessageService,
- private fb: FormBuilder,
- public router: Router,
- private route: ActivatedRoute,
- private mainService: MainService,
- private notification: NzNotificationService,
- private webs: WebsocketNurseService,
- public tool: ToolService
- ) {
- this.othersListOptions = {
- onUpdate: (event: any) => {
- // 触发一次排序
- clearTimeout(this.sortableTimer);
- this.sortableTimer = setTimeout(() => {
- let postData = {
- orders: [],
- tabId: this.checkedTableType == 'other' ? undefined : this.checkedTableType,
- };
- postData.orders = this.othersList[this.checkedTableType].map((item, i) => {
- return {
- id: item.id,
- orders: i,
- };
- });
- this.mainService
- .coopConfig("setOrders", postData)
- .subscribe((result) => {});
- }, 500);
- },
- };
- }
- // 关闭倒计时
- closeTime = 3;
- closeTimeFlag;
- timerCloseTime = null;
- changeShow = true;
- currentHospital; //当前院区
- currentDept; //当前科室
- logTimer = null; //综合日志定时器
- logTime = 0; //综合日志自动刷新秒数
- logTimeConst = 60; //综合日志自动刷新秒数
- orderListTimer = null; //工单列表定时器
- orderListTime = 0; //工单列表自动刷新秒数
- orderListTimeConst = 60; //工单列表自动刷新秒数
- deptDisplay; //护士端是否显示可以别名,1是显示科室名称,2是显示科室别名
- pathologyModal:boolean = false; //病理申请单
- pathologyDetailModal:boolean = false; //病理详情
- // 初始化权限按钮
- coopBtns: any = {};
- surgeryDataId: any; //手术id
- patientDataId: any; //病人id
- ngOnInit() {
- this.getCoopBtns();
- this.currentHospital = this.tool.getCurrentHospital();
- this.tool.getDeptDisplay().subscribe((result) => {
- if (result.status == 200) {
- this.deptDisplay = result.list[0].valueconfig;
- }
- });
- this.getItsmIncident();
- this.getInspectAndPatientTransportConfigTasktype();
- this.getUpdateTipsForNurses();
- this.getRefreshNurseWorkOrderTime();
- this.getCloseTimeFlag();
- this.currentDept = this.tool.getCurrentUserDept();
- console.log(this.currentDept, this.tabSearchCont);
- this.currentDept.typeValue == 'surgery' && !this.tabSearchCont && this.getSurgeryConfig();
- this.getSpecimenButton();
- //防抖
- this.getAccountList();
- this.searchAccountSubject.pipe(debounceTime(500)).subscribe((v:any) => {
- this.getAccountList(v);
- });
- this.searchTabInpSubject.pipe(debounceTime(500)).subscribe((v) => {
- this.getPatient(v);
- });
- this.otherSearchChangeSubject.pipe(debounceTime(500)).subscribe((v) => {
- this.getDeptTaskType(v);
- });
- this.getTodayNum();
- this.initLogin();
- this.getDeptTaskType();
- this.initForm();
- this.getAdvice();
- this.getOrderSelectList();
- this.getCheckStatusLis();
- this.refreshSpecimenWorkOrderMsg();
- this.initRole();
- this.getWebsocket();
- this.getTaskTypesId();
- // 综合日志倒计时 start
- this.logTime = this.logTimeConst;
- clearInterval(this.logTimer);
- this.logTimer = setInterval(() => {
- this.logTime--;
- if (this.logTime === 0) {
- this.logTime = this.logTimeConst;
- if (this.smallTabId == 1) {
- this.listDeptOrderRecord();
- } else if (this.smallTabId == 2) {
- this.getQuickBxlb();
- }
- this.getTodayNum(); //当日工单数量
- }
- }, 1000);
- // 综合日志倒计时 end
- }
- ngOnDestroy() {
- clearInterval(this.moveId);
- clearInterval(this.moveId1);
- clearInterval(this.msgTimerId);
- clearInterval(this.logTimer);
- clearInterval(this.orderListTimer);
- this.webs.closeWs(true);
- }
- loginUser: any = localStorage.getItem("user")
- ? JSON.parse(localStorage.getItem("user")).user
- : null; //登录人信息
- loginUserDeptId: number = JSON.parse(localStorage.getItem("user")).user.dept
- .id; //登录人所属科室
- appointmentBuildFlag = "0"; //是否开启护士端预约建单-患者陪检
- appointmentZyBuildFlag = "0"; //是否开启护士端预约建单-患者其他
- leadTime = 0; //护士端预约建单生效时长
- followFlag = "0"; //是否开启护士端终点关注
- promptContent: string; //操作提示框提示信息
- ifSuccess: boolean; //操作成功/失败
- promptInfo: string; //操作结果提示信息
- back: string; //操作结果后回调标识
- promptModalShow: boolean; //操作提示框是否展示
- hsPromptModalShow: boolean = false; //护士端科室切换提示框是否展示
- deptTaskTypeRules: any = {}; //当前登录科室任务类型信息规则
- orderSelectList: any = []; //工单列表筛选选项
- orderSelected = "-1"; //工单列表下拉框选中
- orderStateSelected = "1"; //工单列表工单状态下拉框选中
- tabSearchCont: string = ""; //左侧tab搜索框内容
- pLoading: boolean = true; //患者信息loading
- patientList: any = []; //左侧tab患者信息list
- infoPageIdx: number = 1; //左侧tab页码
- infoLength: number = 5; //左侧tab信息总数
- specimenWorkOrderMsg: any = {}; //急标普标数量&信息
- jpDrugsWKOMsg: any = {}; //药品静配提示信息
- surgeryWKOMsg: any = {}; //手术提示信息
- detailId:any = null; //病理申请单详情id
- getCoopBtns(){
- let menu: any = JSON.parse(localStorage.getItem("menu")) || []; //菜单
- let coopBtns:any = {};
- let nurseMenu = menu.find(v => v.link === 'nurse');
- let nurseMenuChildren = nurseMenu.childrens || [];
- nurseMenuChildren.forEach((e) => {
- switch (e.link) {
- case "suggestionBox":
- coopBtns.suggestionBox = true; //意见箱
- break;
- case "surgery":
- coopBtns.surgery = true; //手术排程信息
- break;
- case "outpatientHelpAppointment":
- coopBtns.outpatientHelpAppointment = true; //门诊帮扶预约
- break;
- case "inquiryOfHistoricalSpecimens":
- coopBtns.inquiryOfHistoricalSpecimens = true; //历史标本查询
- break;
- case "historicalMedicineListInquiry":
- coopBtns.historicalMedicineListInquiry = true; //历史药单查询
- break;
- case "repairList":
- coopBtns.repairList = true; //报修列表
- break;
- case "buildOrdersForOtherTasks":
- coopBtns.buildOrdersForOtherTasks = true; //其他任务建单
- break;
- }
- });
- this.coopBtns = coopBtns;
- console.log(this.coopBtns);
- }
-
- // 获取任务类型(病理标本)
- taskTypeData:any;
- getTaskTypesId() {
- this.mainService.getDictionary("list", "ordinary_field").subscribe((data) => {
- this.taskTypeData = data.find(i=>i.value=='pathology')
- this.getPathologySys();
- });
- }
-
- // 获取标本配置
- autoCreate:any;
- getPathologySys(){
- let postData = {
- idx: 0,
- sum: 10,
- taskTypeConfig: {
- hosId:this.currentHospital.id,
- taskType:this.taskTypeData.id
- }
- }
-
- this.mainService
- .getFetchDataList("simple/data", "taskTypeConfig", postData)
- .subscribe((result) => {
- if (result.status == 200) {
- this.autoCreate = result.list[0].autoCreate;
- }
- });
- }
-
- // 新增申请单自选类型
- applicationType:any;
- addPathologyType(type){
- this.surgeryDataId = this.surgeryWKOMsg.id
- this.patientDataId = this.surgeryWKOMsg.patientDTO.id
- this.applicationType = type
- let data = {
- idx: 0,
- sum: 9999,
- surgeryId: this.surgeryWKOMsg.id || "",
- patientId: this.surgeryWKOMsg.patientDTO.id || "",
- hosId: this.currentHospital.id || "" ,
- operationType: 'pathologyForm',
- pathologyFormType: type
- };
- this.mainService
- .simplePost("addData", "pathologyForm", data)
- .subscribe((data) => {
- this.detailId = data.data.id
- this.multiDialog = false
- this.pathologyModal = true
- });
- }
-
- // 手术排程-病理申请单
- pathologyAddItem(e,item){
- this.surgeryDataId = item.id
- this.patientDataId = item.patientDTO.id
- let data = {
- idx: 0,
- sum: 9999,
- pathologyForm: {
- // surgeryId: item.id || "",
- patientId: item.patientDTO.id || "",
- hosId: this.currentHospital.id || "" ,
- operationType: 'pathologyForm',
- order:'createTime desc',
- },
- };
- this.isSpinning = true
- this.mainService
- .getFetchDataList("data", "pathologyForm", data)
- .subscribe((data) => {
- this.isSpinning = false
- this.viewData = data.list
- if(this.viewData.pathologyInspectDTOS){
- for(let i of this.viewData.pathologyInspectDTOS){
- i.arr = []
- i.arr.push(i.inspectProject.name)
- }
- }
- this.multiDialog = true
- return
- if(data.list.length==1){
- this.detailId = data.list[0].id
- if(!data.list[0].status){
- this.pathologyModal = true
- return
- }
- if(data.list[0].status &&
- (data.list[0].status.value==1 || data.list[0].status.value==2 ||
- data.list[0].status.value==3 || data.list[0].status.value==4)){
- this.pathologyModal = true
- }else{
- this.pathologyDetailModal = true
- }
- }else if(data.list.length>1){
- this.viewData = data.list
- if(this.viewData.pathologyInspectDTOS){
- for(let i of this.viewData.pathologyInspectDTOS){
- i.arr = []
- i.arr.push(i.inspectProject.name)
- }
- }
- this.multiDialog = true
- }else if(data.list.length==0){
- this.message.error('无申请单')
- }
- });
- }
- // 病理申请单
- multiDialog:any = false;
- isSpinning:any = false;
- viewData:any = [];
- pathologyAdd(e){
- this.surgeryDataId = this.surgeryWKOMsg.id
- this.patientDataId = this.surgeryWKOMsg.patientDTO.id
- let data = {
- idx: 0,
- sum: 9999,
- pathologyForm: {
- // surgeryId: this.surgeryWKOMsg.id || "",
- patientId: this.surgeryWKOMsg.patientDTO.id || "",
- hosId: this.currentHospital.id || "" ,
- operationType: 'pathologyForm',
- order:'createTime desc'
- },
- };
- this.isSpinning = true
- this.mainService
- .getFetchDataList("data", "pathologyForm", data)
- .subscribe((data) => {
- this.isSpinning = false
- this.viewData = data.list
- for(let i of this.viewData){
- if(i.pathologyInspectDTOS){
- i.arr = []
- for(let x of i.pathologyInspectDTOS){
- i.arr.push(x.inspectProject.name)
- }
- }
- }
- console.log(777,this.viewData)
- this.multiDialog = true
- return
- if(data.list.length==1){
- this.detailId = data.list[0].id
- if(!data.list[0].status){
- this.pathologyModal = true
- return
- }
- if(data.list[0].status &&
- (data.list[0].status.value==1 || data.list[0].status.value==2 ||
- data.list[0].status.value==3 || data.list[0].status.value==4)){
- this.pathologyModal = true
- }else{
- this.pathologyDetailModal = true
- }
- }else if(data.list.length>1){
- this.viewData = data.list
- for(let i of this.viewData){
- if(i.pathologyInspectDTOS){
- i.arr = []
- for(let x of i.pathologyInspectDTOS){
- i.arr.push(x.inspectProject.name)
- }
- }
- }
- console.log(777,this.viewData)
- this.multiDialog = true
- }else if(data.list.length==0){
- this.message.error('无申请单')
- }
- });
- }
-
- // 申请单号点击
- itemClick(item){
- this.detailId = item.id
- this.multiDialog = false
- setTimeout(_=>{
- if(!item.status){
- this.pathologyModal = true
- return
- }
- if(item.status && (item.status.value==1 || item.status.value==2 ||
- item.status.value==3 || item.status.value==4)){
- this.pathologyModal = true
- }else{
- this.pathologyDetailModal = true
- }
- },200)
- }
-
- hideModal(){
- this.multiDialog = false
- }
-
- pathologyDetailCancel(){
- this.pathologyDetailModal = false
- }
- pathologyCancel(){
- this.pathologyModal = false
- }
- // 切换综合日志和一键报修
- smallTabs = [];
- smallTabId = 2; //默认显示一键报修
- changeSmallTab(id) {
- this.smallTabId = id;
- if (id == 1) {
- this.listDeptOrderRecord();
- } else if (id == 2) {
- this.getQuickBxlb();
- }
- }
- // 获取当日建单总数
- todayNum = ""; //当日建单总数
- getTodayNum() {
- this.mainService
- .getFetchDataList("nurse", "workOrder", {
- idx: 0,
- sum: 1,
- workOrder: {
- createDept: this.loginUser.dept.id,
- startTime1: format(startOfDay(new Date()), "yyyy-MM-dd HH:mm:ss"),
- endTime1: format(endOfDay(new Date()), "yyyy-MM-dd HH:mm:ss"),
- },
- })
- .subscribe((data) => {
- if (data.status == 200) {
- this.todayNum = data.totalNum || 0;
- }
- });
- }
- // 获取报修区域(所属院区)
- // areas: any = []; //区域(所属院区)列表
- // getArea() {
- // this.areas = [];
- // this.mainService
- // .fetchListBx("area", { idx: 0, sum: 1000 })
- // .subscribe((result: any) => {
- // if (result.status == 200) {
- // this.areas = result.list;
- // if (this.areas.length) {
- // this.bxForm.controls.hospital.setValue(this.areas[0].id);
- // } else {
- // this.bxForm.controls.hospital.setValue(null);
- // }
- // }
- // });
- // }
- //根据区域(所属院区)获取地点(楼栋)
- places: any = []; //地点(楼栋)列表
- getPlace(buildingId) {
- this.places = [];
- this.mainService
- .fetchListBx("place", {
- idx: 0,
- sum: 1000,
- place: { area: { id: buildingId } },
- })
- .subscribe((result: any) => {
- if (result.status == 200) {
- this.places = result.list;
- if (this.places.length) {
- this.bxForm.controls.building.setValue(this.places[0].id);
- } else {
- this.bxForm.controls.building.setValue(null);
- }
- }
- });
- }
- btnLoading: boolean = false; //确认按钮loading状态
- workOrderRemark = ""; //备注
- workOrderRemark1 = ""; //备注
- workOrderRemark2 = ""; //备注
- workOrderRemarkTips = ""; //备注提示
- workOrderRemarkTips1 = ""; //备注提示
- workOrderRemarkTips2 = ""; //备注提示
- customRemarks = []; //备注快速输入
- customRemarks1 = []; //备注快速输入
- customRemarks2 = []; //备注快速输入
- // 添加备注
- addRemarks(item) {
- this.remarksEle.nativeElement.focus();
- this.workOrderRemark += item;
- }
- // 添加备注
- addRemarks1(item) {
- this.remarksEle1.nativeElement.focus();
- this.workOrderRemark1 += item;
- }
- // 添加备注
- addRemarks2(item) {
- this.remarksEle2.nativeElement.focus();
- this.workOrderRemark2 += item;
- }
- // 立即执行
- coopItem: any = {};
- execModal: boolean = false;
- // 打开立即执行模态框
- openExecModal(item) {
- this.coopItem = item;
- // 是否允许提前执行
- if(item.taskType.executeSwitch == 1){
- this.execModal = true;
- }else{
- this.showPromptModal("操作", false, "相关任务会到点执行,无需立即执行。有问题请联系相关科室!");
- }
- }
- // 确认立即执行
- confirmExec() {
- this.btnLoading = true;
- this.mainService.executeNow(this.coopItem.id).subscribe((result: any) => {
- this.closeExecModal();
- if (result.status == 200) {
- this.showPromptModal("立即执行", true, "");
- this.getOrderList();
- } else {
- this.showPromptModal("立即执行", false, result.msg);
- }
- });
- }
- // 关闭立即执行模态框
- closeExecModal() {
- this.execModal = false;
- }
- // 获取系统配置
- isShowBx = false;// 护士端是否显示报修
- isAssign = false;// 是否护士指定人员
- getItsmIncident() {
- let postData = { idx: 0, sum: 100, hospitalConfig: { hosId: this.currentHospital.id } };
- this.mainService.getFetchDataList("simple/data", "hospitalConfig", postData).subscribe((result) => {
- if (result.status == 200) {
- this.isShowBx = result.list.find(v => v.key == 'hos_itsmIncident').value == 1;
- this.isAssign = result.list.find(v => v.key == 'nurseSendOrder').value == 1;
- if (this.isShowBx && this.coopBtns.repairList && !this.checkedTableType) {
- // 初始化默认显示第一个
- console.log(this.tabPermission)
- // if(this.tabPermission.length){
- // this.checkedTableType = (this.tabPermission[0] && this.tabPermission[0].system) ? 'other' : this.tabPermission[0].id;
- // }else if(this.coopBtns.suggestionBox){
- // this.checkedTableType = 'advice';
- // this.checkTable(this.checkedTableType);
- // }else if(this.coopBtns.surgery){
- // this.checkedTableType = 'surgery';
- // this.checkTable(this.checkedTableType);
- // }else if(this.coopBtns.outpatientHelpAppointment){
- // this.checkedTableType = 'outpatientHelpAppointment';
- // this.checkTable(this.checkedTableType);
- // }else if(this.coopBtns.inquiryOfHistoricalSpecimens){
- // this.checkedTableType = 'historySpecimen';
- // this.checkTable(this.checkedTableType);
- // }else if(this.coopBtns.historicalMedicineListInquiry){
- // this.checkedTableType = 'historyDrugsbag';
- // this.checkTable(this.checkedTableType);
- // }else if(this.coopBtns.repairList && this.isShowBx){
- // this.checkedTableType = 'bxlb';
- // this.checkTable(this.checkedTableType);
- // }
- this.smallTabs = [
- { id: 1, name: "综合日志" },
- { id: 2, name: "一键报修" },
- ];
- this.smallTabId = 2;
- this.getQuickBxlb();
- this.getBxlb(this.bxlbPageIndex, true);
- } else {
- this.smallTabs = [{ id: 1, name: "综合日志" }];
- this.smallTabId = 1;
- this.listDeptOrderRecord();
- }
- }
- });
- }
- // 派单,flag 0是待抢单指派,1是待到达指派
- allotWorker(id, stateId, flag?) {
- if (flag == 1) {
- this.router.navigateByUrl("nurse/allotWorker/" + id + "/" + stateId + "/1/" + this.currentHospital.id);
- } else {
- this.router.navigateByUrl("nurse/allotWorker/" + id + "/" + stateId + "/0/" + this.currentHospital.id);
- }
- }
- //获取检查页面任务类型
- getInspectAndPatientTransportConfigTasktype() {
- let postData = {
- idx: 0,
- sum: 10,
- taskType: {
- simpleQuery: true,
- hosId: {
- id: this.currentHospital.id
- },
- 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) {
- let postData = {
- idx: 0,
- sum: 10,
- taskTypeConfig: {
- taskTypeDTO: {
- hosId: {
- id: this.currentHospital.id
- },
- 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};
- // 是否显示排队信息
- if(this.inspectAndPatientTransportConfig.queuingInformation == 1){
- this.getQueuingInformation();
- }
- }
- });
- }
- // 获取排队信息
- queuingInformationList:any[] = [];
- getQueuingInformation() {
- this.mainService
- .coopWorkerOrder("queuingInformation", {})
- .subscribe((result) => {
- if(result.status == 200){
- this.queuingInformationList = result.datalist || [];
- }
- });
- }
- // 获取护士端更新提示
- updateTipsForNurses = "";
- getUpdateTipsForNurses() {
- let postData = {
- idx: 0,
- sum: 1,
- systemConfiguration: { keyconfig: "updateTipsForNurses" },
- };
- this.mainService
- .getFetchDataList("simple/data", "systemConfiguration", postData)
- .subscribe((result) => {
- if (result.status == 200) {
- this.updateTipsForNurses = result.list[0].valueconfig;
- }
- });
- }
- // 获取护士工单列表刷新速度
- getRefreshNurseWorkOrderTime() {
- let postData = {
- idx: 0,
- sum: 1,
- systemConfiguration: { keyconfig: "refreshNurseWorkOrderTime" },
- };
- this.mainService
- .getFetchDataList("simple/data", "systemConfiguration", postData)
- .subscribe((result) => {
- if (result.status == 200) {
- this.orderListTimeConst = result.list[0].valueconfig;
- // 工单列表倒计时 start
- this.orderListTime = this.orderListTimeConst;
- clearInterval(this.orderListTimer);
- this.orderListTimer = setInterval(() => {
- this.orderListTime--;
- if (this.orderListTime === 0) {
- this.orderListTime = this.orderListTimeConst;
- this.getOrderList();
- }
- }, 1000);
- // 工单列表倒计时 end
- }
- });
- }
- // 获取标本按钮
- specimenButton = "";
- getSpecimenButton() {
- if(this.currentDept.typeValue == 'surgery' && !this.tabSearchCont){
- return;
- }
- let postData = {
- idx: 0,
- sum: 1,
- systemConfiguration: { keyconfig: "specimenButton" },
- };
- this.mainService
- .getFetchDataList("simple/data", "systemConfiguration", postData)
- .subscribe((result) => {
- if (result.status == 200) {
- this.specimenButton = result.list[0].valueconfig;
- }
- });
- }
- // 获取护士端弹窗的配置
- // (1) 当用户设置为正数时,用户必须查看此窗体指定秒数。
- // (2) 当用户设置为负数时,用户可点击知道了也可倒计时自动关闭。
- // (3) 如果用户填写0则为无自动关闭和强制查看时间。
- getCloseTimeFlag() {
- let postData = {
- idx: 0,
- sum: 1,
- systemConfiguration: { keyconfig: "nurseDeptSwitchTip" },
- };
- this.mainService
- .getFetchDataList("simple/data", "systemConfiguration", postData)
- .subscribe((result) => {
- if (result.status == 200) {
- this.closeTimeFlag = result.list[0].valueconfig - 0;
- this.changeKs();
- }
- });
- }
- //获取综合日志
- rLoading = false;
- listDeptOrderRecords: any = [];
- listDeptOrderRecord() {
- this.rLoading = true;
- this.mainService
- .listMsgByMain("listDeptOrderRecord", { deptId: this.loginUserDeptId })
- .subscribe((result) => {
- this.rLoading = false;
- if (result["status"] == 200) {
- this.listDeptOrderRecords = result["data"].slice(0, 15);
- }
- });
- }
- // 查看标本历史记录
- historyPromptModalShow = false; //标本历史记录弹窗开关
- scode = ""; //查看历史记录携带
- viewSpecimenHistory(data) {
- this.scode = data.scode;
- this.historyPromptModalShow = true;
- }
- // 关闭标本历史记录弹窗
- closeModelHistory(e) {
- this.historyPromptModalShow = JSON.parse(e).show;
- }
- // 查看药单历史记录
- historyDPromptModalShow = false; //药单历史记录弹窗开关
- drugsBagId = ""; //查看历史记录携带
- viewDrugsbagHistory(data) {
- this.drugsBagId = data.id;
- this.historyDPromptModalShow = true;
- }
- // 关闭药单历史记录弹窗
- closeModelHistoryDrugsbag(e) {
- this.historyDPromptModalShow = JSON.parse(e).show;
- }
- // 查看报修信息
- detailBx(data){
- this.router.navigateByUrl("nurse/detailBx/" + data.id);
- }
- // 查看报修信息弹窗
- bxPromptModalShow = false; //弹窗开关
- bData = ""; //查看详情携带所有数据
- viewBx(data) {
- this.bData = data;
- this.bxPromptModalShow = true;
- }
- // 关闭报修信息弹窗
- closeModelBx(e) {
- this.bxPromptModalShow = JSON.parse(e).show;
- }
- // 护士端患者信息列表,鼠标移入姓名展示最近一条检查信息
- recentInfo = "";
- recentInfoTimer = null;
- recentInfoNum = 0;
- isRemand = true; //自动送回
- yyTime = null; //预约时间-患者列表
- yyTimeZy = null; //预约时间-患者列表-患者其他服务
- yyDate = null; //预约日期-陪检
- yyDateZy = null; //预约日期-转运
- getRecentInfo(patientCode) {
- if(this.currentDept.typeValue == 'surgery' && !this.tabSearchCont){
- return;
- }
- this.recentInfo = "";
- clearTimeout(this.recentInfoTimer);
- this.recentInfoTimer = setTimeout(() => {
- this.recentInfoNum++;
- this.mainService
- .listMsgByMain("workOrder/findInspectRecently", { patientCode })
- .subscribe((result) => {
- this.recentInfoNum--;
- if (result["status"] == 200 && this.recentInfoNum === 0) {
- this.recentInfo = result["data"]["info"];
- } else {
- this.recentInfo = "";
- }
- });
- }, 500);
- }
- // 获取患者陪检任务类型(只有一个)的信息
- getTaskTypeByInspection() {
- const list = {
- idx: 0,
- sum: 1,
- taskType: {
- patientInspectQuery: true,
- hosIds: this.currentHospital.id + "",
- associationType: {
- id: 260,
- },
- },
- };
- return this.mainService.getFetchDataList("configuration", "taskType", list);
- }
- //修改预约建单时间的日期
- 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 [];
- }
- };
- }
- }
- // 关闭其他建单保存结果
- closeModel(e) {
- console.log(e);
- if (e === "other") {
- this.osComponentRef2.osInstance().scroll({ x: 0, y: this.positionY });
- this.getOrderList();
- } else if (e === "bb") {
- this.getOrderList();
- this.getSpecimenWorkOrderMsg();
- }
- }
- // 其他建单
- selectOtherId; //选中的id
- otherSearch = ""; //搜索的关键词
- oLoading = false;
- nLoading = false;
- positionY = 0; //记录其他建单Y轴滚动距离
- otherClick(item) {
- this.osComponentRef2 && (this.positionY = this.osComponentRef2.osInstance().scroll().position.y); //内容滚动的距离
- this.selectOtherId = item.id;
- this.newShortcutOrder(item, "other");
- this.account = null;
- this.userAccount = null;
- }
- selectIncidentId; //选中的id
- incidentClick(item) {
- this.positionY = this.osComponentRef10.osInstance().scroll().position.y; //内容滚动的距离
- this.selectIncidentId = item.id;
- this.bxForm.controls.content.setValue(item.mutiCategory);
- }
- //搜索
- otherNum = 0;
- otherSearchChange() {
- this.otherSearchChangeSubject.next(this.otherSearch);
- }
- // 切换科室
- changeKs() {
- this.hsPromptModalShow = true;
- // (1) 当用户设置为正数时,用户必须查看此窗体指定秒数。
- // (2) 当用户设置为负数时,用户可点击知道了也可倒计时自动关闭。
- // (3) 如果用户填写0则为无自动关闭和强制查看时间。
- if (this.closeTimeFlag === 0) {
- return;
- }
- this.closeTime = Math.abs(this.closeTimeFlag);
- clearInterval(this.timerCloseTime);
- this.timerCloseTime = setInterval(() => {
- this.closeTime = Math.max(--this.closeTime, 0);
- if (this.closeTime === 0) {
- if (this.closeTimeFlag <= 0) {
- this.hsPromptModalShow = false;
- }
- clearInterval(this.timerCloseTime);
- }
- }, 1000);
- }
- // 判断登录是否已失效
- initLogin() {
- let that = this;
- if (!localStorage.getItem("user")) {
- that.message.error("您的登录已失效,请重新登录!", {
- nzDuration: 3000,
- });
- setTimeout(() => {
- that.router.navigateByUrl("login");
- }, 2000);
- return;
- }
- }
- // 连接websocket
- getWebsocket() {
- let that = this;
- this.webs
- .connectWs(http.nurseWs, { userCount: that.loginUser.account })
- .subscribe((data) => {
- if (data && data.content) {
- that.createBasicNotification(data);
- }
- });
- }
- // 每隔一分钟刷新标本信息
- msgTimerId: any;
- refreshSpecimenWorkOrderMsg() {
- this.msgTimerId = setInterval(() => {
- this.getSpecimenWorkOrderMsg();
- }, 60000);
- }
- // 工单列表筛选
- getOrderSelectList() {
- let that = this;
- that.mainService
- .getDictionary("list", "association_types")
- .subscribe((data) => {
- that.orderSelectList = data || [];
- });
- }
- // 急标普标数量
- getSpecimenWorkOrderMsg() {
- if(this.currentDept.typeValue == 'surgery' && !this.tabSearchCont){
- return;
- }
- let that = this;
- that.mainService
- .postCustom("nurse", "getSpecimenWorkOrderMsg", {
- deptId: JSON.parse(localStorage.getItem("user")).user.dept.id,
- })
- .subscribe((data) => {
- that.specimenWorkOrderMsg = data;
- });
- }
- // 手术提示信息
- surgeryLoading = false;
- getSurgeryWKOMsg() {
- if(this.currentDept.typeValue != 'surgery'){
- return;
- }
- let postData = {
- idx: 0,
- sum: 1,
- surgery: {
- applyDateStart: format(startOfDay(new Date()), "yyyy-MM-dd HH:mm:ss"),
- applyDateEnd: format(endOfDay(new Date()), "yyyy-MM-dd HH:mm:ss"),
- // hosId: this.currentHospital.id,
- surgeryDept: this.loginUserDeptId,
- state: {
- key: 'surgery_trans_state',
- value: 8
- }
- }
- }
- this.surgeryLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "surgery", postData)
- .subscribe((data) => {
- data.list = Array.isArray(data.list) ? data.list : [];
- this.surgeryLoading = false;
- this.surgeryWKOMsg = data.list[0] || {};
- });
- }
- // 获取手术配置信息
- surgeryField = null; //手术关联业务
- surgeryConfigs:any = {};
- // 送回苏醒室的运输过程终点科室信息
- surgeryCarryingCourse:any = null;
- surgeryCarryingCourseDepts: any[] = [];
- getSurgeryConfig() {
- this.mainService
- .getDictionary("list", "ordinary_field")
- .subscribe((data) => {
- this.surgeryField = data.find(v => v.value == 'surgery');
- if(this.surgeryField){
- let postData = {
- idx: 0,
- sum: 10,
- taskTypeConfig: {
- hosId: this.currentHospital.id,
- ordinaryField: this.surgeryField
- }
- };
- this.mainService
- .getFetchDataList("simple/data", "taskTypeConfig", postData)
- .subscribe((result) => {
- if (result.status == 200) {
- this.surgeryConfigs = result.list[0] || {};
- // 送回苏醒室开关开启 并且 有对应的任务类型
- if(this.surgeryConfigs.remandRecovery == 1 && this.surgeryConfigs.recoveryType){
- this.surgeryCarryingCourse = this.surgeryConfigs.recoveryType.carryingCourses ? this.surgeryConfigs.recoveryType.carryingCourses.find(v => v.nodeId ? v.nodeId.value == 'finish' : false) : null;
- // 运输过程终点科室配置是固定科室或者固定科室范围-苏醒室
- if(this.surgeryCarryingCourse && (this.surgeryCarryingCourse.departmentStrategy.value == 2 || this.surgeryCarryingCourse.departmentStrategy.value == 3)){
- this.surgeryCarryingCourseDepts = this.surgeryCarryingCourse.departmentDTOS || [];
- }
- }
- }
- });
- }
- });
- }
- // 药品静配提示信息
- drugJpLoading = false;
- getJpDrugsWKOMsg() {
- if(this.currentDept.typeValue == 'surgery' && !this.tabSearchCont){
- return;
- }
- let that = this;
- this.drugJpLoading = true;
- that.mainService
- .postCustom("nurse", "getJpDrugsWKOMsg", {})
- .subscribe((data) => {
- this.drugJpLoading = false;
- that.jpDrugsWKOMsg = data.data ? data.data : {};
- console.log(that.jpDrugsWKOMsg);
- if (
- that.jpDrugsWKOMsg.drugsInfoList &&
- that.jpDrugsWKOMsg.drugsInfoList.length
- ) {
- that.startSwiper(that.jpDrugsWKOMsg.drugsInfoList.length);
- }
- if (
- that.jpDrugsWKOMsg.jpInfoList &&
- that.jpDrugsWKOMsg.jpInfoList.length
- ) {
- that.startSwiper1(that.jpDrugsWKOMsg.jpInfoList.length);
- }
- });
- }
- // swiper 轮播图
- swiperTop: number = 0;
- moveId: any;
- index: number = 0;
- startSwiper(length) {
- let that = this;
- clearInterval(that.moveId);
- setInterval(() => {
- that.index++;
- clearInterval(that.moveId);
- that.moveId = setInterval(() => {
- if (that.swiperTop > -44 * that.index) {
- that.swiperTop--;
- }
- if (that.swiperTop <= length * -44) {
- that.swiperTop = 0;
- that.index = 0;
- clearInterval(that.moveId);
- }
- }, 20);
- }, 2000);
- }
- swiperTop1: number = 0;
- moveId1: any;
- index1: number = 0;
- startSwiper1(length) {
- let that = this;
- clearInterval(that.moveId1);
- setInterval(() => {
- that.index1++;
- clearInterval(that.moveId1);
- that.moveId1 = setInterval(() => {
- if (that.swiperTop1 > -44 * that.index1) {
- that.swiperTop1--;
- }
- if (that.swiperTop1 <= length * -44) {
- that.swiperTop1 = 0;
- that.index1 = 0;
- clearInterval(that.moveId1);
- }
- }, 20);
- }, 2000);
- }
- // 关注患者
- follow(data) {
- this.showCommonModal(
- data,
- data.focusPatient === 0
- ? "您将设置患者【" +
- data.patientName +
- "】为重点关注,后期此患者的相关检查将会自动建单通知支助中心"
- : "您将取消设置患者【" +
- data.patientName +
- "】为重点关注,后期此患者的相关检查将不会自动建单通知支助中心"
- );
- }
- // 通用提示模态框
- commonModal: boolean = false; //模态框
- loading4 = false;
- tipsMsg1: string; //提示框信息
- coop: any; //当前操作列
- showCommonModal(data: any, tipsMsg1: string) {
- this.commonModal = true;
- this.coop = data;
- this.tipsMsg1 = tipsMsg1;
- }
- // 隐藏模态框
- hideCommonModal() {
- this.commonModal = false;
- }
- // 确认
- confirmCommon() {
- this.commonModal = false;
- let postData = {
- patient: {
- id: this.coop.id,
- focusPatient: this.coop.focusPatient === 0 ? 1 : 0,
- },
- };
- this.loading4 = true;
- this.mainService.listMsgByMain("updData/patient", postData).subscribe(
- (result) => {
- this.loading4 = false;
- if (result["status"] == 200) {
- this.showPromptModal(
- result["data"].focusPatient === 0 ? "取消关注" : "关注",
- true,
- ""
- );
- this.getPatient(this.tabSearchCont);
- } else {
- this.showPromptModal(
- result["data"].focusPatient === 0 ? "取消关注" : "关注",
- false,
- ""
- );
- }
- },
- (err) => {
- this.loading4 = false;
- this.showPromptModal("操作", false, "");
- }
- );
- }
- // 初始化新增form表单
- initBxForm(content) {
- this.validateBxForm = this.fb.group({
- description: [content || null, [Validators.required]],
- building: [null, [Validators.required]],
- floor: [null, [Validators.required]],
- officeAddress: [null, [Validators.required]],
- contacts: [this.loginUser.name, [Validators.required]],
- contactsInformation: [this.loginUser.phone, [Validators.required]],
- });
- this.getDeptById(this.currentDept.id);
- }
- // 根据科室ID获取详情
- deptDto:any = {};
- getDeptById(id){
- this.mainService
- .getFetchDataList("simple/data", "department", {
- idx: 0,
- sum: 1,
- department: {
- id,
- }
- })
- .subscribe((data:any) => {
- let list = data.list || [];
- this.deptDto = list.length > 0 ? list[0] : {};
- console.log(this.deptDto);
- this.changeHosp();
- // 回显楼栋
- if(this.deptDto.building){
- this.validateBxForm.controls.building.setValue(this.deptDto.building.id);
- }
- // 回显楼层
- if(this.deptDto.floor){
- this.validateBxForm.controls.floor.setValue(this.deptDto.floor.id);
- }
- });
- }
- // 切换院区选项
- buildings: any = []; //楼栋
- changeHosp() {
- this.validateBxForm.controls.building.setValue(null);
- this.buildings = [];
- let data = {
- idx: 0,
- sum: 9999,
- building: {
- hosId: this.deptDto.hospital.id,
- }
- };
- this.mainService
- .getFetchDataList("simple/data", "building", data)
- .subscribe((data:any) => {
- this.buildings = data.list || [];
- this.floors = [];
- this.message.remove(this.maskFlag);
- this.maskFlag = false;
- });
- }
- // 切换楼栋信息
- floors: Array<any> = []; //楼层
- floorLoading: boolean = false;
- changeBuilding(buildingId) {
- if(!buildingId){
- return;
- }
- this.validateBxForm.controls.floor.setValue(null);
- this.validateBxForm.controls.officeAddress.setValue(null);
- this.floors = [];
- let data = {
- idx: 0,
- sum: 9999,
- floor: {
- buildId: buildingId,
- }
- };
- this.floorLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "floor", data)
- .subscribe((data:any) => {
- this.floorLoading = false;
- this.message.remove(this.maskFlag);
- this.maskFlag = false;
- this.floors = data.list || [];
- });
- }
- // 是否确定报修模态框
- bxModal: boolean = false; //模态框
- loading6 = false;
- coopBx: any; //当前操作列
- validateBxForm: FormGroup; //新增/编辑表单
- showBxModal(data: any) {
- this.maskFlag = this.message.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- this.bxModal = true;
- this.coopBx = data || {};
- this.initBxForm(this.coopBx.content);
- }
- // 隐藏模态框
- hideBxModal() {
- this.bxModal = false;
- }
- // 确认
- confirmBx() {
- for (const i in this.validateBxForm.controls) {
- this.validateBxForm.controls[i].markAsDirty();
- this.validateBxForm.controls[i].updateValueAndValidity();
- }
- if (this.validateBxForm.invalid){
- this.message.error('请填写必填字段!');
- return;
- };
- if (!this.deptDto.id){
- this.message.error('数据异常,无法建单!');
- return;
- };
- this.showReqModal();
- }
- // 报修
- // type, 1是,0否
- async confirmBxNext(type){
- this.maskFlag = this.message.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- if(type == 1){
- this.btnLoading = true;
- let loginUser:any = cloneDeep(this.loginUser);
- if(this.deptDto.hospital){
- loginUser.hospital = { id: this.deptDto.hospital.id };
- }
- if(this.deptDto){
- loginUser.dept = {id: this.deptDto.id};
- }
- if(this.validateBxForm.value.contacts){
- loginUser.name = this.validateBxForm.value.contacts;
- }
- // if(this.validateBxForm.value.floor){
- // loginUser.place = {id: this.validateBxForm.value.floor, area: { id: this.validateBxForm.value.building }};
- // }
- // if(this.validateBxForm.value.officeAddress){
- // loginUser.houseNumber = this.validateBxForm.value.officeAddress;
- // }
- if(this.validateBxForm.value.contactsInformation){
- loginUser.phone = this.validateBxForm.value.contactsInformation;
- }
- let result:any = await this.mainService.coopData("updData", "user", { user: loginUser }).toPromise();
- console.log(result);
- if(result.status != 200){
- this.hideReqModal();
- this.btnLoading = false;
- this.message.remove(this.maskFlag);
- this.maskFlag = false;
- this.message.error(result.msg);
- return;
- }
- }else{
- this.cancenlLoading = true;
- }
- this.mainService.getDictionary("list", "incident_source").subscribe((source:any) => {
- let incidentSourceList = source || [];
- let im = incidentSourceList.find(v => v.value === 'im');
- this.mainService.getDictionary("list", "repair_incident_type").subscribe((result) => {
- let repairIncidentTypeList = result || [];
- let repairIncidentType = repairIncidentTypeList.find(v => v.value === 'dept');
- if (repairIncidentType) {
- let postData: any = {
- incident: {
- repairIncidentType,
- place: { id: this.deptDto.floor.id },
- department: { id: this.deptDto.id},
- description: this.validateBxForm.value.description,
- houseNumber: this.validateBxForm.value.officeAddress,
- contacts: this.validateBxForm.value.contacts,
- contactsInformation: this.validateBxForm.value.contactsInformation,
- hosId: this.deptDto.hospital.id,
- source: im,
- fromWx: true,
- requester: this.loginUser,
- acceptUser: this.loginUser,
- deleteFlag: 0,
- },
- };
- if (this.coopBx.category) {
- postData.incident.category = this.coopBx.categoryDTO;
- }
- this.mainService.flowPost("incident/task/request", postData).subscribe((res) => {
- this.btnLoading = false;
- this.cancenlLoading = false;
- this.message.remove(this.maskFlag);
- this.maskFlag = false;
- this.bxModal = false;
- this.hideReqModal();
- if ((res as any).state == 200) {
- this.showPromptModal("提交", true, "");
- this.checkTable("bxlb");
- } else {
- this.showPromptModal("提交", false, (res as any).msg);
- }
- });
- } else {
- this.btnLoading = false;
- this.showPromptModal("提交", false, "缺少【科室内报修】数据字典");
- }
- });
- })
- }
- // 获取星级
- degrees = [];
- getDegrees() {
- this.iLoading = true;
- this.mainService.getDictionary("list", "incident_degree").subscribe((data: any) => {
- this.iLoading = false;
- this.degrees = data || [];
- });
- }
- iLoading = false;
- // 获取当前登录人科室任务类型信息
- othersList: any = []; // 其他一键建单列表
- bbMsg: any = {}; //标本一键建单
- patientMsgList: any = []; // 患者转运,患者陪检一键建单
- tabFlag = true; //页面初始化获取一次患者陪检的任务类型信息
- allowUrgentFlag = false; //检查列表的患者陪检类型是否允许加急
- tabPermission:any = []; //tab自定义
- tabPermissionTpl:any = []; //tab自定义模板
- getDeptTaskType(search?, clear?) {
- let that = this;
- this.otherNum++;
- this.oLoading = true;
- let postData = {
- deptId: that.loginUserDeptId,
- };
- if (search !== undefined) {
- postData["taskName"] = search;
- postData["tabId"] = this.checkedTableType == 'other' ? undefined : this.checkedTableType;
- }
- that.mainService
- .postCustom("nurse", "getDeptTaskType", postData)
- .subscribe((data) => {
- this.otherNum--;
- if (this.otherNum === 0) {
- this.oLoading = false;
- }
- if (search === undefined) {
- that.deptTaskTypeRules = data.data;
- that.getOrderList();
- if(that.deptTaskTypeRules.openPatientTransport){
- // 手术权限
- that.getSurgeryWKOMsg();
- }
- if (
- that.deptTaskTypeRules.openInspection ||
- that.deptTaskTypeRules.openPatientTransport
- ) {
- // 陪检权限或转科权限
- if (this.tabFlag) {
- this.tabFlag = false;
- this.getTaskTypeByInspection().subscribe((result) => {
- console.log(result);
- if (result.list && result.list.length > 0) {
- this.appointmentBuildFlag =
- result.list[0].appointmentSwitch + ""; //是否开启护士端预约建单
- // this.leadTime = result.list[0].appointmentTime; //生效时长
- this.leadTime = 0; //生效时长
- this.followFlag = result.list[0].focusSwitch + ""; //是否开启护士端重点关注
- this.allowUrgentFlag =
- result.list[0].allowUrgent == 1 ? true : false; //是否允许加急(检查列表)
- } else {
- this.appointmentBuildFlag = "0"; //是否开启护士端预约建单
- this.leadTime = 0; //生效时长
- this.followFlag = "0"; //是否开启护士端重点关注
- this.allowUrgentFlag = false; //是否允许加急(检查列表)
- }
- this.pLoading = true;
- that.getPatient();
- });
- } else {
- that.getPatient();
- }
- }
- if (that.deptTaskTypeRules.openSpecimen) {
- // 标本权限
- that.getSpecimenWorkOrderMsg();
- }
- if (
- that.deptTaskTypeRules.openStaticDistribution ||
- that.deptTaskTypeRules.openDrugsBag
- ) {
- // 药品静配权限
- that.getJpDrugsWKOMsg();
- }
- }
- if(data.data.tabPermission && Array.isArray(data.data.tabPermission.data)){
- if (search !== undefined) {
- let tabPermission = [];
- tabPermission = this.tabPermissionTpl.map(v => {
- let obj = data.data.tabPermission.data.find(vv => vv.id == v.id);
- if(obj){
- return obj;
- }else{
- return v;
- }
- })
- this.tabPermission = tabPermission.sort((a,b) => a.orders - b.orders);
- }else{
- this.tabPermission = data.data.tabPermission.data.sort((a,b) => a.orders - b.orders);
- this.tabPermissionTpl = data.data.tabPermission.data.sort((a,b) => a.orders - b.orders).map(v => ({...v, taskTypeList: []}));
- }
- }else{
- this.tabPermission = this.tabPermissionTpl.length ? cloneDeep(this.tabPermissionTpl) : [];
- }
- if(!this.coopBtns.buildOrdersForOtherTasks){
- this.tabPermission = this.tabPermission.filter(v => !v.system);
- }
- // 初始化默认显示第一个
- if(search === undefined && !this.checkedTableType){
- console.log(this.tabPermission)
- if(this.tabPermission.length){
- this.checkedTableType = (this.tabPermission[0] && this.tabPermission[0].system) ? 'other' : this.tabPermission[0].id;
- }else if(this.coopBtns.suggestionBox){
- this.checkedTableType = 'advice';
- this.checkTable(this.checkedTableType);
- }else if(this.coopBtns.surgery){
- this.checkedTableType = 'surgery';
- this.checkTable(this.checkedTableType);
- }else if(this.coopBtns.outpatientHelpAppointment){
- this.checkedTableType = 'outpatientHelpAppointment';
- this.checkTable(this.checkedTableType);
- }else if(this.coopBtns.inquiryOfHistoricalSpecimens){
- this.checkedTableType = 'historySpecimen';
- this.checkTable(this.checkedTableType);
- }else if(this.coopBtns.historicalMedicineListInquiry){
- this.checkedTableType = 'historyDrugsbag';
- this.checkTable(this.checkedTableType);
- }else if(this.coopBtns.repairList && this.isShowBx){
- this.checkedTableType = 'bxlb';
- this.checkTable(this.checkedTableType);
- }
- }else{
- console.log('this.checkedTableType', this.checkedTableType);
- this.checkTable(this.checkedTableType);
- }
- this.othersList = {};
- this.tabPermission.forEach(v => {
- if(v.system){
- that.othersList['other'] = [];
- }else{
- that.othersList[v.id] = v.taskTypeList || [];
- }
- })
- if (data.data.allTaskTypes) {
- that.patientMsgList = [];
- data.data.allTaskTypes.forEach((e) => {
- if (e.associationType.value == "other") {
- if(that.othersList['other']){
- that.othersList['other'].push(e);
- }else{
- that.othersList['other'] = [e];
- }
- } else if (e.associationType.value == "specimen") {
- that.bbMsg = e;
- } else if (
- e.associationType.value == "patientTransport" ||
- e.associationType.value == "inspect"
- ) {
- that.patientMsgList.push(e);
- }
- });
- // if (clear === "clear") {
- // this.otherSearch = "";
- // this.workOrderRemark = "";
- // this.customRemarks = [];
- // this.historyCustomRemarks = [];
- // let obj = that.othersList.find(
- // (item) => item.id == this.selectOtherId
- // );
- // obj && this.otherClick(obj);
- // }
- console.log(this.selectOtherId);
- if (!this.selectOtherId) {
- if (that.othersList[that.checkedTableType] && that.othersList[that.checkedTableType].length) {
- this.selectOtherId = that.othersList[that.checkedTableType][0].id;
- let obj = that.othersList[that.checkedTableType].find(
- (item) => item.id == this.selectOtherId
- );
- obj && this.otherClick(obj);
- } else {
- this.selectOtherId = null;
- }
- }
- }
- });
- }
- // 工号输入搜索
- searchAccount(e) {
- this.searchAccountSubject.next(e);
- }
- // 根据工号获取用户
- account = null;
- accountList = [];
- isLoading:boolean = false;
- getAccountList(key = ''): void {
- let postData = {
- idx: 0,
- sum: 10,
- user: {
- account: key,
- hospital: {
- id: this.currentHospital.id
- }
- }
- };
- this.isLoading = true;
- this.mainService
- .getFetchDataList("data", "user", postData)
- .subscribe((data) => {
- this.isLoading = false;
- this.accountList = data.list || [];
- });
- }
- // 目标科室输入搜索
- searchDept(type, msg, e) {
- this.getDeptList(type, msg, e);
- }
- // 获取科室
- getDeptList(type, msg, key?): void {
- // 返回值的status是201 则是默认发起科室
- // 返回值的status是202 则是固定科室范围
- // 返回值的status是203 则是固定科室
- // 返回值的status是204 则是自主填写
- // 返回值的status是205 则是固定科室类型
- if (
- (type == "start" && msg.start.start.departmentStrategy == 202) ||
- (type == "target" && msg.end.end.departmentStrategy == 202)
- ) {
- return; //固定科室范围禁用搜索
- }
- let postData: any = {
- idx: 0,
- sum: 20,
- department: {
- searchType: 1,
- cascadeHosId: this.currentHospital.id
- },
- };
- if (key) {
- postData.department["keyWord"] = key;
- }
- if (type == "start" && msg.start.start.departmentStrategy == 205) {
- postData.department["type"] = { id: msg.start.start.startTypeId };
- } else if (type == "target" && msg.end.end.departmentStrategy == 205) {
- postData.department["type"] = { id: msg.end.end.endTypeId };
- }
- if (type == "start") {
- postData.department["ids"] = msg.start.deptIds || "";
- } else if (type == "target") {
- postData.department["ids"] = msg.end.deptIds || "";
- }
- postData.department.nurseSign = 1;
- this.mainService
- .getFetchDataList("data", "department", postData)
- .subscribe((data) => {
- if (type == "target") {
- msg.end.end.list = data.list;
- } else if (type == "start") {
- msg.start.start.list = data.list;
- }
- });
- }
- // 切换左侧tab
- changeInfo() {
- if (
- !this.deptTaskTypeRules.openInspection &&
- !this.deptTaskTypeRules.openPatientTransport
- ) {
- return;
- }
- this.infoPageIdx = 1;
- this.getPatient();
- }
- // 获取患者信息
- snum = 0;
- getPatient(e?) {
- if ((this.currentDept.typeValue == "outpatientDept" || this.currentDept.typeValue == "checkRoom" || this.currentDept.typeValue == "outpatientService") && !this.tabSearchCont) {
- this.pLoading = false;
- this.patientList = [];
- this.infoLength = 0;
- return; //护士端如果登录后如果科室类型为“门诊科室”、“检验科室”、“门诊服务点”,默认不显示患者信息
- }
- this.pLoading = true;
- let postData = {
- idx: this.infoPageIdx - 1,
- sum: 10,
- };
- if(this.currentDept.typeValue == 'surgery' && !this.tabSearchCont){
- // 手术安排信息-手术室类型
- postData["surgery"] = {
- searchKey: e ? e : this.tabSearchCont,
- applyDateStart: format(startOfDay(new Date()), "yyyy-MM-dd HH:mm:ss"),
- applyDateEnd: format(endOfDay(new Date()), "yyyy-MM-dd HH:mm:ss"),
- hosId: this.currentHospital.id,
- surgeryDept: this.loginUserDeptId,
- state: {
- key: 'surgery_trans_state',
- value: 3
- }
- };
- }else if(this.currentDept.typeValue == 'recovery'){
- // 患者信息-复苏室类型
- postData["patient"] = {
- keyWord: e ? e : this.tabSearchCont,
- };
- // 查询父级科室患者
- postData["patient"]["parentIdOnly"] = true;
- postData["patient"]["recoveryDept"] = this.loginUserDeptId;
- postData["patient"]["recoveryDeptDTO"] = {keyWord: '1'};
- }else if(this.currentDept.typeValue == "checkRoom2"){
- // 患者信息
- postData["patient"] = {
- keyWord: e ? e : this.tabSearchCont,
- };
- // 查询父级科室患者
- postData["patient"]["parentIdOnly"] = true;
- if (this.tabSearchCont) {
- delete postData["patient"]["department"]; //搜索范围为全院在院患者
- delete postData["patient"]["checkTempDept"];
- } else {
- postData["patient"]["checkTempDept"] = { id: this.loginUserDeptId };
- }
- }else{
- // 患者信息
- postData["patient"] = {
- keyWord: e ? e : this.tabSearchCont,
- };
- // 查询父级科室患者
- postData["patient"]["parentIdOnly"] = true;
- if (
- this.currentDept.typeValue == "checkRoom2" ||
- this.currentDept.typeValue == "outpatientDept" ||
- this.currentDept.typeValue == "checkRoom" ||
- (this.currentDept.typeValue == 'surgery' && this.tabSearchCont)
- ) {
- delete postData["patient"]["department"]; //搜索范围为全院在院患者
- } else {
- postData["patient"]["department"] = { id: this.loginUserDeptId };
- }
- }
- this.snum++;
- this.mainService
- .getFetchDataList((this.currentDept.typeValue == 'surgery' && !this.tabSearchCont) ? "simple/data" : 'nurse', (this.currentDept.typeValue == 'surgery' && !this.tabSearchCont) ? "surgery" : 'patient', postData)
- .subscribe((data) => {
- this.snum--;
- if (data.list.length > 0) {
- data.list.forEach((item) => {
- if(this.currentDept.typeValue == 'surgery' && !this.tabSearchCont){
- if (item.patientDTO && item.patientDTO.focusPatient === undefined) {
- item.patientDTO.focusPatient = 0;
- }
- }else{
- if (item.focusPatient === undefined) {
- item.focusPatient = 0;
- }
- }
- });
- }
- this.patientList = data.list || [];
- if (this.snum === 0) {
- this.pLoading = false;
- }
- this.infoLength = data.totalNum || 0;
- });
- }
- // tab输入搜索节流阀
- searchTabInp(e) {
- if (
- !this.deptTaskTypeRules.openInspection &&
- !this.deptTaskTypeRules.openPatientTransport
- ) {
- return;
- }
- this.searchTabInpSubject.next(e);
- }
- // 下一日(陪检)
- nextDay() {
- this.yyDate = addDays(this.yyDate, 1);
- this.yyDateChange(this.yyDate);
- }
- // 下一日(转运)
- nextDayZy() {
- this.yyDateZy = addDays(this.yyDateZy, 1);
- this.yyDateChange(this.yyDateZy);
- }
- // 禁用日期(陪检)
- disabledyyDate = (current: Date): boolean => {
- return differenceInCalendarDays(current, new Date()) < 0;
- };
- // 禁用日期(转运)
- disabledyyDateZy = (current: Date): boolean => {
- return differenceInCalendarDays(current, new Date()) < 0;
- };
- // 一键建单确认弹框
- confirmSub: boolean = false;
- confirmPostData: any = {}; //确认提交数据
- confirmYuyue: boolean = false; //确认预约
- confirmInfo: string = "";
- btnLoading3 = false;
- confirm() {
- if (this.confirmYuyue) {
- this.confirmPostData.workOrder.yyTime =
- format(parse(this.yyTime, 'yyyy-MM-dd HH:mm:ss', new Date()), "yyyy-MM-dd HH:mm") + ":00";
- }
- if (!this.confirmYuyue) {
- this.confirmPostData.workOrder.platform = 2;
- } else {
- delete this.confirmPostData.workOrder.platform;
- }
- //是否需要医护陪同检查
- if (this.patientMsg.careLevel && this.currentTasktype.isAccompany == 1) {
- //特级护理或一级护理
- if (
- this.patientMsg.careLevel.value === "0" ||
- this.patientMsg.careLevel.value === "1"
- ) {
- this.btnLoading = false;
- this.btnLoading1 = false;
- this.accompany(this.confirmPostData, this.confirmYuyue, "patient-yy");
- return;
- }
- }
- if (this.patientMsg.illnessState && this.currentTasktype.isAccompany == 1) {
- //病危或病重
- if (
- this.patientMsg.illnessState.value === "2" ||
- this.patientMsg.illnessState.value === "3"
- ) {
- this.btnLoading = false;
- this.btnLoading1 = false;
- this.accompany(this.confirmPostData, this.confirmYuyue, "patient-yy");
- return;
- }
- }
- this.btnLoading3 = true;
- this.confirmPostData.workOrder.isAccompany = 0; //是否需要医护陪同检查
- this.newOrderTimeFun(this.confirmPostData.workOrder, () => {
- this.btnLoading3 = false;
- this.cancel();
- }, () => {
- this.mainService
- .postCustom(
- "api",
- this.confirmYuyue ? "appointmentOrder" : "startOrder",
- this.confirmPostData
- )
- .subscribe((data) => {
- this.message.remove(this.jdFlagId);
- this.btnLoading3 = false;
- this.cancel();
- if (data.status == 200) {
- if(this.currentDept.typeValue == 'recovery'){
- this.mainService.postCustom("api", "clearPatientRecoveryDept", {patientCode: this.confirmPostData.workOrder.patient.patientCode}).subscribe((resultData) => {
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- });
- }else{
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- }
- } else if (data.status == 100042) {
- this.showPromptModal("创建", false, data.msg);
- this.getPatient(this.tabSearchCont);
- } else if (data.status == 1000033) {
- //重复建单那策略
- this.repeatMsg = data.msg;
- this.showDelModal(
- this.confirmPostData,
- "accompany5",
- this.confirmYuyue
- );
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- });
- })
- }
- cancel() {
- this.confirmSub = false;
- // this.confirmPostData = {};
- // this.confirmYuyue = false;
- this.btnLoading = false;
- }
- patientForm: FormGroup; //患者信息一键建单表单
- //患者送检检查项目
- checkTypeLis: any = [];
- // 患者信息一键建单关联检查
- linkCheckLis: any = [];
- goodsLis: any = []; //携带设备
- isRemarks: boolean = false; //是否开启备注信息
- allowUrgent: any = "0"; //加急
- urgentReason: any = ""; //加急原因
- // 初始化form表单
- initForm() {
- // 初始化患者信息一键建单表单
- this.patientForm = this.fb.group({
- checkedType: [null, [Validators.required]],
- goods: [null],
- workOrderRemark2: [null],
- linkCheck: [null, []],
- targetOffice: [null, [this.targetOfficeValidator]],
- originOffice: [null, [this.originOfficeValidator]],
- allowUrgent: [null], //加急
- urgentReason: [null, [this.urgentReasonValidator]], //加急原因
- });
- // 初始化一键发起建单表单
- this.shortcutForm = this.fb.group({
- targetOffice: [null, [this.targetOfficeShortCutValidator]],
- originOffice: [null, [this.originOfficeShortCutValidator]],
- });
- // 初始化一键发起建单表单
- this.shortcutForm1 = this.fb.group({
- targetOffice: [null, [this.targetOfficeShortCutValidator1]],
- originOffice: [null, [this.originOfficeShortCutValidator1]],
- });
- //新增报修
- this.bxForm = this.fb.group({
- // name: [null, [Validators.required]],
- // phone: [null, [Validators.required]],
- // hospital: [null, [Validators.required]],
- // building: [null, [Validators.required]],
- // address: [null, [Validators.required]],
- content: [null, [Validators.required]],
- });
- }
- //创建自定义校验规则dateValidator,用于复选框组校验时调用。
- // 起点科室校验
- originOfficeValidator = (control: FormControl): { [s: string]: boolean } => {
- if (
- this.patientForm &&
- this.patientForm.value &&
- this.checkedShowMsg.status != 200 &&
- !control.value &&
- (this.checkedShowMsg.status == 100015 ||
- this.checkedShowMsg.status == 100013)
- ) {
- return { required: true };
- }
- };
- // 目标科室校验
- targetOfficeValidator = (control: FormControl): { [s: string]: boolean } => {
- if (
- this.patientForm &&
- this.patientForm.value &&
- this.checkedShowMsg.status != 200 &&
- !control.value &&
- (this.checkedShowMsg.status == 100015 ||
- this.checkedShowMsg.status == 100014)
- ) {
- return { required: true };
- }
- };
- // 加急原因校验
- urgentReasonValidator = (control: FormControl): { [s: string]: boolean } => {
- if (this.allowUrgent == 1) {
- return { required: true };
- }
- };
- surgeryModal: boolean = false; //模态框
- surgeryInfo:string = '';
- surgeryItem: any = {};
- hideSurgeryModal() {
- this.surgeryModal = false;
- }
- // 确认
- confirmSurgery(surgeryItem) {
- console.log(surgeryItem);
- this.btnLoading = true;
- this.mainService
- .listMsgByMain('surgeryMsg', {
- surgeryId: surgeryItem.id,
- code: 'surgery_begin',
- })
- .subscribe((result:any) => {
- this.btnLoading = false;
- this.surgeryModal = false;
- if(result.state == 200){
- this.showPromptModal("操作", true, "");
- }else{
- this.showPromptModal("操作", false, result.msg);
- }
- });
- }
- // 手术安排信息-即将开始
- surgeryBegin(e, item){
- e.stopPropagation();
- let maskFlag = this.message.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- let postData = {
- idx: 0,
- sum: 9999,
- transportMessage: {
- hosId: this.currentHospital.id,
- code: 'surgery_begin',
- },
- };
- this.mainService
- .getFetchDataList("simple/data", "transportMessage", postData)
- .subscribe((result:any) => {
- this.message.remove(maskFlag);
- if (result.status == 200) {
- result.list = result.list || [];
- if(result.list.length){
- let resultObj:any = {};
- result.list.forEach(v => {
- resultObj[v.role] = v;
- })
- item.doctorNameFlag = resultObj.doctor.phoneFlag == 1 || resultObj.doctor.wechatFlag == 1;
- item.docAssistantInfosFlag = resultObj.docAssistant.phoneFlag == 1 || resultObj.docAssistant.wechatFlag == 1;
- item.anesthetistNameFlag = resultObj.anesthetist.phoneFlag == 1 || resultObj.anesthetist.wechatFlag == 1;
- item.patientNameFlag = resultObj.patient.phoneFlag == 1 || resultObj.patient.wechatFlag == 1;
- if(item.docAssistantInfosFlag && item.docAssistantInfos){
- item.docAssistantInfos = item.docAssistantInfos.split('|').map(v => v.split(',')[0]).join(' / ');
- }
- this.surgeryModal = true;
- this.surgeryItem = item;
- this.surgeryInfo = `提示:您即将给以下工作人员发送短信/微信提醒,请确认以下信息`;
- }else{
- this.showPromptModal("【手术即将开始通知】未配置", false, "失败");
- }
- }else{
- this.showPromptModal("接口获取数据", false, "失败");
- }
- });
- }
- // -----------------
- // --------------------------------------------------------start
- otherDataModal: boolean = false; //模态框
- otherDataInfo:string = '';
- otherDataItem: any = {};
- hideOtherDataModal() {
- this.otherDataModal = false;
- }
- // 确认
- confirmOtherData() {
- console.log(this.otherDataItem);
- this.otherBuildOrder(JSON.parse(this.otherDataItem).otherList);
- this.otherDataModal = false;
- this.relationTransModalShow = JSON.parse(this.otherDataItem).show;
- }
- otherDataConfirm(e){
- this.otherDataModal = true;
- this.otherDataItem = e;
- this.otherDataInfo = `您本次送${this.otherBindConfigDto.relationTrans.name}选择了${JSON.parse(this.otherDataItem).otherList.length}本${this.otherBindConfigDto.relationTrans.name},您确认要建单配送吗?`;
- }
- // --------------------------------------------------------end
- pickUpModal: boolean = false; //模态框
- pickUpInfo:string = '';
- pickUpItem: any = {};
- hidePickUpModal() {
- this.pickUpModal = false;
- }
- // 确认
- confirmPickUp() {
- console.log(this.pickUpItem);
- this.btnLoading = true;
- this.mainService
- .createOrTakeOrder({
- type: 'surgery',
- id: this.pickUpItem.id,
- workOrder: {
- sourceld: 2,
- createDept: this.loginUser.dept.id,
- platform: 2
- }
- })
- .subscribe((result:any) => {
- this.btnLoading = false;
- this.pickUpModal = false;
- if(result.state == 200){
- this.showPromptModal("创建", true, "");
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- }else{
- this.showPromptModal("创建", false, result.msg);
- }
- });
- }
- // 手术安排信息-一键接患者
- pickUpPatient(e, item){
- e.stopPropagation();
- this.pickUpModal = true;
- this.pickUpItem = item;
- this.pickUpInfo = `您本次需要从<span style="color:red;">${item.areaDeptDTO ? (this.deptDisplay == 2 ? item.areaDeptDTO.deptalias : item.areaDeptDTO.dept) : ''}</span>科室接<span style="color:red;">${item.patientDTO ? item.patientDTO.patientName : ''}</span>患者到<span style="color:red;">${item.surgeryDeptDTO ? (this.deptDisplay == 2 ? item.surgeryDeptDTO.deptalias : item.surgeryDeptDTO.dept) : ''}</span>手术间进行手术,您确认接患者吗?`
- }
- sendWardModal: boolean = false; //模态框
- sendWardInfo:string = '';
- sendWardItem: any = {};
- hideSendWardModal() {
- this.sendWardModal = false;
- }
- // 确认
- sLoading1 = false;
- confirmSendWard(data) {
- console.log(this.sendWardItem);
- this.sLoading1 = true;
- this.mainService
- .createRemandOrder({
- type: 'surgery',
- surgeryId: this.sendWardItem.id,
- orderId: this.sendWardItem.gdid,
- configId: this.surgeryConfigs.id,
- remandType: 'clinical',
- remandClean: data.isRemandClean ? 1 : 0,
- })
- .subscribe((result:any) => {
- this.sLoading1 = false;
- this.sendWardModal = false;
- if(result.state == 200){
- this.showPromptModal("创建", true, "");
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- }else{
- this.showPromptModal("创建", false, result.msg);
- }
- });
- }
- // 手术中患者-送回病房
- sendWard(e, item){
- e.stopPropagation();
- this.sendWardModal = true;
- this.sendWardItem = item;
- this.sendWardInfo = `您是否确认将<span style="color:red;">${item.patientDTO ? item.patientDTO.patientName : ''}</span>患者送往<span style="color:red;">${item.areaDeptDTO ? (this.deptDisplay == 2 ? item.areaDeptDTO.deptalias : item.areaDeptDTO.dept) : ''}</span>科室吗?`
- }
- sendAwakeningRoomModal: boolean = false; //模态框
- sendAwakeningRoomInfo:string = '';
- sendAwakeningRoomItem: any = {};
- hideSendAwakeningRoomModal() {
- this.sendAwakeningRoomModal = false;
- }
- // 确认
- sLoading2 = false;
- confirmSendAwakeningRoom(data) {
- console.log(this.sendAwakeningRoomItem);
- console.log(this.surgeryConfigs);
- if(!data.recoveryRoom){
- this.message.info(`<span class="red">${this.surgeryConfigs.recoveryType.taskName}</span>任务类型-运输过程-终点科室-默认科室配置错误!`);
- return;
- }
- this.sLoading2 = true;
- this.mainService
- .createRemandOrder({
- type: 'surgery',
- surgeryId: this.sendAwakeningRoomItem.id,
- orderId: this.sendAwakeningRoomItem.gdid,
- configId: this.surgeryConfigs.id,
- remandType: 'recovery',
- remandClean: data.isRemandClean ? 1 : 0,
- endDept: data.recoveryRoom || undefined,
- })
- .subscribe((result:any) => {
- this.sLoading2 = false;
- this.sendAwakeningRoomModal = false;
- if(result.state == 200){
- this.showPromptModal("创建", true, "");
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- }else{
- this.showPromptModal("创建", false, result.msg);
- }
- });
- }
- // 手术中患者-送回苏醒区
- sendAwakeningRoom(e, item){
- e.stopPropagation();
- this.sendAwakeningRoomModal = true;
- this.sendAwakeningRoomItem = item;
- this.sendAwakeningRoomInfo = `您是否确定将<span style="color:red;">${item.patientDTO ? item.patientDTO.patientName : ''}</span>患者送往<span style="color:red;">${this.surgeryConfigs.recoveryDeptDTO ? (this.deptDisplay == 2 ? this.surgeryConfigs.recoveryDeptDTO.deptalias : this.surgeryConfigs.recoveryDeptDTO.dept) : ''}</span>科室吗?`
- }
- // 手术排程信息-一键建单
- createOrder(e, item){
- e.stopPropagation();
- this.newPatientOrder(item.patientDTO);
- }
- // 患者信息一键建单
- patientModal: boolean = false; //患者信息一键建单模态框
- patientMsg; //患者信息
- // 打开患者信息一键建单模态框
- maskFlag: any = false;
- newPatientOrder(msg) {
- this.yyTime = null;
- this.yyTimeZy = null;
- this.btnLoading = false;
- this.btnLoading1 = false;
- let that = this;
- that.initForm();
- that.checkedShowMsg = {};
- that.patientMsg = msg;
- this.maskFlag = this.message.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- that.mainService
- .postCustom("configuration", "deptTSPTaskType", {})
- .subscribe((data) => {
- that.checkTypeLis = data.data;
- // 默认选中患者陪检,没有患者陪检,则选择第一个患者其他服务的任务类型
- let id;
- for (let i = that.checkTypeLis.length - 1; i >= 0; i--) {
- if (that.checkTypeLis[i].associationType.value == "inspect") {
- id = that.checkTypeLis[i].id;
- break;
- } else if (
- that.checkTypeLis[i].associationType.value == "patientTransport"
- ) {
- id = that.checkTypeLis[i].id;
- }
- }
- that.patientForm.controls.checkedType.setValue(id);
- this.changeCheckedType();
- });
- }
- 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;
- }
- 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;
- }
- // 获取大于x,并且是n的倍数的数字
- getLgNumber(x: number, n:number): number{
- for(let i = x; i < 60; i++){
- if(i % n === 0){
- return i;
- }
- }
- return 0;
- }
- hidePatientOrder() {
- this.patientModal = false;
- this.clickYYFlag = false;
- this.clickYYZyFlag = false;
- }
- // 预约建单
- btnLoading1 = false;
- confirmPatient1(type) {
- this.confirmPatient(type);
- }
- // 患者信息保存
- clickYYFlag = false; //是否点击预约建单-患者陪检
- clickYYZyFlag = false; //是否点击预约建单-患者其他
- confirmPatient(yuyue?) {
- if (yuyue === "patient-yuyue") {
- this.clickYYFlag = true;
- } else {
- this.clickYYFlag = false;
- }
- if (yuyue === "patient-zy-yuyue") {
- this.clickYYZyFlag = true;
- } else {
- this.clickYYZyFlag = false;
- }
- // 选项是患者转运
- let flag = this.checkTypeLis.some((item) => {
- return (
- item.id == this.patientForm.controls.checkedType.value &&
- item.associationType.value == "patientTransport"
- );
- });
- //预约时间-患者陪检不能为空
- console.log(this.yyTime, this.yyTimeZy, flag, yuyue);
- if (
- (!this.yyTime && !flag && yuyue === "patient-yuyue") ||
- (!this.yyTimeZy && flag && yuyue === "patient-zy-yuyue")
- ) {
- return;
- }
- console.log(this.yyDateZy, this.yyTimeZy, this.yyDate, this.yyTime, flag);
- if (flag) {
- //转运
- 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());
- this.yyTimeZy =
- format(yyDateZy, "yyyy-MM-dd") +
- " " +
- format(yyTimeZy, "HH:mm") +
- ":00";
- } else {
- //陪检
- 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());
- this.yyTime =
- format(yyDate, "yyyy-MM-dd") +
- " " +
- format(yyTime, "HH:mm") +
- ":00";
- }
- var that = this;
- for (const i in that.patientForm.controls) {
- that.patientForm.controls[i].markAsDirty();
- that.patientForm.controls[i].updateValueAndValidity();
- }
- if (that.patientForm.invalid) {
- return;
- }
- console.log(that.patientForm);
- if (yuyue) {
- this.confirmYuyue = true;
- this.btnLoading1 = true;
- } else {
- this.confirmYuyue = false;
- this.btnLoading = true;
- }
- let postData: any = {
- workOrder: {
- sourceId: SourceId.hushi,
- taskType: { id: that.patientForm.controls.checkedType.value },
- startDept: { id: that.checkedShowMsg.startDept },
- endDepts: [{ id: that.checkedShowMsg.endDept }],
- createDept: that.loginUserDeptId,
- patient: {
- patientCode: that.patientMsg.patientCode,
- },
- },
- };
- if (!flag) {
- postData.workOrder.taskType.isHalfInspect =
- this.currentTasktype.isHalfInspect === 1 ? 1 : 0; //半程陪检
- }
- if (
- (that.checkedShowMsg.status == 100013 ||
- that.checkedShowMsg.status == 100015) &&
- that.patientForm.value.originOffice
- ) {
- postData.workOrder.startDept.id = that.patientForm.value.originOffice;
- }
- if (that.patientForm.value.targetOffice) {
- postData.workOrder["endDepts"] = [
- { id: that.patientForm.value.targetOffice },
- ];
- } else if (flag) {
- postData.workOrder["endDepts"] = [
- { id: that.checkedShowMsg.end.end.list[0].id },
- ];
- }
- let checkedArr = [];
- let yy = false; //是否有预约时间
- if (that.linkCheckLis && that.linkCheckLis.length) {
- that.linkCheckLis.forEach((e) => {
- if (e.checked) {
- checkedArr.push({ id: e.value });
- if (e.yyTime) {
- yy = true;
- }
- }
- });
- }
- // 携带设备
- let goods = "";
- if (that.patientForm.value.goods && that.patientForm.value.goods.length) {
- that.patientForm.value.goods.forEach((e) => {
- if (e.checked) {
- goods += e.value + ",";
- }
- });
- goods = goods.slice(0, goods.length - 1);
- }
- postData.workOrder["goods"] = goods;
- // 工单备注
- postData.workOrder["workOrderRemark"] = that.workOrderRemark2 || '';
- if (!yuyue && that.current_allowUrgent && this.allowUrgent == 1) {
- postData.workOrder["urgentDetails"] = {
- checkStatus: { id: 329 },
- urgentReason: that.urgentReason,
- };
- } else {
- delete postData.workOrder["urgentDetails"];
- }
- if (
- yy &&
- that.checkedShowMsg.status == 200 &&
- that.linkCheckLis &&
- checkedArr.length
- ) {
- // 有预约时间
- postData.workOrder["checkList"] = checkedArr;
- that.hidePatientOrder();
- that.confirmSub = true;
- that.confirmPostData = postData;
- that.confirmInfo = "您确认建单吗?";
- } else {
- if (!yy && that.checkedShowMsg.status == 200) {
- postData.workOrder["checkList"] = checkedArr;
- // 添加预约时间
- if (yuyue) {
- postData.workOrder.yyTime =
- format(parse(this.yyTime, 'yyyy-MM-dd HH:mm:ss', new Date()), "yyyy-MM-dd HH:mm") + ":00";
- }
- } else {
- delete postData.workOrder["checkList"];
- // 添加预约时间
- if (yuyue) {
- postData.workOrder.yyTime =
- format(parse(this.yyTimeZy, 'yyyy-MM-dd HH:mm:ss', new Date()), "yyyy-MM-dd HH:mm") + ":00";
- }
- }
- if (that.checkedShowMsg.status != 200) {
- postData.workOrder["isRemand"] = this.isRemand ? 1 : 0;
- }
- if (!yuyue) {
- postData.workOrder.platform = 2;
- } else {
- delete postData.workOrder.platform;
- }
- //是否需要医护陪同检查
- if (this.patientMsg.careLevel && this.currentTasktype.isAccompany == 1) {
- //特级护理或一级护理
- if (
- this.patientMsg.careLevel.value === "0" ||
- this.patientMsg.careLevel.value === "1"
- ) {
- this.btnLoading = false;
- this.btnLoading1 = false;
- this.accompany(postData, yuyue, "patient");
- return;
- }
- }
- if (
- this.patientMsg.illnessState &&
- this.currentTasktype.isAccompany == 1
- ) {
- //病危或病重
- if (
- this.patientMsg.illnessState.value === "2" ||
- this.patientMsg.illnessState.value === "3"
- ) {
- this.btnLoading = false;
- this.btnLoading1 = false;
- this.accompany(postData, yuyue, "patient");
- return;
- }
- }
- postData.workOrder.isAccompany = 0; //是否需要医护陪同检查
- this.newOrderTimeFun(postData.workOrder, () => {
- this.hidePatientOrder();
- }, () => {
- this.mainService
- .postCustom("api", yuyue ? "appointmentOrder" : "startOrder", postData)
- .subscribe((data) => {
- this.message.remove(this.jdFlagId);
- this.hidePatientOrder();
- if (data.status == 200) {
- if(this.currentDept.typeValue == 'recovery'){
- this.mainService.postCustom("api", "clearPatientRecoveryDept", {patientCode: postData.workOrder.patient.patientCode}).subscribe((resultData) => {
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- });
- }else{
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- }
- } else if (data.status == 100042) {
- this.showPromptModal("创建", false, data.msg);
- this.getPatient(this.tabSearchCont);
- } else if (data.status == 1000033) {
- //重复建单那策略
- this.repeatMsg = data.msg;
- this.showDelModal(postData, "transport", yuyue);
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- });
- })
- }
- }
- // 是否需要护士医生陪同模态框
- accompanyModal: boolean = false;
- accompanyLoading: boolean = false;
- cancenlLoading: boolean = false;
- accompanyPostData = null;
- accompanyYuyue;
- accompanyType = "";
- accompany(postData, yuyue, type) {
- this.accompanyModal = true;
- this.accompanyPostData = postData;
- this.accompanyYuyue = yuyue;
- this.accompanyType = type;
- }
- confirmAccompany() {
- this.accompanyPostData.workOrder.isAccompany = 1;
- this.accompanyLoading = true;
- if (this.accompanyType == "patient") {
- //患者列表直接建单
- this.newOrderTimeFun(this.accompanyPostData.workOrder, () => {
- this.hidePatientOrder();
- this.accompanyModal = false;
- this.accompanyLoading = false;
- }, () => {
- this.mainService
- .postCustom(
- "api",
- this.accompanyYuyue ? "appointmentOrder" : "startOrder",
- this.accompanyPostData
- )
- .subscribe((data) => {
- this.message.remove(this.jdFlagId);
- this.hidePatientOrder();
- this.accompanyModal = false;
- this.accompanyLoading = false;
- if (data.status == 200) {
- if(this.currentDept.typeValue == 'recovery'){
- this.mainService.postCustom("api", "clearPatientRecoveryDept", {patientCode: this.accompanyPostData.workOrder.patient.patientCode}).subscribe((resultData) => {
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- });
- }else{
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- }
- } else if (data.status == 100042) {
- this.showPromptModal("创建", false, data.msg);
- this.getPatient(this.tabSearchCont);
- } else if (data.status == 1000033) {
- //重复建单那策略
- this.repeatMsg = data.msg;
- this.showDelModal(
- this.accompanyPostData,
- "accompany1",
- this.accompanyYuyue
- );
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- });
- })
- } else if (this.accompanyType == "patient-yy") {
- //患者列表预约建单
- this.newOrderTimeFun(this.accompanyPostData.workOrder, () => {
- this.btnLoading3 = false;
- this.accompanyModal = false;
- this.accompanyLoading = false;
- this.cancel();
- }, () => {
- this.mainService
- .postCustom(
- "api",
- this.accompanyYuyue ? "appointmentOrder" : "startOrder",
- this.accompanyPostData
- )
- .subscribe((data) => {
- this.message.remove(this.jdFlagId);
- this.btnLoading3 = false;
- this.accompanyModal = false;
- this.accompanyLoading = false;
- this.cancel();
- if (data.status == 200) {
- if(this.currentDept.typeValue == 'recovery'){
- this.mainService.postCustom("api", "clearPatientRecoveryDept", {patientCode: this.accompanyPostData.workOrder.patient.patientCode}).subscribe((resultData) => {
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- });
- }else{
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- }
- } else if (data.status == 100042) {
- this.showPromptModal("创建", false, data.msg);
- this.getPatient(this.tabSearchCont);
- } else if (data.status == 1000033) {
- //重复建单那策略
- this.repeatMsg = data.msg;
- this.showDelModal(
- this.accompanyPostData,
- "accompany2",
- this.accompanyYuyue
- );
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- });
- })
- }
- }
- hideAccompanyModal(e) {
- console.log(e);
- if (e === "x") {
- //关闭
- this.accompanyModal = false;
- return;
- }
- this.accompanyPostData.workOrder.isAccompany = 0;
- this.cancenlLoading = true;
- if (this.accompanyType == "patient") {
- //患者列表直接建单
- this.newOrderTimeFun(this.accompanyPostData.workOrder, () => {
- this.hidePatientOrder();
- this.accompanyModal = false;
- this.cancenlLoading = false;
- }, () => {
- this.mainService
- .postCustom(
- "api",
- this.accompanyYuyue ? "appointmentOrder" : "startOrder",
- this.accompanyPostData
- )
- .subscribe((data) => {
- this.message.remove(this.jdFlagId);
- this.hidePatientOrder();
- this.accompanyModal = false;
- this.cancenlLoading = false;
- if (data.status == 200) {
- if(this.currentDept.typeValue == 'recovery'){
- this.mainService.postCustom("api", "clearPatientRecoveryDept", {patientCode: this.accompanyPostData.workOrder.patient.patientCode}).subscribe((resultData) => {
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- });
- }else{
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- }
- } else if (data.status == 100042) {
- this.showPromptModal("创建", false, data.msg);
- this.getPatient(this.tabSearchCont);
- } else if (data.status == 1000033) {
- //重复建单那策略
- this.repeatMsg = data.msg;
- this.showDelModal(
- this.accompanyPostData,
- "accompany3",
- this.accompanyYuyue
- );
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- });
- })
- } else if (this.accompanyType == "patient-yy") {
- //患者列表预约建单
- this.newOrderTimeFun(this.accompanyPostData.workOrder, () => {
- this.btnLoading3 = false;
- this.accompanyModal = false;
- this.cancenlLoading = false;
- this.cancel();
- }, () => {
- this.mainService
- .postCustom(
- "api",
- this.accompanyYuyue ? "appointmentOrder" : "startOrder",
- this.accompanyPostData
- )
- .subscribe((data) => {
- this.message.remove(this.jdFlagId);
- this.btnLoading3 = false;
- this.accompanyModal = false;
- this.cancenlLoading = false;
- this.cancel();
- if (data.status == 200) {
- if(this.currentDept.typeValue == 'recovery'){
- this.mainService.postCustom("api", "clearPatientRecoveryDept", {patientCode: this.accompanyPostData.workOrder.patient.patientCode}).subscribe((resultData) => {
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- });
- }else{
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- }
- } else if (data.status == 100042) {
- this.showPromptModal("创建", false, data.msg);
- this.getPatient(this.tabSearchCont);
- } else if (data.status == 1000033) {
- //重复建单那策略
- this.repeatMsg = data.msg;
- this.showDelModal(
- this.accompanyPostData,
- "accompany4",
- this.accompanyYuyue
- );
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- });
- })
- }
- }
- // 切换患者送检检查项目
- checkedShowMsg: any = {}; //患者送检检查项目对应展示信息
- current_allowUrgent = false; //当前任务类型是否允许加急
- currentTasktype; //当前选中的任务类型对象
- cLoading = false;
- historyCustomRemarks2 = [];
- changeCheckedType() {
- this.workOrderRemark2 = "";
- this.customRemarks2 = [];
- this.historyCustomRemarks2 = [];
- this.isYyInspect = false;
- this.linkCheckLisTrue = false;
- this.clickYYFlag = false;
- this.clickYYZyFlag = false;
- this.currentTasktype = this.checkTypeLis.find(
- (item) => item.id == this.patientForm.controls.checkedType.value
- );
- // 获取患者其他服务,护士端是否预约建单
- let appointmentZyBuildFlag = this.checkTypeLis.filter(
- (item) =>
- item.id == this.patientForm.controls.checkedType.value &&
- item.associationType.value == "patientTransport"
- );
- if (appointmentZyBuildFlag.length) {
- this.appointmentZyBuildFlag =
- appointmentZyBuildFlag[0].appointmentOtherSwitch == 1 ? "1" : "0";
- console.log(this.appointmentZyBuildFlag, "seimin");
- this.yyDateZy = new Date();
- this.yyTimeZy = new Date();
- let end = this.getLgNumber(this.yyTimeZy.getMinutes(), this.inspectAndPatientTransportConfig.timeMod);
- this.yyTimeZy.setMinutes(end);
- if(end === 0){
- this.yyTimeZy.setHours(this.yyTimeZy.getHours() + 1);
- }
- } else {
- this.appointmentBuildFlag =
- this.currentTasktype.appointmentSwitch == 1 ? "1" : "0";
- console.log(this.appointmentBuildFlag, "seimin");
- }
- console.log(this.patientForm.controls.checkedType.value, this.checkTypeLis);
- this.current_allowUrgent =
- this.checkTypeLis.find(
- (item) => item.id == this.patientForm.controls.checkedType.value
- ).allowUrgent == 1
- ? true
- : false;
- // 判断这个任务类型是否允许加急 start
- // 判断这个任务类型是否允许加急 end
- let that = this;
- let postData = {
- taskTypeId: that.patientForm.controls.checkedType.value,
- patientCode: that.patientMsg.patientCode,
- };
- this.cLoading = true;
- that.mainService
- .postCustom("nurse", "workOrder/buildTrip", postData)
- .subscribe((data) => {
- this.cLoading = false;
- this.message.remove(this.maskFlag);
- this.maskFlag = false;
- this.patientModal = true;
- that.checkedShowMsg = data;
- if (that.checkedShowMsg.status != 200) {
- that.isRemand = data.isRemand == 1 ? true : false;
- }
- that.goodsLis = [];
- that.allowUrgent = "0"; //加急
- that.urgentReason = ""; //加急原因
- if (data.goods && data.goods.length) {
- data.goods.forEach((e) => {
- that.goodsLis.push({
- label: e.name,
- value: e["id"],
- checked: false,
- });
- });
- }
- // 工单备注配置 start
- that.isRemarks = data.remarksSwitch == 1;
- if (data.remarksSwitch == 1) {
- if (data.customRemarks === null || data.customRemarks === "") {
- that.customRemarks2 = [];
- } else {
- that.customRemarks2 = data.customRemarks.split("$");
- }
- that.workOrderRemarkTips2 =
- data.remarksPrompts || "请填写工单备注,不超过100个字符";
- // let user = JSON.parse(localStorage.getItem("user"));
- // that.mainService
- // .postCustom("nurse", "workOrder/recentRemarks", {
- // deptId: user.user.dept.id,
- // taskTypeId: that.patientForm.controls.checkedType.value,
- // })
- // .subscribe((result) => {
- // if (result.state == 200) {
- // that.historyCustomRemarks2 = result.data;
- // }
- // });
- }
- // 工单备注配置 end
- that.linkCheckLis = [];
- if (data.status == 200 && data.data && data.data.length) {
- let arr = [];
- data.data.forEach((e) => {
- arr.push({
- execDeptId: e.execDept.id,
- yyTime: e.yyTime,
- priority: e.priority,
- label:
- (e.yyTime || "") +
- " " +
- (this.deptDisplay == 2
- ? e.execDept.deptalias
- : e.execDept.dept) +
- " 进行 " +
- (e.inspectName || "检查"),
- value: e["id"],
- checked: false,
- });
- });
- that.linkCheckLis = arr;
- }
- });
- }
- // 需要预约建单-事件
- yyInspectChange(e) {
- if (this.currentTasktype.associationType.value === "inspect") {
- //陪检
- let obj = this.filterLinkCheckLis.find((item) => {
- return (
- parse(item.yyTime, 'yyyy-MM-dd HH:mm:ss', new Date()).getTime() - new Date().getTime() >
- this.leadTime * 60 * 1000
- );
- });
- if (obj) {
- this.showDateTime();
- } else {
- this.yyTime = null;
- this.yyDate = new Date();
- console.log(this.isYyInspect);
- }
- } else {
- //转运
- this.yyTimeZy = null;
- this.yyDateZy = new Date();
- }
- }
- //回显时间日期
- showDateTime() {
- //当前时间要大于生效时间
- let isYyInspect = this.filterLinkCheckLis.every((item) => {
- return (
- parse(item.yyTime, 'yyyy-MM-dd HH:mm:ss', new Date()).getTime() - new Date().getTime() >
- this.leadTime * 60 * 1000
- );
- });
- //如果勾选需要预约检查
- if (isYyInspect) {
- //筛选离当前时间最近的
- let timeList = this.filterLinkCheckLis
- .map((item) => parse(item.yyTime, 'yyyy-MM-dd HH:mm:ss', new Date()).getTime())
- .sort();
- this.yyTime = new Date(timeList[0] - this.leadTime * 60 * 1000); //回显预约时间,需要减去生效时间
- this.yyDate = new Date(timeList[0] - this.leadTime * 60 * 1000); //回显预约日期,需要减去生效时间
- this.yyDateChange(this.yyTime);
- } else {
- this.yyTime = null;
- this.yyDate = null;
- }
- }
- // 患者送检检查项目-选择检查项目
- linkCheckLisTrue = false; //是否有已选择(患者)
- isInspectPriority = false; //选择的检查是否紧急(患者)
- filterLinkCheckLis = []; //有预约时间并且选中的
- isInspects = false; //勾选检车的时候是否多个检查多个检查科室
- linkCheckLisChange(e) {
- let flag = false; //检查是否紧急
- let arr = []; //选中的索引
- // 是否检查生成工单允许多个科室,1是,0否
- if (this.currentTasktype.isMoreDept === 0) {
- let arr = e.map((item) => item.execDeptId);
- arr = Array.from(new Set(arr));
- this.isInspects = arr.length > 1;
- }
- this.linkCheckLis.forEach((item, index) => {
- if (e.length) {
- //有选中的检查
- e.forEach((v) => {
- //检查是否有紧急度
- if (v.priority == 1) {
- flag = true;
- }
- //选中的检查设置checked
- if (v.value == item.value) {
- arr.push(index);
- }
- });
- } else {
- item.checked = false;
- }
- });
- this.linkCheckLis.forEach((item, index) => {
- item.checked = arr.includes(index);
- });
- console.log(e, this.linkCheckLis);
- //检查有紧急度,则加急
- if (flag) {
- this.allowUrgent = "1";
- this.urgentReason = "系统根据检查信息,自动进行加急";
- } else {
- this.allowUrgent = "0";
- this.urgentReason = "";
- }
- this.clickYYFlag = false;
- // 有预约时间并且选中的
- this.filterLinkCheckLis = this.linkCheckLis.filter(
- (item) => Boolean(item.yyTime) && item.checked
- );
- //有预约时间并且选中的检查数组不为空,并且预约建单的开关开启
- if (this.filterLinkCheckLis.length && this.appointmentBuildFlag == "1") {
- //当前时间要大于生效时间
- this.isYyInspect = this.filterLinkCheckLis.every((item) => {
- return (
- parse(item.yyTime, 'yyyy-MM-dd HH:mm:ss', new Date()).getTime() - new Date().getTime() >
- this.leadTime * 60 * 1000
- );
- });
- this.allowUrgentChange(this.allowUrgent);
- if (this.allowUrgent == 0) {
- //不加急状态下,回显时间
- this.showDateTime();
- }
- } else {
- //有预约时间并且选中的检查数组为空
- this.isYyInspect = false;
- this.yyTime = null;
- this.yyDate = null;
- }
- this.linkCheckLisTrue = e.length > 0;
- this.isInspectPriority = e.some((item) => item.priority == 1);
- }
- // 是否加急
- allowUrgentChange(e) {
- // this.urgentReasonValidator = (control: FormControl): { [s: string]: boolean } => {
- // if (e == 1) {
- // return { required: true };
- // }
- // };
- if (e == 0) {
- this.patientForm.get("urgentReason")!.clearValidators();
- this.patientForm.get("urgentReason")!.markAsPristine();
- } else {
- this.patientForm.get("urgentReason")!.setValidators(Validators.required);
- this.patientForm.get("urgentReason")!.markAsDirty();
- }
- this.patientForm.get("urgentReason")!.updateValueAndValidity();
- if (this.isYyInspect) {
- this.isYyInspect = e == 0;
- if (!this.isYyInspect) {
- this.yyDate = null;
- this.yyDateZy = null;
- this.yyTime = null;
- this.yyTimeZy = null;
- }
- } else {
- this.yyDate = null;
- this.yyDateZy = null;
- this.yyTime = null;
- this.yyTimeZy = null;
- }
- }
- // 禁用小时
- 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 [];
- }
- }
- // start和end之间能被n整除的所有数字集合
- 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;
- }
- // 快捷一键发起建单
- shortcutMsg; //一键发起信息
- buildMsg: any = {}; //一键发起返回信息
- buildType: string = ""; //快捷建单类型
- historyCustomRemarks = []; //历史快捷输入
- // 打开一键发起建单模态框
- newShortcutOrder(msg, type) {
- this.workOrderRemark = "";
- this.customRemarks = [];
- this.historyCustomRemarks = [];
- console.log(msg, type);
- this.buildType = type;
- this.shortcutMsg = msg;
- this.initForm();
- this.buildMsg = {};
- let postData = {
- taskTypeId: msg.id,
- };
- this.nLoading = true;
- this.mainService
- .postCustom("nurse", "workOrder/buildTrip", postData)
- .subscribe((result) => {
- this.buildMsg = result;
- if (result.remarksSwitch == 1) {
- if (result.customRemarks === null || result.customRemarks === "") {
- this.customRemarks = [];
- } else {
- this.customRemarks = result.customRemarks.split("$");
- }
- this.workOrderRemarkTips =
- result.remarksPrompts || "请填写工单备注,不超过100个字符";
- let user = JSON.parse(localStorage.getItem("user"));
- this.mainService
- .postCustom("nurse", "workOrder/recentRemarks", {
- deptId: user.user.dept.id,
- taskTypeId: msg.id,
- })
- .subscribe((result1) => {
- this.nLoading = false;
- if (result1.state == 200) {
- this.historyCustomRemarks = result1.data;
- }
- });
- } else {
- this.nLoading = false;
- }
- });
- }
- shortcutForm: FormGroup; //一键发起建单表单
- bxForm: FormGroup; //报修表单
- // 一键建单校验
- // 起点科室校验
- originOfficeShortCutValidator = (
- control: FormControl
- ): { [s: string]: boolean } => {
- if (
- this.shortcutForm &&
- this.shortcutForm.value &&
- !control.value &&
- (this.buildMsg.status == 100013 || this.buildMsg.status == 100015)
- ) {
- return { required: true };
- }
- };
- // 目标科室校验
- targetOfficeShortCutValidator = (
- control: FormControl
- ): { [s: string]: boolean } => {
- if (
- this.shortcutForm &&
- this.shortcutForm.value &&
- !control.value &&
- (this.buildMsg.status == 100014 || this.buildMsg.status == 100015)
- ) {
- return { required: true };
- }
- };
- // 修改工号
- userAccount = null;
- changeAccount(e){
- this.userAccount =this.accountList.find(v => v.id == e);
- }
- // 查看关联业务
- otherBindConfigDto:any = {};
- relationTransModalShow = false; //关联业务弹窗开关
- // 关闭关联业务弹窗
- closeModelRelationTrans(e) {
- this.relationTransModalShow = JSON.parse(e).show;
- }
- // 确定关联业务弹窗
- confirmModelRelationTrans(e) {
- if(JSON.parse(e).otherList.length){
- this.otherDataConfirm(e);
- }else{
- this.message.info('请选择病历!');
- }
- }
- // 一键发起建单保存
- loading5 = false;
- async confirmShortcut() {
- var that = this;
- for (const i in that.shortcutForm.controls) {
- that.shortcutForm.controls[i].markAsDirty();
- that.shortcutForm.controls[i].updateValueAndValidity();
- }
- console.log(that.shortcutForm);
- if (that.shortcutForm.invalid) return;
- that.loading5 = true;
- that.buildType = "other";
- if(this.buildMsg.reserveUserSwitch == 1 && !this.userAccount){
- this.message.info('请选择工号!');
- this.loading5 = false;
- return;
- }
- // 判断改任务类型是否开启关联数据
- let taskTypeDtoPromise = await this.mainService.getFetchDataList('simple/data', 'otherBindConfig', {"idx":0,"sum":10,"otherBindConfig":{"hosId":1}}).toPromise();
- console.log(taskTypeDtoPromise);
- console.log(that.shortcutMsg);
- let otherBindConfigDto = taskTypeDtoPromise.list.find(v => v.taskTypeId == that.shortcutMsg.id);
- if(taskTypeDtoPromise.status == 200 && otherBindConfigDto && otherBindConfigDto.startAlert == 1 && that.shortcutMsg.bindTrans == 1){
- this.otherBindConfigDto = otherBindConfigDto;
- this.relationTransModalShow = true;
- that.loading5 = false;
- return;
- }
- this.otherBuildOrder();
- }
- otherBuildOrder(otherList?){
- var that = this;
- // 其他
- let workOrderRemark = '';
- if(otherList){
- workOrderRemark = this.userAccount ? `${this.userAccount.account}-${this.userAccount.name}:${this.workOrderRemark}共${otherList.length}本${this.otherBindConfigDto.relationTrans.name}` : this.workOrderRemark + `共${otherList.length}本${this.otherBindConfigDto.relationTrans.name}`;
- }else{
- workOrderRemark = this.userAccount ? `${this.userAccount.account}-${this.userAccount.name}:${this.workOrderRemark}` : this.workOrderRemark;
- }
- let postData = {
- workOrder: {
- sourceId: SourceId.hushi,
- workOrderRemark,
- taskType: { id: that.shortcutMsg.id },
- createDept: that.loginUserDeptId,
- startDept: { id: that.buildMsg.startDept },
- endDepts: [{ id: that.buildMsg.endDept }],
- otherList: otherList || undefined,
- },
- };
- if (
- (that.buildMsg.status == 100013 || that.buildMsg.status == 100015) &&
- that.shortcutForm.value.originOffice
- ) {
- postData.workOrder.startDept.id = that.shortcutForm.value.originOffice;
- }
- if (that.shortcutForm.value.targetOffice) {
- postData.workOrder["endDepts"] = [
- { id: that.shortcutForm.value.targetOffice },
- ];
- } else {
- postData.workOrder["endDepts"] = [
- { id: that.buildMsg.end.end.list[0].id },
- ];
- }
- console.log(postData);
- this.newOrderTimeFun(postData.workOrder, () => {
- that.loading5 = false;
- }, () => {
- that.mainService
- .postCustom("api", this.shortcutMsg.reserveSwitch == 1 && this.currentDept.typeValue != 'recovery' && this.currentDept.typeValue != 'surgery' ? "reserveOrder" :"startOrder", postData)
- .subscribe((data) => {
- this.message.remove(this.jdFlagId);
- that.loading5 = false;
- if (data.status == 200 && that.buildType == "other") {
- that.showPromptModal("创建", true, "", "other");
- this.getTodayNum();
- } else if (data.status == 200 && that.buildType == "bb") {
- that.showPromptModal("创建", true, "", "bb");
- this.getTodayNum();
- } else if (that.buildType == "bb" && data.status == 100043) {
- that.showPromptModal("创建", true, data.msg);
- this.getTodayNum();
- } else if (data.status == 1000033) {
- //重复建单那策略
- this.repeatMsg = data.msg;
- this.showDelModal(postData, "other");
- } else {
- that.showPromptModal("创建", false, data.msg);
- }
- });
- })
- }
- // ======================start===============================
- // 快捷一键发起建单
- shortcutModal: boolean = false; //检查信息一键建单模态框
- shortcutMsg1; //一键发起信息
- buildMsg1: any = {}; //一键发起返回信息
- urgentFlag = false;
- bLoading = false; //收取标本的loading
- // 打开一键发起建单模态框,urgent为true的时候是紧急
- historyCustomRemarks1 = [];
- newShortcutOrder1(msg, type, urgent?) {
- this.btnLoading = false;
- this.workOrderRemark1 = "";
- this.customRemarks1 = [];
- this.historyCustomRemarks1 = [];
- console.log(msg, type);
- this.urgentFlag = Boolean(urgent);
- this.buildType = type;
- this.shortcutMsg1 = msg;
- this.initForm();
- this.buildMsg1 = {};
- let postData = {
- taskTypeId: msg.id,
- deptId: JSON.parse(localStorage.getItem("user")).user.dept.id,
- };
- this.bLoading = true;
- this.mainService
- .postCustom("nurse", "workOrder/buildTrip", postData)
- .subscribe((result) => {
- this.shortcutModal = true;
- this.buildMsg1 = result;
- if (result.remarksSwitch == 1) {
- if (result.customRemarks === null || result.customRemarks === "") {
- this.customRemarks1 = [];
- } else {
- this.customRemarks1 = result.customRemarks.split("$");
- }
- this.workOrderRemarkTips1 =
- result.remarksPrompts || "请填写工单备注,不超过100个字符";
- let user = JSON.parse(localStorage.getItem("user"));
- this.mainService
- .postCustom("nurse", "workOrder/recentRemarks", {
- deptId: user.user.dept.id,
- taskTypeId: msg.id,
- })
- .subscribe((result1) => {
- this.bLoading = false;
- if (result1.state == 200) {
- this.historyCustomRemarks1 = result1.data;
- }
- });
- } else {
- this.bLoading = false;
- }
- });
- }
- hideShortcutOrder() {
- this.shortcutModal = false;
- }
- shortcutForm1: FormGroup; //一键发起建单表单
- // 一键建单校验
- // 起点科室校验
- originOfficeShortCutValidator1 = (
- control: FormControl
- ): { [s: string]: boolean } => {
- if (
- this.shortcutForm1 &&
- this.shortcutForm1.value &&
- !control.value &&
- (this.buildMsg1.status == 100013 || this.buildMsg1.status == 100015)
- ) {
- return { required: true };
- }
- };
- // 目标科室校验
- targetOfficeShortCutValidator1 = (
- control: FormControl
- ): { [s: string]: boolean } => {
- if (
- this.shortcutForm1 &&
- this.shortcutForm1.value &&
- !control.value &&
- (this.buildMsg1.status == 100014 || this.buildMsg1.status == 100015)
- ) {
- return { required: true };
- }
- };
- // 建单判断时间-护士端建单通用方法
- isShowConfirm:boolean = true;
- isShowConfirmInfo:string = '';
- newOrderTimeFun(order, fun1, fun2){
- if(this.currentDept.typeValue != 'recovery' && this.currentDept.typeValue != 'surgery'){
- let taskTypeId = order.taskType.id;
- let deptId = order.createDept;
- let maskFlag = this.message.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- this.mainService
- .postCustom("api", "compareWorkTime", {taskTypeId, deptId, yyTime: order.yyTime})
- .subscribe((data) => {
- this.message.remove(maskFlag);
- if(data.state == 200){
- fun2.call(this);
- }else{
- fun1.call(this);
- this.limitTimeModal = true;
- this.limitTimeItem = {taskTypeId, fun1, fun2};
- this.limitTimeInfo = data.data.remark;
- this.isShowConfirm = data.data.limitType == 1;
- if(this.isShowConfirm || data.data.limitNum == 1){
- this.isShowConfirmInfo = '';
- }else{
- this.isShowConfirmInfo = '请在规定时间内下单';
- }
- }
- })
- }else{
- fun2.call(this);
- }
- }
- limitTimeModal: boolean = false; //模态框
- limitTimeInfo:string = '';
- limitTimeItem: any = {};
- hideLimitTimeModal() {
- this.limitTimeModal = false;
- }
- // 确认
- jdFlagId;
- limitTimeLoading:boolean = false;
- confirmLimitTime() {
- console.log(this.limitTimeItem);
- this.limitTimeModal = false;
- this.jdFlagId = this.message.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- this.limitTimeItem.fun2.call(this);
- }
- // 一键发起建单保存
- confirmShortcut1() {
- var that = this;
- for (const i in that.shortcutForm1.controls) {
- that.shortcutForm1.controls[i].markAsDirty();
- that.shortcutForm1.controls[i].updateValueAndValidity();
- }
- console.log(that.shortcutForm1);
- if (that.shortcutForm1.invalid) return;
- that.btnLoading = true;
- let postData;
- if (that.buildType == "bb") {
- // 标本
- postData = {
- urgent: this.urgentFlag ? 1 : 0,
- workOrder: {
- sourceId: SourceId.hushi,
- workOrderRemark: this.workOrderRemark1,
- taskType: { id: that.shortcutMsg1.id },
- createDept: that.loginUserDeptId,
- startDept: { id: that.loginUserDeptId },
- },
- };
- }
- console.log(postData);
- this.newOrderTimeFun(postData.workOrder, () => {
- this.hideShortcutOrder();
- }, () => {
- that.mainService
- .postCustom("api", "startOrder", postData)
- .subscribe((data) => {
- this.message.remove(this.jdFlagId);
- this.hideShortcutOrder();
- console.log(that.buildType, data.status);
- if (data.status == 200 && that.buildType == "other") {
- that.showPromptModal("创建", true, "", "other");
- this.getTodayNum();
- } else if (data.status == 200 && that.buildType == "bb") {
- that.showPromptModal("创建", true, "", "bb");
- this.getTodayNum();
- } else if (that.buildType == "bb" && data.status == 100043) {
- that.showPromptModal("创建", true, data.msg);
- this.getOrderList();
- this.getSpecimenWorkOrderMsg();
- this.getTodayNum();
- } else if (data.status == 1000033) {
- //重复建单那策略
- this.repeatMsg = data.msg;
- this.showDelModal(postData, "specimen");
- } else {
- that.showPromptModal("创建", false, data.msg);
- }
- });
- });
- }
- repeatModal: boolean = false; //删除模态框
- repeatMsg = "";
- loadingRepeat = false;
- repeatPostData;
- sourceType;
- isYuyue;
- showDelModal(postData, sourceType, yuyue?) {
- this.repeatModal = true;
- this.repeatPostData = postData;
- this.sourceType = sourceType;
- this.isYuyue = yuyue ? yuyue : false;
- }
- hideRepeatModal() {
- this.repeatModal = false;
- this.btnLoading = false;
- }
- confirmRepeat() {
- this.loadingRepeat = true;
- this.repeatPostData.tipsCreateOder = 1;
- this.newOrderTimeFun(this.repeatPostData.workOrder, () => {
- this.loadingRepeat = false;
- this.repeatModal = false;
- }, () => {
- this.mainService
- .postCustom(
- "api",
- this.isYuyue ? "appointmentOrder" : "startOrder",
- this.repeatPostData
- )
- .subscribe((data) => {
- this.message.remove(this.jdFlagId);
- this.loadingRepeat = false;
- this.repeatModal = false;
- if(this.currentDept.typeValue == 'recovery'){
- this.mainService.postCustom("api", "clearPatientRecoveryDept", {patientCode: this.repeatPostData.workOrder.patient.patientCode}).subscribe((resultData) => {
- this.confirmRepeatFun(data);
- });
- }else{
- this.confirmRepeatFun(data);
- }
- });
- })
- }
- confirmRepeatFun(data){
- if (this.sourceType === "specimen") {
- // 标本建单
- if (data.status == 200 && this.buildType == "other") {
- this.showPromptModal("创建", true, "", "other");
- this.getTodayNum();
- } else if (data.status == 200 && this.buildType == "bb") {
- this.showPromptModal("创建", true, "", "bb");
- this.getTodayNum();
- } else if (this.buildType == "bb" && data.status == 100043) {
- this.showPromptModal("创建", true, data.msg);
- this.getOrderList();
- this.getSpecimenWorkOrderMsg();
- this.getTodayNum();
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- } else if (this.sourceType === "other") {
- // 其他建单
- if (data.status == 200 && this.buildType == "other") {
- this.showPromptModal("创建", true, "", "other");
- this.getTodayNum();
- } else if (data.status == 200 && this.buildType == "bb") {
- this.showPromptModal("创建", true, "", "bb");
- this.getTodayNum();
- } else if (this.buildType == "bb" && data.status == 100043) {
- this.showPromptModal("创建", true, data.msg);
- this.getTodayNum();
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- } else if (this.sourceType === "transport") {
- // 转运
- if (data.status == 200) {
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- } else if (data.status == 100042) {
- this.showPromptModal("创建", false, data.msg);
- this.getPatient(this.tabSearchCont);
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- } else if (this.sourceType === "accompany1") {
- // 陪检
- if (data.status == 200) {
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- } else if (data.status == 100042) {
- this.showPromptModal("创建", false, data.msg);
- this.getPatient(this.tabSearchCont);
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- } else if (this.sourceType === "accompany2") {
- // 陪检
- if (data.status == 200) {
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- } else if (data.status == 100042) {
- this.showPromptModal("创建", false, data.msg);
- this.getPatient(this.tabSearchCont);
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- } else if (this.sourceType === "accompany3") {
- // 陪检
- if (data.status == 200) {
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- } else if (data.status == 100042) {
- this.showPromptModal("创建", false, data.msg);
- this.getPatient(this.tabSearchCont);
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- } else if (this.sourceType === "accompany4") {
- // 陪检
- if (data.status == 200) {
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- } else if (data.status == 100042) {
- this.showPromptModal("创建", false, data.msg);
- this.getPatient(this.tabSearchCont);
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- } else if (this.sourceType === "accompany5") {
- // 陪检
- if (data.status == 200) {
- this.showPromptModal("创建", true, "");
- this.goodsLis = [];
- this.getOrderList();
- this.getDeptTaskType();
- this.getTodayNum();
- } else if (data.status == 100042) {
- this.showPromptModal("创建", false, data.msg);
- this.getPatient(this.tabSearchCont);
- } else {
- this.showPromptModal("创建", false, data.msg);
- }
- }
- }
- // =======================end=================================
- // 页面中间部分tab切换
- checkedTableType: string = "";
- checkTable(type) {
- if(typeof type === 'object'){
- if(type.system){
- this.checkedTableType = 'other';
- }else{
- this.checkedTableType = type.id;
- }
- this.getDeptTaskType('');
- }else{
- this.checkedTableType = type;
- }
- this.positionY = 0;
- this.selectOtherId = null;
- this.otherSearch = '';
- if (type === "surgery") {
- this.getSurgery(true);
- } else if (type === "outpatientHelpAppointment") {
- this.getOutpatientHelpAppointment(true);
- } else if (type === "historySpecimen") {
- this.getHistorySpecimen(true);
- } else if (type === "historyDrugsbag") {
- this.getHistoryDrugsbag(true);
- } else if (type === "bxlb" && this.isShowBx && this.coopBtns.repairList) {
- this.getBxlb(this.bxlbPageIndex);
- // this.getIncidentState();
- this.getDegrees();
- }
- }
- //提交报修
- bxLoading = false;
- submitBxForm() {
- for (const i in this.bxForm.controls) {
- this.bxForm.controls[i].markAsDirty();
- this.bxForm.controls[i].updateValueAndValidity();
- }
- if (this.bxForm.invalid) return;
- // if(!this.selectIncidentId){
- // this.message.error("请选择故障现象!");
- // return;
- // }
- this.bxLoading = true;
- this.mainService.wxbx({}).subscribe((result) => {
- if ((result as any).status == 200) {
- let bxcode = (result as any).data; //生成微信报修号
- let postData = {
- verification: "true",
- incident: {
- branch:this.loginUser.currentHospital.id,
- // contacts: this.loginUser.name,
- deptId:this.loginUser.dept.id,
- // contactsInformation: this.loginUser.phone,
- // address: this.bxForm.controls.address.value,
- // areaId: this.bxForm.controls.hospital.value,
- // contacts: this.bxForm.controls.name.value,
- // contactsInformation: this.bxForm.controls.phone.value,
- description: this.bxForm.controls.content.value,
- categoryId: this.selectIncidentId,
- // placeId: this.bxForm.controls.building.value,
- requester: { account: this.loginUser.account },
- sourceType: "wechatUserIncident",
- fileUrl: "url",
- bxcode,
- },
- loginUser: {
- account: this.loginUser.account,
- id: this.loginUser.id,
- },
- };
- this.mainService.addWxIncident(postData).subscribe((res) => {
- this.bxLoading = false;
- if ((res as any).state == 200) {
- this.showPromptModal("提交", true, "");
- this.checkTable("bxlb");
- } else {
- this.showPromptModal("提交", false, (res as any).msg);
- }
- });
- } else {
- this.bxLoading = false;
- this.showPromptModal("提交", false, "");
- }
- });
- }
- // 意见箱表格数据
- adviceList: any = [];
- advicePageIndex: number = 1; //表格当前页码
- advicePageSize: number = 10; //表格每页展示条数
- adviceListLength: number = 10; //表格总数据量
- adviceSearchInp: string = ""; //意见箱搜索
- adviceLoading = false;
- getAdvice(idx?) {
- if(!this.coopBtns.suggestionBox){
- return;
- }
- if(idx){
- this.advicePageIndex = 1;
- }
- let that = this;
- let postData = {
- advice: {
- content: that.adviceSearchInp || "",
- creatDepartment: {
- id: that.loginUserDeptId,
- },
- createUser: {
- id: that.loginUser.id,
- },
- },
- idx: that.advicePageIndex - 1,
- sum: that.advicePageSize,
- };
- this.adviceLoading = true;
- that.mainService
- .getFetchDataList("adviceCollection", "advice", postData)
- .subscribe((data) => {
- this.adviceLoading = false;
- that.adviceList = data.list || [];
- that.adviceListLength = data.totalNum || 0;
- });
- }
- // 手术排程信息表格数据
- surgeryList: any = [];
- surgeryPageIndex: number = 1; //表格当前页码
- surgeryPageSize: number = 10; //表格每页展示条数
- surgeryListLength: number = 10; //表格总数据量
- surgeryCodeSearchInp: string = ""; //标本编码搜索
- surgeryParentSearchInp: string = ""; //患者信息搜索
- surgeryInfoLoading = false;
- getSurgery(idx?) {
- if (idx) {
- this.surgeryPageIndex = 1;
- }
- let postData:any = {
- surgery: {
- applyDateStart: format(startOfDay(new Date()), "yyyy-MM-dd HH:mm:ss"),
- applyDateEnd: format(endOfDay(new Date()), "yyyy-MM-dd HH:mm:ss"),
- // hosId: this.currentHospital.id,
- },
- idx: this.surgeryPageIndex - 1,
- sum: this.surgeryPageSize,
- };
- if(this.currentDept.typeValue == 'surgery'){
- postData.surgery.surgeryDept = this.loginUserDeptId;
- }else{
- postData.surgery.areaDept = this.loginUserDeptId;
- }
- this.surgeryInfoLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "surgery", postData)
- .subscribe((data) => {
- this.surgeryInfoLoading = false;
- this.surgeryList = data.list || [];
- this.surgeryListLength = data.totalNum || 0;
- });
- }
- // 门诊帮扶表格数据
- outpatientHelpAppointmentList: any = [];
- outpatientHelpAppointmentPageIndex: number = 1; //表格当前页码
- outpatientHelpAppointmentPageSize: number = 10; //表格每页展示条数
- outpatientHelpAppointmentListLength: number = 10; //表格总数据量
- outpatientHelpAppointmentDateSearchInp = new Date(); //预约时间搜索
- outpatientHelpAppointmentInfoLoading = false;
- getOutpatientHelpAppointment(idx?) {
- if (idx) {
- this.outpatientHelpAppointmentPageIndex = 1;
- }
- let postData:any = {
- patientAppointment: {
- escortTime: this.outpatientHelpAppointmentDateSearchInp ? format(startOfDay(this.outpatientHelpAppointmentDateSearchInp), "yyyy-MM-dd HH:mm:ss") : undefined,
- hosId: this.currentHospital.id,
- },
- idx: this.outpatientHelpAppointmentPageIndex - 1,
- sum: this.outpatientHelpAppointmentPageSize,
- };
- this.outpatientHelpAppointmentInfoLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "patientAppointment", postData)
- .subscribe((data) => {
- this.outpatientHelpAppointmentInfoLoading = false;
- this.outpatientHelpAppointmentList = data.list || [];
- this.outpatientHelpAppointmentListLength = data.totalNum || 0;
- });
- }
- // 历史标本查询表格数据
- historySpecimenList: any = [];
- historySpecimenPageIndex: number = 1; //表格当前页码
- historySpecimenPageSize: number = 10; //表格每页展示条数
- historySpecimenListLength: number = 10; //表格总数据量
- historySpecimenCodeSearchInp: string = ""; //标本编码搜索
- historySpecimenParentSearchInp: string = ""; //患者信息搜索
- hsLoading = false;
- getHistorySpecimen(idx?) {
- if (idx) {
- this.historySpecimenPageIndex = 1;
- }
- let current = JSON.parse(localStorage.getItem("user"));
- let postData = {
- specimen: {
- hosId: this.currentHospital.id,
- sickRoom: {
- id: current.user.dept.id,
- },
- scode:
- this.historySpecimenCodeSearchInp === ""
- ? null
- : this.historySpecimenCodeSearchInp,
- keyWord:
- this.historySpecimenParentSearchInp === ""
- ? null
- : this.historySpecimenParentSearchInp,
- },
- idx: this.historySpecimenPageIndex - 1,
- sum: this.historySpecimenPageSize,
- };
- this.hsLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "specimen", postData)
- .subscribe((data) => {
- this.hsLoading = false;
- this.historySpecimenList = data.list || [];
- this.historySpecimenListLength = data.totalNum || 0;
- });
- }
- // 历史药单查询表格数据
- historyDrugsbagList: any = [];
- historyDrugsbagPageIndex: number = 1; //表格当前页码
- historyDrugsbagPageSize: number = 10; //表格每页展示条数
- historyDrugsbagListLength: number = 10; //表格总数据量
- historyDrugsbagCodeSearchInp: string = ""; //发药单号搜索
- // historyDrugsbagParentSearchInp: string = ""; //患者信息搜索
- hsDLoading = false;
- getHistoryDrugsbag(idx?) {
- if (idx) {
- this.historyDrugsbagPageIndex = 1;
- }
- let current = JSON.parse(localStorage.getItem("user"));
- let postData = {
- drugsBag: {
- target: {
- id: current.user.dept.id,
- },
- packid:
- this.historyDrugsbagCodeSearchInp === ""
- ? ""
- : this.historyDrugsbagCodeSearchInp,
- platform: 2,
- },
- idx: this.historyDrugsbagPageIndex - 1,
- sum: this.historyDrugsbagPageSize,
- };
- this.hsDLoading = true;
- this.mainService
- .getFetchDataList("api", "drugsBag", postData)
- .subscribe((data) => {
- this.hsDLoading = false;
- this.historyDrugsbagList = data.list || [];
- this.historyDrugsbagListLength = data.totalNum || 0;
- });
- }
- // 获取事件状态
- incidentStateId = undefined;
- incidentStateList = [
- {name: '全部', value: 0},
- {name: '待受理', value: 'accept,storage'},
- {name: '处理中', value: 'pending,handler,reassign'},
- {name: '待评价', value: 'close0', hasWxdegree: 0},
- {name: '已关闭', value: 'close1', hasWxdegree: 1},
- {name: '不受理', value: 'reject'},
- {name: '撤销', value: 'cancel'},
- ];
- // getIncidentState() {
- // let postData = { type: "list", key: "wxincident_state" };
- // this.iLoading = true;
- // this.mainService.getDictionaryByITSM(postData).subscribe((data: any) => {
- // this.iLoading = false;
- // if (data.status == 200) {
- // this.incidentStateList = data.data || [];
- // }
- // });
- // }
- // 报修列表查询表格数据
- bxlbList: any = [];
- bxlbPageIndex: number = 1; //表格当前页码
- bxlbPageSize: number = 10; //表格每页展示条数
- bxlbListLength: number = 10; //表格总数据量
- bxlbCodeSearchInp: string = ""; //标本编码搜索
- bxlbParentSearchInp: string = ""; //患者信息搜索
- processing: number = 0; //处理中的数量
- bxlbLoading = false;
- repairIncidentTypeList = [];//科室报修或公共报修
- getBxlb(idx, isInitState = false) {
- // 获取事件状态
- this.iLoading = true;
- this.bxlbLoading = true;
- this.mainService.getDictionary('list', 'repair_incident_type').subscribe((data: any) => {
- this.iLoading = false;
- this.repairIncidentTypeList = data || [];
- if(isInitState){
- let valueObj2 = this.incidentStateList.find(v => v.value == 0);
- this.incidentStateId = valueObj2 ? valueObj2.value : undefined;
- }
- // 报修列表查询表格数据
- if (idx) {
- this.bxlbPageIndex = 1;
- }
- let current = JSON.parse(localStorage.getItem("user"));
- this.mainService
- .getFetchDataList("simple/data", "incident", {
- idx: this.bxlbPageIndex - 1,
- sum: this.bxlbPageSize,
- incident: {
- repairIncidentType: { id: this.repairIncidentTypeList.find(v => v.value === 'dept').id },
- statesValues: this.incidentStateId || undefined,
- department: { id: current.user.dept.id },
- }
- })
- .subscribe((data: any) => {
- this.bxlbLoading = false;
- this.bxlbList = data.list || [];
- this.bxlbListLength = data.totalNum || 0;
- this.processing = data.totalNum || 0;
- });
- })
- }
- //快速报修列表
- quickBxlbLoading = false;
- quickBxlbList = [];
- getQuickBxlb() {
- this.quickBxlbLoading = true;
- this.mainService
- .getFetchDataList("simple/data", "incidentCategoryContent", { idx: 0, sum: 10 })
- .subscribe((data: any) => {
- this.quickBxlbLoading = false;
- if (data.status == 200) {
- this.quickBxlbList = data.list || [];
- }
- });
- }
- // 意见箱-查看模态框
- adviceModal: boolean = false;
- adviceDetailInfo: any = {}; //意见详情
- adviceDetail(id) {
- this.adviceModal = true;
- this.mainService
- .getFetchData("adviceCollection", "advice", id)
- .subscribe((data) => {
- this.adviceDetailInfo = data.data;
- console.log(this.adviceDetailInfo);
- });
- }
- hideAdvice() {
- this.adviceModal = false;
- }
- // 意见收集
- adviceSubModal: boolean = false;
- adviceSubContent: string; //填写意见内容
- coopAdviceInfo: any = {}; //当前编辑意见详情
- addAdvice(data?) {
- let that = this;
- that.adviceSubContent = "";
- if (data) {
- that.coopAdviceInfo = data;
- that.adviceSubContent = data.content;
- }
- that.adviceSubModal = true;
- }
- hideSubAdvice() {
- this.adviceSubModal = false;
- }
- // 提交意见内容
- confirmSubAdvice() {
- let that = this;
- if (!that.adviceSubContent) return;
- that.btnLoading = true;
- let postData = {
- advice: {
- creatDepartment: {
- id: that.loginUserDeptId,
- },
- createUser: {
- id: that.loginUser.id,
- },
- content: that.adviceSubContent,
- },
- };
- if (that.coopAdviceInfo.id) {
- postData.advice["id"] = that.coopAdviceInfo.id;
- }
- that.mainService
- .postCustom(
- "adviceCollection",
- that.coopAdviceInfo.id ? "updData/advice" : "addData/advice",
- postData
- )
- .subscribe((data) => {
- if (data.status == 200) {
- that.adviceSubModal = false;
- that.showPromptModal(
- that.coopAdviceInfo.id ? "编辑" : "新增",
- true,
- ""
- );
- that.coopAdviceInfo = {};
- that.adviceSubContent = "";
- that.getAdvice();
- } else {
- that.adviceSubModal = false;
- that.showPromptModal(
- that.coopAdviceInfo.id ? "编辑" : "新增",
- false,
- data.msg
- );
- that.adviceSubContent = "";
- }
- });
- }
- // 查看标本详情
- detailModel: boolean = false;
- loading33: boolean = false;
- detailList: any = [];
- // 选择急查或普查(1是急标,2是普标)
- changeSpeDetail(speDetailType: number) {
- this.detailModel = true;
- let user = JSON.parse(localStorage.getItem("user"));
- let postData = {
- deptId: user.user.dept.id,
- urgent: speDetailType,
- };
- this.loading33 = true;
- this.mainService
- .postCustom("nurse", "getSpecimenWorkOrderDetails", postData)
- .subscribe((result) => {
- this.loading33 = false;
- if (result.status == 200) {
- this.detailList = result.data || [];
- }
- });
- }
- // 隐藏查看标本详情弹层
- hideSpeDetailModel() {
- this.detailModel = false;
- }
- // 意见删除模态框
- delAdviceModal: boolean = false;
- delAdviceId: number; //删除意见id
- delAdvice(id) {
- this.delAdviceId = id;
- this.delAdviceModal = true;
- }
- confirmDelAdvice() {
- let that = this;
- that.btnLoading = true;
- let postData = [that.delAdviceId];
- that.mainService
- .postCustom("adviceCollection", "rmvData/advice", postData)
- .subscribe((data) => {
- if (data.status == 200) {
- that.delAdviceModal = false;
- that.showPromptModal("删除", true, "");
- if (
- that.adviceList.length == 1 &&
- that.advicePageIndex ==
- Math.ceil(that.adviceListLength / that.advicePageSize)
- ) {
- that.adviceListLength--;
- that.advicePageIndex = Math.ceil(
- that.adviceListLength / that.advicePageSize
- );
- }
- that.getAdvice();
- } else {
- that.delAdviceModal = false;
- that.showPromptModal("删除", false, data.msg);
- }
- });
- }
- hideDelAdviceModal() {
- this.delAdviceModal = false;
- }
- // 报修提示框
- reqModal: boolean = false;
- extraData:any = {};
- showReqModal() {
- this.extraData.floor = this.floors.find(v => v.id == this.validateBxForm.value.floor);
- // this.reqModal = true;
- this.confirmBxNext(0);
- }
- confirmReq() {
- this.confirmBxNext(1);
- }
- cancelReq() {
- this.confirmBxNext(0);
- }
- hideReqModal() {
- this.reqModal = false;
- }
- // 工单列表下拉筛选
- selectedType: null;
- changeOrderSel(e) {
- this.selectedType = e;
- this.getOrderList();
- }
- // 工单列表工单状态下拉筛选
- changeOrderState(e) {
- this.getOrderList();
- }
- // 工单列表
- orderList: any = [];
- orderIdx: number = 1;
- orderLength: number = 10;
- OLoading: boolean = true;
- getOrderList() {
- let that = this;
- that.orderList = [];
- that.OLoading = true;
- let postData: any = {
- workOrder: {
- createDept: JSON.parse(localStorage.getItem("user")).user.dept.id,
- platform: 2,
- searchDays: 2,
- taskType: {},
- },
- idx: that.orderIdx - 1,
- sum: 10,
- };
- if (that.selectedType && that.selectedType != -1) {
- postData.workOrder.taskType["associationType"] = {
- id: that.selectedType,
- };
- }
- // 执行中包含状态:待抢单、待接单、待到达、待送达、执行中、定时预约
- if (that.orderStateSelected == "1") {
- //执行中
- delete postData.workOrder.gdState;
- postData.workOrder.nurseState = 1;
- } else if (that.orderStateSelected == "2") {
- //待评价
- delete postData.workOrder.nurseState;
- postData.workOrder.gdState = { id: "73" };
- } else {
- //全部
- delete postData.workOrder.nurseState;
- delete postData.workOrder.gdState;
- }
- that.mainService
- .getFetchDataList("nurse", "workOrder", postData)
- .subscribe((data) => {
- that.orderList = data.list || [];
- //显示三项
- that.orderList.forEach((item) => {
- if (item.record.length > 2) {
- let i = item.record
- .reverse()
- .findIndex((step) => step.record.length > 0);
- item.record.reverse();
- i = item.record.length - 1 - i;
- if (i < 2) {
- item.record = item.record.slice(0, 3);
- } else if (i > item.record.length - 2) {
- item.record = item.record.slice(
- item.record.length - 3,
- item.record.length
- );
- } else {
- item.record = item.record.slice(i - 1, i + 2);
- }
- }
- });
- that.orderLength = data.totalNum || 0;
- that.OLoading = false;
- });
- }
- // 撤销
- coopId: number;
- recallOrderModal: boolean = false;
- // 打开撤销模态框
- openRecallModal(id) {
- this.coopId = id;
- this.recallOrderModal = true;
- }
- // 确认撤销
- confirmRec() {
- let that = this;
- that.btnLoading = true;
- that.mainService.delOrder(that.coopId).subscribe((data) => {
- that.closeRecallOrderModal();
- if (data.status == 200) {
- that.getOrderList();
- that.changeInfo();
- this.getTodayNum();
- that.showPromptModal("撤销", true, "");
- } else {
- that.showPromptModal("撤销", false, data.msg);
- }
- });
- }
- // 关闭撤销模态框
- closeRecallOrderModal() {
- this.recallOrderModal = false;
- }
- // 打印二维码-门诊服务点---------------start
- outpatientServiceMsg = "";
- coopOutpatientServiceItem: any;
- outpatientServiceModal: boolean = false;
- // 打开模态框
- openOutpatientServiceModal(item) {
- this.coopOutpatientServiceItem = item;
- this.outpatientServiceMsg = `提示:打印<strong class='red'>${item.patientName}</strong>患者二维码,可用于身份识别`
- this.outpatientServiceModal = true;
- }
- // 确认
- cardNoDto: any = {};
- confirmOutpatientService() {
- this.btnLoading = true;
- this.mainService.qrcodeCardNo({id: this.coopOutpatientServiceItem.id, fieldName: 'cardNo'}).subscribe((data) => {
- this.closeOutpatientServiceModal();
- this.btnLoading = false;
- if (data.state == 200) {
- data.logo = location.origin + '/file' + data.logo || '';
- this.cardNoDto = data;
- this.getPatient();
- // 打印
- setTimeout(()=>{
- this.printBtn.nativeElement.click();
- }, )
- } else {
- this.showPromptModal("打印", false, data.msg);
- }
- });
- }
- // 关闭模态框
- closeOutpatientServiceModal() {
- this.outpatientServiceModal = false;
- }
- // 打印二维码-门诊服务点---------------end
- // 评价
- appraiseModal: boolean = false;
- starNum: number = 5; //评价星
- appraiseContent: string = ""; //评级
- appraiseId: number;
- showAppraise(id) {
- this.appraiseId = id;
- this.appraiseModal = true;
- this.starNum = 5;
- this.appraiseContent = "";
- }
- // 保存评价
- confirmAppraise() {
- console.log(this.starNum, this.appraiseContent);
- let that = this;
- if (!that.starNum) return;
- that.btnLoading = true;
- let id;
- switch (that.starNum) {
- case 1:
- id = 358;
- break;
- case 2:
- id = 357;
- break;
- case 3:
- id = 356;
- break;
- case 4:
- id = 355;
- break;
- case 5:
- id = 354;
- break;
- }
- let postData = {
- serviceEvaluation: { id: id },
- remark: that.appraiseContent,
- };
- this.mainService
- .postCustom("nurse/workOrder", "evaluate/" + this.appraiseId, postData)
- .subscribe((data) => {
- that.hideAppraise();
- if (data.status == 200) {
- that.getOrderList();
- that.showPromptModal("评价", true, "");
- } else {
- that.showPromptModal("评价", false, data.msg);
- }
- });
- }
- hideAppraise() {
- this.appraiseModal = false;
- }
- // 报修评价
- appraiseModalBx: boolean = false;
- starNumBx: number = 5; //评价星
- appraiseContentBx: string = ""; //评级
- appraiseDataBx: any;
- showAppraiseBx(data) {
- this.appraiseDataBx = data;
- this.appraiseModalBx = true;
- this.starNumBx = 5;
- this.appraiseContentBx = "";
- }
- // 保存评价
- confirmAppraiseBx() {
- console.log(this.starNumBx, this.appraiseContentBx);
- if (!this.starNumBx) return;
- this.btnLoading = true;
- let id = this.degrees.find(v=>v.value == this.starNumBx).id;
- let postData = {
- incident: {
- ...this.appraiseDataBx,
- wxdegree: { id },
- wxdegreeremark: this.appraiseContentBx,
- }
- };
- this.mainService
- .flowPost("incident/task/resolve", postData)
- .subscribe((data:any) => {
- this.hideAppraiseBx();
- if (data.state == 200) {
- this.getBxlb(this.bxlbPageIndex);
- this.showPromptModal("评价", true, "");
- } else {
- this.showPromptModal("评价", false, "");
- }
- });
- }
- hideAppraiseBx() {
- this.appraiseModalBx = false;
- }
- // 审核状态
- checkStatusLis: any = [];
- getCheckStatusLis() {
- let that = this;
- that.mainService.getDictionary("list", "check_status").subscribe((data) => {
- that.checkStatusLis = data;
- });
- }
- // 填写加急原因模态框
- jiajiModal: boolean = false;
- jiajiContent: string; //加急原因
- jiajiId; //加急工单id
- showJiaji(id) {
- this.jiajiId = id;
- this.jiajiModal = true;
- this.jiajiContent = "";
- }
- hideJiaji() {
- this.jiajiModal = false;
- }
- // 保存加急原因
- confirmJiaji() {
- let that = this;
- let checkStatusId;
- if (!that.jiajiContent) return;
- that.btnLoading = true;
- that.checkStatusLis.forEach((e) => {
- if (e.value == 1) {
- checkStatusId = e.id;
- }
- });
- let postData = {
- urgentDetails: {
- workerOrder: that.jiajiId,
- checkStatus: { id: checkStatusId },
- urgentReason: that.jiajiContent,
- },
- };
- that.mainService
- .postCustom("workerOrder", "urge", postData)
- .subscribe((data) => {
- if (data.status == 200) {
- that.showPromptModal("加急", true, "");
- that.getOrderList();
- that.hideJiaji();
- } else {
- that.showPromptModal("加急", false, data.msg);
- }
- });
- }
- // 查看工单详情
- openDetails(data) {
- if (data.taskType.associationType.value == 'specimen' || data.taskType.associationType.value == 'specimenPlan') {
- // 标本类
- this.router.navigateByUrl("nurse/detailSample/" + data.id);
- } else if (data.taskType.associationType.value == 'inspect' || data.taskType.associationType.value == 'patientTransport') {
- // 送患者
- this.router.navigateByUrl("nurse/detailPatients/" + data.id);
- } else if (data.taskType.associationType.value == 'drugsBag' || data.taskType.associationType.value == 'jPBag') {
- // 药品配送/静配
- this.router.navigateByUrl("nurse/detailDrug/" + data.id);
- } else if (data.taskType.associationType.value == 'ordinary') {
- // 万能交接服务
- this.router.navigateByUrl("nurse/detailOrdinary/" + data.id);
- } else {
- // 其他
- this.router.navigateByUrl("nurse/detailOthers/" + data.id);
- }
- }
- // 展示信息提示框(con:提示信息,success:操作是否成功,promptInfo:操作结果提示信息)
- showPromptModal(con, success, promptInfo?, back?) {
- this.btnLoading = false;
- this.btnLoading1 = false;
- this.promptModalShow = false;
- this.promptContent = con;
- this.ifSuccess = success;
- this.promptInfo = promptInfo;
- this.back = back;
- setTimeout(() => {
- this.promptModalShow = true;
- }, 100);
- }
- // 回到系统管理
- toMain() {
- this.router.navigateByUrl("main");
- }
- // 查看工单
- toOrder() {
- this.router.navigateByUrl(`main/orderManagement`);
- }
- // 退出
- logOut(): void {
- let that = this;
- // 假退出
- let hospital = this.tool.getCurrentHospital();
- if(hospital){
- this.router.navigate(["login", hospital.id]);
- }else{
- this.router.navigateByUrl("login");
- }
- localStorage.removeItem("user");
- localStorage.removeItem("menu");
- localStorage.removeItem("index");
- // 假退出
- that.mainService.logOut().subscribe((data) => {
- if (data.status == 200) {
- if(hospital){
- this.router.navigate(["login", hospital.id]);
- }else{
- this.router.navigateByUrl("login");
- }
- localStorage.removeItem("user");
- localStorage.removeItem("menu");
- localStorage.removeItem("index");
- }
- });
- }
- // 格式化时分秒
- // (时间小于一分钟则显示秒,时间大于一分钟则显示分钟数,如超出一小时则显示小时和分钟。)time单位:秒
- 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;
- }
- // 计算历史记录耗时
- filterTime(step) {
- let num = 0;
- step.forEach((e) => {
- num += e.difTime;
- });
- return this.formatTime(num / 1000);
- }
- // 截取意见内容(ie内核截取)
- spliceContent(con) {
- if (con.length >= 41 && navigator.userAgent.indexOf("Trident") > -1) {
- return con.slice(0, 41) + "...";
- } else {
- return con;
- }
- }
- @ViewChild("msgTemplate", { static: false }) msgTemplate: TemplateRef<any>; //消息通知模板
- // 消息提醒
- createBasicNotification(msgs): void {
- this.notification.template(this.msgTemplate, {
- nzDuration: 0,
- nzData: msgs,
- });
- }
- isShowNurseCode = false; //是否展开科室二维码
- nurseCodeImg = ""; //图片
- refreshQRCodeTime = 0; //刷新时间间隔
- // 关闭科室二维码
- closeNurseCode() {
- this.isShowNurseCode = false;
- clearInterval(this.timer);
- this.timer = null;
- }
- // 展开科室二维码
- timer = null;
- showNurseCode() {
- this.isShowNurseCode = true;
- this.getConfig()
- }
-
- // 获取配置
- iskeySwitch:any = false;
- getConfig() {
- let postData = {
- idx: 0,
- sum: 9999,
- hospitalConfig:{
- hosId:this.currentHospital.id,
- model:"all"
- }
- };
- this.mainService.getFetchDataList("simple/data", "hospitalConfig", postData).subscribe((result:any) => {
- if (result.status == 200) {
- for(let i of result.list){
- if(i.key=='digitalSecretKey'){
- if(i.value==1){
- this.iskeySwitch = true
- this.getSecretKey()
- }else{
- this.iskeySwitch = false
- this.mainService.getDeptCode([this.loginUserDeptId]).subscribe((data) => {
- if (data["status"] == 200) {
- this.nurseCodeImg = data["data"][0].base64;
- this.refreshQRCodeTime = data["data"][0].refreshQRCodeTime;
- clearInterval(this.timer);
- this.timer = setInterval(() => {
- this.refreshQRCodeTime = Math.max(--this.refreshQRCodeTime, 0);
- if (this.refreshQRCodeTime === 0) {
- clearInterval(this.timer);
- this.showNurseCode();
- }
- }, 1000);
- }
- });
- }
- }
- }
- }
- });
- }
-
- // 获取动态密钥
- numberKey:any;
- getSecretKey(){
- this.mainService.getSecretKey(this.currentDept.id).subscribe((res:any) => {
- if (res["status"] == 200) {
- this.numberKey = res.data.digitalSecretKey;
- this.nurseCodeImg = res.data.base64;
- this.refreshQRCodeTime = res.data.refreshQRCodeTime;
- clearInterval(this.timer);
- this.timer = setInterval(() => {
- this.refreshQRCodeTime = Math.max(--this.refreshQRCodeTime, 0);
- if (this.refreshQRCodeTime === 0) {
- clearInterval(this.timer);
- this.showNurseCode();
- }
- }, 1000);
- }
- });
- }
-
- // 右侧菜单
- showLastItems: boolean = false;
- // 下拉
- fixedMenuXiala() {
- this.showLastItems = true;
- }
- // 上拉
- fixedMenuShangla() {
- this.showLastItems = false;
- }
- mainRole: boolean = false; //回到系统管理权限
- mainRoleBtnName = "回到系统管理"; //回到系统管理名字
- initRole() {
- let menus = JSON.parse(localStorage.getItem("menu"));
- console.log("菜单数量" + menus.length);
- if (menus.length >= 2) {
- this.mainRole = true;
- return;
- }
- }
- // 切换右侧菜单Tab
- fixedTab: string = "";
- checkFixedTab(type: string) {
- if (type == "toSystem") {
- this.router.navigateByUrl("main");
- }
- if (this.fixedTab == type) {
- this.fixedTab = "";
- } else {
- this.fixedTab = type;
- }
- }
- //子传父接收
- closeModelHs(e) {
- this.hsPromptModalShow = JSON.parse(e).show;
- this.changeShow = JSON.parse(e).changeShow;
- }
- //子传父接收
- clearModelHs(e) {
- if (JSON.parse(e).clear === true) {
- clearInterval(this.timerCloseTime);
- }
- this.changeShow = JSON.parse(e).changeShow;
- }
- // 头部切换科室
- changeKsNow() {
- this.hsPromptModalShow = true;
- clearInterval(this.timerCloseTime);
- this.changeShow = false;
- }
- // 刷新工单列表
- refreshList(e) {
- if (!e.promptContent) {
- return;
- }
- this.getOrderList();
- }
- // 打印二维码-门诊服务点
- printCode(item){
- console.log(item)
- }
- }
|