12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968 |
- 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,
- } from "date-fns";
- import { SourceId } from "src/app/type/types";
- // 日期禁用
- 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("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("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;
- othersListOptions: any;
- sortableTimer = null;
- searchAccountSubject = new Subject(); //查工号防抖
- searchTabInpSubject = new Subject(); //左侧查患者信息和检查信息防抖
- otherSearchChangeSubject = new Subject(); //其他建单搜索防抖
- incidentSearchChangeSubject = 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: [],
- };
- postData.orders = this.othersList.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是显示科室别名
- // 初始化权限按钮
- coopBtns: any = {};
- 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.getCloseTimeFlag();
- this.currentDept = this.tool.getCurrentUserDept();
- console.log(this.currentDept, this.tabSearchCont);
- this.currentDept.typeValue == 'surgery' && 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.incidentSearchChangeSubject
- .pipe(debounceTime(500))
- .subscribe((v: string) => {
- this.getIncidentcategory(v);
- });
- this.getTodayNum();
- this.initLogin();
- this.getDeptTaskType();
- this.initForm();
- this.getAdvice();
- this.getOrderSelectList();
- this.getCheckStatusLis();
- this.refreshSpecimenWorkOrderMsg();
- this.initRole();
- this.getWebsocket();
- // 综合日志倒计时 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
- // 工单列表倒计时 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
- }
- 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 = {}; //手术提示信息
- 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 "inquiryOfHistoricalSpecimens":
- coopBtns.inquiryOfHistoricalSpecimens = true; //历史标本查询
- break;
- case "historicalMedicineListInquiry":
- coopBtns.historicalMedicineListInquiry = true; //历史药单查询
- break;
- case "quickReportForRepair":
- coopBtns.quickReportForRepair = true; //快捷报修
- break;
- case "repairList":
- coopBtns.repairList = true; //报修列表
- break;
- case "buildOrdersForOtherTasks":
- coopBtns.buildOrdersForOtherTasks = true; //其他任务建单
- break;
- }
- });
- this.coopBtns = coopBtns;
- console.log(this.coopBtns);
- }
- // 切换综合日志和一键报修
- 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;
- this.execModal = true;
- }
- // 确认立即执行
- confirmExec() {
- this.btnLoading = true;
- // let postData: any = {
- // workOderId: this.coopItem.id,
- // workOrder: {
- // sourceId: this.coopItem.sourceId,
- // taskType: {
- // id: this.coopItem.taskType.id,
- // },
- // startDept: {
- // id: this.coopItem.startDept.id,
- // },
- // endDepts: this.coopItem.endDepts.map((v) => ({ id: v.id })),
- // createDept: this.coopItem.createDept,
- // patient: {
- // patientCode: this.coopItem.patient.patientCode,
- // },
- // goods: this.coopItem.goods,
- // platform: 2,
- // isAccompany: this.coopItem.isAccompany,
- // },
- // };
- // if (this.coopItem.isRemand !== undefined) {
- // postData.workOrder.isRemand = this.coopItem.isRemand;
- // }
- // if (this.coopItem.taskType.associationType.value == 'inspect') {
- // postData.workOrder.taskType.isHalfInspect = this.coopItem.taskType.isHalfInspect;
- // }
- // checkList:[
- // {
- // "id": 1165517
- // }
- // ]
- 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;
- 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;
- if (this.isShowBx && (this.coopBtns.repairList || this.coopBtns.quickReportForRepair)) {
- this.smallTabs = [
- { id: 1, name: "综合日志" },
- { id: 2, name: "一键报修" },
- ];
- this.smallTabId = 2;
- this.getQuickBxlb();
- this.getBxlb();
- } else {
- this.smallTabs = [{ id: 1, name: "综合日志" }];
- this.smallTabId = 1;
- this.listDeptOrderRecord();
- }
- }
- });
- }
- //获取检查页面任务类型
- 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;
- }
- });
- }
- // 获取标本按钮
- specimenButton = "";
- getSpecimenButton() {
- if(this.currentDept.typeValue == 'surgery'){
- 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'){
- 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.positionY = this.osComponentRef2.osInstance().scroll().position.y; //内容滚动的距离
- this.selectOtherId = item.id;
- this.newShortcutOrder(item, "other");
- this.account = 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);
- }
- //搜索
- incidentSearch = ""; //搜索的关键词
- incidentNum = 0;
- incidentSearchChange() {
- this.incidentSearchChangeSubject.next(this.incidentSearch);
- }
- // 切换科室
- 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'){
- 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'){
- 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, "");
- }
- );
- }
- // 是否确定报修模态框
- bxModal: boolean = false; //模态框
- loading6 = false;
- tipsMsg2: string; //提示框信息
- coopBx: any; //当前操作列
- showBxModal(data: any, tipsMsg2: string) {
- this.bxModal = true;
- this.coopBx = data;
- this.tipsMsg2 = tipsMsg2;
- }
- // 隐藏模态框
- hideBxModal() {
- this.bxModal = false;
- }
- // 确认
- confirmBx() {
- this.loading6 = true;
- this.mainService.wxbx({}).subscribe((result) => {
- if ((result as any).status == 200) {
- let bxcode = (result as any).data; //生成微信报修号
- let postData: any = {
- verification: "true",
- incident: {
- branch:this.loginUser.currentHospital.id,
- deptId:this.loginUser.dept.id,
- // contacts: this.loginUser.name,
- // contactsInformation: this.loginUser.phone,
- description: this.coopBx.content,
- requester: { account: this.loginUser.account },
- sourceType: "wechatUserIncident",
- fileUrl: "url",
- bxcode,
- },
- loginUser: {
- account: this.loginUser.account,
- id: this.loginUser.id,
- },
- };
- if (this.coopBx.category) {
- postData.incident.categoryId = this.coopBx.category.id;
- }
- this.mainService.addWxIncident(postData).subscribe((res) => {
- this.loading6 = false;
- this.bxModal = false;
- if ((res as any).state == 200) {
- this.showPromptModal("提交", true, "");
- this.checkTable("bxlb");
- } else {
- this.showPromptModal("提交", false, (res as any).msg);
- }
- });
- } else {
- this.loading6 = false;
- this.showPromptModal("提交", false, "");
- }
- });
- }
- // 获取事件状态
- incidentStateId = undefined;
- incidentStateList = [];
- 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 || [];
- }
- });
- }
- // 获取星级
- degrees = [];
- getDegrees() {
- let postData = { type: "list", key: "incident_degree" };
- this.iLoading = true;
- this.mainService.getDictionaryByITSM(postData).subscribe((data: any) => {
- this.iLoading = false;
- if (data.status == 200) {
- this.degrees = data.data || [];
- }
- });
- }
- // 获取故障现象(三级)
- incidentList = [];
- iLoading = false;
- getIncidentcategory(key = "") {
- let postData = {
- idx: 0,
- sum: 9999,
- incidentcategory: {
- category: key,
- selectType: "pinyin_qs",
- hierarchyQuery: "three",
- },
- };
- this.iLoading = true;
- this.mainService
- .fetchListBx("incidentcategory", postData)
- .subscribe((data: any) => {
- this.iLoading = false;
- if (data.status == 200) {
- this.incidentList = data.list || [];
- }
- });
- }
- // 获取当前登录人科室任务类型信息
- othersList: any = []; // 其他一键建单列表
- bbMsg: any = {}; //标本一键建单
- patientMsgList: any = []; // 患者转运,患者陪检一键建单
- tabFlag = true; //页面初始化获取一次患者陪检的任务类型信息
- allowUrgentFlag = false; //检查列表的患者陪检类型是否允许加急
- getDeptTaskType(search?, clear?) {
- let that = this;
- this.otherNum++;
- this.oLoading = true;
- let postData = {
- deptId: that.loginUserDeptId,
- };
- if (search !== undefined) {
- postData["taskName"] = search;
- }
- 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.allTaskTypes) {
- that.othersList = [];
- that.patientMsgList = [];
- data.data.allTaskTypes.forEach((e) => {
- if (e.associationType.value == "other") {
- that.othersList.push(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.length) {
- this.selectOtherId = that.othersList[0].id;
- let obj = that.othersList.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 == "checkRoom2" ||
- this.currentDept.typeValue == "outpatientDept" ||
- this.currentDept.typeValue == "checkRoom") &&
- !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'){
- // 手术安排信息-手术室类型
- 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{
- // 患者信息
- postData["patient"] = {
- keyWord: e ? e : this.tabSearchCont,
- };
- // 查询父级科室患者
- postData["patient"]["parentIdOnly"] = true;
- if (
- this.currentDept.typeValue == "checkRoom2" ||
- this.currentDept.typeValue == "outpatientDept" ||
- this.currentDept.typeValue == "checkRoom"
- ) {
- delete postData["patient"]["department"]; //搜索范围为全院在院患者
- } else {
- postData["patient"]["department"] = { id: this.loginUserDeptId };
- }
- }
- this.snum++;
- this.mainService
- .getFetchDataList(this.currentDept.typeValue == 'surgery' ? "simple/data" : 'nurse', this.currentDept.typeValue == 'surgery' ? "surgery" : 'patient', postData)
- .subscribe((data) => {
- this.snum--;
- if (data.list.length > 0) {
- data.list.forEach((item) => {
- if(this.currentDept.typeValue == 'surgery'){
- 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(new Date(this.yyTime), "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.taskType.id, () => {
- 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 };
- }
- };
- 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>科室吗?`
- }
- // 患者信息一键建单
- 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;
- }
- if (flag) {
- //转运
- this.yyTimeZy =
- format(new Date(this.yyDateZy), "yyyy-MM-dd") +
- " " +
- format(new Date(this.yyTimeZy), "HH:mm") +
- ":00";
- } else {
- //陪检
- this.yyTime =
- format(new Date(this.yyDate), "yyyy-MM-dd") +
- " " +
- format(new Date(this.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(new Date(this.yyTime), "yyyy-MM-dd HH:mm") + ":00";
- }
- } else {
- delete postData.workOrder["checkList"];
- // 添加预约时间
- if (yuyue) {
- postData.workOrder.yyTime =
- format(new Date(this.yyTimeZy), "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.taskType.id, () => {
- 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.taskType.id, () => {
- 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.taskType.id, () => {
- 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.taskType.id, () => {
- 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.taskType.id, () => {
- 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 (
- new Date(item.yyTime).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 (
- new Date(item.yyTime).getTime() - new Date().getTime() >
- this.leadTime * 60 * 1000
- );
- });
- //如果勾选需要预约检查
- if (isYyInspect) {
- //筛选离当前时间最近的
- let timeList = this.filterLinkCheckLis
- .map((item) => new Date(item.yyTime).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 (
- new Date(item.yyTime).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);
- }
- // 一键发起建单保存
- loading5 = false;
- 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;
- let postData;
- that.buildType = "other";
- if (that.buildType == "other") {
- if(this.buildMsg.reserveUserSwitch == 1 && !this.userAccount){
- this.message.info('请选择工号!');
- this.loading5 = false;
- return;
- }
- // 其他
- postData = {
- workOrder: {
- sourceId: SourceId.hushi,
- workOrderRemark: this.userAccount ? `${this.userAccount.account}-${this.userAccount.name}:${this.workOrderRemark}` : this.workOrderRemark,
- taskType: { id: that.shortcutMsg.id },
- createDept: that.loginUserDeptId,
- startDept: { id: that.buildMsg.startDept },
- endDepts: [{ id: that.buildMsg.endDept }],
- },
- };
- 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.taskType.id, () => {
- 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.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 };
- }
- };
- // 建单判断时间-护士端建单通用方法
- newOrderTimeFun(taskTypeId, fun1, fun2){
- if(this.currentDept.typeValue != 'recovery' && this.currentDept.typeValue != 'surgery'){
- let maskFlag = this.message.loading("正在加载中..", {
- nzDuration: 0,
- }).messageId;
- this.mainService
- .postCustom("api", "compareReserveDate", {taskTypeId})
- .subscribe((data) => {
- this.message.remove(maskFlag);
- if(!data.data){
- fun2.call(this);
- }else{
- fun1.call(this);
- this.limitTimeModal = true;
- this.limitTimeItem = {taskTypeId, fun1, fun2};
- this.limitTimeInfo = data.data;
- }
- })
- }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.taskType.id, () => {
- 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.taskType.id, () => {
- 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 = "other";
- checkTable(type) {
- this.checkedTableType = type;
- if (type === "historySpecimen") {
- this.getHistorySpecimen();
- } else if (type === "historyDrugsbag") {
- this.getHistoryDrugsbag();
- } else if (type === "bxlb" && this.isShowBx && this.coopBtns.repairList) {
- this.getBxlb();
- this.getIncidentState();
- this.getDegrees();
- } else if (type === "kjbx" && this.isShowBx && this.coopBtns.quickReportForRepair) {
- // this.getQuickBxlb();
- this.getIncidentcategory();
- // 获取报修的区域(所属院区)
- // this.getArea();
- // this.bxForm.controls.name.setValue(this.loginUser.name);
- // this.bxForm.controls.phone.setValue(this.loginUser.phone);
- // this.bxForm.controls.address.setValue(null);
- this.bxForm.controls.content.setValue(null);
- }
- }
- //提交报修
- 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() {
- if(!this.coopBtns.suggestionBox){
- return;
- }
- let that = this;
- let postData = {
- advice: {
- content: that.adviceSearchInp || "",
- creatDepartment: {
- id: that.loginUserDeptId,
- },
- createUser: {
- id: that.loginUser.id,
- },
- },
- idx: that.advicePageIndex - 1 < 0 ? 0 : 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;
- });
- }
- // 历史标本查询表格数据
- 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;
- });
- }
- // 报修列表查询表格数据
- bxlbList: any = [];
- bxlbPageIndex: number = 1; //表格当前页码
- bxlbPageSize: number = 10; //表格每页展示条数
- bxlbListLength: number = 10; //表格总数据量
- bxlbCodeSearchInp: string = ""; //标本编码搜索
- bxlbParentSearchInp: string = ""; //患者信息搜索
- processing: number = 0; //处理中的数量
- bxlbLoading = false;
- getBxlb(idx?) {
- if (idx) {
- this.bxlbPageIndex = 1;
- }
- let current = JSON.parse(localStorage.getItem("user"));
- this.bxlbLoading = true;
- this.mainService
- .listWxIncident({
- deptId: current.user.dept.id,
- // assignee: current.user.account,
- state: this.incidentStateId?parseInt(this.incidentStateId):undefined,
- idx: this.bxlbPageIndex - 1,
- sum: this.bxlbPageSize,
- })
- .subscribe((data: any) => {
- this.bxlbLoading = false;
- this.bxlbList = data.data || [];
- this.bxlbListLength = data.resultCount || 0;
- this.processing = data.resultCount || 0;
- });
- }
- //快速报修列表
- quickBxlbLoading = false;
- quickBxlbList = [];
- getQuickBxlb() {
- this.quickBxlbLoading = true;
- this.mainService
- .fetchListBx("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;
- }
- // 工单列表下拉筛选
- 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;
- }
- // 评价
- 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 = ""; //评级
- appraiseIdBx: number;
- showAppraiseBx(id) {
- this.appraiseIdBx = id;
- 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 = {
- degree: id,
- degreeRemark: this.appraiseContentBx,
- id: this.appraiseIdBx,
- };
- this.mainService
- .degree(postData)
- .subscribe((data:any) => {
- this.hideAppraiseBx();
- if (data.state == 200) {
- this.getBxlb();
- 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' && data.taskType.ordinaryField.value == 'blood') {
- // 万能交接服务&&血制品
- this.router.navigateByUrl("nurse/detailBlood/" + data.id);
- } else {
- // 其他
- this.router.navigateByUrl("nurse/detailOthers/" + data.id);
- }
- }
- // 派单
- allotWorker(id, stateId) {
- this.router.navigateByUrl("nurse/allotWorker/" + id + "/" + stateId);
- }
- // 展示信息提示框(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;
- // 假退出
- localStorage.removeItem("user");
- localStorage.removeItem("menu");
- localStorage.removeItem("phones");
- localStorage.removeItem("index");
- that.router.navigateByUrl("login");
- // 假退出
- that.mainService.logOut().subscribe((data) => {
- if (data.status == 200) {
- localStorage.removeItem("user");
- localStorage.removeItem("menu");
- localStorage.removeItem("phones");
- localStorage.removeItem("index");
- that.router.navigateByUrl("login");
- }
- });
- }
- // 格式化时分秒
- // (时间小于一分钟则显示秒,时间大于一分钟则显示分钟数,如超出一小时则显示小时和分钟。)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.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);
- }
- });
- }
- // 右侧菜单
- 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;
- }
- }
|