1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747 |
- <template>
- <div >
- <div id="tem_table_data" v-show="schedulingTableVisible">
- <slot></slot>
- <div class="table_contain temtable_contain">
- <div class="left_contain">
- <div
- class="cell clearfix"
- >
- <el-input
- size="small"
- style="width: 200px"
- class="filter-item"
- v-model.trim="keywords"
- placeholder="病人名称/透析号"
- @keyup.enter.native="search_two"
- />
- <el-button
- size="small"
- class="filter-item"
- type="primary"
- icon="el-icon-search"
- @click="search_two"
- >搜索</el-button
- >
- </div>
-
- <div style="margin-bottom: 10px; display: flex">
- <h3 style="line-height: 45px">
- <span
- style="margin-right: 15px; font-size: 16px; white-space: nowrap"
- >当前选择</span
- >
- </h3>
- <div
- style="line-height: 45px;
- background: rgb(64, 158, 255);
- color: white;
- "
- >
- <div
- draggable="true"
- @dragstart="curInfoDragStart"
- class="item_touz"
- style="font-weight: bolder"
- >
- <span>{{ cur_info.patient_name }}</span>
-
- <span>{{ cur_info.mode_name }}</span>
- </div>
- </div>
- </div>
- <div style="width: 225px">
- <el-row :gutter="10">
- <el-col :span="15">
- <div style="width: 225px; display: flex">
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- :data="patients"
- height="620"
- border
- @row-click="patientClick"
- :row-class-name="patientclass"
- ref="patient_table"
- style="margin-right: 14px"
- >
- <el-table-column
- prop="name"
- label="患者名称"
- >
- </el-table-column>
- </el-table>
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266',
- }"
- :data="modes"
- height="620"
- ref="mode_table"
- @row-click="modeClick"
- :row-class-name="modeclass"
- border
- >
- <el-table-column
- prop="name"
- label="透析模式"
-
- align="center"
- ></el-table-column>
- </el-table>
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
- <div class="right_contain">
- <el-table
- :fit="true"
- :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)' }"
- ref="table"
- :data="opera_device_numbers"
- :span-method="spanMethod"
- show-summary
- height="750"
- style="width: 100%; cursor: pointer"
- :cell-class-name="cellClass"
- :row-class-name="rowClass"
- :summary-method="getSummaries"
- @cell-click="itemClick"
- @cell-dblclick="itemdblclick"
- sum-text="总数"
- >
- <el-table-column
- label="分区"
- min-width="50"
- align="center"
- fixed
- >
- <template slot-scope="scope">
- {{ scope.row.zone.name }}
- </template>
- </el-table-column>
-
- <el-table-column label="机号" min-width="40" align="center" fixed style="text-align: center;" >
- <template slot-scope="scope">
- <div>{{ scope.row.number }}</div>
- </template>
- </el-table-column>
-
- <el-table-column label="周一" align="center" >
- <el-table-column prop="1_1" label="上" min-width="40" align="center" style="padding: 0px 0px !important;">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['1_1'], '1_1', scope.row)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '1_1', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['1_1']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '1_1',
- scope.row.index,
- scope.row['1_1'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="1_2" label="下" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['1_2'], '1_2', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '1_2', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['1_2']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '1_2',
- scope.row.index,
- scope.row['1_2'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="1_3" label="晚" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['1_3'], '1_3', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '1_3', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['1_3']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '1_3',
- scope.row.index,
- scope.row['1_3'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
-
- <el-table-column label="周二" align="center">
- <el-table-column prop="2_1" label="上" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['2_1'], '2_1', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '2_1', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['2_1']"
- :draggable="true"
- @mouseover.native="
- drag(
- $event,
- '2_1',
- scope.row.index,
- scope.row['2_1'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="2_2" label="下" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['2_2'], '2_2', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '2_2', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['2_2']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '2_2',
- scope.row.index,
- scope.row['2_2'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="2_3" label="晚" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['2_3'], '2_3', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '2_3', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['2_3']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '2_3',
- scope.row.index,
- scope.row['2_3'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
-
- <el-table-column label="周三" align="center">
- <el-table-column prop="3_1" label="上" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['3_1'], '3_1', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '3_1', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['3_1']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '3_1',
- scope.row.index,
- scope.row['3_1'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="3_2" label="下" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['3_2'], '3_2', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '3_2', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['3_2']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '3_2',
- scope.row.index,
- scope.row['3_2'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="3_3" label="晚" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['3_3'], '3_3', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '3_3', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['3_3']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '3_3',
- scope.row.index,
- scope.row['3_3'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
-
- <el-table-column label="周四" align="center">
- <el-table-column prop="4_1" label="上" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['4_1'], '4_1', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '4_1', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['4_1']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '4_1',
- scope.row.index,
- scope.row['4_1'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="4_2" label="下" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['4_2'], '4_2', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '4_2', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['4_2']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '4_2',
- scope.row.index,
- scope.row['4_2'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="4_3" label="晚" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['4_3'], '4_3', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '4_3', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['4_3']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '4_3',
- scope.row.index,
- scope.row['4_3'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
-
- <el-table-column label="周五" align="center">
- <el-table-column prop="5_1" label="上" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['5_1'], '5_1', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '5_1', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['5_1']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '5_1',
- scope.row.index,
- scope.row['5_1'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="5_2" label="下" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['5_2'], '5_2', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '5_2', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['5_2']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '5_2',
- scope.row.index,
- scope.row['5_2'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="5_3" label="晚" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['5_3'], '5_3', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '5_3', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['5_3']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '5_3',
- scope.row.index,
- scope.row['5_3'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
-
- <el-table-column label="周六" align="center">
- <el-table-column prop="6_1" label="上" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['6_1'], '6_1', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '6_1', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['6_1']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '6_1',
- scope.row.index,
- scope.row['6_1'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="6_2" label="下" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['6_2'], '6_2', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '6_2', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['6_2']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '6_2',
- scope.row.index,
- scope.row['6_2'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="6_3" label="晚" min-width="40" align="center">
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['6_3'], '6_3', scope.row)
- "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '6_3', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['6_3']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '6_3',
- scope.row.index,
- scope.row['6_3'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
-
- <el-table-column label="周日" align="center">
- <el-table-column
- prop="7_1"
- label="上"
- min-width="40"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['7_1'], '7_1', scope.row) "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '7_1', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['7_1']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '7_1',
- scope.row.index,
- scope.row['7_1'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="7_2"
- label="下"
- min-width="40"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['7_2'], '7_2', scope.row) "
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '7_2', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['7_2']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '7_2',
- scope.row.index,
- scope.row['7_2'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- <el-table-column
- prop="7_3"
- label="晚"
- min-width="40"
- align="center"
- >
- <template slot-scope="scope">
- <div class="del_table_btn">
- <el-button
- type="danger"
- size="mini"
- icon="el-icon-close"
- circle
- @click.stop="
- deletePatientMode(scope.row['7_3'], '7_3', scope.row)"
- v-show="cur_drag_info.patient_id== 0 ? false : true"
- ></el-button>
- </div>
- <div
- @drop="
- drop($event, '7_3', scope.row.index, scope.row, scope.row)
- "
- @dragover="allowDrop"
- @dragover.prevent
- >
- <template-table-item
- :info="scope.row['7_3']"
- :draggable="true"
-
- @mouseover.native="
- drag(
- $event,
- '7_3',
- scope.row.index,
- scope.row['7_3'],
- scope.row
- )
- "
- ></template-table-item>
- </div>
- </template>
- </el-table-column>
- </el-table-column>
- </el-table>
- </div>
- </div>
- </div>
- <!-- 修改透析模式 -->
- <schedule-selector-dialog
- ref="selector_dialog"
- :patients="patients"
- @did_selected="will_add_schedule_action_three"
- @did_cancel="cancel_schedule_action"
- ></schedule-selector-dialog>
-
- <template-schedule-dialog
- ref="selector_dialog_two"
- :patients="patients"
- @did_selected="will_add_schedule_action_four"
- @did_cancel="cancel_schedule_action"
- >
- </template-schedule-dialog>
-
- <!-- 智能排班 -->
- <div class="dialog-wrapper">
- <el-dialog
- class="smartdialog"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- append-to-body
- width="48%"
- :visible.sync="smartVisible"
- >
- <!-- :style="{ background: '#409EFF', color: 'white' }" -->
- <div slot="title" class="header-title">
- <div style="padding: 15px 20px">
- {{
- `智能排班 (姓名:${
- this.cur_smart_patient_name ? this.cur_smart_patient_name : ""
- } 透析号:${
- this.cur_smart_patient_no ? this.cur_smart_patient_no : ""
- })`
- }}
- </div>
- </div>
- <el-autocomplete
- class="checkSearch"
- popper-class="my-autocomplete"
- v-model.trim="smart_keyword"
- :fetch-suggestions="querySearchAsync"
- placeholder="病人透析号/姓名"
- @select="handleSelect"
- >
- <i class="el-icon-search el-input__icon" slot="suffix"></i>
- <template slot-scope="{ item }">
- <div class="name">{{ item.name }}</div>
- </template>
- </el-autocomplete>
-
- <el-tabs
- v-model="editableTabsValue"
- type="card"
- @tab-click="handleClick"
- >
- <el-tab-pane
- :key="item.name"
- v-for="(item, index) in editableTabs"
- :label="item.title"
- :name="item.name"
- >
- <el-table
- border
- v-loading="handledDataLoading"
- :data="item.tableWeekArrage"
- style="width: 100%"
- >
- <!-- 自定义表结构 -->
- <el-table-column
- label="星期"
- prop="week"
- align="center"
- width="100"
- >
- </el-table-column>
- <el-table-column align="left">
- <template slot="header" slot-scope="scope">
- <el-checkbox-group
- v-model="item.checkedWeek"
- @change="select_week"
- >
- <el-checkbox
- v-for="(i, index) in weeks"
- :label="i"
- :key="index"
- :value="i"
- >
- {{ i.name }}
- </el-checkbox>
- </el-checkbox-group>
- </template>
- <template slot-scope="scope">
- <div>
- <span>模式:</span>
- <el-select
- v-model="scope.row.treat_mode"
- placeholder="请选择"
- size="mini"
- class="select_list_arrage"
- >
- <el-option
- v-for="(item, index) in modes"
- :key="index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <span>班次:</span>
- <el-select
- v-model="scope.row.time_type"
- placeholder="请选择"
- @change="changeSch(scope.row)"
- size="mini"
- class="select_list_arrage"
- >
- <el-option
- v-for="(item, index) in teem_sel"
- :key="index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <span>分区:</span>
- <el-select
- v-model="scope.row.zone_id"
- placeholder="请选择"
- @change="changeSch(scope.row)"
- size="mini"
- class="select_list_arrage"
- >
- <el-option
- v-for="(item, index) in all_zones"
- :key="index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- <span>机号:</span>
- <el-select
- v-model="scope.row.device_number_id"
- placeholder="请选择"
- size="mini"
- @click.native="changeSchMachine(scope.row)"
- class="select_list_arrage"
- >
- <el-option
- v-for="(item, index) in scope.row.jihaos"
- :key="index"
- :label="item.number"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </el-tab-pane>
- </el-tabs>
- <span slot="footer" class="dialog-footer">
- <el-button @click="smartVisible = false">取 消</el-button>
- <el-button
- type="primary"
- v-loading="smartSaveLoading"
- @click="batchSetSch"
- >保 存</el-button
- >
- </span>
- </el-dialog>
- </div>
- <!-- 替换/交换 -->
- <el-dialog
- title="提示"
- :visible.sync="tipDialogVisible"
- width="300px"
- >
- <div>
- 所选位置已有排班,请选择操作
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- type="danger"
- @click="tipDialogVisibleTwo = true"
- >替换</el-button>
- <el-button
- type="primary"
- @click="tipDialogVisibleThree = true"
- >交换</el-button>
- <el-button @click="tipDialogVisible = false">取 消</el-button>
- </span>
- </el-dialog>
- <!-- 替换弹窗 -->
- <el-dialog
- title="提示"
- :visible.sync="tipDialogVisibleTwo"
- width="300px"
- >
- <div>
- 是否将此位置排班替换
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- type="primary"
- :loading="changeLoadingOne"
- @click="coverSch()"
- >确定</el-button>
-
- <el-button @click="tipDialogVisibleTwo = false">取 消</el-button>
- </span>
- </el-dialog>
- <!-- 互换弹窗 -->
- <el-dialog
- title="提示"
- :visible.sync="tipDialogVisibleThree"
- width="300px"
- >
- <div>
- 是否将此位置排班互换
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- type="primary"
- :loading="changeLoadingTwo"
- @click="changeSchTemplateTwo()"
- >确定</el-button>
- <el-button @click="tipDialogVisibleThree = false">取 消</el-button>
- </span>
- </el-dialog>
-
- </div>
- </template>
-
- <script>
- import {
- cancelScheduleTemplate,
- getPatientSmartSchTemplate,
- getTemplateScheduleSearchResult,
- updateSchedules,
- updateEditSchedules,
- getTemplateSmartDevices,
- getSmartDevices,
- CoverSchTemplate,
- ExchangeSchTemplate,
- DeleteAndAddScheduleTemplateTwo
- } from "@/api/schedule_template/sch_template";
-
- import TemplateTableItem from "./template_table_item";
- import ScheduleSelectorDialog from "./template_schedule_selector_dialog";
- import { PostSearchSmartSchTemplatePatient } from "../../../api/schedule_template/sch_template";
- import TemplateScheduleDialog from './template_schedule_dialog'
-
- const weekOptions = [
- {
- name: "周一",
- week_type: 1,
- is_edit: true,
- },
- {
- name: "周二",
- week_type: 2,
- is_edit: true,
- },
- {
- name: "周三",
- week_type: 3,
- is_edit: true,
- },
- {
- name: "周四",
- week_type: 4,
- is_edit: true,
- },
- {
- name: "周五",
- week_type: 5,
- is_edit: true,
- },
- {
- name: "周六",
- week_type: 6,
- is_edit: true,
- },
- {
- name: "周日",
- week_type: 7,
- is_edit: true,
- },
- ];
-
- var rowspanNoControl = -1;
- export default {
- name: "TemplateTable",
- components: {
- TemplateScheduleDialog,
- TemplateTableItem,
- ScheduleSelectorDialog,
- },
- data() {
- return {
- schedulingTableVisible:true,//全屏
- changeLoadingOne:false,
- changeLoadingTwo:false,
- tipDialogVisibleTwo:false,
- tipDialogVisibleThree:false,
- tipDialogVisible:false,
-
- teem_sel: [
- { name: "上午", id: 1 },
- { name: "下午", id: 2 },
- { name: "晚上", id: 3 },
- ],
- smartSaveLoading: false,
- checkedWeek: [], //默认选中那些星期,如不需要可去掉
- editableTabsValue: "",
- handledDataLoading: false,
- smartVisible: false,
- current_patient_data:[],
- isDel:false,
- isEdit:false,
- zones: [],
- weeks: weekOptions,
- patient_id_hover:0,
- smart_keyword: "",
- cur_smart_patient_id: 0,
- cur_smart_patient_name: "",
- cur_smart_patient_no: "",
- all_zones: [],
- devices: [],
- current_all_sch: [],
- editableTabs: [],
- current_all_schtemplate: [],
- cur_drag_obj:1, //當前拖拽對象,用來區分病人列表那的當前選擇和表格内的拖拽對象,1.病人列表,2.表格内的
- // 拖拽数据
- cur_drag_info: {
- patient_name: "",
- patient_id: "",
- mode_name: "",
- mode_id: "",
- schedule_date:"",
- schedule_type:"",
- bed_id:"",
- partition_id:"",
- schedule_week:"",
- type_name:"",
- zone_name:"",
- bed_name:"",
- id:"",
- },
- // 左侧患者数据
- cur_info: {
- patient_name: "",
- mode_name: "",
- mode_id: "",
- patient_id: "",
- },
- cur_temp_info:{
- patient_name: "",
- patient_id: "",
- mode_name: "",
- mode_id: "",
- schedule_date:"",
- schedule_type:"",
- bed_id:"",
- partition_id:"",
- schedule_week:"",
- type_name:"",
- zone_name:"",
- bed_name:"",
- id:"",
-
-
- },
- all_patients:[],
- patientList: [],
- keywords: "",
- schedulePatients: [],
- searchTableVisible: false,
- saving: false,
- zone_device_counts: {},
- treat_modes: {},
- // is_editing: false,
- opera_device_numbers: [],
- origin_device_numbers: [],
- opera_device_numbers_two: [],
-
- partition_id: 0,
- tableHeight: document.documentElement.clientHeight,
- template:null,
- all_template:[],
- active_name:"first",
- };
- },
- props: {
- modes: {
- type: Array,
- },
-
- template_mode: {
- type: Object,
- },
- data: {
- type: Array,
- },
- editable: {
- type: Boolean,
- default: false,
- },
- is_editing: {
- type: Boolean,
- default: false,
- },
- device_numbers: {
- type: Array,
- },
-
- patients: {
- type: Array,
- },
- },
- created() {
- this.treat_modes = this.$store.getters.treatment_mode;
- // window.addEventListener('scroll', this.handleScroll)
- },
- watch: {
- // device_numbers: function () {
- // if(this.isEdit){
- // this.opera_device_numbers = this.makeDeviceNumbers(this.device_numbers);
- // this.origin_device_numbers = this.makeDeviceNumbers(this.device_numbers);
- //
- // }
- //
- //
- // },
- // "template.items": function () {
- // if(this.isEdit) {
- //
- // this.$nextTick(() => {
- // var weekdays = [1, 2, 3, 4, 5, 6, 7]; // 周一-周日
- // var time_types = [1, 2, 3]; // 上下晚
- // for (let d_n_i = 0; d_n_i < this.opera_device_numbers.length; d_n_i++) {
- // const op_d_n = this.opera_device_numbers[d_n_i];
- // const or_d_n = this.origin_device_numbers[d_n_i];
- //
- // op_d_n.total = 0;
- // or_d_n.total = 0;
- //
- // for (let w_i = 0; w_i < weekdays.length; w_i++) {
- // const weekday = weekdays[w_i];
- // for (let t_i = 0; t_i < time_types.length; t_i++) {
- // const time_type = time_types[t_i];
- //
- // var item_key = weekday + "_" + time_type;
- // var op_item = op_d_n[item_key];
- // var or_item = or_d_n[item_key];
- //
- // op_item.pid = 0;
- // op_item.name = "";
- // op_item.treat_mode_id = 0;
- // op_item.treat_mode = "";
- //
- // or_item.pid = 0;
- // or_item.name = "";
- // or_item.treat_mode_id = 0;
- // or_item.treat_mode = "";
- // }
- // }
- // }
- // console.log("this.template");
- // console.log(this.template);
- // for (let index = 0; index < this.template.items.length; index++) {
- // const template_item = this.template.items[index];
- // if (template_item.patient == null) {
- // continue;
- // }
- //
- // for (let d_i = 0; d_i < this.opera_device_numbers.length; d_i++) {
- // const device_number = this.opera_device_numbers[d_i];
- // if (device_number.id == template_item.device_number_id) {
- // var weekday = template_item.weekday;
- // var time_type = template_item.time_type;
- // var cell_item = device_number[weekday + "_" + time_type];
- // cell_item.pid = template_item.patient_id;
- // cell_item.name = template_item.patient.name;
- // cell_item.treat_mode_id = template_item.treat_mode;
- // cell_item.treat_mode = template_item.treat_mode
- // ? this.treat_modes[template_item.treat_mode].name
- // : "";
- // device_number.total += 1;
- //
- // // origin_device_numbers 初始化时数据应该是和 opera_device_numbers 一样的,这里就不再用一个 for 遍历 origin_device_numbers 重复 opera_device_numbers 的操作了
- // const o_device_number = this.origin_device_numbers[d_i];
- // var o_cell_item = o_device_number[weekday + "_" + time_type];
- // o_cell_item.pid = template_item.patient_id;
- // o_cell_item.name = template_item.patient.name;
- // o_cell_item.treat_mode_id = template_item.treat_mode;
- // o_cell_item.treat_mode = template_item.treat_mode
- // ? this.treat_modes[template_item.treat_mode].name
- // : "";
- // o_device_number.total += 1;
- //
- // break;
- // }
- // }
- // }
- // let obj = {
- // id: this.template.id,
- // data: this.opera_device_numbers,
- // data2: this.origin_device_numbers,
- // };
- // this.data.push(obj);
- //
- // });
- // console.log("~~~~~~2222222");
- // console.log(this.template);
- // // 先清除所有已有 item
- // }
- //
- // },
- tableHeight(val) {
- if (!this.timer) {
- this.tableHeight = val;
- this.timer = true;
- const that = this;
- setTimeout(function () {
- that.timer = false;
- }, 400);
- }
- },
-
- },
- mounted() {
- this.tableContainHeight =
- window.innerHeight - this.$refs.table.$el.offsetTop - 310;
-
- const that = this;
- window.onresize = () => {
- return (() => {
- window.fullHeight = document.documentElement.clientHeight;
- if (window.fullHeight < 200) {
- that.tableHeight = 200;
- } else {
- that.tableHeight = window.fullHeight - 200;
- }
- })();
- };
-
- this.$refs.patient_table.setCurrentRow(this.patients[0]);
- this.$refs.mode_table.setCurrentRow(this.modes[0]);
- },
- methods: {
- // 后两周
- GetTemplateTwo(template){
- this.$nextTick(() => {
- var weekdays = [1, 2, 3, 4, 5, 6, 7]; // 周一-周日
- var time_types = [1, 2, 3]; // 上下晚
- for (let d_n_i = 0; d_n_i < this.opera_device_numbers_two.length; d_n_i++) {
- const op_d_n = this.opera_device_numbers_two[d_n_i];
- const or_d_n = this.origin_device_numbers[d_n_i];
-
- op_d_n.total = 0;
- or_d_n.total = 0;
-
- for (let w_i = 0; w_i < weekdays.length; w_i++) {
- const weekday = weekdays[w_i];
- for (let t_i = 0; t_i < time_types.length; t_i++) {
- const time_type = time_types[t_i];
-
- var item_key = weekday + "_" + time_type;
- var op_item = op_d_n[item_key];
- var or_item = or_d_n[item_key];
-
- op_item.pid = 0;
- op_item.name = "";
- op_item.treat_mode_id = 0;
- op_item.treat_mode = "";
-
- or_item.pid = 0;
- or_item.name = "";
- or_item.treat_mode_id = 0;
- or_item.treat_mode = "";
- }
- }
- }
-
- for (let index = 0; index < template.items.length; index++) {
- const template_item = template.items[index];
- if (template_item.patient == null) {
- continue;
- }
-
- for (let d_i = 0; d_i < this.opera_device_numbers_two.length; d_i++) {
- const device_number = this.opera_device_numbers_two[d_i];
- if (device_number.id == template_item.device_number_id) {
- var weekday = template_item.weekday;
- var time_type = template_item.time_type;
- var cell_item = device_number[weekday + "_" + time_type];
- cell_item.pid = template_item.patient_id;
- cell_item.name = template_item.patient.name;
- cell_item.treat_mode_id = template_item.treat_mode;
- cell_item.treat_mode = template_item.treat_mode
- ? this.treat_modes[template_item.treat_mode].name
- : "";
- device_number.total += 1;
-
- // origin_device_numbers 初始化时数据应该是和 opera_device_numbers 一样的,这里就不再用一个 for 遍历 origin_device_numbers 重复 opera_device_numbers 的操作了
- const o_device_number = this.origin_device_numbers[d_i];
- var o_cell_item = o_device_number[weekday + "_" + time_type];
- o_cell_item.pid = template_item.patient_id;
- o_cell_item.name = template_item.patient.name;
- o_cell_item.treat_mode_id = template_item.treat_mode;
- o_cell_item.treat_mode = template_item.treat_mode
- ? this.treat_modes[template_item.treat_mode].name
- : "";
- o_device_number.total += 1;
-
- break;
- }
- }
- }
-
-
- })},
- // 下一周
- GetTemplate(template){
- this.$nextTick(() => {
- var weekdays = [1, 2, 3, 4, 5, 6, 7]; // 周一-周日
- var time_types = [1, 2, 3]; // 上下晚
- for (let d_n_i = 0; d_n_i < this.opera_device_numbers.length; d_n_i++) {
- const op_d_n = this.opera_device_numbers[d_n_i];
- const or_d_n = this.origin_device_numbers[d_n_i];
-
- op_d_n.total = 0;
- or_d_n.total = 0;
-
- for (let w_i = 0; w_i < weekdays.length; w_i++) {
- const weekday = weekdays[w_i];
- for (let t_i = 0; t_i < time_types.length; t_i++) {
- const time_type = time_types[t_i];
-
- var item_key = weekday + "_" + time_type;
- var op_item = op_d_n[item_key];
- var or_item = or_d_n[item_key];
-
- op_item.pid = 0;
- op_item.name = "";
- op_item.treat_mode_id = 0;
- op_item.treat_mode = "";
-
- or_item.pid = 0;
- or_item.name = "";
- or_item.treat_mode_id = 0;
- or_item.treat_mode = "";
- }
- }
- }
- console.log("this.template");
- console.log(template);
- for (let index = 0; index < template.items.length; index++) {
- const template_item = template.items[index];
- if (template_item.patient == null) {
- continue;
- }
-
- for (let d_i = 0; d_i < this.opera_device_numbers.length; d_i++) {
- const device_number = this.opera_device_numbers[d_i];
- if (device_number.id == template_item.device_number_id) {
- var weekday = template_item.weekday;
- var time_type = template_item.time_type;
- var cell_item = device_number[weekday + "_" + time_type];
- cell_item.pid = template_item.patient_id;
- cell_item.name = template_item.patient.name;
- cell_item.treat_mode_id = template_item.treat_mode;
- cell_item.treat_mode = template_item.treat_mode
- ? this.treat_modes[template_item.treat_mode].name
- : "";
- device_number.total += 1;
-
- // origin_device_numbers 初始化时数据应该是和 opera_device_numbers 一样的,这里就不再用一个 for 遍历 origin_device_numbers 重复 opera_device_numbers 的操作了
- const o_device_number = this.origin_device_numbers[d_i];
- var o_cell_item = o_device_number[weekday + "_" + time_type];
- o_cell_item.pid = template_item.patient_id;
- o_cell_item.name = template_item.patient.name;
- o_cell_item.treat_mode_id = template_item.treat_mode;
- o_cell_item.treat_mode = template_item.treat_mode
- ? this.treat_modes[template_item.treat_mode].name
- : "";
- o_device_number.total += 1;
-
- break;
- }
- }
- }
- let obj = {
- id: template.id,
- data: this.opera_device_numbers,
- data2: this.origin_device_numbers,
- };
- this.data.push(obj);
- this.$emit("changeLoading")
-
- })},
- changePartiton(val) {
- this.$emit("event1", val);
- // this.partition_id = val;
- // this.getWeekPanels();
- // this.getSchedules();
- },
- // 这周
- handleData() {
- this.$nextTick(() => {
- var weekdays = [1, 2, 3, 4, 5, 6, 7]; // 周一-周日
- var time_types = [1, 2, 3]; // 上下晚
- for (let d_n_i = 0; d_n_i < this.opera_device_numbers.length; d_n_i++) {
- const op_d_n = this.opera_device_numbers[d_n_i];
- const or_d_n = this.origin_device_numbers[d_n_i];
-
- op_d_n.total = 0;
- or_d_n.total = 0;
-
- for (let w_i = 0; w_i < weekdays.length; w_i++) {
- const weekday = weekdays[w_i];
- for (let t_i = 0; t_i < time_types.length; t_i++) {
- const time_type = time_types[t_i];
-
- var item_key = weekday + "_" + time_type;
- var op_item = op_d_n[item_key];
- var or_item = or_d_n[item_key];
-
- op_item.pid = 0;
- op_item.name = "";
- op_item.treat_mode_id = 0;
- op_item.treat_mode = "";
-
- or_item.pid = 0;
- or_item.name = "";
- or_item.treat_mode_id = 0;
- or_item.treat_mode = "";
- }
- }
- }
- console.log("this.template");
- console.log(this.template);
- for (let index = 0; index < this.template.items.length; index++) {
- const template_item = this.template.items[index];
- if (template_item.patient == null) {
- continue;
- }
-
- for (let d_i = 0; d_i < this.opera_device_numbers.length; d_i++) {
- const device_number = this.opera_device_numbers[d_i];
- if (device_number.id == template_item.device_number_id) {
- var weekday = template_item.weekday;
- var time_type = template_item.time_type;
- var cell_item = device_number[weekday + "_" + time_type];
- cell_item.pid = template_item.patient_id;
- cell_item.name = template_item.patient.name;
- cell_item.treat_mode_id = template_item.treat_mode;
- cell_item.treat_mode = template_item.treat_mode
- ? this.treat_modes[template_item.treat_mode].name
- : "";
- device_number.total += 1;
-
- // origin_device_numbers 初始化时数据应该是和 opera_device_numbers 一样的,这里就不再用一个 for 遍历 origin_device_numbers 重复 opera_device_numbers 的操作了
- const o_device_number = this.origin_device_numbers[d_i];
- var o_cell_item = o_device_number[weekday + "_" + time_type];
- o_cell_item.pid = template_item.patient_id;
- o_cell_item.name = template_item.patient.name;
- o_cell_item.treat_mode_id = template_item.treat_mode;
- o_cell_item.treat_mode = template_item.treat_mode
- ? this.treat_modes[template_item.treat_mode].name
- : "";
- o_device_number.total += 1;
-
- break;
- }
- }
- }
- let obj = {
- id: this.template.id,
- data: this.opera_device_numbers,
- data2: this.origin_device_numbers,
- };
- this.data.push(obj);
- console.log(this.data);
- });
- },
- // 便利周一到周日
- getWeekByzhongwen(week_str) {
- switch (week_str) {
- case "周一":
- return 1;
- break;
- case "周二":
- return 2;
- break;
- case "周三":
- return 3;
- break;
- case "周四":
- return 4;
- break;
- case "周五":
- return 5;
- break;
- case "周六":
- return 6;
- break;
- case "周日":
- return 7;
- break;
- }
- },
- // 拖拽
- drop(e, day, index, name, row) {
- e.preventDefault();
- console.log('11111111',row)
- for (var key in row) {
- if (key == day) {
- let info = {};
- for (var key in row) {
- if (key == day) {
- info = row[key];
- }
- }
- console.log(info)
-
- var weekday_timetype = day.split("_");
- var weekday = weekday_timetype[0];
- var time_type = weekday_timetype[1];
-
- this.cur_temp_info.schedule_week = weekday
- this.cur_temp_info.schedule_type = time_type
- this.cur_temp_info.patient_id = info.pid
- this.cur_temp_info.id = row.id
-
- if (info.pid > 0 || info.treat_mode_id > 0 ) {
- if (this.cur_drag_obj == 2){
-
- if(info.pid != this.cur_drag_info.patient_id){
- console.log('1234132412',info.pid,this.cur_drag_info.patient_id);
- this.tipDialogVisible = true
- }
- // this.tipDialogVisible = false
- }else{
- this.$message.error("当前机号已有排班2");
- return;
- }
-
- } else {
- //當前類型是表格内的拖拽,如果是同一天内的表格拖拽到空床位則先刪除原先排版,后在將排班弄到空床位
- if(this.cur_drag_obj == 2){
- if (this.cur_drag_info.schedule_week == weekday){
- //删除原来的排班,新增一个新的排班
- let params={
- template_id:this.template.id,
- week_type_one:this.cur_drag_info.schedule_week,
- time_type_one:this.cur_drag_info.schedule_type,
- device_id_one:this.cur_drag_info.id,
- patient_id_one:this.cur_drag_info.patient_id,
-
-
- week_type_two:this.cur_temp_info.schedule_week,
- time_type_two:this.cur_temp_info.schedule_type,
- device_id_two:this.cur_temp_info.id,
- patient_id_two:this.cur_drag_info.patient_id,
- mode_id:this.cur_drag_info.mode_id,
-
- }
- DeleteAndAddScheduleTemplateTwo(params).then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- this.tipDialogVisibleThree = false
- } else {
- this.all_template = response.data.data.items
- this.$emit("setTemplate",response.data.data.items)
- if(this.active_name == 'first'){
- this.GetTemplate(response.data.data.items[0])
- }else if(this.active_name == "second"){
- this.GetTemplate(response.data.data.items[1])
- }else if(this.active_name == "third"){
- this.GetTemplate(response.data.data.items[2])
- }else if(this.active_name == "four"){
- this.GetTemplate(response.data.data.items[3])
- }
- }
- });
-
- }else{
- this.will_add_schedule_action(
- this.cur_drag_info.patient_id,
- this.cur_drag_info.mode_id,
- weekday,
- time_type,
- row.id,
- 0
- );
- this.saveActionTwo();
- }
- }else{
- this.will_add_schedule_action(
- this.cur_info.patient_id,
- this.cur_info.mode_id,
- weekday,
- time_type,
- row.id,
- 0
- );
- this.saveActionTwo();
- }
- }
- }
- }
- },
- unique_two(array) {
- // res用来存储结果
- var res = [];
- for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
- for (var j = 0, resLen = res.length; j < resLen; j++) {
- if (array[i].id === res[j].id) {
- break;
- }
- }
- // 如果array[i]是唯一的,那么执行完循环,j等于resLen
- if (j === resLen) {
- res.push(array[i]);
- }
- }
- return res;
- },
-
- showSmartDialog() {
- this.smartVisible = true;
- this.smart_keyword = "";
- this.all_zones = this.unique_two(this.all_zones);
- //
- // for (let i = 0; i < this.patientList.length; i++) {
- // if (this.patientList[i].id == this.cur_info.patient_id) {
- // this.cur_smart_patient_name = this.patientList[i].name;
- // this.cur_smart_patient_no = this.patientList[i].dialysis_no;
- // this.cur_smart_patient_id = this.patientList[i].id;
- // }
- // }
- //
- // let params = {
- // patient_id: this.cur_smart_patient_id,
- // };
- //
- // getPatientSmartSchTemplate(params).then((response) => {
- // if (response.data.state == 0) {
- // return false;
- // }
- //
- // if ((response.data.data.status = 1)) {
- // var data = [];
- // var schedules = response.data.data.schedules_template;
- // for (let i = 0; i < this.editableTabs.length; i++) {
- // this.editableTabs[i].checkedWeek = [];
- // this.editableTabs[i].tableWeekArrage = [];
- // }
- // for (let i = 0; i < schedules.length; i++) {
- // if (i == 0) {
- // this.editableTabsValue = schedules[0].id;
- // }
- // let obj = {
- // id: schedules[i].id,
- // checkedWeek: [],
- // title: schedules[i].week,
- // name: schedules[i].id,
- // tableWeekArrage: schedules[i].template,
- // };
- // if (i == 0) {
- // obj.title = "一周模版";
- // } else if (i == 1) {
- // obj.title = "二周模版";
- // } else if (i == 2) {
- // obj.title = "三周模版";
- // } else if (i == 3) {
- // obj.title = "四周模版";
- // }
- // for (let b = 0; b < schedules[i].template.length; b++) {
- // let devices = [];
- // for (let d = 0; d < this.devices.length; d++) {
- // if (
- // this.devices[d].zone.id == schedules[i].template[b].zone_id
- // ) {
- // devices.push(this.devices[d]);
- // }
- // }
- // schedules[i].template[b]["jihaos"] = devices;
- // schedules[i].template[b]["week"] = this.getWeekDay(
- // schedules[i].template[b].weekday
- // );
- // schedules[i].template[b]["week_type"] = this.getWeekByzhongwen(
- // schedules[i].template[b].weekday
- // );
- //
- // for (let c = 0; c < this.weeks.length; c++) {
- // if (
- // schedules[i].template[b].weekday == this.weeks[c].week_type
- // ) {
- // obj.checkedWeek.push(this.weeks[c]);
- // }
- // }
- // }
- // schedules[i].template.sort(function (a, b) {
- // return a.week_type - b.week_type;
- // });
- // data.push(obj);
- // }
- //
- // this.editableTabs = data;
- // this.current_patient_data = this.deepClone(data);
- // this.current_all_schtemplate = data
- // } else {
- // }
- // });
- //
-
- this.smartVisible = true;
- },
- SetSmartSch(tempData,del_data) {
- this.saveActionThree(tempData,del_data);
- },
- check(tempData) {
- let isJiXu = true;
- //进行校验
- for (let i = 0; i < tempData.length; i++) {
- for (let index = 0; index < this.opera_device_numbers_two.length; index++) {
- const device_number = this.opera_device_numbers_two[index];
- for (let t_y = 1; t_y <= 3; t_y++) {
- if (
- t_y == tempData[i].time_type &&
- tempData[i].jihao_id == device_number.id &&
- device_number[tempData[i].schedule_week + "_" + t_y].pid !=
- tempData[i].patient_id
- ) {
- console.log( device_number[tempData[i].schedule_week + "_" + t_y].pid)
- console.log(tempData[i].patient_id)
- console.log( tempData[i].jihao_id)
- console.log( device_number.id)
- let msg = "";
- let name = "";
- for(let i = 0; i < this.editableTabs.length;i++){
- if(this.editableTabs[i].name == tempData[i].t_id){
- name = this.editableTabs[i].title
- }
- }
- msg = name + "周" + tempData[i].schedule_week;
-
- if (tempData[i].time_type == 1) {
- msg = msg + "上午";
- } else if (tempData[i].time_type == 2) {
- msg = msg + "下午";
- } else {
- msg = msg + "晚上";
- }
- isJiXu = false;
- this.smartSaveLoading = false;
- msg =
- msg +
- device_number.zone.name +
- device_number.number +
- "已有排班";
- this.$message.error(msg);
- }
- }
- }
- }
- return isJiXu;
- },
- batchSetSch() {
- this.smartSaveLoading = true;
- var tempData = [];
- var delData = [];
- for (let b = 0; b < this.editableTabs.length; b++) {
- for (let c = 0; c < this.editableTabs[b].tableWeekArrage.length; c++) {
- let obj = {
- time_type: this.editableTabs[b].tableWeekArrage[c].time_type,
- jihao_id: this.editableTabs[b].tableWeekArrage[c].device_number_id,
- schedule_week: this.getWeekByzhongwen(
- this.editableTabs[b].tableWeekArrage[c].week
- ),
- mode_id: this.editableTabs[b].tableWeekArrage[c].treat_mode,
- sch_id: this.editableTabs[b].tableWeekArrage[c].id,
- zone_id: this.editableTabs[b].tableWeekArrage[c].zone_id,
- t_id: this.editableTabs[b].name,
- title:this.editableTabs[b].title,
- patient_id: this.cur_smart_patient_id,
- };
- tempData.push(obj);
- }
- }
-
- for (let b = 0; b < this.current_patient_data.length; b++) {
- for (let c = 0; c < this.current_patient_data[b].tableWeekArrage.length; c++) {
- let obj = {
- time_type: this.current_patient_data[b].tableWeekArrage[c].time_type,
- jihao_id: this.current_patient_data[b].tableWeekArrage[c].device_number_id,
- schedule_week: this.getWeekByzhongwen(
- this.current_patient_data[b].tableWeekArrage[c].week
- ),
- mode_id: this.current_patient_data[b].tableWeekArrage[c].treat_mode,
- sch_id: this.current_patient_data[b].tableWeekArrage[c].id,
- zone_id: this.current_patient_data[b].tableWeekArrage[c].zone_id,
- t_id: this.current_patient_data[b].name,
- title:this.current_patient_data[b].title,
- patient_id: this.cur_smart_patient_id,
- };
- delData.push(obj);
- }
- }
- if(tempData.length > 0) {
- for (let i = 0; i < delData.length; i++) {
- for (let b = 0; b < tempData.length; b++) {
- if (delData[i] && delData[i].sch_id == tempData[b].sch_id) {
- delData.splice(i, 1)
- }
- }
- }
- }
-
- for (let i = 0; i < tempData.length; i++) {
- if (tempData[i].jihao_id == "" || tempData[i].zone_id == "") {
- this.$message.error("分区或者床位不能空");
- this.smartSaveLoading = false;
-
- return;
- }
- }
- this.isEdit = true
- console.log("saveData")
- console.log(tempData)
- this.$emit("saveData", tempData,delData);
- },
- changeJihao(){
- this.$forceUpdate()
- },
- changeSchMachine(row) {
- let params = {
- zone_id: row.zone_id,
- sch_type: row.time_type,
- weekday: this.getWeekByzhongwen(row.week),
- patient_id: this.cur_smart_patient_id,
- template_id:this.editableTabsValue,
- };
- //进行网络请求,获取空排班机位
- getTemplateSmartDevices(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- } else {
- var devices = response.data.data.devices;
- row.jihaos = [];
- // row.jihaos = devices;
- for (let i = 0; i < devices.length; i++){
- this.$set(row.jihaos , i, devices[i])
- }
- }
- });
- },
- changeSch(row) {
-
- console.log(row)
- let params = {
- zone_id: row.zone_id,
- sch_type: row.time_type,
- weekday: this.getWeekByzhongwen(row.week),
- patient_id: this.cur_smart_patient_id,
- template_id:this.editableTabsValue,
- };
- //进行网络请求,获取空排班机位
- getTemplateSmartDevices(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- } else {
- var devices = response.data.data.devices;
- row.jihaos = [];
- // row.jihaos = devices;
- for (let i = 0; i < devices.length; i++){
- this.$set(row.jihaos , i, devices[i])
- }
-
- row.device_number_id = "";
- }
- });
- },
- changeArea(row) {
-
-
- let params = {
- zone_id: row.zone_id,
- sch_type: row.time_type,
- weekday: this.getWeekByzhongwen(row.week),
- patient_id: this.cur_smart_patient_id,
- template_id:this.editableTabsValue,
- };
- //进行网络请求,获取空排班机位
- getTemplateSmartDevices(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- } else {
- var devices = response.data.data.devices;
- row.jihaos = [];
- row.jihaos = devices;
- row.device_number_id = "";
- }
- });
-
- },
- // changeJihao(row) {
- // // let devices = [];
- // // devices = this.opera_device_numbers_two;
- // // let cur_key =
- // // this.getWeekByzhongwen(row.week).toString() +
- // // "_" +
- // // row.time_type.toString();
- // // row.jihaos = [];
- // // for (let i = 0; i < devices.length; i++) {
- // // if (devices[i].zone_id == row.zone_id) {
- // // let is_sch = false; //是否有排班
- // // for (let key in devices[i]) {
- // // if (key == cur_key) {
- // // if (
- // // devices[i][key].pid > 0 &&
- // // devices[i][key].treat_mode_id > 0 &&
- // // devices[i][key].pid != this.cur_smart_patient_id
- // // ) {
- // // is_sch = true;
- // // }
- // // }
- // // }
- // // if (!is_sch) {
- // // row.jihaos.push(devices[i]);
- // // }
- // // }
- // // }
- // // row.device_number_id = ""
- // // let params = {
- // // zone_id: row.zone_id,
- // // sch_type: row.time_type,
- // // weekday: row.weekday,
- // // patient_id: this.cur_smart_patient_id,
- // // };
- // // //进行网络请求,获取空排班机位
- // // getTemplateSmartDevices(params).then((response) => {
- // // if (response.data.state == 0) {
- // // return false;
- // // } else {
- // // var devices = response.data.data.devices;
- // // row.ihaos = [];
- // // row.jihaos = devices;
- // // if (devices && devices.length > 0) {
- // // row.jihao_id = devices[0].id;
- // // } else {
- // // row.jihao_id = "";
- // // }
- // // }
- // // });
- // },
-
- select_week(val) {
- this.handledDataLoading = true;
- let params = {
- patient_id: this.cur_smart_patient_id,
- };
-
- getPatientSmartSchTemplate(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- }
-
- if(response.data.data.status = 1) {
- this.handledDataLoading = false;
-
- var data = [];
- var schedules = response.data.data.schedules_template;
-
- for (let i = 0; i < schedules.length; i++) {
- let obj = {
- id: schedules[i].id,
- checkedWeek: [],
- title: schedules[i].week,
- name: schedules[i].id,
- tableWeekArrage: schedules[i].template,
- };
- if (i == 0) {
- obj.title = "一周模版";
- } else if (i == 1) {
- obj.title = "二周模版";
- } else if (i == 2) {
- obj.title = "三周模版";
- } else if (i == 3) {
- obj.title = "四周模版";
- }
- for (let b = 0; b < schedules[i].template.length; b++) {
- let devices = [];
- for (let d = 0; d < this.devices.length; d++) {
- if (
- this.devices[d].zone.id == schedules[i].template[b].zone_id
- ) {
- devices.push(this.devices[d]);
- }
- }
- schedules[i].template[b]["jihaos"] = devices;
- schedules[i].template[b]["week"] = this.getWeekDay(
- schedules[i].template[b].weekday
- );
- schedules[i].template[b]["week_type"] = this.getWeekByzhongwen(
- schedules[i].template[b].weekday
- );
-
- for (let c = 0; c < this.weeks.length; c++) {
- if (
- schedules[i].template[b].weekday == this.weeks[c].week_type
- ) {
- obj.checkedWeek.push(this.weeks[c]);
- }
- }
- }
- schedules[i].template.sort(function (a, b) {
- return a.week_type - b.week_type;
- });
- data.push(obj);
- }
-
- this.current_all_schtemplate = this.editableTabs
- var sch = [];
- for (let i = 0; i < this.current_all_schtemplate.length; i++) {
- if (this.current_all_schtemplate[i].name == this.editableTabsValue) {
- sch = this.current_all_schtemplate[i];
- }
- }
-
- let data2 = [];
- if (val.length == 0) {
- for (let i = 0; i < this.editableTabs.length; i++) {
- if (this.editableTabsValue == this.editableTabs[i].name) {
- this.editableTabs[i].tableWeekArrage = [];
- this.editableTabs[i].checkedWeek = [];
- }
- }
- }
-
- for (let i = 0; i < val.length; i++) {
- let is_new = true;
- let week_name = val[i].name;
-
- let obj = {};
- for (let b = 0; b < sch.tableWeekArrage.length; b++) {
-
- if (week_name == sch.tableWeekArrage[b].week) {
- is_new = false;
- obj = sch.tableWeekArrage[b];
- }
- }
- if (!is_new) {
- data2.push(obj);
- } else {
- data2.push({
- treat_mode: 1,
- week: val[i].name,
- time_type: 1,
- zone_id: "",
- device_number_id: "",
- jihaos: [],
- id: 0,
- });
- }
- }
-
- for (let i = 0; i < data2.length; i++) {
- data2[i]["week_type"] = this.getWeekByzhongwen(data2[i].week);
- }
-
- data2.sort(function (a, b) {
- return a.week_type - b.week_type;
- });
-
- for (let i = 0; i < this.editableTabs.length; i++) {
- if (this.editableTabs[i].name == this.editableTabsValue) {
- this.editableTabs[i].tableWeekArrage = data2;
- }
- }
- } else {
- }
- });
-
-
- },
- handleClick() {
- if(this.editableTabsValue == this.all_template[0].id){
- this.GetTemplateTwo(this.all_template[0])
-
- }else if(this.editableTabsValue == this.all_template[1].id){
- this.GetTemplateTwo(this.all_template[1])
-
-
- }else if(this.editableTabsValue == this.all_template[2].id){
- this.GetTemplateTwo(this.all_template[2])
-
-
- }else if(this.editableTabsValue == this.all_template[3].id){
-
- this.GetTemplateTwo(this.all_template[3])
-
- }
-
- },
- deepClone(source) {
- if (!source && typeof source !== 'object') {
- throw new Error('error arguments', 'shallowClone')
- }
- const targetObj = source.constructor === Array ? [] : {}
- Object.keys(source).forEach((keys) => {
- if (source[keys] && typeof source[keys] === 'object') {
- targetObj[keys] = this.deepClone(source[keys])
- } else {
- targetObj[keys] = source[keys]
- }
- })
- return targetObj
- },
-
- handleSelect(val) {
- for (let i = 0; i < this.editableTabs.length; i++) {
- this.editableTabs[i].tableWeekArrage = [];
- this.editableTabs[i].checkedWeek = [];
- }
-
- this.smart_keyword = val.name;
- this.cur_smart_patient_id = val.id;
- this.cur_smart_patient_name = val.name;
- this.cur_smart_patient_no = val.dialysis_no;
-
- let params = {
- patient_id: this.cur_smart_patient_id,
- };
-
- getPatientSmartSchTemplate(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- }
-
- if ((response.data.data.status = 1)) {
- var data = [];
- var schedules = response.data.data.schedules_template;
- for (let i = 0; i < this.editableTabs.length; i++) {
- this.editableTabs[i].checkedWeek = [];
- this.editableTabs[i].tableWeekArrage = [];
- }
- for (let i = 0; i < schedules.length; i++) {
- if (i == 0) {
- this.editableTabsValue = schedules[0].id;
- }
- let obj = {
- id: schedules[i].id,
- checkedWeek: [],
- title: schedules[i].week,
- name: schedules[i].id,
- tableWeekArrage: schedules[i].template,
- };
- if (i == 0) {
- obj.title = "一周模版";
- } else if (i == 1) {
- obj.title = "二周模版";
- } else if (i == 2) {
- obj.title = "三周模版";
- } else if (i == 3) {
- obj.title = "四周模版";
- }
- for (let b = 0; b < schedules[i].template.length; b++) {
- let devices = [];
- for (let d = 0; d < this.devices.length; d++) {
- if (
- this.devices[d].zone.id == schedules[i].template[b].zone_id
- ) {
- devices.push(this.devices[d]);
- }
- }
- schedules[i].template[b]["jihaos"] = devices;
- schedules[i].template[b]["week"] = this.getWeekDay(
- schedules[i].template[b].weekday
- );
- schedules[i].template[b]["week_type"] = this.getWeekByzhongwen(
- schedules[i].template[b].weekday
- );
-
- for (let c = 0; c < this.weeks.length; c++) {
- if (
- schedules[i].template[b].weekday == this.weeks[c].week_type
- ) {
- obj.checkedWeek.push(this.weeks[c]);
- }
- }
- }
- schedules[i].template.sort(function (a, b) {
- return a.week_type - b.week_type;
- });
- data.push(obj);
- }
-
- this.editableTabs = data;
- this.current_patient_data = this.deepClone(data);
- this.current_all_schtemplate = data
- } else {
- }
- });
-
- // var schedules = val.XtPatientScheduleTemplateId;
- // var data = [];
- // for (let i = 0; i < schedules.length; i++) {
- // if (i == 0) {
- // this.editableTabsValue = schedules[0].id;
- // }
- // let obj = {
- // id: schedules[i].id,
- // checkedWeek: [],
- // title: schedules[i].week,
- // name: schedules[i].id,
- // tableWeekArrage: schedules[i].template,
- // };
- //
- // if (i == 0) {
- // obj.title = "一周模版";
- // } else if (i == 1) {
- // obj.title = "二周模版";
- // } else if (i == 2) {
- // obj.title = "三周模版";
- // } else if (i == 3) {
- // obj.title = "四周模版";
- // }
- // for (let b = 0; b < schedules[i].template.length; b++) {
- // let devices = [];
- // for (let d = 0; d < this.devices.length; d++) {
- // if (this.devices[d].zone.id == schedules[i].template[b].zone_id) {
- // devices.push(this.devices[d]);
- // }
- // }
- //
- // schedules[i].template[b]["jihaos"] = devices;
- // schedules[i].template[b]["week"] = this.getWeekDay(
- // schedules[i].template[b].weekday
- // );
- // schedules[i].template[b]["week_type"] = this.getWeekByzhongwen(
- // schedules[i].template[b].weekday
- // );
- //
- // for (let c = 0; c < this.weeks.length; c++) {
- // if (schedules[i].template[b].weekday == this.weeks[c].week_type) {
- // obj.checkedWeek.push(this.weeks[c]);
- // }
- // }
- // }
- // data.push(obj);
- // }
- // this.editableTabs = data;
- // // this.current_patient_data = data;
- // this.current_patient_data = data
- // this.current_all_sch =data;
- // this.current_patient_data = data
-
- },
- querySearchAsync(keyword, cb) {
- let key = "";
- if (keyword != undefined) {
- key = keyword;
- }
- let searchArray = [];
- let obj = {
- keyword: key,
- };
- PostSearchSmartSchTemplatePatient(obj).then((response) => {
- if (response.data.state == 1) {
- searchArray = response.data.data.patient;
- cb(searchArray);
- } else {
- cb([]);
- }
- });
- },
- getData() {
- return this.opera_device_numbers;
- },
- // 左侧模式点击
- modeClick(row) {
- this.cur_info.mode_name = row.name;
- this.cur_info.mode_id = row.id;
- },
- deletePatientMode(row, key, rows) {
- this.isEdit= true
- var weekday_timetype = key.split("_");
- var weekday = weekday_timetype[0];
- var time_type = weekday_timetype[1];
- this.cancel_schedule_action(weekday, time_type, rows.id);
- this.saveActionTwo();
- },
- setEditData(patients, template, device_numbers,all_template,active_name) {
- this.active_name = active_name
- this.all_template = all_template
- this.all_patients = patients
- this.patientList = patients;
- this.template = template;
- this.device_numbers = device_numbers
- this.cur_info.patient_name = this.patientList[0].name;
- this.cur_info.mode_name = this.modes[0].name;
- this.cur_info.patient_id = this.patientList[0].id;
- this.cur_info.mode_id = this.modes[0].id;
- this.$refs.patient_table.setCurrentRow(this.patientList[0]);
- this.$refs.mode_table.setCurrentRow(this.modes[0]);
- let that = this
- if(that.opera_device_numbers.length == 0 &&that.origin_device_numbers.length == 0){
- that.opera_device_numbers = that.makeDeviceNumbers(device_numbers);
- that.origin_device_numbers = that.makeDeviceNumbers(device_numbers);
- that.opera_device_numbers_two = that.makeDeviceNumbers(device_numbers);
- }
- setTimeout(function (){
- that.GetTemplate(template)
- that.GetTemplateTwo(template)
-
- }, 1000);
-
- },
- // 左侧拖拽
- curInfoDragStart(){
- this.cur_drag_obj = 1
- this.cur_drag_info.patient_id = this.cur_info.patient_id
- this.cur_drag_info.patient_name = this.cur_info.patient_name
- this.cur_drag_info.mode_id = this.cur_info.mode_id
- this.cur_drag_info.mode_name = this.cur_info.mode_name
- },
- // 左侧患者点击
- patientClick(row) {
- console.log(row);
- this.cur_info.patient_name = row.name;
- this.cur_info.patient_id = row.id;
- this.patient_id_hover = row.id
- console.log('this.patient_id_hover',this.patient_id_hover);
- console.log('patientClick的数据',row);
- },
- dragstartTwo(event) {
- console.log("start的索引");
- },
- dragendTwo(event) {
- console.log("dragend");
- },
- // 鼠标移入
- drag(e, day, index, name,row) {
- e.preventDefault();
- let info = {};
- for (var key in row) {
- if (key == day) {
- info = row[key];
- }
- }
- var weekday_timetype = day.split("_");
- var weekday = weekday_timetype[0];
- var time_type = weekday_timetype[1];
-
- console.log(info)
- console.log(row)
- if(info.pid > 0 ) {
- this.cur_drag_obj = 2
- this.cur_drag_info.schedule_type =time_type;
- this.cur_drag_info.partition_id = row.zone_id;
- this.cur_drag_info.schedule_week = weekday;
- this.cur_drag_info.mode_id = info.treat_mode_id;
- this.cur_drag_info.mode_name = info.treat_mode;
- this.cur_drag_info.patient_name = info.name;
- this.cur_drag_info.patient_id = info.pid;
- this.cur_drag_info.id = row.id;
- }else{
- this.cur_drag_obj = 2
- this.cur_drag_info.schedule_type ='';
- this.cur_drag_info.partition_id = '';
- this.cur_drag_info.schedule_week = '';
- this.cur_drag_info.mode_id = '';
- this.cur_drag_info.mode_name = '';
- this.cur_drag_info.patient_name = '';
- this.cur_drag_info.patient_id = 0;
- this.cur_drag_info.id = 0;
-
- }
-
- console.log('this.cur_drag_info的数据',this.cur_drag_info);
- },
- allowDrop(e) {
- e.preventDefault();
- },
- // ----------------------------------
- // | !在html里面的chedule-item里绑定的|
- // | ":draggable"可控制该表格能否拖 |
- // | 动,根据实际情况进行修改 |
- // | |
- // -----------------------------------
- // drop(e, day, index, name,row) {
- // e.preventDefault();
- // for(var key in row){
- // if(key == day){
- // var week = this.weekDay(day);
- //
- //
- // this.currentData.schedule_date = this.weekDays[week[0] - 1];
- // this.currentData.schedule_type = week[1];
- // this.currentData.bed_id = row.jihao_id;
- // this.currentData.partition_id = row.zone_id;
- // this.currentData.schedule_week = week[0];
- // this.currentData.type_name = this.dayType(week[1]);
- // this.currentData.zone_name = row.area;
- // this.currentData.bed_name = row.cut;
- // this.currentData.partition_type = row.zone_type;
- //
- // // if(this.currentData.schedule_date)
- // //TODO 比较当前拖动到的日期和当天比较,如果小于今天则无法添加
- //
- // if( row[key].patient.length > 0 || row[key].mode_name.length > 0 || row[key].mode_id > 0 || row[key].patient_id > 0){
- // this.$message.error("当前机号已有排班");
- // return
- // }else{ //接口提交排班数据
- //
- //
- //
- // this.currentData.mode_id = this.cur_info.mode_id;
- // this.currentData.id = 0;
- // this.currentData.contagions = [];
- // this.currentData.patient_id = this.cur_info.patient_id;
- // this.currentData.patient = this.cur_info.patient_name;
- // this.setSchedule()
- // }
- // }
- // }
- //
- // },
-
- // 左边栏选中名字和模式拖动结束后
- taskDraggerEnd(e) {
- console.log(e.to);
- console.log(e.form);
- },
-
- //move回调方法
- onMove(e, originalEvent) {
- return true;
- },
-
- compare(p) {
- //这是比较函数
- return function (m, n) {
- var a = m[p];
- var b = n[p];
- return a - b; //升序
- };
- },
- // 周一到周日
- getWeekDay: function (week) {
- let week_name = "";
- switch (week) {
- case 1:
- week_name = "周一";
- break;
- case 2:
- week_name = "周二";
- break;
- case 3:
- week_name = "周三";
- break;
- case 4:
- week_name = "周四";
- break;
- case 5:
- week_name = "周五";
- break;
- case 6:
- week_name = "周六";
- break;
- case 7:
- week_name = "周日";
- break;
- }
- return week_name;
- },
- // 早中晚
- getSchedulesType: function (type) {
- let type_name = "";
- switch (type) {
- case 1:
- type_name = "上午";
- break;
- case 2:
- type_name = "下午";
-
- break;
- case 3:
- type_name = "晚上";
- break;
- }
- return type_name;
- },
- getModeName: function (mode) {
- if (this.$store.getters.treatment_mode[mode] != undefined) {
- return this.$store.getters.treatment_mode[mode].name;
- }
- return "";
- },
-
- makeDeviceNumbers: function (device_numbers) {
- this.all_zones = [];
- this.devices = [];
- console.log("device_numbers", device_numbers);
- var arr = [];
- for (let i = 0; i < device_numbers.length; i++) {
- arr.push(device_numbers[i]);
- }
- arr.sort(this.arraySort("sort"));
- console.log("Arr2332232332", arr);
- var maked_device_numbers = [];
- var weekdays = [1, 2, 3, 4, 5, 6, 7]; // 周一-周日
- var time_types = [1, 2, 3]; // 上下晚
- for (let index = 0; index < arr.length; index++) {
- const device_number = arr[index];
- if (device_number.zone != null) {
- var zone = {
- id: device_number.zone.id,
- name: device_number.zone.name,
- type: device_number.zone.type,
- sort: device_number.sort,
- };
- this.all_zones.push(zone);
- var device = {
- id: device_number.id,
- number: device_number.number,
- group_id: device_number.group_id,
- zone_id: device_number.zone_id,
- zone: zone,
- sort: device_number.sort,
- };
- this.devices.push(device);
- }
-
- // 以 weekday_timetype 为 key,{pid: 0, name: "", treat_mode_id: 0, treat_mode: ""} 为 value,加入到 maked_device_numbers 中
- for (let w_i = 0; w_i < weekdays.length; w_i++) {
- const weekday = weekdays[w_i];
- for (let t_i = 0; t_i < time_types.length; t_i++) {
- const time_type = time_types[t_i];
- var defaultValue = {};
- this.$set(defaultValue, "pid", 0);
- this.$set(defaultValue, "name", "");
- this.$set(defaultValue, "treat_mode_id", 0);
- this.$set(defaultValue, "treat_mode", "");
- this.$set(device, weekday + "_" + time_type, defaultValue);
- }
- }
- this.$set(device, "total", 0); // 每个床位号每周的排班总数
-
- maked_device_numbers.push(device);
- }
-
- this.all_zones = this.unique_two(this.all_zones);
-
- return maked_device_numbers;
- },
- // 替换
- coverSch(){
- let params={
- template_id:this.template.id,
- week_type_one:this.cur_drag_info.schedule_week,
- time_type_one:this.cur_drag_info.schedule_type,
- device_id_one:this.cur_drag_info.id,
- patient_id_one:this.cur_drag_info.patient_id,
-
- week_type_two:this.cur_temp_info.schedule_week,
- time_type_two:this.cur_temp_info.schedule_type,
- device_id_two:this.cur_temp_info.id,
- patient_id_two:this.cur_temp_info.patient_id,
-
- }
- this.changeLoadingOne = true
- CoverSchTemplate(params).then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- this.tipDialogVisibleTwo = false
- this.changeLoadingOne = false
-
- } else {
- this.$message.success("替换成功");
- this.tipDialogVisible = false
- this.tipDialogVisibleTwo = false
- this.changeLoadingOne = false
-
- // this.getSchedules();
- this.all_template = response.data.data.items
- console.log('替换数据',response.data.data);
- this.$emit("setTemplate",response.data.data.items)
- if(this.active_name == 'first'){
- this.GetTemplate(response.data.data.items[0])
- }else if(this.active_name == "second"){
- this.GetTemplate(response.data.data.items[1])
- }else if(this.active_name == "third"){
- this.GetTemplate(response.data.data.items[2])
- }else if(this.active_name == "four"){
- this.GetTemplate(response.data.data.items[3])
- }
- }
- });
- },
- // 交换
- changeSchTemplateTwo(){
- let params={
- template_id:this.template.id,
- week_type_one:this.cur_drag_info.schedule_week,
- time_type_one:this.cur_drag_info.schedule_type,
- device_id_one:this.cur_drag_info.id,
- patient_id_one:this.cur_drag_info.patient_id,
-
-
- week_type_two:this.cur_temp_info.schedule_week,
- time_type_two:this.cur_temp_info.schedule_type,
- device_id_two:this.cur_temp_info.id,
- patient_id_two:this.cur_temp_info.patient_id,
-
-
- }
- this.changeLoadingTwo = true
- ExchangeSchTemplate(params).then((response) => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- this.tipDialogVisibleThree = false
- this.changeLoadingTwo = false
-
- } else {
- this.$message.success("交换成功");
- this.tipDialogVisible = false
- this.tipDialogVisibleThree = false
- this.changeLoadingTwo = false
-
- // this.getSchedules();
- this.all_template = response.data.data.items
- this.$emit("setTemplate",response.data.data.items)
- if(this.active_name == 'first'){
- this.GetTemplate(response.data.data.items[0])
- }else if(this.active_name == "second"){
- this.GetTemplate(response.data.data.items[1])
- }else if(this.active_name == "third"){
- this.GetTemplate(response.data.data.items[2])
- }else if(this.active_name == "four"){
- this.GetTemplate(response.data.data.items[3])
- }
-
- }
- });
- },
- // 合并行或列的计算方法
- spanMethod({ row, column, rowIndex, columnIndex }) {
- if (columnIndex == 0) {
- if (rowIndex == 0) {
- rowspanNoControl = -1;
- }
- var spanRowCount = this.zone_device_counts[row.zone_id];
- var isFirstRowInGroup = false;
- if (spanRowCount == undefined) {
- var count = 0;
- for (
- let index = 0;
- index < this.opera_device_numbers.length;
- index++
- ) {
- const number = this.opera_device_numbers[index];
- if (number.zone_id == row.zone_id) {
- count++;
- }
- }
- this.zone_device_counts[row.zone_id] = count;
- spanRowCount = count + 0;
- isFirstRowInGroup = true;
- } else {
- isFirstRowInGroup = rowIndex == rowspanNoControl + 1;
- if (rowspanNoControl + spanRowCount == rowIndex) {
- rowspanNoControl = rowIndex;
- }
- }
-
- if (isFirstRowInGroup) {
- return {
- rowspan: spanRowCount,
- colspan: 1,
- };
- } else
- {
- return {
- rowspan: 0,
- colspan: 0,
- };
- }
- }
- },
- search_two: function () {
- if (this.keywords.length == 0) {
- this.patients = this.all_patients;
- } else {
- this.patients = [];
- for (let i = 0; i < this.all_patients.length; i++) {
- if (
- this.all_patients[i].name.indexOf(this.keywords) != -1 ||
- this.all_patients[i].dialysis_no.indexOf(this.keywords) != -1
- ) {
- this.patients.push(this.all_patients[i]);
- }
- }
-
- if (this.patients.length > 0) {
- this.cur_info.patient_name = this.patients[0].name;
- this.cur_info.mode_name = this.modes[0].name;
- this.cur_info.patient_id = this.patients[0].id;
- this.cur_info.mode_id = this.modes[0].id;
- this.$refs.patient_table.setCurrentRow(this.patients[0]);
- this.$refs.mode_table.setCurrentRow(this.modes[0]);
- }
- }
- },
- search: function () {
- const params = {
- keywords: this.keywords,
- template_id: this.template.id,
- };
- getTemplateScheduleSearchResult(params).then((response) => {
- if (response.data.state == 1) {
- this.schedulePatients = response.data.data.schdules;
- console.log(this.schedulePatients);
- this.searchTableVisible = true;
- }
- });
- },
- //单击
- itemClick: function (row, column, cell, event) {
- console.log('itemClick的数据',row[column.property]);
- if(row[column.property].pid >0 ){
- this.cur_info.patient_id=row[column.property].pid
- this.cur_info.mode_id=row[column.property].treat_mode_id
- this.patient_id_hover = this.cur_info.patient_id;
- this.cur_info.patient_name = row[column.property].name
- this.cur_info.mode_name = row[column.property].treat_mode
- console.log('this.patient_id_hover的数据',this.patient_id_hover);
- }else{
- var item = row[column.property]
- var weekday_timetype = column.property.split('_')
- var weekday = weekday_timetype[0]
- var time_type = weekday_timetype[1]
- var device_number_id = row.id
- if (item.pid == 0) {
- this.$refs.selector_dialog_two.show(weekday, time_type, device_number_id,this.patients)
- } else {
- this.$refs.selector_dialog_two.showWith(item.pid, item.treat_mode_id, weekday, time_type, device_number_id,this.patients)
- }
-
- }
- },
- // 双击
- itemdblclick (row, column, cell, event){
- if (
- column.property == undefined ||
- /^[1-7]_[1-3]$/.test(column.property) == false
- ) {
- return;
- }
- if (row[column.property] == undefined) {
- return;
- }
- var item = row[column.property];
- var weekday_timetype = column.property.split("_");
- var weekday = weekday_timetype[0];
- var time_type = weekday_timetype[1];
- var device_number_id = row.id;
- if (item.pid != 0) {
- // this.$refs.selector_dialog.show(weekday, time_type, device_number_id)
- this.$refs.selector_dialog.showWith(
- item.pid,
- item.treat_mode_id,
- weekday,
- time_type,
- device_number_id
- );
- }
- },
- will_add_schedule_actionTwo: function (
- patient_id,
- treat_mode,
- weekday,
- time_type,
- device_number_id,
- t_id
- ) {
- var patient = null;
- console.log(patient_id);
- for (let index = 0; index < this.patientList.length; index++) {
- const p = this.patientList[index];
- console.log(p);
- if (p.id == patient_id) {
- console.log(patient_id);
- console.log(p);
- patient = p;
- break;
- }
- }
- console.log(patient);
-
- if (patient == null) {
- this.smartSaveLoading = false;
- this.$message.error("患者不存在");
- return;
- }
-
- for (let index = 0; index < this.opera_device_numbers.length; index++) {
- const device_number = this.opera_device_numbers[index];
- for (let t_y = 1; t_y <= 3; t_y++) {
- if (device_number[weekday + "_" + t_y].pid == patient_id) {
- // this.$message.error('一天不能存在多个排班')
- // return
- console.log("~~~~~~");
- this.cancel_schedule_action(weekday, t_y, device_number.id);
- }
- }
- }
-
- for (let index = 0; index < this.opera_device_numbers.length; index++) {
- const device_number = this.opera_device_numbers[index];
- if (device_number.id == device_number_id) {
- var isDiseaseSame = false;
- var havePatientDisease = patient.contagions.length > 0;
- if (patient.contagions.length > 0 || device_number.zone.type != 1) {
- if (device_number.zone.type != 1) {
- for (let c_i = 0; c_i < patient.contagions.length; c_i++) {
- const contagion = patient.contagions[c_i];
- if (contagion.disease_id == device_number.zone.type) {
- isDiseaseSame = true;
- }
- }
- }
- } else {
- isDiseaseSame = true;
- }
- // if (isDiseaseSame == false) {
- // // 此患者没有传染病,与此透析机不匹配,确定在此排班吗?
- // // 此患者有传染病,与此透析机不匹配,确定在此排班吗?
- // var msg = havePatientDisease ? '此患者有传染病,与此透析机不匹配,确定在此排班吗?' : '此患者没有传染病,与此透析机不匹配,确定在此排班吗?'
- // this.$confirm(msg, '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
- // .then(() => {
- // this.add_schedule(patient, device_number, treat_mode, weekday, time_type)
- // })
- // } else {
- // console.log("33333333")
- this.add_scheduleTwo(
- patient,
- device_number,
- treat_mode,
- weekday,
- time_type,
- t_id
- );
- // }
- return;
- }
- }
-
- this.$message.error("设备不存在");
- },
- will_add_schedule_action_four: function(patient_id, treat_mode, weekday, time_type, device_number_id) {
- var patient = null
- for (let index = 0; index < this.patients.length; index++) {
- const p = this.patients[index]
- if (p.id == patient_id) {
- patient = p
- break
- }
- }
- if (patient == null) {
- this.$message.error('患者不存在')
- return
- }
-
- for (let index = 0; index < this.opera_device_numbers.length; index++) {
- const device_number = this.opera_device_numbers[index]
- console.log(device_number)
- for (let t_y = 1; t_y <= 3; t_y++) {
- if (t_y == time_type && device_number_id == device_number.id) {
- continue
- }
- if (device_number[weekday + '_' + t_y].pid == patient_id) {
- this.$message.error('同位患者一天内不可有两次排班')
- return
- }
- }
- }
-
- for (let index = 0; index < this.opera_device_numbers.length; index++) {
- const device_number = this.opera_device_numbers[index]
- if (device_number.id == device_number_id) {
- var isDiseaseSame = false
- var havePatientDisease = patient.contagions.length > 0
- if (patient.contagions.length > 0 || device_number.zone.type != 1) {
- if (device_number.zone.type != 1) {
- for (let c_i = 0; c_i < patient.contagions.length; c_i++) {
- const contagion = patient.contagions[c_i]
- if (contagion.disease_id == device_number.zone.type) {
- isDiseaseSame = true
- }
- }
- }
- } else {
- isDiseaseSame = true
- }
- if (isDiseaseSame == false) {
- // 此患者没有传染病,与此透析机不匹配,确定在此排班吗?
- // 此患者有传染病,与此透析机不匹配,确定在此排班吗?
- var msg = havePatientDisease ? '此患者有传染病,与此透析机不匹配,确定在此排班吗?' : '此患者没有传染病,与此透析机不匹配,确定在此排班吗?'
- this.$confirm(msg, '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
- .then(() => {
- // this.add_scheduleTwo(patient, device_number, treat_mode, weekday, time_type)
-
- this.will_add_schedule_action(
- patient.id,
- treat_mode,
- weekday,
- time_type,
- device_number.id,
- 0
- );
- this.saveActionTwo();
- })
- } else {
- // this.add_scheduleTwo(patient, device_number, treat_mode, weekday, time_type)
- this.will_add_schedule_action(
- patient.id,
- treat_mode,
- weekday,
- time_type,
- device_number.id,
- 0
- );
- this.saveActionTwo();
- }
- // this.saveActionTwo()
- this.$refs.selector_dialog_two.hide()
- return
- }
- }
-
- this.$message.error('设备不存在')
- },
- will_add_schedule_action_three: function (
- patient_id,
- treat_mode,
- weekday,
- time_type,
- device_number_id,
- t_id
- ) {
- console.log("111111");
- var patient = null;
- for (let index = 0; index < this.patientList.length; index++) {
- const p = this.patientList[index];
- if (p.id == patient_id) {
- patient = p;
- break;
- }
- }
- if (patient == null) {
- this.$message.error("患者不存在");
- return;
- }
- this.isEdit = true
- for (let index = 0; index < this.opera_device_numbers.length; index++) {
- const device_number = this.opera_device_numbers[index];
- if (device_number.id == device_number_id) {
- var isDiseaseSame = false;
- var havePatientDisease = patient.contagions.length > 0;
- if (patient.contagions.length > 0 || device_number.zone.type != 1) {
- if (device_number.zone.type != 1) {
- for (let c_i = 0; c_i < patient.contagions.length; c_i++) {
- const contagion = patient.contagions[c_i];
- if (contagion.disease_id == device_number.zone.type) {
- isDiseaseSame = true;
- }
- }
- }
- } else {
- isDiseaseSame = true;
- }
- // if (isDiseaseSame == false) {
- // // 此患者没有传染病,与此透析机不匹配,确定在此排班吗?
- // // 此患者有传染病,与此透析机不匹配,确定在此排班吗?
- // var msg = havePatientDisease ? '此患者有传染病,与此透析机不匹配,确定在此排班吗?' : '此患者没有传染病,与此透析机不匹配,确定在此排班吗?'
- // this.$confirm(msg, '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
- // .then(() => {
- // this.add_schedule(patient, device_number, treat_mode, weekday, time_type)
- // })
- // } else {
- // console.log("33333333")
- this.add_scheduleTwo(
- patient,
- device_number,
- treat_mode,
- weekday,
- time_type,
- t_id
- );
- this.saveActionTwo()
- // }
- return;
- }
- }
-
- this.$message.error("设备不存在");
- },
-
- will_add_schedule_action: function (
- patient_id,
- treat_mode,
- weekday,
- time_type,
- device_number_id,
- t_id
- ) {
- console.log("111111");
-
- var patient = null;
- for (let index = 0; index < this.patientList.length; index++) {
- const p = this.patientList[index];
- if (p.id == patient_id) {
- patient = p;
- break;
- }
- }
- if (patient == null) {
- this.$message.error("患者不存在");
- return;
- }
- console.log("22222222");
-
- for (let index = 0; index < this.opera_device_numbers.length; index++) {
- const device_number = this.opera_device_numbers[index];
- for (let t_y = 1; t_y <= 3; t_y++) {
- if (t_y == time_type && device_number_id == device_number.id) {
- continue;
- }
- if (device_number[weekday + "_" + t_y].pid == patient_id) {
- this.$message.error("同位患者一天内不可有两次排班");
- return;
- }
- }
- }
-
- for (let index = 0; index < this.opera_device_numbers.length; index++) {
- const device_number = this.opera_device_numbers[index];
- if (device_number.id == device_number_id) {
- var isDiseaseSame = false;
- var havePatientDisease = patient.contagions.length > 0;
- if (patient.contagions.length > 0 || device_number.zone.type != 1) {
- if (device_number.zone.type != 1) {
- for (let c_i = 0; c_i < patient.contagions.length; c_i++) {
- const contagion = patient.contagions[c_i];
- if (contagion.disease_id == device_number.zone.type) {
- isDiseaseSame = true;
- }
- }
- }
- } else {
- isDiseaseSame = true;
- }
- // if (isDiseaseSame == false) {
- // // 此患者没有传染病,与此透析机不匹配,确定在此排班吗?
- // // 此患者有传染病,与此透析机不匹配,确定在此排班吗?
- // var msg = havePatientDisease ? '此患者有传染病,与此透析机不匹配,确定在此排班吗?' : '此患者没有传染病,与此透析机不匹配,确定在此排班吗?'
- // this.$confirm(msg, '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
- // .then(() => {
- // this.add_schedule(patient, device_number, treat_mode, weekday, time_type)
- // })
- // } else {
- // console.log("33333333")
- this.add_schedule(
- patient,
- device_number,
- treat_mode,
- weekday,
- time_type,
- t_id
- );
- // }
- return;
- }
- }
-
- this.$message.error("设备不存在");
- },
- cancel_schedule_action: function (weekday, time_type, device_number_id) {
-
-
- for (let index = 0; index < this.opera_device_numbers.length; index++) {
- const device_number = this.opera_device_numbers[index];
- if (device_number.id == device_number_id) {
- console.log("````````")
- var item = device_number[weekday + "_" + time_type];
- item.pid = 0;
- item.name = "";
- item.treat_mode_id = 0;
- item.treat_mode = "";
- }
- }
-
- let obj = {
- id: this.template.id,
- data: [],
- data2: [],
- };
- obj.data = this.opera_device_numbers;
- obj.data2 = this.origin_device_numbers;
- this.data.push(obj);
- },
- cancel_schedule_action_two: function (row) {
- let params = {
- id: row.id,
- };
- cancelScheduleTemplate(params).then((response) => {
- if (response.data.state == 1) {
- for (let index = 0; index < this.schedulePatients.length; index++) {
- const sch = this.schedulePatients[index];
- if (sch.id == row.id) {
- this.schedulePatients.splice(index, 1);
- }
- }
-
- for (
- let index = 0;
- index < this.opera_device_numbers.length;
- index++
- ) {
- const device_number = this.opera_device_numbers[index];
- if (device_number.id == row.device_number_id) {
- var item = device_number[row.weekday + "_" + row.time_type];
- item.pid = 0;
- item.name = "";
- item.treat_mode_id = 0;
- item.treat_mode = "";
- }
- }
-
- // this.$emit('cancel_sch')
- }
- });
- },
- add_scheduleTwo: function (
- patient,
- device_number,
- treat_mode,
- weekday,
- time_type,
- t_id
- ) {
- var item = device_number[weekday + "_" + time_type];
- var isNew = item.pid == 0;
- item.pid = patient.id;
- item.name = patient.name;
- item.treat_mode_id = treat_mode;
- item.treat_mode = this.treat_modes[treat_mode].name;
-
- if (isNew) {
- device_number.total += 1;
- }
- if (t_id == 0) {
- let obj = {
- id: this.template.id,
- data: [],
- data2: [],
- };
- obj.data = this.opera_device_numbers;
- obj.data2 = this.origin_device_numbers;
- this.data.push(obj);
- } else {
- let obj = {
- id: t_id,
- data: [],
- data2: [],
- };
- obj.data = this.opera_device_numbers;
- obj.data2 = this.origin_device_numbers;
- this.data.push(obj);
- this.$refs.selector_dialog.hide();
- }
- },
-
- add_schedule: function (
- patient,
- device_number,
- treat_mode,
- weekday,
- time_type,
- t_id
- ) {
- var item = device_number[weekday + "_" + time_type];
- var isNew = item.pid == 0;
- item.pid = patient.id;
- item.name = patient.name;
- item.treat_mode_id = treat_mode;
- item.treat_mode = this.treat_modes[treat_mode].name;
-
- if (isNew) {
- device_number.total += 1;
- }
- if (t_id == 0) {
- let obj = {
- id: this.template.id,
- data: [],
- data2: [],
- };
- obj.data = this.opera_device_numbers;
- obj.data2 = this.origin_device_numbers;
- this.data.push(obj);
- } else {
- let obj = {
- id: t_id,
- data: [],
- data2: [],
- };
- obj.data = this.opera_device_numbers;
- obj.data2 = this.origin_device_numbers;
- this.data.push(obj);
- this.$refs.selector_dialog.hide();
- }
- },
- saveActionFour: function () {
- var add_items = [];
- var del_items = [];
- var change_items = [];
- var weekdays = [1, 2, 3, 4, 5, 6, 7]; // 周一-周日
- var time_types = [1, 2, 3]; // 上下晚
- for (let d_n_i = 0; d_n_i < this.opera_device_numbers.length; d_n_i++) {
- const op_d_n = this.opera_device_numbers[d_n_i];
- const or_d_n = this.origin_device_numbers[d_n_i];
-
- for (let w_i = 0; w_i < weekdays.length; w_i++) {
- const weekday = weekdays[w_i];
- for (let t_i = 0; t_i < time_types.length; t_i++) {
- const time_type = time_types[t_i];
-
- var item_key = weekday + "_" + time_type;
- var op_item = op_d_n[item_key];
- var or_item = or_d_n[item_key];
- if (op_item.pid == 0 && or_item.pid == 0) {
- continue;
- }
- if (
- op_item.pid == or_item.pid &&
- op_item.treat_mode_id == or_item.treat_mode_id
- ) {
- continue;
- }
- if (op_item.pid == 0) {
- del_items.push({
- device_number_id: op_d_n.id,
- weekday: weekday,
- time_type: time_type,
- });
-
- } else if (or_item.pid == 0) {
- console.log(op_item.pid);
- add_items.push({
- device_number_id: op_d_n.id,
- patient_id: op_item.pid,
- mode: op_item.treat_mode_id,
- weekday: weekday,
- time_type: time_type,
- });
-
-
- } else {
- if (
- op_item.pid != or_item.pid ||
- op_item.treat_mode_id != or_item.treat_mode_id
- ) {
- change_items.push({
- device_number_id: op_d_n.id,
- patient_id: op_item.pid,
- mode: op_item.treat_mode_id,
- weekday: weekday,
- time_type: time_type,
- });
- }
- }
- }
- }
- }
- if (
- add_items.length == 0 &&
- del_items.length == 0 &&
- change_items.length == 0
- ) {
-
- } else {
- var res = [];
- for (var i = 0, arrayLen = add_items.length; i < arrayLen; i++) {
- for (var j = 0, resLen = res.length; j < resLen; j++) {
- if (
- add_items[i].weekday === res[j].weekday &&
- add_items[i].patient_id === res[j].patient_id
- ) {
- break;
- }
- }
- // 如果array[i]是唯一的,那么执行完循环,j等于resLen
- if (j === resLen) {
- res.push(add_items[i]);
- }
- }
-
- updateSchedules(
- this.template.id,
- JSON.stringify(res),
- JSON.stringify(del_items),
- JSON.stringify(change_items)
- ).then((rs) => {
- var resp = rs.data;
- if (resp.state == 1) {
- // this.opera_device_numbers = this.origin_device_numbers
- this.all_template = resp.data.items
- this.$emit("setTemplate",resp.data.items)
- this.smartSaveLoading = false;
- } else {
- this.$message.error(resp.msg);
- }
- });
- }
- },
- saveActionTwo: function () {
- var add_items = [];
- var del_items = [];
- var change_items = [];
- var weekdays = [1, 2, 3, 4, 5, 6, 7]; // 周一-周日
- var time_types = [1, 2, 3]; // 上下晚
- for (let d_n_i = 0; d_n_i < this.opera_device_numbers.length; d_n_i++) {
- const op_d_n = this.opera_device_numbers[d_n_i];
- const or_d_n = this.origin_device_numbers[d_n_i];
-
- for (let w_i = 0; w_i < weekdays.length; w_i++) {
- const weekday = weekdays[w_i];
- for (let t_i = 0; t_i < time_types.length; t_i++) {
- const time_type = time_types[t_i];
-
- var item_key = weekday + "_" + time_type;
- var op_item = op_d_n[item_key];
- var or_item = or_d_n[item_key];
- if (op_item.pid == 0 && or_item.pid == 0) {
- continue;
- }
- if (
- op_item.pid == or_item.pid &&
- op_item.treat_mode_id == or_item.treat_mode_id
- ) {
- continue;
- }
- if (op_item.pid == 0) {
- del_items.push({
- device_number_id: op_d_n.id,
- weekday: weekday,
- time_type: time_type,
- });
-
- } else if (or_item.pid == 0) {
- console.log(op_item.pid);
- add_items.push({
- device_number_id: op_d_n.id,
- patient_id: op_item.pid,
- mode: op_item.treat_mode_id,
- weekday: weekday,
- time_type: time_type,
- });
-
-
- } else {
- if (
- op_item.pid != or_item.pid ||
- op_item.treat_mode_id != or_item.treat_mode_id
- ) {
- change_items.push({
- device_number_id: op_d_n.id,
- patient_id: op_item.pid,
- mode: op_item.treat_mode_id,
- weekday: weekday,
- time_type: time_type,
- });
- }
- }
- }
- }
- }
- if (
- add_items.length == 0 &&
- del_items.length == 0 &&
- change_items.length == 0
- ) {
-
- } else {
- var res = [];
- for (var i = 0, arrayLen = add_items.length; i < arrayLen; i++) {
- for (var j = 0, resLen = res.length; j < resLen; j++) {
- if (
- add_items[i].weekday === res[j].weekday &&
- add_items[i].patient_id === res[j].patient_id
- ) {
- break;
- }
- }
- // 如果array[i]是唯一的,那么执行完循环,j等于resLen
- if (j === resLen) {
- res.push(add_items[i]);
- }
- }
-
- updateSchedules(
- this.template.id,
- JSON.stringify(res),
- JSON.stringify(del_items),
- JSON.stringify(change_items)
- ).then((rs) => {
- var resp = rs.data;
- if (resp.state == 1) {
- // this.opera_device_numbers = this.origin_device_numbers
- this.all_template = resp.data.items
- this.$emit("setTemplate",resp.data.items)
- this.smartSaveLoading = false;
- } else {
- this.$message.error(resp.msg);
- }
- });
- }
- },
- saveActionThree: function (val,del_data) {
- updateEditSchedules(
- JSON.stringify(val),
- JSON.stringify(del_data),
- ).then((rs) => {
- var resp = rs.data;
- if (resp.state == 1) {
- this.all_template = resp.data.items
- this.$emit("setTemplate",resp.data.items)
- if(this.active_name == 'first'){
- this.GetTemplate(resp.data.items[0])
- }else if(this.active_name == "second"){
- this.GetTemplate(resp.data.items[1])
- }else if(this.active_name == "third"){
- this.GetTemplate(resp.data.items[2])
- }else if(this.active_name == "four"){
- this.GetTemplate(resp.data.items[3])
- }
- this.smartSaveLoading = false;
- this.smartVisible = false;
- } else {
- this.smartSaveLoading = false;
- this.$message.error(resp.msg);
- }
- });
- },
- saveAction: function () {
- var add_items = [];
- var del_items = [];
- var change_items = [];
- var weekdays = [1, 2, 3, 4, 5, 6, 7]; // 周一-周日
- var time_types = [1, 2, 3]; // 上下晚
- for (let d_n_i = 0; d_n_i < this.opera_device_numbers.length; d_n_i++) {
- const op_d_n = this.opera_device_numbers[d_n_i];
- const or_d_n = this.origin_device_numbers[d_n_i];
-
- for (let w_i = 0; w_i < weekdays.length; w_i++) {
- const weekday = weekdays[w_i];
- for (let t_i = 0; t_i < time_types.length; t_i++) {
- const time_type = time_types[t_i];
-
- var item_key = weekday + "_" + time_type;
- var op_item = op_d_n[item_key];
- var or_item = or_d_n[item_key];
- if (op_item.pid == 0 && or_item.pid == 0) {
- continue;
- }
- if (
- op_item.pid == or_item.pid &&
- op_item.treat_mode_id == or_item.treat_mode_id
- ) {
- continue;
- }
- if (op_item.pid == 0) {
- del_items.push({
- device_number_id: op_d_n.id,
- weekday: weekday,
- time_type: time_type,
- });
-
- } else if (or_item.pid == 0) {
- console.log(op_item.pid);
- add_items.push({
- device_number_id: op_d_n.id,
- patient_id: op_item.pid,
- mode: op_item.treat_mode_id,
- weekday: weekday,
- time_type: time_type,
- });
-
- } else {
- if (
- op_item.pid != or_item.pid ||
- op_item.treat_mode_id != or_item.treat_mode_id
- ) {
- change_items.push({
- device_number_id: op_d_n.id,
- patient_id: op_item.pid,
- mode: op_item.treat_mode_id,
- weekday: weekday,
- time_type: time_type,
- });
- }
- }
- }
- }
- }
-
- var res = [];
- for (var i = 0, arrayLen = add_items.length; i < arrayLen; i++) {
- for (var j = 0, resLen = res.length; j < resLen; j++) {
- if (
- add_items[i].weekday === res[j].weekday &&
- add_items[i].patient_id === res[j].patient_id
- ) {
- break;
- }
- }
- // 如果array[i]是唯一的,那么执行完循环,j等于resLen
- if (j === resLen) {
- res.push(add_items[i]);
- }
- }
-
- updateSchedules(
- this.template.id,
- JSON.stringify(res),
- JSON.stringify(del_items),
- JSON.stringify(change_items)
- ).then((rs) => {
- var resp = rs.data;
- if (resp.state == 1) {
- // this.$message({
- // message: '保存成功',
- // type: 'success'
- // })
- // this.$emit("saveSuccess")
- } else {
- this.$message.error(resp.msg);
- }
- this.saving = false;
- this.is_editing = false;
- });
- },
- // 计算总数
- getSummaries(param) {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 0 || index === 25) {
- sums[index] = "总数";
- return;
- }
- if (index === 1 || index === 24) {
- sums[index] = data.length;
- return;
- }
-
- const values = data.map((item) => item[column.property]);
-
- if (index === 23) {
- sums[index] = values.reduce((prev, curr) => {
- const value = Number(curr);
- if (!isNaN(value)) {
- return prev + curr;
- } else {
- return prev;
- }
- }, 0);
- sums[index];
- return;
- }
-
- sums[index] = values.reduce((prev, curr) => {
- if (typeof curr["treat_mode_id"] === "undefined") {
- return prev;
- }
- const value = Number(curr["treat_mode_id"]);
- if (!isNaN(value) && value > 0) {
- return prev + 1;
- } else {
- return prev;
- }
- }, 0);
- sums[index];
- });
- this.$nextTick(() => {
- this.$refs.table.doLayout();
- });
- // if(this.$store.getters.xt_user.template_info.org_id == 9671 || this.$store.getters.xt_user.template_info.org_id == 0 || this.$store.getters.xt_user.template_info.org_id == 3877 || this.$store.getters.xt_user.template_info.org_id == 10340){
- //表格某列全部数据
- var Mon_M = []
- var Mon_A = []
- var Mon_N = []
-
- var Tue_M =[]
- var Tue_A = []
- var Tue_N = []
-
- var Wed_M = []
- var Wed_A = []
- var Wed_N = []
-
- var Thurs_M = []
- var Thurs_A = []
- var Thurs_N = []
-
- var Fri_M = []
- var Fri_A = []
- var Fri_N = []
-
- var Sat_M = []
- var Sat_A = []
- var Sat_N = []
-
- var Sun_M = []
- var Sun_A = []
- var Sun_N = []
-
- // 操作后数据
- var Mon_M_One= []
- var Mon_A_One = []
- var Mon_N_One = []
-
- var Tue_M_One =[]
- var Tue_A_One = []
- var Tue_N_One = []
-
- var Wed_M_One = []
- var Wed_A_One = []
- var Wed_N_One = []
-
- var Thurs_M_One = []
- var Thurs_A_One = []
- var Thurs_N_One = []
-
- var Fri_M_One = []
- var Fri_A_One = []
- var Fri_N_One = []
-
- var Sat_M_One = []
- var Sat_A_One = []
- var Sat_N_One = []
-
- var Sun_M_One = []
- var Sun_A_One = []
- var Sun_N_One = []
- for(let j in data){
- if(data[j].hasOwnProperty ('1_1') == true){
- Mon_M.push(data[j]['1_1'].treat_mode)
- Mon_M=Mon_M.filter(item=> item && item.trim())//去掉空字符串
- var countNum =Mon_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
-
- }
- for(let x in countNum){
- Mon_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Mon_M_One.length; i < len; i+=29) {
- var strObjcet = Mon_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[2]="总人数:"+ sums[2] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('1_2') == true){
- Mon_A.push(data[j]['1_2'].treat_mode)
- Mon_A=Mon_A.filter(item=> item && item.trim())//去掉空字符串
- var countNum =Mon_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Mon_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Mon_A_One.length; i < len; i+=29) {
- var strObjcet = Mon_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[3]="总人数:"+ sums[3] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('1_3') == true){
- Mon_N.push(data[j]['1_3'].treat_mode)
- Mon_N=Mon_N.filter(item=> item && item.trim())
- var countNum =Mon_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Mon_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Mon_N_One.length; i < len; i+=29) {
- var strObjcet = Mon_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[4]="总人数:"+ sums[4] +"\n"+result
- // 星期二
- for(let j in data){
- if(data[j].hasOwnProperty ('2_1') == true){
- Tue_M.push(data[j]['2_1'].treat_mode)
- Tue_M=Tue_M.filter(item=> item && item.trim())
- var countNum =Tue_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Tue_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Tue_M_One.length; i < len; i+=29) {
- var strObjcet = Tue_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[5]="总人数:"+ sums[5] +"\n"+result
- // var newTue_A
- for(let j in data){
- if(data[j].hasOwnProperty ('2_2') == true){
- Tue_A.push(data[j]['2_2'].treat_mode)
- Tue_A=Tue_A.filter(item=> item && item.trim())
- var countNum =Tue_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Tue_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Tue_A_One.length; i < len; i+=29) {
- var strObjcet = Tue_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[6]="总人数:"+ sums[6] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('2_3') == true){
- Tue_N.push(data[j]['2_2'].treat_mode)
- Tue_N=Tue_N.filter(item=> item && item.trim())
- var countNum =Tue_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Tue_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Tue_N_One.length; i < len; i+=29) {
- var strObjcet = Tue_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[7]="总人数:"+ sums[7] +"\n"+result
- // 星期三
- for(let j in data){
- if(data[j].hasOwnProperty ('3_1') == true){
- Wed_M.push(data[j]['3_1'].treat_mode)
- Wed_M=Wed_M.filter(item=> item && item.trim())
- var countNum =Wed_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Wed_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Wed_M_One.length; i < len; i+=29) {
- var strObjcet = Wed_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[8]="总人数:"+ sums[8] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('3_2') == true){
- Wed_A.push(data[j]['3_2'].treat_mode)
- Wed_A=Wed_A.filter(item=> item && item.trim())
- var countNum =Wed_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Wed_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Wed_A_One.length; i < len; i+=29) {
- var strObjcet = Wed_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[9]="总人数:"+ sums[9] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('3_3') == true){
- Wed_N.push(data[j]['3_3'].treat_mode)
- Wed_N=Wed_N.filter(item=> item && item.trim())
- var countNum =Wed_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Wed_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Wed_N_One.length; i < len; i+=29) {
- var strObjcet = Wed_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[10]="总人数:"+ sums[10] +"\n"+result
- // 星期四
- for(let j in data){
- if(data[j].hasOwnProperty ('4_1') == true){
- Thurs_M.push(data[j]['4_1'].treat_mode)
- Thurs_M=Thurs_M.filter(item=> item && item.trim())
- var countNum =Thurs_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Thurs_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Thurs_M_One.length; i < len; i+=29) {
- var strObjcet = Thurs_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[11]="总人数:"+ sums[11] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('4_2') == true){
- Thurs_A.push(data[j]['4_2'].treat_mode)
- Thurs_A=Thurs_A.filter(item=> item && item.trim())
- var countNum =Thurs_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Thurs_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Thurs_A_One.length; i < len; i+=29) {
- var strObjcet = Thurs_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[12]="总人数:"+ sums[12] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('4_3') == true){
- Thurs_N.push(data[j]['4_3'].treat_mode)
- Thurs_N=Thurs_N.filter(item=> item && item.trim())
- var countNum =Thurs_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Thurs_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Thurs_N_One.length; i < len; i+=29) {
- var strObjcet = Thurs_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[13]="总人数:"+ sums[13] +"\n"+result
- // 星期五
- for(let j in data){
- if(data[j].hasOwnProperty ('5_1') == true){
- Fri_M.push(data[j]['5_1'].treat_mode)
- Fri_M=Fri_M.filter(item=> item && item.trim())
- var countNum =Fri_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Fri_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Fri_M_One.length; i < len; i+=29) {
- var strObjcet = Fri_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[14]="总人数:"+ sums[14] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('5_2') == true){
- Fri_A.push(data[j]['5_2'].treat_mode)
- Fri_A=Fri_A.filter(item=> item && item.trim())
- var countNum =Fri_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Fri_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Fri_A_One.length; i < len; i+=29) {
- var strObjcet = Fri_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[15]="总人数:"+ sums[15] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('5_3') == true){
- Fri_N.push(data[j]['5_3'].treat_mode)
- Fri_N=Fri_N.filter(item=> item && item.trim())
- var countNum =Fri_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Fri_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Fri_N_One.length; i < len; i+=29) {
- var strObjcet = Fri_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[16]="总人数:"+ sums[16] +"\n"+result
- // 星期六
- for(let j in data){
- if(data[j].hasOwnProperty ('6_1') == true){
- Sat_M.push(data[j]['6_1'].treat_mode)
- Sat_M=Sat_M.filter(item=> item && item.trim())
- var countNum =Sat_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Sat_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Sat_M_One.length; i < len; i+=29) {
- var strObjcet = Sat_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[17]="总人数:"+ sums[17] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('6_2') == true){
- Sat_A.push(data[j]['6_2'].treat_mode)
- Sat_A=Sat_A.filter(item=> item && item.trim())
- var countNum =Sat_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Sat_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Sat_A_One.length; i < len; i+=29) {
- var strObjcet = Sat_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[18]="总人数:"+ sums[18] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('6_3') == true){
- Sat_N.push(data[j]['6_3'].treat_mode)
- Sat_N=Sat_N.filter(item=> item && item.trim())
- var countNum =Sat_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Sat_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Sat_N_One.length; i < len; i+=29) {
- var strObjcet = Sat_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[19]="总人数:"+ sums[19] +"\n"+result
- // 星期天
- for(let j in data){
- if(data[j].hasOwnProperty ('7_1') == true){
- Sun_M.push(data[j]['7_1'].treat_mode)
- Sun_M=Sun_M.filter(item=> item && item.trim())
- var countNum =Sun_M.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
- Sun_M_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Sun_M_One.length; i < len; i+=29) {
- var strObjcet = Sun_M_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[20]="总人数:"+ sums[20] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('7_2') == true){
- Sun_A.push(data[j]['7_2'].treat_mode)
- Sun_A=Sun_A.filter(item=> item && item.trim())
- var countNum =Sun_A.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Sun_A_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Sun_A_One.length; i < len; i+=29) {
- var strObjcet = Sun_A_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[21]="总人数:"+ sums[21] +"\n"+result
-
- for(let j in data){
- if(data[j].hasOwnProperty ('7_3') == true){
- Sun_N.push(data[j]['7_3'].treat_mode)
- Sun_N=Sun_N.filter(item=> item && item.trim())
- var countNum =Sun_N.reduce((obj,name)=>{
- if(name in obj){
- obj[name]++
- }else{
- obj[name]=1
- }
- return obj
- },{})
- }
- }
- for(let x in countNum){
-
- Sun_N_One.push(x + ':' + countNum[x]+"\n")
- }
- var result = [];
- for (var i = 0,len = Sun_N_One.length; i < len; i+=29) {
- var strObjcet = Sun_N_One.slice(i, i+29);
- var str = strObjcet.toString();
- str = str.replace(/,/g, " "); //将所有的逗号 替换成空格
- result.push(str);
- }
- sums[22]="总人数:"+ sums[22] +"\n"+result
- // }
-
- return sums;
- },
- // 右侧表格的列回调
- cellClass({row,column, rowIndex, columnIndex}){
- // console.log('cellClass数据',row);
- if(columnIndex==1&&row.zone.type!=1){
- //
- return "table-row-new-class schedule-table-row Infectious_disease";
- }
- if(columnIndex==0 ||columnIndex==1){
- return ''
- }else{
- if(row[column.property].pid >0 &&
- row[column.property].pid == this.patient_id_hover){
- return 'hover-td'
- }
- }
- },
- // 右侧表格的行回调
- rowClass({row,column, rowIndex, columnIndex}){
- if (row.zone.type == 1) {
- return "table-row-new-class schedule-table-row ";
- } else {
- return "table-row-new-class schedule-table-row infectious";
- };
- },
- // 左侧表格的患者回调
- patientclass({row,column, rowIndex, columnIndex}){
- if(this.cur_info.patient_id == row.id){
- return 'highlight';
- }
- },
- // 左侧表格的透析回调
- modeclass({row,column, rowIndex, columnIndex}){
- if(this.cur_info.mode_id == row.id){
- return 'highlight';
- }
- },
- arraySort(property) {
- return function (a, b) {
- var value1 = a[property];
- var value2 = b[property];
- return value1 - value2;
- };
- },
- unique_id(array) {
- // res用来存储结果
- var res = [];
- for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
- for (var j = 0, resLen = res.length; j < resLen; j++) {
- if (array[i] === res[j]) {
- break;
- }
- }
- // 如果array[i]是唯一的,那么执行完循环,j等于resLen
- if (j === resLen) {
- res.push(array[i]);
- }
- }
- return res;
- },
- },
- };
- </script>
-
- <style lang="scss">
- .table_contain {
- display: flex;
-
- .left_contain {
- width: 14%;
- margin-right: 50px;
- .highlight{
- background-color: #ecf5ff !important;
- color: #3a8ee6 !important;
- }
- .item_touz{
- width: 115px;
- padding: 6px 5px;
- margin: 0px 5px ;
- // border: solid 1px #eee;
- text-align: left;
- }
- }
-
- .right_contain {
- width: 83%;
- .el-table td .cell{
- text-align: center !important;
- white-space: pre-wrap;
- padding: 0 0px !important;
- }
- .Infectious_disease{
- background-color: red !important;
- color: white;
- }
- .el-table--medium td, .el-table--medium th {
- padding: 5px 0 !important;
- }
- .del_table_btn{
- position: absolute;
- right: 0px;
- top: -3px;
- visibility: hidden;
- .el-button {
- width: 15px;
- height: 15px;
- padding: 0px;
- }
- }
- }
-
- // .el-table th .cell, .el-table td .cell {
- // margin: 0;
- // padding: 0 0px;
- // }
- // .el-table--medium td, .el-table--medium th {
- // padding: 5px 0 !important;
- // }
- }
- .temtable_contain{
- margin-top: 30px !important;
- }
- .infectious{
- color: red !important;
- }
- .schedule-table-row {
- background: #fff !important;
- }
- .schedule-table-row:hover {
- background: #fff !important;
- }
-
- .schedule-table-row td:hover {
- background: rgb(88, 162, 236) !important;
- }
-
- .schedule-table-row td .cell {
- font-size: 12px;
- white-space: normal !important;
- }
-
- #tem_table_data {
- /*min-height: calc(100vh - 350px);*/
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- overflow: auto;
- margin: 0;
- background: #fff;
- padding: 20px;
- z-index:2000;
- height: 100%;
- }
-
- #tem_table_data ::-webkit-scrollbar {
- height: 15px;
- }
-
- #tem_table_data {
- .el-table__body tr.current-row > td {
- background-color: #ecf5ff !important;
- color: #3a8ee6;
- }
-
- .el-table__body tr > td:hover {
- background-color: #409eff !important;
- color: #fff;
-
- .del_table_btn {
- visibility: visible;
- }
- }
- .el-table__body tr .hover-td {
- background-color: #409eff !important;
- color: #fff;
- }
- }
-
- // #table_data {
- // min-height: calc(100vh - 350px);
- // }
-
- #tem_table_data ::-webkit-scrollbar {
- height: 15px;
- }
-
- // .del_table_btn {
- // position: absolute;
- // right: 0px;
- // top: -3px;
- // z-index: 999;
- // visibility: hidden;
-
- // .el-button {
- // width: 15px;
- // height: 15px;
- // padding: 0px;
- // }
- // }
-
- #tem_table_data {
- min-height: calc(100vh - 350px);
- }
-
- #tem_table_data ::-webkit-scrollbar {
- height: 15px;
- }
-
- .el-table td,
- .el-table th.is-leaf,
- .el-table--border,
- .el-table--group {
- border-color: #d0d3da;
- }
-
- .el-table--border::after,
- .el-table--group::after,
- .el-table::before {
- background-color: #d0d3da;
- }
-
- .el-table--border th {
- border-color: #d0d3da;
- }
-
- .el-table--border td {
- border-color: #d0d3da;
- }
-
- .el-table td {
- border-color: #d0d3da;
- }
-
- .select_list_arrage {
- width: 105px !important;
- }
-
- .checkSearch {
- position: absolute;
- top: 25px;
- right: 120px;
- }
-
- .el-dialog__wrapper {
- .el-dialog {
- /deep/ .el-dialog__header {
- background: #3a8ee6;
- padding: 0px;
- padding: 0 !important;
- }
- }
- }
-
- // .el-dialog__header {
- // padding: 0 !important;
- // }
- </style>
|