12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335 |
- <template>
- <div id="table_data">
- <div class="cell clearfix" >
- <span>选择周次:</span>
- <el-date-picker
- v-model="weekTime"
- type="week"
- format="第 WW 周"
- placeholder="选择周"
- :picker-options="{'firstDayOfWeek': 1}"
- @change="changeWeek"
- :clearable="false"
- >
- <!-- "{'firstDayOfWeek': 1}" -->
- </el-date-picker>
- </div>
- <!-- -->
- <el-dialog :visible.sync="searchTableVisible" width="80%">
- <el-table
- :data="schedulePatients"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- :row-style="{ color: '#303133' }"
- style="width: 100%"
- border
- >
- <el-table-column label="姓名" width="120">
- <template slot-scope="scope">
- {{ scope.row.patient }}
- </template>
- </el-table-column>
- <el-table-column label="透析日期" width="200">
- <template slot-scope="scope">
- {{ getDialysisDate(scope.row) }}
- </template>
- </el-table-column>
- <el-table-column label="分区">
- <template slot-scope="scope">
- {{ scope.row.zone.name }}
- </template>
- </el-table-column>
- <el-table-column label="班次" width="80">
- <template slot-scope="scope">
- {{ getSchedulesType(scope.row.schedule_type,scope.row) }}
- </template>
- </el-table-column>
- <el-table-column label="机号" width="80">
- <template slot-scope="scope">
- {{ scope.row.number.number }}
- </template>
- </el-table-column>
- <el-table-column label="透析模式" width="100">
- <template slot-scope="scope">
- {{ scope.row.mode.name }}
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" width="300">
- <template slot-scope="scope">
- <span v-if="now_time <=scope.row.schedule_date">
- <el-button
- size="mini"
- type="primary"
- @click="CancelSchedule(scope.row.id)"
- >
- 取消排班
- </el-button>
- <el-button
- size="mini"
- type="primary"
- @click="changeMachineNumber(scope.$index, scope.row)"
- >
- 调整机号
- </el-button>
- <el-button
- size="mini"
- type="primary"
- @click="changeMode(scope.$index, scope.row)"
- >
- 调整模式
- </el-button>
- </span>
-
- </template>
- </el-table-column>
- </el-table>
- </el-dialog>
-
- <div class="center-tab">
- <el-table
- :row-style="{ color: '#303133' }"
- :header-cell-style="{
- backgroundColor: 'rgb(245, 247, 250)',
- color: '#606266'
- }"
- :fit="true"
- :data="scheduleZone"
- :span-method="objectSpanMethod"
- @cell-click="clickThis"
-
- :summary-method="getSummaries"
- show-summary
- :row-class-name="tableRowClassName"
- :cell-class-name="cellClass"
- sum-text="总数"
- :height="tableContainHeight"
- ref="table"
- style="table-layout: fixed;"
- >
- <!-- @cell-mouse-enter="hoverMouse" -->
- <el-table-column
- prop="area"
- label="分区"
- width="50"
- align="center"
- fixed
- ></el-table-column>
- <el-table-column
- prop="cut"
- label="机号"
- align="center"
- min-width="40"
- fixed
- ></el-table-column>
- <el-table-column
- :label="' 周一(' + weekTitle[0] + ')'"
- v-if="isShowOne"
- align="center"
- >
- <el-table-column prop="Mon_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Mon_M"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Mon_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Mon_A"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Mon_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Mon_N"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周二 (' + weekTitle[1] + ')'"
- min-width="120"
- v-if="isShowTwo"
- align="center"
- :fit="true"
- >
- <el-table-column prop="Tue_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Tue_M"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Tue_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Tue_A"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Tue_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Tue_N"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周三 (' + weekTitle[2] + ')'"
- v-if="isShowThree"
- align="center"
- >
- <el-table-column prop="Wed_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Wed_M"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Wed_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Wed_A"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Wed_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
- <schedule-item
- slot-scope="scope"
- :config="config"
- :schedulFlag="value1"
- :schedule-detail="scope.row.Wed_N"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周四 (' + weekTitle[3] + ')'"
- align="center"
- v-if="isShowFour"
-
- >
- <el-table-column prop="Thurs_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
- <schedule-item
- slot-scope="scope"
- :config="config"
- :schedule-detail="scope.row.Thurs_M"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Thurs_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Thurs_A"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Thurs_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Thurs_N"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周五 (' + weekTitle[4] + ')'"
-
- align="center"
- v-if="isShowFive"
-
- >
- <el-table-column prop="Fri_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Fri_M"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Fri_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Fri_A"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Fri_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Fri_N"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周六 (' + weekTitle[5] + ')'"
-
- align="center"
- v-if="isShowSix"
-
- >
- <el-table-column prop="Sat_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Sat_M"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Sat_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Sat_A"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Sat_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Sat_N"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- </el-table-column>
- <el-table-column
- :label="'周日 (' + weekTitle[6] + ')'"
-
- align="center"
- v-if="isShowSeven"
-
- >
- <el-table-column prop="Sun_M" label="上" min-width="40" align="center" v-if="isShowShangWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Sun_M"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Sun_A" label="下" min-width="40" align="center" v-if="isShowXiaWu">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Sun_A"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- ></schedule-item>
- </el-table-column>
- <el-table-column prop="Sun_N" label="晚" min-width="40" align="center" v-if="isShowWanShang">
- <schedule-item
- slot-scope="scope"
- :schedule-detail="scope.row.Sun_N"
- :config="config"
- :schedulFlag="value1"
- :schedulMode="modename_value"
- >
- <!-- -->
- </schedule-item>
- </el-table-column>
- </el-table-column>
- </el-table>
- </div>
-
- <!-- 调整模式 -->
- <el-dialog
- title="调整模式"
- :visible.sync="msDialogVisible"
- width="500px"
- v-loading="changing_mode"
- :modal-append-to-body='false'
- :close-on-click-modal="false"
- >
- <div>
- <el-form
- :model="changeSchedule"
- ref="changeSchedule"
- :rules="changeRules"
- >
- <el-form-item label="" prop="mode_id">
- <el-select
- v-model="changeSchedule.mode_id"
- placeholder="请选择"
- style="width: 100%"
- >
- <el-option
- :disabled="item.id == currentData.mode_id"
- v-for="item in modeOptions"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="msDialogVisible = false">取 消</el-button>
- <el-button
- :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
- type="primary"
- @click="submitMode('changeSchedule')"
- >保 存</el-button
- >
- </span>
- </el-dialog>
-
- <!--调整机号 -->
- <el-dialog
- title="调整机号"
- :visible.sync="jhDialogVisible"
- width="500px"
- v-loading="changing_bed"
- :modal-append-to-body='false'
- :close-on-click-modal="false"
- >
- <div>
- <el-form
- :model="changeSchedule"
- ref="changeSchedule"
- :rules="changeRules"
- label-width="90px"
-
- >
- <el-form-item label="排班日期: ">
- <el-input v-model="currentData.schedule_date" disabled></el-input>
- </el-form-item>
- <el-form-item label="班次: " prop="schedule_type">
- <el-select
- v-model="changeSchedule.schedule_type"
- placeholder="请选择"
- style="width: 100%"
- @change="changeScheduleType"
- >
- <el-option
- v-for="item in scheduleType"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="分区: " prop="partition_id">
- <el-select
- v-model="changeSchedule.partition_id"
- placeholder="请选择"
- style="width: 100%"
- @change="changePartition"
- >
- <el-option
- v-for="(item, index) in zones"
- :key="index"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="透析机: " prop="bed_id">
- <el-select
- v-model="device_id"
- placeholder="请选择"
- style="width: 100%"
- >
- <el-option
- v-for="item in current_devices"
- :key="item.id"
- :label="item.number"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="jhDialogVisible = false">取 消</el-button>
- <el-button
- :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
- type="primary"
- @click="submitTiaoZJH('changeSchedule')"
- >保 存</el-button>
- <!-- -->
- </span>
- </el-dialog>
- </div>
- </template>
-
- <script>
- import { uParseTime } from "@/utils/tools";
- import print from 'print-js'
- const moment = require('moment')
- import {
- CancelSchedule,
- ChangeSchedule,
- CreateSchedule,
- getSchedulePatients,
- getSchedulesOne,
- getSearchResult,
- getUrgentScheduleInitData,
- getWeekPanelsOne,
- getAllZones,
- getSchedules
- } from "@/api/schedule";
- import {
- getSmartDevices
- } from "@/api/schedule_template/sch_template";
-
- import ScheduleItem from "./ScheduleItem";
- const weekOptions = ['周一','周二','周三','周四','周五','周六','周日'];
- let rowNumber = 0;
- export default {
- name: "tableData",
- props: {
- is_edit:{
- type: Boolean,
- default: false,
-
- },
- // weekTime: {
- // type: String,
- // default: "thisWeek"
- // },
- // 机号数
- scheduleZoneRowProp: {
- type: Array,
- dafault: []
- },
- // 分区
- // partitionsProp: {
- // type: Object,
- // dafault: {}
- // },
- config: {
- type: Object,
- dafault: {}
- },
-
- },
- data() {
- return {
- // 禁选当前之后的日期
- // pickerBeginDateBefore: {
- // disabledDate(time) {
- // return time.getTime() > Date.now();
- // }
- // },
- tableContainHeight:null,
- value1:false,
- modename_value:true,
- weeks:weekOptions,
- searchKey: "",
- tiaoZhengType: 1,
- weekTime:"historyWeek",
- modeOptions: null,
- keywords: "",
- schedulePatients: [],
- searchTableVisible: false,
- patients: [],
- toDay: "",
- schedulArr: [
- { value: 0, label: "不限" },
- { value: 2, label: "未排班" },
- { value: 1, label: "已排班" }
- ],
- tagArr: [
- { value: 1, label: "不限" },
- { value: 2, label: "透析记录" },
- { value: 3, label: "传染病" }
- ],
- diseasesArr: [{ value: 0, label: "不限" }],
- scheduleType: [
- { id: 1, name: "上午" },
- { id: 2, name: "下午" },
- { id: 3, name: "晚上" }
- ],
- // dialogTableVisible: false,
- tzDialogVisible: false,
- msDialogVisible: false,
- jhDialogVisible: false,
- // scheduleZone: this.scheduleZoneProp,
- scheduleZoneRow: -1,
- partitions: [],
- jihaos: [],
- weekTitle: ["", "", "", "", "", "", ""],
- weekList: ["", "", "", "", "", "", ""],
- weekDays: ["", "", "", "", "", "", ""],
- currentData: {
- id: 0,
- schedule_date: "",
- schedule_type: 0,
- bed_id: 0,
- partition_id: 0,
- patient_id: 0,
- schedule_week: 0,
- mode_id: 0,
- type_name: "",
- bed_name: "",
-
- partition_type: 0,
- contagions: [],
- patient: ""
- },
- changeSchedule: {
- mode_id: "",
- schedule_type: "",
- partition_id: "",
- bed_id: "",
- schedule_week: "",
- partition_type: ""
- },
- patientQuery: {
- keywords: "",
- schedule: 0,
- contagion: 0
- },
- start_time:'',//开始时间
- end_time:'',//结束时间
- lastweek:{},//上两周的第一天和最后一天
- tiaozhengclass: "tiaozhengclass",
- changeRules: {
- mode_id: [{ required: true, message: "请选择模式", trigger: "blur" }],
- schedule_type: [
- { required: true, message: "请选择班次", trigger: "blur" }
- ],
- partition_id: [
- { required: true, message: "请选择病房", trigger: "blur" }
- ],
- bed_id: [{ required: true, message: "请选择透析机", trigger: "blur" }]
- },
-
- weekday: 0,
-
- creating_schedule: false,
- changing_mode: false,
- changing_bed: false,
-
- tableHeight: document.documentElement.clientHeight,
-
- origin_schedules: [],
- origin_device_numbers: [],
- zone_device_map: {},
- device_id: 0,
- zone_name: "",
- current_devices: [],
- zone_names: [],
- zone_device_options: [],
- options:[
- {id:1,name:"上午"},
- {id:2,name:"下午"},
- {id:3,name:"晚上"},
- ],
- partition_id:0,
- schedule_type:[],
- week_type:[],
- zones:[],
- theType:"",
- scheduleZone:[],
- source_scheduleZone:[],
- theWeek: {
- historyWeek:0,
- lastWeek: 0,
- thisWeek: 0,
- nextWeek: 0,
- nextTwoWeek: 0
- },
- zoneIdList:[],
- strArr:"",
- patient_id_hover:0,
- now_time:"",
- isShowOne:true,
- isShowTwo:true,
- isShowThree:true,
- isShowFour:true,
- isShowFive:true,
- isShowSix:true,
- isShowSeven:true,
- isShowShangWu:true,
- isShowXiaWu:true,
- isShowWanShang:true,
- // schedulesGroup:[]
- };
- },
-
- watch: {
- schedule_type:function (){
- this.isShowShangWu = false
- this.isShowXiaWu = false
- this.isShowWanShang = false
- if(this.schedule_type.length > 0) {
- for (let i = 0; i < this.schedule_type.length; i++) {
- if (this.schedule_type[i] == 1) {
- this.isShowShangWu = true
- } else if (this.schedule_type[i] == 2) {
- this.isShowXiaWu = true
- } else if (this.schedule_type[i] == 3) {
- this.isShowWanShang = true
- }
- }
- }else{
- this.isShowShangWu = true
- this.isShowXiaWu = true
- this.isShowWanShang = true
- }
-
- },
- week_type:function () {
-
- this.isShowOne = false
- this.isShowTwo = false
- this.isShowThree = false
- this.isShowFour = false
- this.isShowFive = false
- this.isShowSix = false
- this.isShowSeven = false
- if(this.week_type.length > 0) {
- for (let i = 0; i < this.week_type.length; i++) {
- if (this.week_type[i] == "周一") {
- this.isShowOne = true
- } else if (this.week_type[i] == "周二") {
- this.isShowTwo = true
- } else if (this.week_type[i] == "周三") {
- this.isShowThree = true
- } else if (this.week_type[i] == "周四") {
- this.isShowFour = true
- } else if (this.week_type[i] == "周五") {
- this.isShowFive = true
- } else if (this.week_type[i] == "周六") {
- this.isShowSix = true
- } else if (this.week_type[i] == "周日") {
- this.isShowSeven = true
- }
- }
- }else{
- this.isShowOne = true
- this.isShowTwo = true
- this.isShowThree = true
- this.isShowFour = true
- this.isShowFive = true
- this.isShowSix = true
- this.isShowSeven = true
- }
- },
- weekTime: function() {
- var theType = this.weekType(this.weekTime);
- // console.log("999999999",theType)
- this.theType = theType
- this.getSchedules()
- },
- scheduleZoneRow: function() {
- var theType = this.weekType(this.weekTime);
- this.theType = theType
- this.getSchedules()
- },
- tableHeight(val) {
- if (!this.timer) {
- this.tableHeight = val;
- this.timer = true;
- const that = this;
- setTimeout(function() {
- that.timer = false;
- }, 400);
- }
- }
- },
- created() {
- // sessionStorage.setItem('value1',!this.value1);
- sessionStorage.removeItem('value1')
- var date = new Date()
- this.time = date
- var year = date.getFullYear()
- var month = date.getMonth() + 1
- if (month < 10) {
- month = "0" + month
- }
- var day = date.getDate()
- if (day < 10) {
- day = "0" + day
- }
- var nowDate = year + "-" + month + "-" + day
- var date = new Date(nowDate + " 00:00:00")
-
- this.now_time = date.getTime()/1000
- this.getAllZones()
-
- this.changeScheduleType(1)
- rowNumber = 0;
- this.modeOptions = this.$store.getters.treatment_mode;
-
- // this.partitions = this.partitionsProp;
-
-
- var contagions = this.$store.getters.contagions;
- if (contagions.length > 0) {
- var that = this;
- contagions.forEach(function(citem) {
- if (citem.type == 2) {
- that.diseasesArr.push({ value: citem.id, label: citem.name });
- }
- });
- }
-
- this.scheduleZoneRow = this.scheduleZoneRowProp;
-
-
- this.weekday = new Date().getDay();
- if (this.weekday == 0) {
- this.weekday = 7;
- }
-
- },
- methods: {
-
- getData(){
- return this.scheduleZone
- },
- compare(p){ //这是比较函数
- return function(m,n){
- var a = m[p];
- var b = n[p];
- return a - b; //升序
- }
- },
- getWeekPanels() {
- this.scheduleZone=[]
- var partionStr = this.partition_id
- var arr = this.zoneIdList.join(',')
-
- var str = ""
- if(partionStr == 0){
- str = arr
- }
- if(partionStr != 0){
- str = partionStr.join(',')
- }
- // 第几周,星期几
- getWeekPanelsOne(1,str).then(response => {
- // console.log('wertwetr',response.data.data);
- if (response.data.state == 0) {
- return false
- }
- var partitions = response.data.data.partitions
- this.theWeek.thisWeek = response.data.data.theWeek
- this.theWeek.historyWeek = this.theWeek.thisWeek -2
- this.theWeek.lastWeek = this.theWeek.thisWeek - 1
- this.theWeek.nextWeek = this.theWeek.thisWeek + 1
- this.theWeek.nextTwoWeek = this.theWeek.thisWeek + 2
- var that = this
- if (partitions.length > 0) {
- partitions.forEach(function(partition) {
- if (partition.jihaos.length == 0) {
- return false
- }
- that.scheduleZoneRow.push(partition.jihaos.length)
-
- that.partitions[partition.id] = partition
-
- partition.jihaos.forEach(function(jihao) {
- var thisPa = {
- area: partition.name,
- zone_id: partition.id,
- zone_type: partition.type,
- cut: jihao.number,
- jihao_id: jihao.id,
- sort:jihao.sort,
-
- Mon_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Mon_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Mon_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Tue_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Tue_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Tue_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Wed_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Wed_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Wed_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Thurs_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Thurs_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Thurs_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Fri_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Fri_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Fri_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Sat_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Sat_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Sat_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Sun_A: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Sun_N: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- Sun_M: {
- schedule_id: 0,
- mode_id: 0,
- mode_name: '',
- patient_id: 0,
- patient: '',
- dialysis_machine_name:'',
- schedule_date:"",
- Count:0,
- },
- total: 0
- }
-
- that.scheduleZone.push(thisPa)
-
- })
- })
- }
-
- this.scheduleZone.sort(this.compare('sort'))
- this.source_scheduleZone = this.scheduleZone
- // console.log("34455555566666",this.source_scheduleZone)
- this.getSchedules()
- })
- },
-
- cellClass({ row, column, rowIndex, columnIndex }) {
-
- if(columnIndex==1&&row.zone_type!=1){
- // console.log(columnIndex,row.zone_type);
- return "table-row-new-class schedule-table-row Infectious_disease";
- }
-
- if (columnIndex == 0 || columnIndex == 1 || columnIndex == 23) {
- return "";
- } else {
- if (this.weekTime == "lastWeek") {
- if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
- return 'hover-td schedule-table-cell-disable'
- }else {
- return 'schedule-table-cell-disable'
- }
- // return "schedule-table-cell-disable";
- } else if (this.weekTime == "thisWeek") {
- var weekday = Math.floor((columnIndex - 2) / 3 + 1);
- if (weekday < this.weekday) {
- if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
- return 'hover-td schedule-table-cell-disable'
- }else {
- return 'schedule-table-cell-disable'
- }
- // return "schedule-table-cell-disable";
- }else {
- if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
- return 'hover-td '
- }else {
- return ''
- }
- }
- }else if(this.weekTime == "historyWeek"){
- return 'schedule-table-cell-disable'
- }
- }
- return "";
- },
- // SubmitSearch() {
- // this.patientQuery.keywords = this.searchKey;
- // this.getSchedulePatients();
- // },
- changeSearchContagion(id) {
- this.patientQuery.contagion = id;
- this.getSchedulePatients();
- },
- // changeSearchSchedule(id) {
- // this.patientQuery.schedule = id;
- // this.getSchedulePatients();
- // },
- getSummaries(param) {
- const { columns, data } = param;
- const sums = [];
- columns.forEach((column, index) => {
- if (index === 0 ) {
- sums[index] = "总数";
- return;
- }
- if (index === 1 ) {
- sums[index] = data.length;
- return;
- }
-
- const values = data.map(item => item[column.property]);
-
- sums[index] = values.reduce((prev, curr) => {
- if (typeof curr["mode_id"] === "undefined") {
- return prev;
- }
- const value = Number(curr["mode_id"]);
- if (!isNaN(value) && value > 0) {
- return prev + 1;
- } else {
- return prev;
- }
- }, 0);
- sums[index];
- });
- this.$nextTick(() => {
- this.$refs.table.doLayout();
- });
-
-
- //表格某列全部数据
- 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 ('Mon_A') == true){
- Mon_A.push(data[j].Mon_A.mode_name)
- 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 ('Mon_M') == true){
- Mon_M.push(data[j].Mon_M.mode_name)
- 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){
- // console.log(x);
- 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 ('Mon_N') == true){
- Mon_N.push(data[j].Mon_N.mode_name)
- 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 ('Tue_M') == true){
- Tue_M.push(data[j].Tue_M.mode_name)
- 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 ('Tue_A') == true){
- Tue_A.push(data[j].Tue_A.mode_name)
- 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 ('Tue_N') == true){
- Tue_N.push(data[j].Tue_N.mode_name)
- 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 ('Wed_M') == true){
- Wed_M.push(data[j].Wed_M.mode_name)
- 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 ('Wed_A') == true){
- Wed_A.push(data[j].Wed_A.mode_name)
- 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 ('Wed_N') == true){
- Wed_N.push(data[j].Wed_N.mode_name)
- 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 ('Thurs_M') == true){
- Thurs_M.push(data[j].Thurs_M.mode_name)
- 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 ('Thurs_A') == true){
- Thurs_A.push(data[j].Thurs_A.mode_name)
- 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 ('Thurs_N') == true){
- Thurs_N.push(data[j].Thurs_N.mode_name)
- 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 ('Fri_M') == true){
- Fri_M.push(data[j].Fri_M.mode_name)
- 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 ('Fri_A') == true){
- Fri_A.push(data[j].Fri_A.mode_name)
- 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 ('Fri_N') == true){
- Fri_N.push(data[j].Fri_N.mode_name)
- 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 ('Sat_M') == true){
- Sat_M.push(data[j].Sat_M.mode_name)
- 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 ('Sat_A') == true){
- Sat_A.push(data[j].Sat_A.mode_name)
- 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 ('Sat_N') == true){
- Sat_N.push(data[j].Sat_N.mode_name)
- 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 ('Sun_M') == true){
- Sun_M.push(data[j].Sun_M.mode_name)
- 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 ('Sun_A') == true){
- Sun_A.push(data[j].Sun_A.mode_name)
- 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 ('Sun_N') == true){
- Sun_N.push(data[j].Sun_N.mode_name)
- 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;
-
- },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
-
- var that = this;
- var rowNum = 0;
- rowNumber = 0;
- var rutrnData = {};
- if (columnIndex === 0) {
- var rowLen = this.scheduleZoneRow.length;
- if (rowLen > 0) {
- for (let index = 0; index < rowLen; index++) {
- rowNum = this.scheduleZoneRow[index];
- rowNumber += rowNum;
- var f = rowNumber - rowNum;
- if (f == rowIndex) {
- rutrnData = {
- rowspan: rowNum,
- colspan: 1
- };
- break;
- } else if (rowIndex < rowNumber) {
- rutrnData = {
- rowspan: 0,
- colspan: 0
- };
- break;
- }
- }
- return rutrnData;
- }
- }
- },
- handleCurrentChange(row) {
- if (typeof row === "undefined" || row == null) {
- this.currentData.patient_id = 0;
- this.currentData.contagions = [];
- } else {
- this.currentData.patient_id = row.id;
- this.currentData.contagions = row.contagions;
- }
- },
- closePatientPanel(row) {
- this.dialogTableVisible = false;
- this.$refs.singleTable.setCurrentRow(row);
- this.currentData.patient_id = 0;
- },
-
- getSchedulePatients() {
- getSchedulePatients(this.patientQuery).then(response => {
- if (response.data.state == 1) {
- this.patients = response.data.data.patients;
- }
- });
- },
- // 搜索弹窗操作取消排班
- CancelSchedule(id) {
- this.$confirm("确定要取消当前排班?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- CancelSchedule(id).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- this.$message({
- type: "success",
- message: "排班已取消!"
- });
- var that = this;
- var schedule = response.data.data.schedule;
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: 0,
- mode_id: 0,
- patient_id: 0,
- patient: "",
- mode_name: "",
- dialysis_machine_name: '',
- };
-
- that.scheduleZone[index].total -= 1;
- }
- }
- });
- this.tzDialogVisible = false;
- this.searchTableVisible = false;
- }
- });
- })
- .catch(() => { });
- },
- // 搜索修改机号成功
- changeScheduleActon(formName) {
- this.changing_bed = true;
- ChangeSchedule(this.currentData.id, this.changeSchedule)
- .then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- this.$message({
- type: "success",
- message: "修改成功!"
- });
- var that = this;
- var schedule = response.data.data.schedule;
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: schedule.id,
- mode_id: schedule.mode_id,
- patient_id: schedule.patient_id,
- patient: that.currentData.patient,
-
-
- dialysis_machine_name: schedule.dialysis_machine_name,
-
- patient_contagions: that.currentData.contagions,
- mode_name:
- typeof that.modeOptions[schedule.mode_id] === "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name
- };
-
- that.scheduleZone[index].total += 1;
- }
- }
- if (
- zone.zone_id == that.currentData.partition_id &&
- zone.jihao_id == that.currentData.bed_id
- ) {
- var weekPath = that.weekPath(
- that.currentData.schedule_week,
- that.currentData.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: 0,
- mode_id: 0,
- patient_id: 0,
- patient: "",
- mode_name: "",
- dialysis_machine_name: "",
- patient_contagions: []
- };
-
- that.scheduleZone[index].total -= 1;
- }
- }
- });
- this.$refs[formName].resetFields();
- this.jhDialogVisible = false;
- }
- this.changing_bed = false;
- })
- .catch(err => {
- this.$message.error(err);
- this.changing_bed = false;
- });
- },
- CreateSchedule(id, data) {
- this.creating_schedule = true;
- CreateSchedule(id, data)
- .then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- this.$message({
- type: "success",
- message: "排班成功!"
- });
- var that = this;
- var schedule = response.data.data.schedule;
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: schedule.id,
- mode_id: schedule.mode_id,
- patient_id: schedule.patient_id,
- patient: schedule.patient,
- dialysis_machine_name: schedule.dialysis_machine_name,
- patient_contagions: that.currentData.contagions,
- mode_name:
- typeof that.modeOptions[schedule.mode_id] === "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name
- };
- that.scheduleZone[index].total += 1;
- }
- }
- });
- this.closePatientPanel();
- }
- this.creating_schedule = false;
- })
- .catch(err => {
- this.$message.error(err);
- this.creating_schedule = false;
- });
- },
- // hoverMouse(row, column, cell, event) {
- // if (row[column.property].schedule_id > 0) {
- // let patient_id = row[column.property].patient_id
- // this.patient_id_hover = patient_id
- // } else {
- // this.patient_id_hover = -1
- // }
- // },
- clickThis(row, column, cell, event) {
- if (!this.is_edit) {
- this.$message.error("当前页面不可编辑");
- return
- }
- // debugger
- var week = this.weekDay(column.property);
-
- if (week[0] == -1 || week[1] == -1) {
- return false;
- }
- if (this.toDay > this.weekDays[week[0] - 1]) {
- return false;
- }
-
- 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 (row[column.property].schedule_id > 0) {
- this.currentData.mode_id = row[column.property].mode_id;
- this.currentData.id = row[column.property].schedule_id;
- this.currentData.patient_id = row[column.property].patient_id;
- this.currentData.patient = row[column.property].patient;
- this.currentData.contagions = row[column.property].patient_contagions;
- this.tiaoZhengType = 1;
- this.tzDialogVisible = true;
- } else {
- this.currentData.mode_id = 1;
- this.currentData.id = 0;
- this.currentData.patient_id = 0;
- this.currentData.patient = "";
- this.currentData.contagions = [];
- this.getSchedulePatients();
- this.dialogTableVisible = true;
- }
- },
- // 调整机号的确认按钮
- submitTiaoZJH(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- var weekPath = this.weekPath(
- this.changeSchedule.schedule_week,
- this.changeSchedule.schedule_type
- );
- if (weekPath.length != 2) {
- this.$message.error("数据异常");
- return false;
- }
-
- this.changeSchedule.bed_id = this.device_id;
- for (let i = 0; i < this.origin_device_numbers.length; i++) {
- if (this.origin_device_numbers[i].id == this.device_id) {
- this.changeSchedule.partition_id = this.origin_device_numbers[
- i
- ].zone_id;
- }
- }
- this.changeSchedule.partition_id = this.zone_name
- this.changeSchedule.change_action = "change_device";
- this.changeScheduleActon(formName);
-
- // this.changeSchedule.spartition_type = this.scheduleZone[index].zone_type
- var weekPathKey = weekPath[0] + '_' + weekPath[1]
- for (var index in this.scheduleZone) {
- if (this.scheduleZone[index].jihao_id == this.changeSchedule.bed_id) {
- if (this.scheduleZone[index][weekPathKey].mode_id > 0) {
- this.$message.error('选中的区域已经存在排班,不能再排班!')
- return false
- }
- break
- }
- }
-
- // 可能
- // 患者有传染病,与选择的机器类型(传染病)不匹配
- // 患者没有传染病,但机器是某个传染病的专用透析器
- // 机器的透析模式与患者不匹配
-
- // if (this.currentData.contagions.length > 0) {
- // var cflag = false
- // for (var index in this.currentData.contagions) {
- // if (this.currentData.contagions[index].disease_id == this.changeSchedule.partition_type) {
- // cflag = true
- // }
- // }
- // if (!cflag) {
- // this.$confirm('此患者有传染病,与此透析机不匹配,确定在此排班吗?', '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
- // .then(() => {
- //
- // }).catch(() => {
- // })
- // } else {
- // this.changeSchedule.change_action = 'change_device'
- // this.changeScheduleActon(formName)
- // }
- // } else if (this.changeSchedule.partition_type > 1) {
- // this.$confirm('此患者没有传染病,与此透析机不匹配,确定在此排班吗?', '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
- // .then(() => {
- // this.changeSchedule.change_action = 'change_device'
- // this.changeScheduleActon(formName)
- // }).catch(() => {
- // })
- // } else {
- // this.changeSchedule.change_action = 'change_device'
- // this.changeScheduleActon(formName)
- // }
- }
- })
- },
- // 搜索弹窗操作调整模式确认按钮
- submitMode(formName) {
- this.changing_mode = true;
- this.changeSchedule.change_action = "change_mode";
- ChangeSchedule(this.currentData.id, this.changeSchedule)
- .then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- this.$message({
- type: "success",
- message: "修改成功!"
- });
- var that = this;
- var schedule = response.data.data.schedule;
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey].mode_id =
- schedule.mode_id;
- that.scheduleZone[index][weekPathKey].mode_name =
- typeof that.modeOptions[schedule.mode_id] === "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name;
- }
- }
- });
- this.msDialogVisible = false;
- }
- this.changing_mode = false;
- })
- .catch(err => {
- this.$message.error(err);
- this.changing_mode = false;
- });
- },
-
- submitTiaoZMS(formName) {
- this.$refs[formName].validate(valid => {
- if (valid) {
- this.changing_mode = true;
- this.changeSchedule.change_action = "change_mode";
- ChangeSchedule(this.currentData.id, this.changeSchedule)
- .then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- this.$message({
- type: "success",
- message: "修改成功!"
- });
- var that = this;
- var schedule = response.data.data.schedule;
- this.scheduleZone.forEach(function (zone, index) {
- if (
- zone.zone_id == schedule.partition_id &&
- zone.jihao_id == schedule.bed_id
- ) {
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
- if (weekPath.length == 2) {
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey].mode_id =
- schedule.mode_id;
- that.scheduleZone[index][weekPathKey].mode_name =
- typeof that.modeOptions[schedule.mode_id] ===
- "undefined"
- ? ""
- : that.modeOptions[schedule.mode_id].name;
- }
- }
- });
- this.$refs[formName].resetFields();
- this.msDialogVisible = false;
- }
- this.changing_mode = false;
- })
- .catch(err => {
- this.$message.error(err);
- this.changing_mode = false;
- });
- }
- });
- },
-
- changePartition(value) {
- let params = {
- zone_id: value,
- sch_type: this.currentData.schedule_type,
- schedule_date: this.currentData.schedule_date,
- patient_id: this.currentData.patient_id,
- };
- //进行网络请求,获取空排班机位
- getSmartDevices(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- } else {
- var devices = response.data.data.devices;
- this.current_devices = [];
- this.current_devices = devices;
- this.zone_names = devices;
- this.device_id = devices[0].id
- this.changeSchedule.bed_id = devices[0].id
- }
- });
- },
- changeScheduleType(schedule_type) {
- this.currentData.schedule_type = schedule_type
- let params = {
- zone_id: this.currentData.partition_id,
- sch_type: schedule_type,
- schedule_date: this.currentData.schedule_date,
- patient_id: this.currentData.patient_id,
- };
- //进行网络请求,获取空排班机位
- getSmartDevices(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- } else {
- var devices = response.data.data.devices;
- this.current_devices = [];
- this.current_devices = devices;
- this.changeSchedule.bed_id = ""
- this.changeSchedule.partition_id = this.currentData.partition_id
-
- }
- });
- },
- submitTiaoX() {
- if (this.tiaoZhengType == 1) {
- this.$confirm('确定要取消当前排班?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.CancelSchedule(this.currentData.id);
- }).catch(() => { });
- }
-
- switch (this.tiaoZhengType) {
- case 1:
- this.CancelSchedule(this.currentData.id);
- break;
- case 2:
- this.changeSchedule = {
- mode_id: this.currentData.mode_id,
- schedule_type: this.currentData.schedule_type,
- partition_id: this.currentData.partition_id,
- bed_id: this.currentData.bed_id,
- schedule_week: this.currentData.schedule_week,
- partition_type: ""
- };
-
- if (
- typeof this.partitions[this.currentData.partition_id].jihaos !==
- "undefined"
- ) {
- this.jihaos = this.partitions[this.currentData.partition_id].jihaos;
- } else {
- this.jihaos = [];
- }
-
- const params = {
- type: this.currentData.schedule_type,
- date: this.currentData.schedule_date
- };
- getUrgentScheduleInitData(params)
- .then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- } else {
- if (response.data.state == 1) {
- this.origin_schedules = response.data.data.schedules;
- this.origin_device_numbers =
- response.data.data.device_numbers;
-
- var zone_device_map = {};
- for (
- let index = 0;
- index < this.origin_device_numbers.length;
- index++
- ) {
- const device_number = this.origin_device_numbers[index];
- if (
- zone_device_map[device_number.zone_name] == null ||
- zone_device_map[device_number.zone_name] == undefined
- ) {
- zone_device_map[device_number.zone_name] = [];
- }
- zone_device_map[device_number.zone_name].push(
- device_number
- );
- }
- this.zone_device_map = zone_device_map;
- this.zone_names = Object.keys(this.zone_device_map);
- if (this.zone_names.length > 0) {
- this.zone_name = this.zone_names[0];
- this.current_devices = this.zone_device_map[this.zone_name];
- this.device_id = this.current_devices[0].id;
- }
- this.zone_device_options = [
- { values: this.zone_names },
- // { values: this.getDeviceNumberNames(this.current_devices) },
- { values: this.current_devices }
- ];
-
- //
- // for (let i = this.origin_schedules.length - 1; i >= 0; i--) {
- // for (let y = this.origin_device_numbers.length - 1; y >= 0; y--) {
- // if (this.origin_device_numbers[y].id == this.origin_schedules[i].bed_id) {
- // this.origin_device_numbers.splice(y, 1)
- // }
- // }
- // }
- // // debugger
- // var zone_device_map = {}
- // for (let index = 0; index < this.origin_device_numbers.length; index++) {
- // const device_number = this.origin_device_numbers[index]
- // if (zone_device_map[device_number.zone.name] == null || zone_device_map[device_number.zone.name] == undefined) {
- // zone_device_map[device_number.zone.name] = []
- // }
- // zone_device_map[device_number.zone.name].push(device_number)
- // }
- // this.zone_device_map = zone_device_map
- //
- // this.zone_names = Object.keys(this.zone_device_map)
- // if (this.zone_names.length > 0) {
- // this.zone_name = this.zone_names[0]
- // this.current_devices = this.zone_device_map[this.zone_name]
- // this.device_id = this.current_devices[0].id
- // }
- //
- // this.zone_device_options = [
- // { values: this.zone_names },
- // // { values: this.getDeviceNumberNames(this.current_devices) },
- // { values: this.current_devices }
- // ]
- } else {
- }
- }
- })
- .catch(err => {
- this.$message.error(err);
- });
-
- this.tzDialogVisible = false;
- this.jhDialogVisible = true;
- break;
- case 3:
- this.changeSchedule = {
- mode_id: "",
- schedule_type: "",
- partition_id: "",
- bed_id: "",
- schedule_week: "",
- partition_type: ""
- };
- this.tzDialogVisible = false;
- this.msDialogVisible = true;
- break;
-
- default:
- break;
- }
- },
- setSchedule() {
- var that = this;
- var submitFlag = true;
- if (this.currentData.patient_id <= 0) {
- this.$message.error("请先选择患者");
- return false;
- }
-
- if (
- this.currentData.schedule_date.length == 0 ||
- this.currentData.schedule_type < 1 ||
- this.currentData.schedule_type > 3 ||
- this.currentData.bed_id < 1 ||
- this.currentData.partition_id < 1 ||
- this.currentData.schedule_week < 1 ||
- this.currentData.schedule_week > 7
- ) {
- this.$message.error("请先选择排班时间或机号");
- return false;
- }
-
- // 可能
- // 患者有传染病,与选择的机器类型(传染病)不匹配
- // 患者没有传染病,但机器是某个传染病的专用透析器
- // 机器的透析模式与患者不匹配
-
- if (this.currentData.contagions.length > 0) {
- var cflag = false;
- this.currentData.contagions.forEach(function (contagion) {
- if (contagion.disease_id == that.currentData.partition_type) {
- cflag = true;
- }
- });
- if (!cflag) {
- this.$confirm(
- "此患者有传染病,与此透析机不匹配,确定在此排班吗?",
- "提示",
- {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning"
- }
- )
- .then(() => {
- this.CreateSchedule(
- this.currentData.patient_id,
- this.currentData
- );
- })
- .catch(() => { });
- } else {
- this.CreateSchedule(this.currentData.patient_id, this.currentData);
- }
- } else if (that.currentData.partition_type > 1) {
- this.$confirm(
- "此患者没有传染病,与此透析机不匹配,确定在此排班吗?",
- "提示",
- {
- confirmButtonText: "确 定",
- cancelButtonText: "取 消",
- type: "warning"
- }
- )
- .then(() => {
- this.CreateSchedule(this.currentData.patient_id, this.currentData);
- })
- .catch(() => { });
- } else {
- this.CreateSchedule(this.currentData.patient_id, this.currentData);
- }
- },
- weekType(weekTime) {
- var theType = 2;
- switch (weekTime) {
- case "historyWeek":
- theType = 0;
- break;
- case "lastWeek":
- theType = 1;
- break;
- case "thisWeek":
- theType = 2;
- break;
- case "nextWeek":
- theType = 3;
- break;
- case "nextTwoWeek":
- theType = 4;
- break;
- default:
- theType = 2;
- break;
- }
- return theType;
- },
- dayType(theType) {
- var jType = "";
- switch (theType) {
- case 1:
- jType = "上午";
- break;
- case 2:
- jType = "下午";
- break;
- case 3:
- jType = "晚上";
- break;
-
- default:
- break;
- }
- return jType;
- },
- weekPath(week, schedule_type) {
- var weekArr = {
- 1: "Mon",
- 2: "Tue",
- 3: "Wed",
- 4: "Thurs",
- 5: "Fri",
- 6: "Sat",
- 7: "Sun"
- };
- var typeArr = { 1: "M", 2: "A", 3: "N" };
- if (
- typeof weekArr[week] === "undefined" ||
- typeof typeArr[schedule_type] === "undefined"
- ) {
- return [];
- }
- return [weekArr[week], typeArr[schedule_type]];
- },
- weekDay(prop) {
- var week = prop.split("_");
- if (week.length != 2) {
- return [-1, -1];
- }
- var w = -1;
- var n = -1;
- switch (week[0]) {
- case "Mon":
- w = 1;
- break;
- case "Tue":
- w = 2;
- break;
- case "Wed":
- w = 3;
- break;
- case "Thurs":
- w = 4;
- break;
- case "Fri":
- w = 5;
- break;
- case "Sat":
- w = 6;
- break;
- case "Sun":
- w = 7;
- break;
- default:
- w = -1;
- break;
- }
- switch (week[1]) {
- case "M":
- n = 1;
- break;
- case "A":
- n = 2;
- break;
- case "N":
- n = 3;
- break;
- default:
- n = -1;
- break;
- }
- if (w == -1 || n == -1) {
- return [-1, -1];
- }
- return [w, n];
- },
- // 搜索
- search: function () {
- let week_type = 0
- var weeklist = moment().format('E');//计算今天是这周第几天
- var first_monday = moment().subtract(weeklist - 1, 'days').format('YYYY-MM-DD');//周一日期
- var end_monday = moment().add(7 - weeklist, 'days').format('YYYY-MM-DD')
- if (this.weekTime == 'thisWeek') {
- week_type = 1
- } else if (this.weekTime == 'nextWeek') {
- week_type = 2
- } else if (this.weekTime == 'nextTwoWeek') {
- week_type = 3
- }
-
- const params = {
- keywords: this.keywords,
- week_type: week_type,
- start_sch: first_monday,
- end_sch: end_monday,
- };
- // console.log("params",params)
- getSearchResult(params).then(response => {
- if (response.data.state == 1) {
- this.schedulePatients = response.data.data.schdules;
- this.searchTableVisible = true;
- }
- });
- },
- // 搜索弹窗调整机号按钮
- changeMachineNumber: function (index, row) {
- this.currentData.schedule_type = row.schedule_type;
- this.currentData.bed_id = row.bed_id;
- this.currentData.partition_id = row.partition_id;
- this.currentData.schedule_week = row.schedule_week;
-
- switch (row.schedule_type) {
- case 1:
- this.currentData.type_name = "上午";
- break;
- case 2:
- this.currentData.type_name = "下午";
- break;
- case 3:
- this.currentData.type_name = "晚上";
- break;
- }
-
- this.currentData.zone_name = row.zone.name;
- this.currentData.bed_name = row.number.number;
- this.currentData.partition_type = row.zone.type;
-
- this.currentData.mode_id = row.mode_id;
- this.currentData.patient_id = row.patient_id;
- this.currentData.patient = row.patient;
- this.currentData.contagions = row.patient_contagions;
-
- this.currentData.id = row.id;
- this.currentData.schedule_date = uParseTime(
- row.schedule_date,
- "{y}-{m}-{d}"
- );
-
- this.zone_name = row.partition_id;
- this.device_id = row.bed_id;
- // this.current_devices = this.partitions[row.partition_id].jihaos
-
- let params = {
- zone_id: row.partition_id,
- sch_type: row.schedule_type,
- schedule_date: this.currentData.schedule_date,
- patient_id: this.currentData.patient_id,
- };
- //进行网络请求,获取空排班机位
- getSmartDevices(params).then((response) => {
- if (response.data.state == 0) {
- return false;
- } else {
- var devices = response.data.data.devices;
- this.current_devices = [];
- this.current_devices = devices;
- this.device_id = devices[0].id
- }
- });
-
- this.changeSchedule = {
- mode_id: row.mode_id,
- schedule_type: row.schedule_type,
- partition_id: row.partition_id,
- bed_id: row.bed_id,
- schedule_week: row.schedule_week,
- partition_type: ""
- };
-
- if (typeof this.partitions[row.partition_id].jihaos !== "undefined") {
- this.jihaos = this.partitions[row.partition_id].jihaos;
- } else {
- this.jihaos = [];
- }
-
- this.searchTableVisible = false;
- this.jhDialogVisible = true;
- },
- getDialysisDate: function (row) {
- let week = "";
- switch (row.schedule_week) {
- case 7:
- week = "周日";
- break;
- case 1:
- week = "周一";
- break;
- case 2:
- week = "周二";
-
- break;
- case 3:
- week = "周三";
-
- break;
- case 4:
- week = "周四";
-
- break;
- case 5:
- week = "周五";
- break;
- case 6:
- week = "周六";
- break;
- }
-
- return week + "(" + uParseTime(row.schedule_date, "{y}-{m}-{d}") + ")";
- },
- getSchedulesType: function (type, row) {
- let type_name = "";
- switch (type) {
- case 1:
- type_name = "上午";
- break;
- case 2:
- type_name = "下午";
-
- break;
- case 3:
- type_name = "晚上";
- break;
- }
-
- return type_name;
- },
- // 搜索弹窗调整模式按钮
- changeMode: function (index, row) {
- this.changeSchedule = {
- mode_id: "",
- schedule_type: "",
- partition_id: "",
- bed_id: "",
- schedule_week: "",
- partition_type: ""
- };
- this.currentData.id = row.id;
- this.searchTableVisible = false;
- this.msDialogVisible = true;
- },
- tableRowClassName({ row, rowIndex }) {
- if (row.zone_type == 1) {
- return 'table-row-new-class schedule-table-row'
- } else {
- return 'table-row-new-class schedule-table-row backPurple'
- }
- },
- getAllZones() {
- getAllZones().then(response => {
- if (response.data.state == 1) {
- // console.log('getAllZones的数据',response.data.data);
- var zones = response.data.data.zones
- for (let i = 0; i < zones.length; i++) {
- this.zoneIdList.push(zones[i].id)
- }
- this.zones.push(...zones)
- var strArr = this.zoneIdList.join(",")
-
- this.strArr = strArr
- this.getWeekPanels()
- }
- })
- },
- changePartiton(val) {
- this.$emit('event1', val)
- this.partition_id = val
- this.getWeekPanels()
-
- // this.getSchedules()
- // this.getWeekPanels()
- },
- changeSchedule_type(val) {
- this.$emit('event2', val)
- this.schedule_type = val
-
- this.getSchedules()
-
-
- },
- changeWeekDay(val) {
- this.$emit('event3', val)
- },
- getTimestamp(time) { //把时间日期转成时间戳
- return (new Date(time)).getTime() / 1000
- },
- getTime(val) {
- return uParseTime(val, '{y}-{m}-{d}')
- },
- changeWeek(val) {
- console.log('效果国233232',val)
- this.newDay = []
- var start = this.getTimestamp(val) - 86400
- var end = start + 518400
-
- this.start_time = this.getTime(start)
- this.end_time = this.getTime(end)
-
- this.newDay.push(this.start_time)
- this.newDay.push(this.end_time)
-
- console.log("sart323232我的",this.start_time)
- console.log("end_timewowowo",this.end_time)
- this.scheduleZone=[]
- // this.$nextTick(() => {
- this.getAllZones()
- // this.getSchedules()
- // this.source_scheduleZone=[]
- // })
-
- },
- // 选择周次
- start(){
- var thisweek = {};
- var date = new Date();
- // 本周一的日期
- date.setDate(date.getDate() - date.getDay() + 1);
- thisweek.start_day = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() ;
-
- // 本周日的日期
- date.setDate(date.getDate() + 6);
- thisweek.end_day = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
- // console.log('asdfgdsafg',thisweek.start_day,thisweek.end_day);
-
- var date = new Date();
- // 上上周一的日期
- date.setDate(date.getDate()-14 - date.getDay() + 1);
- var month=(date.getMonth() + 1)<10 ? "0"+(date.getMonth()+1):(date.getMonth()+1)
- var day=(date.getDate())<10 ? "0"+(date.getDate()):(date.getDate())
- this.start_time = date.getFullYear() + "-" + month + "-" + day + " 00:00:00";
-
- // 上上周日的日期
- date.setDate(date.getDate() + 6);
- var month=(date.getMonth() + 1)<10 ? "0"+(date.getMonth()+1):(date.getMonth()+1)
- var day=(date.getDate())<10 ? "0"+(date.getDate()):(date.getDate())
- this.end_time = date.getFullYear() + "-" + month + "-" + day + ' 23:59:59';
- // console.log('1234566',this.lastweek.start_day,this.lastweek.end_day) ;
- // this.getAllZones()
- this.getSchedules()
- },
- getSchedules(){
- var partionStr = this.partition_id
- var arr = this.zoneIdList.join(',')
- var str = ""
- if (partionStr == 0) {
- str = arr
- }
- if (partionStr != 0) {
- str = partionStr.join(',')
- }
- const params = {
- is_before:1,
- start_time: this.start_time ,
- end_time:this.end_time ,
- weekTime: this.theType,
- patitionid: str,
- schedule_type: this.schedule_type,
- }
- console.log("params232323232",params)
- getSchedulesOne(params).then(response => {
- // console.log('getSchedulesOne',response.data.data);
- if (response.data.state == 1) {
- this.weekTitle = response.data.data.weekTitle;
- this.weekTitle = []
- console.log("first_day23333333333333",this.start_time)
- var first = this.getTimestamp(this.start_time)
- var first_day = this.getTime(first, "{y}-{m}-{d}")
- console.log("first_day23333333333333",first_day)
- this.weekTitle.push(first_day)
-
- var second = this.getTimestamp(this.start_time) + 86400
- var soncond_day = this.getTime(second, "{y}-{m}-{d}")
- this.weekTitle.push(soncond_day)
-
- var three = this.getTimestamp(this.start_time) + 172800
- var three_day = this.getTime(three, "{y}-{m}-{d}")
- this.weekTitle.push(three_day)
-
- var four = this.getTimestamp(this.start_time) + 259200
- var four_day = this.getTime(four, "{y}-{m}-{d}")
- this.weekTitle.push(four_day)
-
- var five = this.getTimestamp(this.start_time) + 345600
- var five_day = this.getTime(five, "{y}-{m}-{d}")
- this.weekTitle.push(five_day)
-
- var six = this.getTimestamp(this.start_time) + 432000
- var six_day = this.getTime(six, "{y}-{m}-{d}")
- this.weekTitle.push(six_day)
-
- var seven = this.getTimestamp(this.start_time) + 518400
- var seven_day = this.getTime(seven, "{y}-{m}-{d}")
- this.weekTitle.push(seven_day)
-
- // console.log("this.weekTitle",this.weekTitle)
-
- this.weekDays = response.data.data.days;
-
- this.toDay = response.data.data.today;
- var theSchedules = response.data.data.schdules;
- var schedulesGroup = response.data.data.schedulesGroup
- this.schedulesGroup = schedulesGroup
-
- var that = this;
-
- this.scheduleZone.forEach(function (zone, index) {
-
- that.scheduleZone[index].Mon_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Mon_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Mon_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Tue_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Tue_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Tue_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Wed_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Wed_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Wed_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
-
- };
- that.scheduleZone[index].Thurs_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Thurs_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Thurs_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Fri_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Fri_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Fri_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Sat_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Sat_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Sat_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Sun_A = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Sun_N = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
- that.scheduleZone[index].Sun_M = {
- mode_id: 0,
- mode_name: "",
- patient_id: 0,
- patient: "",
- dialysis_machine_name: "",
- schedule_date: "",
- Count: 0,
- };
-
- that.scheduleZone[index].total = 0;
-
- if (response.data.data.schdules.length > 0) {
- theSchedules.forEach(function (schedule, sindex) {
-
- if (zone.jihao_id == schedule.bed_id) {
-
- var weekPath = that.weekPath(
- schedule.schedule_week,
- schedule.schedule_type
- );
-
- if (weekPath.length == 2) {
-
-
- var weekPathKey = weekPath[0] + "_" + weekPath[1];
- that.scheduleZone[index][weekPathKey] = {
- schedule_id: schedule.id,
- mode_id: schedule.mode_id,
- patient_id: schedule.patient_id,
- patient: schedule.patient,
- dialysis_machine_name: schedule.dialysis_machine_name,
- patient_contagions: schedule.patient_contagions,
- schedule_date: schedule.schedule_date,
- mode_name: typeof that.modeOptions[schedule.mode_id] === "undefined" ? "" : that.modeOptions[schedule.mode_id].name
- };
- that.scheduleZone[index].total += 1;
-
- }
- }
- });
- }
-
- });
-
- this.source_scheduleZone = this.scheduleZone
- // console.log("历史aaaa", this.scheduleZone)
- } else {
- this.$message.error("网络错误");
- return false;
- }
- });
- },
- getTimestamp(time) {
- //把时间日期转成时间戳
- // console.log("日期", new Date(time));
- return new Date(time).getTime() / 1000;
- },
-
- getTimestampToTime (timestamp) {
- let date = new Date(timestamp)
- let Y = date.getFullYear() + '-'
- let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
- let D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate())
- let time = Y + M + D
- return time
- },
- getTime(value, temp) {
- if (value != undefined) {
- return uParseTime(value, temp)
- }
- return ''
- },
- },
- components: {
- ScheduleItem
- },
- mounted() {
-
- this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 120;
-
- // var theType = this.weekType(this.weekTime);
- // this.getSchedules(theType);
- const that = this;
- window.onresize = () => {
- return (() => {
- window.fullHeight = document.documentElement.clientHeight;
- if (window.fullHeight < 200) {
- that.tableHeight = 200;
- } else {
- that.tableHeight = window.fullHeight - 160;
- }
- })();
- };
- },
-
- };
- </script>
-
- <style rel="stylesheet/css" lang="scss">
- *{
- -webkit-touch-callout:none; /*系统默认菜单被禁用*/
- -webkit-user-select:none; /*webkit浏览器*/
- -khtml-user-select:none; /*早期浏览器*/
- -moz-user-select:none;/*火狐*/
- -ms-user-select:none; /*IE10*/
- user-select:none;
- }
- input{
- -webkit-user-select:auto; /*webkit浏览器*/
- }
- textarea{
- -webkit-user-select:auto; /*webkit浏览器*/
- }
- .tiaozhengclass {
- display: block;
- margin: 0 auto;
- }
- .center-tab{
- .el-table .cell{
- padding: 0px 0px !important;
- white-space: pre-wrap;
- }
- }
- .el-table--medium td, .el-table--medium th {
- padding: 5px 0 !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;
- // normal
- }
-
- .schedule-table-cell-disable {
- background-color: rgb(245, 245, 245) !important;
- }
-
- #table_data {
- min-height: calc(100vh - 350px);
- .switch{
- margin-left: 10px;
- }
- }
-
- #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;
- }
-
- #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;
- }
- .el-table__body tr .hover-td {
- background-color: #409eff !important;
- color: #fff;
- }
- .Infectious_disease{
- background-color: red !important;
- color: white;
- }
- }
- .backPurple{
- color: #f32424 !important;
- }
- // .el-table td .cell{
- // padding: 0px 0px !important;
- // }
- </style>
|