Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

template.vue 129KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359
  1. <template>
  2. <div class="main-contain">
  3. <el-dialog
  4. title="提示"
  5. :visible.sync="exportVisible"
  6. width="40%"
  7. >
  8. <div>
  9. 您提交的排班信息已上传成功,系统正在执行导入,请稍候点击当前页面右上角“下载日志”查看导入结果
  10. </div>
  11. <span slot="footer" class="dialog-footer">
  12. <el-button @click="exportVisible = false">取 消</el-button>
  13. <el-button type="primary" @click="exportVisible = false">确 定</el-button>
  14. </span>
  15. </el-dialog>
  16. <el-dialog
  17. title="提示"
  18. :visible.sync="exportLogVisible"
  19. width="40%"
  20. >
  21. <div v-for="(item,index) in logs" :key="index">
  22. <span> {{ item.export_time | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
  23. <br/>
  24. <br/>
  25. <span>{{ getContent(item) }}</span>
  26. <span>点击</span>
  27. <span style="color:blue" @click="generateTxt(item)">查看详情</span>
  28. <br/>
  29. <br/>
  30. </div>
  31. <span slot="footer" class="dialog-footer">
  32. <el-button @click="exportLogVisible = false">取 消</el-button>
  33. <el-button type="primary" @click="exportLogVisible = false">确 定</el-button>
  34. </span>
  35. </el-dialog>
  36. <el-dialog
  37. title="提示"
  38. :visible.sync="dialogVisible"
  39. width="40%"
  40. >
  41. <span>您提交的文档不是系统标准导入模板,请检查您的文档或重新下载文档</span>
  42. <span slot="footer" class="dialog-footer">
  43. <el-button @click="dialogVisible = false">取 消</el-button>
  44. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  45. </span>
  46. </el-dialog>
  47. <el-dialog
  48. title="提示"
  49. :visible.sync="msgTipVisible"
  50. width="40%"
  51. >
  52. <span>如果导入成功,会将当前已有的排版会被全部清除,是否继续导入排版数据</span>
  53. <span slot="footer" class="dialog-footer">
  54. <el-button @click="msgTipVisible = false">取 消</el-button>
  55. <el-button type="primary" @click="export_file()">确 定</el-button>
  56. </span>
  57. </el-dialog>
  58. <el-dialog
  59. title="提示"
  60. :visible.sync="isExistRepeatVisible"
  61. width="40%"
  62. >
  63. <span>检查到文档中同一天同个人存在多个排班,请检查并修改您的文档,重新导入</span>
  64. <span slot="footer" class="dialog-footer">
  65. <el-button @click="isExistRepeatVisible = false">取 消</el-button>
  66. <el-button type="primary" @click="isExistRepeatVisible = false">确 定</el-button>
  67. </span>
  68. </el-dialog>
  69. <div class="position">
  70. <bread-crumb :crumbs="crumbs"></bread-crumb>
  71. <div style="display:flex;align-items:center">
  72. <!--<upload-excel style="float:right;" :on-success='handleSuccess' :before-upload="beforeUpload"></upload-excel>-->
  73. <schedule-template-upload-excel style="margin-right:10px;"
  74. :on-success='handleSuccess'></schedule-template-upload-excel>
  75. <!-- <el-col :span="3" style="text-align: right;"> -->
  76. <el-button v-loading="downloadLoading" v-if="template_mode"
  77. size="small" icon="el-icon-setting" type="primary" @click="import_file()">下载模版
  78. </el-button>
  79. <el-button size="small" icon="el-icon-setting" type="primary" @click="setData" v-if="template_mode.mode>0">同步数据</el-button>
  80. <el-button size="small" icon="el-icon-setting" type="primary" @click="setScheduleTemplateAction">设置</el-button>
  81. <el-button size="small" icon="el-icon-setting" type="primary" @click="editClick">智能排班</el-button>
  82. <el-button size="small" icon="el-icon-setting" type="primary" @click="saveClick">保存并退出</el-button>
  83. <el-button
  84. @click="generateLog()"
  85. class="filter-item"
  86. type="primary"
  87. size="small"
  88. v-loading="generateLoading"
  89. >下载日志
  90. </el-button>
  91. </div>
  92. <!-- </el-col> -->
  93. </div>
  94. <div class="app-container">
  95. <!-- <el-tabs v-model="activeName" tab-position="top" @tab-click="handleClick"> -->
  96. <!-- <el-tab-pane name="schedules">-->
  97. <!-- <span slot="label"> 排班信息 </span>-->
  98. <!-- <template-table :editable="false" :device_numbers="device_numbers" :template="this_week_schedules" :is_editing="false"-->
  99. <!-- :patients="patients" :data="data"></template-table>-->
  100. <!-- </el-tab-pane>-->
  101. <!-- <el-tab-pane name="first" :disabled="template_mode.mode == 0" > -->
  102. <!-- <span slot="label">-->
  103. <!-- </span>-->
  104. <!-- <span slot="label"> {{first_template.week?'一周模版':'一周模版'}} -->
  105. <!-- <span v-if="schedule.mode == 2 && schedule.execute_times%2==0">(下一周)</span>-->
  106. <!-- <span v-if="schedule.mode == 2 && schedule.execute_times%2!=0">(本周)</span>-->
  107. <!-- <span v-if="schedule.mode ==1">(本周)</span>
  108. <span v-if="schedule.mode == 2 && schedule.execute_times%2==0">(下一周)</span>
  109. <span v-if="schedule.mode == 2 && schedule.execute_times%2!=0">(本周)</span>
  110. </span>
  111. </el-tab-pane>
  112. <el-tab-pane name="second" :disabled="template_mode.mode != 2 && template_mode.mode != 3 && template_mode.mode != 4"> -->
  113. <!-- <template-table ref="table_two" :is_editing="is_editing" :editable="true" :device_numbers="device_numbers" :template="first_template"-->
  114. <!-- :modes="modes" :patients="patients" @cancel_sch="refresh" :data="data" :template_mode="template_mode" @cur_info="cur_info" @saveData="saveData" @event1="changeZone" @saveSuccessTwo="refresh"></template-table>-->
  115. <!-- <span slot="label"> {{second_template.week?'二周模版':'二周模版'}} -->
  116. <!-- <span v-if="schedule.mode == 2 && schedule.execute_times%2==0">(下一周)</span>-->
  117. <!-- <span v-if="schedule.mode == 2 && schedule.execute_times%2!=0">(本周)</span>-->
  118. <!-- -->
  119. <!-- <span v-if="schedule.mode == 2 && schedule.execute_times%2==0">(本周)</span>
  120. <span v-if="schedule.mode == 2 && schedule.execute_times%2!=0">(下一周)</span>
  121. </span>
  122. </el-tab-pane> -->
  123. <!-- <el-tab-pane :label=" third_template.week? '三周模版':'三周模版'" name="third" :disabled="template_mode.mode != 3 && template_mode.mode != 4"> -->
  124. <!-- <template-table ref="table_three" :is_editing="is_editing" :editable="true" :device_numbers="device_numbers" :template="first_template"-->
  125. <!-- :modes="modes" :patients="patients" @cancel_sch="refresh" :data="data" :template_mode="template_mode" @cur_info="cur_info" @saveData="saveData" @event1="changeZone" @saveSuccessTwo="refresh"></template-table>-->
  126. <!-- </el-tab-pane> -->
  127. <!-- <el-tab-pane :label="four_template.week?'四周模版':'四周模版'" name="four" :disabled="template_mode.mode != 4 "> -->
  128. <!-- <span slot="label"> 四周模版 {{ four_template.week?four_template.week+'周':""}}-->
  129. <!-- <span v-if="schedule.execute_times%2==0">(下一周)</span>-->
  130. <!-- <span v-if="schedule.execute_times%2!=0">(本周)</span>-->
  131. <!-- <span v-if="schedule.execute_times%4==0">(本周)</span>-->
  132. <!-- <span v-if="schedule.execute_times%4==1">(下一周)</span>-->
  133. <!-- <span v-if="schedule.execute_times%4==2">(下二周)</span>-->
  134. <!-- <span v-if="schedule.execute_times%4==3">(下三周)</span>-->
  135. <!-- </span>-->
  136. <!-- <template-table ref="table_four" :is_editing="is_editing" :editable="true" :device_numbers="device_numbers" :template="first_template"-->
  137. <!-- :modes="modes" :patients="patients" @cancel_sch="refresh" :data="data" :template_mode="template_mode" @cur_info="cur_info" @saveData="saveData" @event1="changeZone" @saveSuccessTwo="refresh"></template-table>-->
  138. <!-- </el-tab-pane> -->
  139. <!-- <template-table-two v-show="activeName =='second'" ref="table_two" :is_editing="is_editing" :editable="true" :device_numbers="device_numbers" :template="second_template"-->
  140. <!-- :modes="modes" :patients="patients" @cancel_sch="refresh" :data="data" :template_mode="template_mode" @cur_info="cur_info" @saveData="saveData" @saveSuccessTwo="refresh"></template-table-two>-->
  141. <!-- <template-table-three v-show="activeName =='third'" ref="table_three" :editable="true" :device_numbers="device_numbers" :template="third_template" :is_editing="is_editing"-->
  142. <!-- :modes="modes" :patients="patients" :data="data" @cancel_sch="refresh" :template_mode="template_mode" @cur_info="cur_info" @saveData="saveData" @saveSuccessTwo="refresh" ></template-table-three>-->
  143. <!-- <template-table-four v-show="activeName =='four'" ref="table_four" :editable="true" :device_numbers="device_numbers" :template="four_template" :is_editing="is_editing"-->
  144. <!-- :modes="modes" :patients="patients" :data="data" @cancel_sch="refresh" :template_mode="template_mode" @saveSuccess="refresh" @cur_info="cur_info" @saveData="saveData" @saveSuccessTwo="refresh"></template-table-four>-->
  145. <!-- </el-tabs> -->
  146. <template-table v-loading="dataloading" ref="table" :is_editing="is_editing" :editable="true" :device_numbers="device_numbers" :template="template"
  147. :modes="modes" :patients="patients" @cancel_sch="refresh" :data="data" :template_mode="template_mode"
  148. @cur_info="cur_info" @saveData="saveData" @event1="changeZone" @saveSuccessTwo="refresh"
  149. @setTemplate="setTemplate" @changeLoading="changeLoading">
  150. <div class="position">
  151. <div>
  152. <el-tabs v-model="activeName" tab-position="top" @tab-click="handleClick">
  153. <el-tab-pane name="first" :disabled="template_mode.mode == 0" >
  154. <span slot="label"> {{first_template.week?'一周模版'+'('+first_template.week+'周'+')':'一周模版'+'('+first_template.week+'周'+')'}}
  155. <span v-if="schedule.mode ==1">{{'(本周)'}}</span>
  156. <span v-if="schedule.mode == 2 && schedule.execute_times%2==0">{{'(下一周)'}}</span>
  157. <span v-if="schedule.mode == 2 && schedule.execute_times%2!=0">{{'(本周)'}}</span>
  158. </span>
  159. </el-tab-pane>
  160. <el-tab-pane name="second" :disabled="template_mode.mode != 2 && template_mode.mode != 3 && template_mode.mode != 4">
  161. <span slot="label"> {{second_template.week?'二周模版'+'('+second_template.week+'周'+')':'二周模版'+'('+second_template.week+'周'+')'}}
  162. <span v-if="schedule.mode == 2 && schedule.execute_times%2==0">{{'(本周)'}}</span>
  163. <span v-if="schedule.mode == 2 && schedule.execute_times%2!=0">{{'(下一周)'}}</span>
  164. </span>
  165. </el-tab-pane>
  166. <!-- {{ four_template.week?four_template.week+'周':""}}-->
  167. <el-tab-pane :label="'三周模版'+'('+third_template.week+'周'+')'" name="third" :disabled="template_mode.mode != 3 && template_mode.mode != 4">
  168. </el-tab-pane>
  169. <el-tab-pane :label="'四周模版'+'('+four_template.week+'周'+')'" name="four" :disabled="template_mode.mode != 4 ">
  170. </el-tab-pane>
  171. </el-tabs>
  172. </div>
  173. <div style="display:flex;align-items:center">
  174. <!--<upload-excel style="float:right;" :on-success='handleSuccess' :before-upload="beforeUpload"></upload-excel>-->
  175. <schedule-template-upload-excel style="margin-right:10px;"
  176. :on-success='handleSuccess'></schedule-template-upload-excel>
  177. <!-- <el-col :span="3" style="text-align: right;"> -->
  178. <el-button v-loading="downloadLoading" v-if="template_mode"
  179. size="small" icon="el-icon-setting" type="primary" @click="import_file()">下载模版
  180. </el-button>
  181. <el-button size="small" icon="el-icon-setting" type="primary" @click="setData" v-if="template_mode.mode>0">同步数据</el-button>
  182. <el-button size="small" icon="el-icon-setting" type="primary" @click="setScheduleTemplateAction">设置</el-button>
  183. <el-button size="small" icon="el-icon-setting" type="primary" @click="editClick">智能排班</el-button>
  184. <el-button size="small" icon="el-icon-setting" type="primary" @click="saveClick">保存并退出</el-button>
  185. <el-button
  186. @click="generateLog()"
  187. class="filter-item"
  188. type="primary"
  189. size="small"
  190. v-loading="generateLoading"
  191. >下载日志
  192. </el-button>
  193. </div>
  194. </div>
  195. </template-table>
  196. <!-- <template-table ref="table" :editable="true" :device_numbers="device_numbers" :template="tar_template" :is_editing="is_editing"-->
  197. <!-- :modes="modes" :patients="patients" @cancel_sch="refresh" :data="data" :template_mode="template_mode" @saveSuccess="refresh" @cur_info="cur_info" @saveData="saveData" ></template-table>-->
  198. </div>
  199. <set-up-template-dialog ref="setup_dialog" :template_mode="template_mode" :origin_mode="origin_mode"
  200. @chenge_mode="didChangeTemplateMode"></set-up-template-dialog>
  201. <el-dialog title="同步排班" width="600px" :visible.sync="newVisible">
  202. <el-form :model="form" ref="form" label-width="90px" :rules="rules">
  203. <el-form-item label="同步模板:" v-if="template_mode.mode == 1">
  204. <el-radio v-model="form.firstWeek" label="1">模板一</el-radio>
  205. </el-form-item>
  206. <el-form-item label="同步模板:" v-if="template_mode.mode == 2">
  207. <el-radio v-model="form.firstWeek" label="1">模板一</el-radio>
  208. <el-radio v-model="form.firstWeek" label="2">模板二</el-radio>
  209. </el-form-item>
  210. <el-form-item label="同步模板:" v-if="template_mode.mode == 3">
  211. <el-radio v-model="form.firstWeek" label="1">模板一</el-radio>
  212. <el-radio v-model="form.firstWeek" label="2">模板二</el-radio>
  213. <el-radio v-model="form.firstWeek" label="3">模板三</el-radio>
  214. </el-form-item>
  215. <el-form-item label="同步模板:" v-if="template_mode.mode == 4">
  216. <el-radio v-model="form.firstWeek" label="1">模板一</el-radio>
  217. <el-radio v-model="form.firstWeek" label="2">模板二</el-radio>
  218. <el-radio v-model="form.firstWeek" label="3">模板三</el-radio>
  219. <el-radio v-model="form.firstWeek" label="4">模板四</el-radio>
  220. </el-form-item>
  221. <el-form-item label="同步到 :">
  222. <el-select v-model="form.copyWeek" placeholder="请选择" required prop="copyWeek">
  223. <el-option
  224. v-for="item in typeOptions"
  225. :key="item.value"
  226. :label="item.label"
  227. :value="item.value">
  228. </el-option>
  229. </el-select>
  230. </el-form-item>
  231. </el-form>
  232. <div slot="footer" class="dialog-footer">
  233. <el-button @click="newVisible=false">取 消</el-button>
  234. <el-button v-loading="syncLoading" type="primary" @click="submitAction('form')">保 存</el-button>
  235. </div>
  236. </el-dialog>
  237. </div>
  238. </template>
  239. <script>
  240. import SetUpTemplateDialog from './components/setup_template_dialog'
  241. import TemplateTable from './components/template_table'
  242. import {getTemplateInitData} from '@/api/schedule_template/sch_template'
  243. import {getTemplateInitDataTwo} from '@/api/schedule_template/sch_template'
  244. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  245. import {
  246. exportScheduleTemplate,
  247. getPatientScheduleTemplate,
  248. getWeekPanels,
  249. initDate,
  250. synchroSchedule
  251. } from '@/api/schedule'
  252. import ScheduleTemplateUploadExcel from './components/scheduleTemplateUploadExcel/index'
  253. import {generateLog} from '@/api/config'
  254. import TemplateTableTwo from "./components/template_table_two";
  255. import TemplateTableThree from "./components/template_table_three";
  256. import TemplateTableFour from "./components/template_table_four";
  257. export default {
  258. name: 'WorkforceTemplate',
  259. components: {
  260. TemplateTableFour,
  261. TemplateTableThree,
  262. TemplateTableTwo,
  263. ScheduleTemplateUploadExcel,
  264. SetUpTemplateDialog,
  265. TemplateTable,
  266. BreadCrumb
  267. },
  268. data: function () {
  269. return {
  270. schedulingTableVisible:false,
  271. dataloading:true,
  272. is_editing:true,
  273. editable:false,
  274. data:[],
  275. crumbs: [
  276. {path: false, name: '排班管理'},
  277. {path: 'workforce/template', name: '排班模版'}
  278. ],
  279. isTrue:0,
  280. partitions: {},
  281. scheduleZone: [],
  282. activeName: 'first',
  283. downloadLoading: false,
  284. isExistRepeatVisible: false,
  285. exportLogVisible: false,
  286. exportVisible: false,
  287. logs: [],
  288. generateLoading: false,
  289. days: [],
  290. msgTipVisible: false,
  291. dialogVisible: false,
  292. template_mode: {
  293. id: 0,
  294. mode: 0
  295. },
  296. cur_info:{
  297. patient_id:0,
  298. patient_name:"",
  299. mode_name:"",
  300. mode_id:0,
  301. },
  302. origin_mode: 0,
  303. device_numbers: [],
  304. patients: [],
  305. modes:[],
  306. tar_template:{},
  307. first_template: {
  308. id: 1,
  309. items: []
  310. },
  311. second_template: {
  312. id: 2,
  313. items: []
  314. },
  315. third_template:{
  316. id: 3,
  317. items: []
  318. },
  319. four_template:{
  320. id: 3,
  321. items: []
  322. },
  323. this_week_schedules: {
  324. id: 0,
  325. items: []
  326. },
  327. firstWeekData: [],
  328. secondWeekData: [],
  329. thirdWeekData:[],
  330. fourWeekData:[],
  331. tableList: [],
  332. newVisible: false,
  333. syncLoading:false,
  334. weekList: [],
  335. currentFirstDate1: '',
  336. weekNum: '',
  337. weekDayArr: [],
  338. todayDate: '',
  339. clen: 7,
  340. nowYear: new Date().getFullYear(),
  341. schedule_week: 0,
  342. newDay: [],
  343. typeOptions: [],
  344. timeOptions: [],
  345. templates:[],
  346. form: {
  347. firstWeek: "1",
  348. secondWeek: "",
  349. copyWeek: ''
  350. },
  351. rules: {
  352. copyWeek: [{required: true, message: "请选择同步时间段", trigger: "blur"}],
  353. },
  354. schedule: {},
  355. }
  356. },
  357. created() {
  358. this.getPatientScheduleTemplate()
  359. let year = new Date().getFullYear()
  360. let month = new Date().getMonth() + 1
  361. let date = new Date().getDate()
  362. this.weekNum = this.getYearWeek(year, month, date)
  363. this.todayDate = this.formatDate(new Date())
  364. this.setDate(new Date(new Date().setDate((new Date().getDate() - 7))))
  365. for (var i = 0; i <= 9; i++) {
  366. this.setDate1(this.addDate(this.currentDate, 7))
  367. }
  368. let newNum = 0
  369. for (let i = 0; i < this.weekList.length; i++) {
  370. if (this.weekNum + i + 1 <= 53) {
  371. let num = this.weekNum + i
  372. let str = this.weekList[i][0] + '~' + this.weekList[i][6]
  373. this.typeOptions.push({value: i, label: str})
  374. let stt = this.weekList[i][0] + "~" + this.weekList[i][6]
  375. this.timeOptions.push({value: i, label: stt})
  376. } else {
  377. newNum++
  378. let str = this.weekList[i][0] + '~' + this.weekList[i][6]
  379. this.typeOptions.push({value: i, label: str})
  380. let stt = this.weekList[i][0] + "~" + this.weekList[i][6]
  381. this.timeOptions.push({value: i, label: stt})
  382. }
  383. }
  384. this.getWeekPanels("")
  385. this.getInitDate()
  386. for(let key in this.$store.getters.treatment_mode){
  387. let obj = {
  388. id:this.$store.getters.treatment_mode[key].id,
  389. name:this.$store.getters.treatment_mode[key].name,
  390. }
  391. this.modes.push(obj)
  392. }
  393. },
  394. mounted(){
  395. let params = {
  396. patitionid:""
  397. }
  398. getTemplateInitData(params).then(rs => {
  399. var resp = rs.data
  400. if (resp.state == 1) {
  401. var mode = resp.data.template_mode
  402. var device_numbers = resp.data.device_numbers
  403. var templates = resp.data.templates
  404. this.templates = templates
  405. if(templates.length > 0){
  406. this.firstWeekData = templates[0].items
  407. this.first_template = templates[0]
  408. }
  409. if(templates.length > 1){
  410. this.secondWeekData = templates[1].items
  411. this.second_template = templates[1]
  412. }
  413. if(templates.length > 2){
  414. this.thirdWeekData = templates[2].items
  415. this.third_template = templates[2]
  416. }
  417. if(templates.length > 3){
  418. this.fourWeekData = templates[3].items
  419. this.four_template = templates[3]
  420. }
  421. var patients = resp.data.patients
  422. this.template_mode = mode
  423. this.origin_mode = mode.mode
  424. this.device_numbers = device_numbers
  425. this.patients = patients
  426. this.tar_template = this.first_template
  427. this.$refs.table.setEditData(this.patients,this.first_template,this.device_numbers,this.templates, this.activeName)
  428. var fakeTemplateItems = []
  429. this.this_week_schedules.items = fakeTemplateItems
  430. } else {
  431. this.$message(resp.msg)
  432. }
  433. })
  434. },
  435. methods: {
  436. changeLoading(){
  437. this.dataloading = false
  438. },
  439. setTemplate(items){
  440. if(this.template_mode.mode == 1){
  441. this.first_template = items[0]
  442. }else if(this.template_mode.mode == 2){
  443. this.first_template = items[0]
  444. this.second_template = items[1]
  445. }else if(this.template_mode.mode == 3){
  446. this.first_template = items[0]
  447. this.second_template = items[1]
  448. this.third_template = items[2]
  449. }else if(this.template_mode.mode == 4){
  450. this.first_template = items[0]
  451. this.second_template = items[1]
  452. this.third_template = items[2]
  453. this.four_template = items[3]
  454. }
  455. },
  456. handleClick(val){
  457. this.dataloading = true
  458. if(this.activeName == "first"){
  459. this.activeName = "first"
  460. // this.tar_template = this.first_template
  461. this.$refs.table.setEditData(this.patients,this.first_template,this.device_numbers,this.templates, this.activeName)
  462. }else if(this.activeName == "second"){
  463. this.activeName = "second"
  464. // this.tar_template = this.second_template
  465. this.$refs.table.setEditData(this.patients,this.second_template,this.device_numbers,this.templates, this.activeName)
  466. }else if(this.activeName == "third"){
  467. this.activeName = "third"
  468. // this.tar_template = this.third_template
  469. this.$refs.table.setEditData(this.patients,this.third_template,this.device_numbers,this.templates, this.activeName)
  470. }else {
  471. this.activeName = "four"
  472. // this.tar_template = this.four_template
  473. this.$refs.table.setEditData(this.patients, this.four_template,this.device_numbers,this.templates, this.activeName)
  474. }
  475. },
  476. getYearWeek(year, month, date) {
  477. /*
  478. dateNow是当前日期
  479. dateFirst是当年第一天
  480. dataNumber是当前日期是今年第多少天
  481. 用dataNumber + 当前年的第一天的周差距的和在除以7就是本年第几周
  482. */
  483. let dateNow = new Date(year, parseInt(month) - 1, date);
  484. let dateFirst = new Date(year, 0, 1);
  485. let dataNumber = Math.round((dateNow.valueOf() - dateFirst.valueOf()) / 86400000);
  486. return Math.ceil((dataNumber + ((dateFirst.getDay() + 1) - 1)) / 7);
  487. },
  488. getTimestamp(time) { //把时间日期转成时间戳
  489. return (new Date(time)).getTime() / 1000
  490. },
  491. formatDate(date) {
  492. var year = date.getFullYear() + '.'
  493. var month = (date.getMonth() + 1) + '.';
  494. var day = date.getDate();
  495. return year + month + day
  496. },
  497. formatDateTwo(date) {
  498. var year = date.getFullYear() + '.'
  499. var month = (date.getMonth() + 1) + '.';
  500. var day = date.getDate();
  501. return year + month + day
  502. },
  503. addDate(date, n) {
  504. date.setDate(date.getDate() + n);
  505. return date;
  506. },
  507. //
  508. setDate(date) {
  509. var week = date.getDay() - 1;
  510. date = this.addDate(date, week * -1);
  511. this.currentFirstDate = new Date(date);
  512. this.currentDate = new Date(date)
  513. for (var i = 0; i < this.clen; i++) {
  514. this.weekDayArr.push(this.formatDate(i == 0 ? date : this.addDate(date, 1)))
  515. }
  516. },
  517. setDate1(date) {
  518. var week = date.getDay() - 1
  519. date = this.addDate(date, week * -1)
  520. this.currentDate = new Date(date)
  521. let arr1 = []
  522. for (var i = 0; i < this.clen; i++) {
  523. arr1.push(this.formatDate(i == 0 ? date : this.addDate(date, 1)))
  524. }
  525. this.weekList.push(arr1)
  526. let num = this.weekNum
  527. this.currentFirstDate1 = num + 1
  528. },
  529. getTimestamp(time) { //把时间日期转成时间戳
  530. return (new Date(time)).getTime() / 1000
  531. },
  532. refresh() {
  533. // this.isTrue.push(1)
  534. let params = {
  535. patitionid:""
  536. }
  537. getTemplateInitData(params).then(rs => {
  538. var resp = rs.data
  539. if (resp.state == 1) {
  540. var mode = resp.data.template_mode
  541. var device_numbers = resp.data.device_numbers
  542. var templates = resp.data.templates
  543. this.templates = templates
  544. if(templates.length > 0){
  545. this.firstWeekData = templates[0].items
  546. this.first_template = templates[0]
  547. }
  548. if(templates.length > 1){
  549. this.secondWeekData = templates[1].items
  550. this.second_template = templates[1]
  551. }
  552. if(templates.length > 2){
  553. this.thirdWeekData = templates[2].items
  554. this.third_template = templates[2]
  555. }
  556. if(templates.length > 3){
  557. this.fourWeekData = templates[3].items
  558. this.four_template = templates[3]
  559. }
  560. var patients = resp.data.patients
  561. // var schedules = resp.data.schedules
  562. this.template_mode = mode
  563. this.origin_mode = mode.mode
  564. this.device_numbers = device_numbers
  565. this.patients = patients
  566. var fakeTemplateItems = []
  567. this.this_week_schedules.items = fakeTemplateItems
  568. } else {
  569. this.$message(resp.msg)
  570. }
  571. })
  572. },
  573. generateTxt: function (log) {
  574. var content = ''
  575. var errlog = log.err_logs
  576. content = this.getContent(log)
  577. for (let i = 0; i < errlog.length; i++) {
  578. if (content.length == 0) {
  579. content = errlog[i].err_msg
  580. } else {
  581. content = content + "\n" + errlog[i].err_msg
  582. }
  583. }
  584. var url = new Blob(['\ufeff' + content], {type: 'text/txt,charset=UTF-8'})
  585. if (typeof url === 'object' && url instanceof Blob) {
  586. url = URL.createObjectURL(url) // 创建blob地址
  587. }
  588. const aLink = document.createElement('a')
  589. aLink.href = url
  590. aLink.download = this.timestampToTime(log.export_time) + '排班模板导入日志.txt'
  591. aLink.click()
  592. },
  593. timestampToTime(timestamp) {
  594. var date = new Date(timestamp * 1000)//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  595. var Y = date.getFullYear() + '年'
  596. var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '月'
  597. var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + '日 '
  598. var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + '时'
  599. var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + '分'
  600. var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()) + '秒'
  601. return Y + M + D + h + m + s
  602. },
  603. getContent(log) {
  604. return '您导入的文档共' + log.total_num + '条患者数据' + ',' + '已成功导入' + log.success_num + '条,导入失败' + log.fail_num + '条,'
  605. },
  606. generateLog() {
  607. this.generateLoading = true
  608. let params = {
  609. 'log_type': 3
  610. }
  611. generateLog(params).then(
  612. response => {
  613. if (response.data.state === 1) {
  614. this.generateLoading = false
  615. this.logs = response.data.data.logs
  616. this.exportLogVisible = true
  617. } else {
  618. this.$message.error(response.data.msg)
  619. this.generateLoading = false
  620. }
  621. }
  622. ).catch(error => {
  623. this.generateLoading = false
  624. })
  625. },
  626. getInitDate() {
  627. initDate().then(response => {
  628. if (response.data.state == 0) {
  629. return false
  630. }
  631. this.days = response.data.data.days
  632. })
  633. },
  634. handleSuccess({results, header}) {
  635. let headers = []
  636. for (let key in results[0]) {
  637. headers.push(key)
  638. }
  639. console.log("hhh2332323232", this.template_mode.mode)
  640. console.log("result233232233223232323", results)
  641. console.log("result233232233223232323", headers)
  642. if (this.template_mode.mode == 1) {
  643. if (results.length > 0) {
  644. var isHas_1 = headers.includes('区号')
  645. console.log(isHas_1)
  646. var isHas_2 = headers.includes('机号')
  647. console.log(isHas_2)
  648. var isHas_3 = headers.includes('周一')
  649. console.log(isHas_3)
  650. var isHas_4 = headers.includes('')
  651. console.log(isHas_4)
  652. var isHas_5 = headers.includes('_1')
  653. console.log(isHas_5)
  654. var isHas_6 = headers.includes('周二')
  655. console.log(isHas_6)
  656. var isHas_7 = headers.includes('_2')
  657. console.log(isHas_7)
  658. var isHas_8 = headers.includes('_3')
  659. console.log(isHas_8)
  660. var isHas_9 = headers.includes('周三')
  661. console.log(isHas_9)
  662. var isHas_10 = headers.includes('_4')
  663. console.log(isHas_1)
  664. var isHas_11 = headers.includes('_5')
  665. console.log(isHas_1)
  666. var isHas_12 = headers.includes('周四')
  667. console.log(isHas_1)
  668. var isHas_13 = headers.includes('_6')
  669. console.log(isHas_1)
  670. var isHas_14 = headers.includes('_7')
  671. console.log(isHas_1)
  672. var isHas_15 = headers.includes('周五')
  673. console.log(isHas_1)
  674. var isHas_16 = headers.includes('_8')
  675. console.log(isHas_1)
  676. var isHas_17 = headers.includes('_9')
  677. console.log(isHas_1)
  678. var isHas_18 = headers.includes('周六')
  679. console.log(isHas_1)
  680. var isHas_19 = headers.includes('_10')
  681. console.log(isHas_1)
  682. var isHas_20 = headers.includes('_11')
  683. console.log(isHas_1)
  684. var isHas_21 = headers.includes('周日')
  685. console.log(isHas_1)
  686. var isHas_22 = headers.includes('_12')
  687. console.log(isHas_1)
  688. var isHas_23 = headers.includes('_13')
  689. console.log(isHas_1)
  690. if (!(isHas_1 && isHas_2 && isHas_3 && isHas_4 && isHas_5 &&
  691. isHas_6 && isHas_7 && isHas_8 && isHas_9 && isHas_10 &&
  692. isHas_11 && isHas_12 && isHas_13 && isHas_14 && isHas_15 &&
  693. isHas_16 && isHas_17 && isHas_18 && isHas_19 && isHas_20 &&
  694. isHas_21 && isHas_22 && isHas_23)) {
  695. this.dialogVisible = true
  696. return
  697. }
  698. } else {
  699. this.dialogVisible = true
  700. return
  701. }
  702. } else if (this.template_mode.mode == 2) {
  703. if (results.length > 0) {
  704. var isHas_1 = headers.includes('区号')
  705. console.log("区号", isHas_1)
  706. var isHas_2 = headers.includes('机号')
  707. console.log("机号", isHas_2)
  708. var isHas_3 = headers.includes('周一')
  709. console.log(isHas_3)
  710. var isHas_4 = headers.includes('')
  711. console.log(isHas_4)
  712. var isHas_5 = headers.includes('_1')
  713. console.log(isHas_5)
  714. var isHas_6 = headers.includes('周二')
  715. console.log(isHas_6)
  716. var isHas_7 = headers.includes('_2')
  717. console.log(isHas_7)
  718. var isHas_8 = headers.includes('_3')
  719. console.log(isHas_8)
  720. var isHas_9 = headers.includes('周三')
  721. console.log(isHas_9)
  722. var isHas_10 = headers.includes('_4')
  723. console.log(isHas_10)
  724. var isHas_11 = headers.includes('_5')
  725. console.log(isHas_11)
  726. var isHas_12 = headers.includes('周四')
  727. console.log(isHas_12)
  728. var isHas_13 = headers.includes('_6')
  729. console.log(isHas_13)
  730. var isHas_14 = headers.includes('_7')
  731. console.log(isHas_14)
  732. var isHas_15 = headers.includes('周五')
  733. console.log(isHas_15)
  734. var isHas_16 = headers.includes('_8')
  735. console.log(isHas_16)
  736. var isHas_17 = headers.includes('_9')
  737. console.log(isHas_17)
  738. var isHas_18 = headers.includes('周六')
  739. console.log(isHas_18)
  740. var isHas_19 = headers.includes('_10')
  741. console.log(isHas_19)
  742. var isHas_20 = headers.includes('_11')
  743. console.log(isHas_20)
  744. var isHas_21 = headers.includes('周日')
  745. console.log(isHas_21)
  746. var isHas_22 = headers.includes('_12')
  747. console.log(isHas_22)
  748. var isHas_23 = headers.includes('_13')
  749. console.log(isHas_23)
  750. var isHas_24 = headers.includes('周一_1')
  751. console.log(isHas_24)
  752. var isHas_25 = headers.includes('_14')
  753. console.log(isHas_25)
  754. var isHas_26 = headers.includes('_15')
  755. console.log(isHas_26)
  756. var isHas_27 = headers.includes('周二_1')
  757. console.log(isHas_27)
  758. var isHas_28 = headers.includes('_16')
  759. console.log(isHas_28)
  760. var isHas_29 = headers.includes('_17')
  761. console.log(isHas_29)
  762. var isHas_30 = headers.includes('周三_1')
  763. console.log(isHas_30)
  764. var isHas_31 = headers.includes('_18')
  765. console.log(isHas_31)
  766. var isHas_32 = headers.includes('_19')
  767. console.log(isHas_32)
  768. var isHas_33 = headers.includes('周四_1')
  769. console.log(isHas_33)
  770. var isHas_34 = headers.includes('_20')
  771. console.log(isHas_34)
  772. var isHas_35 = headers.includes('_21')
  773. console.log(isHas_35)
  774. var isHas_36 = headers.includes('周五_1')
  775. console.log(isHas_36)
  776. var isHas_37 = headers.includes('_22')
  777. console.log(isHas_37)
  778. var isHas_38 = headers.includes('_23')
  779. console.log(isHas_38)
  780. var isHas_39 = headers.includes('周六_1')
  781. console.log(isHas_39)
  782. var isHas_40 = headers.includes('_24')
  783. console.log(isHas_40)
  784. var isHas_41 = headers.includes('_25')
  785. console.log(isHas_41)
  786. var isHas_42 = headers.includes('周日_1')
  787. console.log(isHas_42)
  788. var isHas_43 = headers.includes('_26')
  789. console.log(isHas_43)
  790. var isHas_44 = headers.includes('_27')
  791. console.log(isHas_44)
  792. if (!(isHas_1 && isHas_2 && isHas_3 && isHas_4 && isHas_5 &&
  793. isHas_6 && isHas_7 && isHas_8 && isHas_9 && isHas_10 &&
  794. isHas_11 && isHas_12 && isHas_13 && isHas_14 && isHas_15 &&
  795. isHas_16 && isHas_17 && isHas_18 && isHas_19 && isHas_20 &&
  796. isHas_21 && isHas_22 && isHas_23 && isHas_24 && isHas_25 &&
  797. isHas_26 && isHas_27 && isHas_28 && isHas_29 && isHas_30 &&
  798. isHas_31 && isHas_32 && isHas_33 && isHas_34 && isHas_35 &&
  799. isHas_36 && isHas_37 && isHas_38 && isHas_39 && isHas_40 &&
  800. isHas_41 && isHas_42 && isHas_43 && isHas_44)) {
  801. console.log("~~~~~~~")
  802. this.dialogVisible = true
  803. return
  804. }
  805. } else {
  806. console.log("---------")
  807. this.dialogVisible = true
  808. return
  809. }
  810. } else if (this.template_mode.mode == 3) {
  811. if (results.length > 0) {
  812. var isHas_1 = headers.includes('区号')
  813. console.log("区号", isHas_1)
  814. var isHas_2 = headers.includes('机号')
  815. console.log("机号", isHas_2)
  816. var isHas_3 = headers.includes('周一')
  817. console.log(isHas_3)
  818. var isHas_4 = headers.includes('')
  819. console.log(isHas_4)
  820. var isHas_5 = headers.includes('_1')
  821. console.log(isHas_5)
  822. var isHas_6 = headers.includes('周二')
  823. console.log(isHas_6)
  824. var isHas_7 = headers.includes('_2')
  825. console.log(isHas_7)
  826. var isHas_8 = headers.includes('_3')
  827. console.log(isHas_8)
  828. var isHas_9 = headers.includes('周三')
  829. console.log(isHas_9)
  830. var isHas_10 = headers.includes('_4')
  831. console.log(isHas_1)
  832. var isHas_11 = headers.includes('_5')
  833. console.log(isHas_1)
  834. var isHas_12 = headers.includes('周四')
  835. console.log(isHas_1)
  836. var isHas_13 = headers.includes('_6')
  837. console.log(isHas_1)
  838. var isHas_14 = headers.includes('_7')
  839. console.log(isHas_1)
  840. var isHas_15 = headers.includes('周五')
  841. console.log(isHas_1)
  842. var isHas_16 = headers.includes('_8')
  843. console.log(isHas_1)
  844. var isHas_17 = headers.includes('_9')
  845. console.log(isHas_1)
  846. var isHas_18 = headers.includes('周六')
  847. console.log(isHas_1)
  848. var isHas_19 = headers.includes('_10')
  849. console.log(isHas_1)
  850. var isHas_20 = headers.includes('_11')
  851. console.log(isHas_1)
  852. var isHas_21 = headers.includes('周日')
  853. console.log(isHas_1)
  854. var isHas_22 = headers.includes('_12')
  855. console.log(isHas_1)
  856. var isHas_23 = headers.includes('_13')
  857. console.log(isHas_1)
  858. var isHas_24 = headers.includes('周一_1')
  859. var isHas_25 = headers.includes('_14')
  860. var isHas_26 = headers.includes('_15')
  861. var isHas_27 = headers.includes('周二_1')
  862. var isHas_28 = headers.includes('_16')
  863. var isHas_29 = headers.includes('_17')
  864. var isHas_30 = headers.includes('周三_1')
  865. var isHas_31 = headers.includes('_18')
  866. var isHas_32 = headers.includes('_19')
  867. var isHas_33 = headers.includes('周四_1')
  868. var isHas_34 = headers.includes('_20')
  869. var isHas_35 = headers.includes('_21')
  870. var isHas_36 = headers.includes('周五_1')
  871. var isHas_37 = headers.includes('_22')
  872. var isHas_38 = headers.includes('_23')
  873. var isHas_39 = headers.includes('周六_1')
  874. var isHas_40 = headers.includes('_24')
  875. var isHas_41 = headers.includes('_25')
  876. var isHas_42 = headers.includes('周日_1')
  877. var isHas_43 = headers.includes('_26')
  878. var isHas_44 = headers.includes('_27')
  879. var isHas_45 = headers.includes('周一_2')
  880. var isHas_46 = headers.includes('_28')
  881. var isHas_47 = headers.includes('_29')
  882. var isHas_48 = headers.includes('周二_2')
  883. var isHas_49 = headers.includes('_30')
  884. var isHas_50 = headers.includes('_31')
  885. var isHas_51 = headers.includes('周三_2')
  886. var isHas_52 = headers.includes('_32')
  887. var isHas_53 = headers.includes('_33')
  888. var isHas_54 = headers.includes('周四_2')
  889. var isHas_55 = headers.includes('_34')
  890. var isHas_56 = headers.includes('_35')
  891. var isHas_57 = headers.includes('周五_2')
  892. var isHas_58 = headers.includes('_36')
  893. var isHas_59 = headers.includes('_37')
  894. var isHas_60 = headers.includes('周六_2')
  895. var isHas_61 = headers.includes('_38')
  896. var isHas_62 = headers.includes('_39')
  897. var isHas_63 = headers.includes('周日_2')
  898. var isHas_64 = headers.includes('_40')
  899. var isHas_65 = headers.includes('_41')
  900. if (!(isHas_1 && isHas_2 && isHas_3 && isHas_4 && isHas_5 &&
  901. isHas_6 && isHas_7 && isHas_8 && isHas_9 && isHas_10 &&
  902. isHas_11 && isHas_12 && isHas_13 && isHas_14 && isHas_15 &&
  903. isHas_16 && isHas_17 && isHas_18 && isHas_19 && isHas_20 &&
  904. isHas_21 && isHas_22 && isHas_23 && isHas_24 && isHas_25 &&
  905. isHas_26 && isHas_27 && isHas_28 && isHas_29 && isHas_30 &&
  906. isHas_31 && isHas_32 && isHas_33 && isHas_34 && isHas_35 &&
  907. isHas_36 && isHas_37 && isHas_38 && isHas_39 && isHas_40 &&
  908. isHas_41 && isHas_42 && isHas_43 && isHas_44 && isHas_45 &&
  909. isHas_46 && isHas_47 && isHas_48 && isHas_49 && isHas_50 &&
  910. isHas_51 && isHas_52 && isHas_53 && isHas_54 && isHas_55 &&
  911. isHas_56 && isHas_57 && isHas_58 && isHas_59 && isHas_60 &&
  912. isHas_61 && isHas_62 && isHas_63 && isHas_64 && isHas_65)) {
  913. this.dialogVisible = true
  914. return
  915. }
  916. } else {
  917. this.dialogVisible = true
  918. return
  919. }
  920. }else if (this.template_mode.mode == 4) {
  921. if (results.length > 0) {
  922. var isHas_1 = headers.includes('区号')
  923. console.log("区号", isHas_1)
  924. var isHas_2 = headers.includes('机号')
  925. console.log("机号", isHas_2)
  926. var isHas_3 = headers.includes('周一')
  927. console.log(isHas_3)
  928. var isHas_4 = headers.includes('')
  929. console.log(isHas_4)
  930. var isHas_5 = headers.includes('_1')
  931. console.log(isHas_5)
  932. var isHas_6 = headers.includes('周二')
  933. console.log(isHas_6)
  934. var isHas_7 = headers.includes('_2')
  935. console.log(isHas_7)
  936. var isHas_8 = headers.includes('_3')
  937. console.log(isHas_8)
  938. var isHas_9 = headers.includes('周三')
  939. console.log(isHas_9)
  940. var isHas_10 = headers.includes('_4')
  941. console.log(isHas_1)
  942. var isHas_11 = headers.includes('_5')
  943. console.log(isHas_1)
  944. var isHas_12 = headers.includes('周四')
  945. console.log(isHas_1)
  946. var isHas_13 = headers.includes('_6')
  947. console.log(isHas_1)
  948. var isHas_14 = headers.includes('_7')
  949. console.log(isHas_1)
  950. var isHas_15 = headers.includes('周五')
  951. console.log(isHas_1)
  952. var isHas_16 = headers.includes('_8')
  953. console.log(isHas_1)
  954. var isHas_17 = headers.includes('_9')
  955. console.log(isHas_1)
  956. var isHas_18 = headers.includes('周六')
  957. console.log(isHas_1)
  958. var isHas_19 = headers.includes('_10')
  959. console.log(isHas_1)
  960. var isHas_20 = headers.includes('_11')
  961. console.log(isHas_1)
  962. var isHas_21 = headers.includes('周日')
  963. console.log(isHas_1)
  964. var isHas_22 = headers.includes('_12')
  965. console.log(isHas_1)
  966. var isHas_23 = headers.includes('_13')
  967. console.log(isHas_1)
  968. var isHas_24 = headers.includes('周一_1')
  969. var isHas_25 = headers.includes('_14')
  970. var isHas_26 = headers.includes('_15')
  971. var isHas_27 = headers.includes('周二_1')
  972. var isHas_28 = headers.includes('_16')
  973. var isHas_29 = headers.includes('_17')
  974. var isHas_30 = headers.includes('周三_1')
  975. var isHas_31 = headers.includes('_18')
  976. var isHas_32 = headers.includes('_19')
  977. var isHas_33 = headers.includes('周四_1')
  978. var isHas_34 = headers.includes('_20')
  979. var isHas_35 = headers.includes('_21')
  980. var isHas_36 = headers.includes('周五_1')
  981. var isHas_37 = headers.includes('_22')
  982. var isHas_38 = headers.includes('_23')
  983. var isHas_39 = headers.includes('周六_1')
  984. var isHas_40 = headers.includes('_24')
  985. var isHas_41 = headers.includes('_25')
  986. var isHas_42 = headers.includes('周日_1')
  987. var isHas_43 = headers.includes('_26')
  988. var isHas_44 = headers.includes('_27')
  989. var isHas_45 = headers.includes('周一_2')
  990. var isHas_46 = headers.includes('_28')
  991. var isHas_47 = headers.includes('_29')
  992. var isHas_48 = headers.includes('周二_2')
  993. var isHas_49 = headers.includes('_30')
  994. var isHas_50 = headers.includes('_31')
  995. var isHas_51 = headers.includes('周三_2')
  996. var isHas_52 = headers.includes('_32')
  997. var isHas_53 = headers.includes('_33')
  998. var isHas_54 = headers.includes('周四_2')
  999. var isHas_55 = headers.includes('_34')
  1000. var isHas_56 = headers.includes('_35')
  1001. var isHas_57 = headers.includes('周五_2')
  1002. var isHas_58 = headers.includes('_36')
  1003. var isHas_59 = headers.includes('_37')
  1004. var isHas_60 = headers.includes('周六_2')
  1005. var isHas_61 = headers.includes('_38')
  1006. var isHas_62 = headers.includes('_39')
  1007. var isHas_63 = headers.includes('周日_2')
  1008. var isHas_64 = headers.includes('_40')
  1009. var isHas_65 = headers.includes('_41')
  1010. var isHas_66 = headers.includes('周一_3')
  1011. var isHas_67 = headers.includes('_42')
  1012. var isHas_68 = headers.includes('_43')
  1013. var isHas_69 = headers.includes('周二_3')
  1014. var isHas_70 = headers.includes('_44')
  1015. var isHas_71 = headers.includes('_45')
  1016. var isHas_72 = headers.includes('周三_3')
  1017. var isHas_73 = headers.includes('_46')
  1018. var isHas_74 = headers.includes('_47')
  1019. var isHas_75 = headers.includes('周四_3')
  1020. var isHas_76 = headers.includes('_48')
  1021. var isHas_77 = headers.includes('_49')
  1022. var isHas_78 = headers.includes('周五_3')
  1023. var isHas_79 = headers.includes('_50')
  1024. var isHas_80 = headers.includes('_51')
  1025. var isHas_81 = headers.includes('周六_3')
  1026. var isHas_82 = headers.includes('_52')
  1027. var isHas_83 = headers.includes('_53')
  1028. var isHas_84 = headers.includes('周日_3')
  1029. var isHas_85 = headers.includes('_54')
  1030. if (!(isHas_1 && isHas_2 && isHas_3 && isHas_4 && isHas_5 &&
  1031. isHas_6 && isHas_7 && isHas_8 && isHas_9 && isHas_10 &&
  1032. isHas_11 && isHas_12 && isHas_13 && isHas_14 && isHas_15 &&
  1033. isHas_16 && isHas_17 && isHas_18 && isHas_19 && isHas_20 &&
  1034. isHas_21 && isHas_22 && isHas_23 && isHas_24 && isHas_25 &&
  1035. isHas_26 && isHas_27 && isHas_28 && isHas_29 && isHas_30 &&
  1036. isHas_31 && isHas_32 && isHas_33 && isHas_34 && isHas_35 &&
  1037. isHas_36 && isHas_37 && isHas_38 && isHas_39 && isHas_40 &&
  1038. isHas_41 && isHas_42 && isHas_43 && isHas_44 && isHas_45 &&
  1039. isHas_46 && isHas_47 && isHas_48 && isHas_49 && isHas_50 &&
  1040. isHas_51 && isHas_52 && isHas_53 && isHas_54 && isHas_55 &&
  1041. isHas_56 && isHas_57 && isHas_58 && isHas_59 && isHas_60 &&
  1042. isHas_61 && isHas_62 && isHas_63 && isHas_64 && isHas_65 && isHas_66 && isHas_67 &&
  1043. isHas_68 && isHas_69 && isHas_70 && isHas_71 && isHas_72 &&
  1044. isHas_73 && isHas_74 && isHas_75 && isHas_76 && isHas_77&&
  1045. isHas_78 && isHas_79 && isHas_80 && isHas_81 && isHas_82 &&
  1046. isHas_83 && isHas_84 && isHas_85 )) {
  1047. this.dialogVisible = true
  1048. return
  1049. }
  1050. } else {
  1051. this.dialogVisible = true
  1052. return
  1053. }
  1054. }else {
  1055. this.dialogVisible = true
  1056. return
  1057. }
  1058. let is_system_zone = true
  1059. let is_device_number = true
  1060. let zones = []
  1061. let deviceNumber = []
  1062. for (let i = 0; i < results.length; i++) {
  1063. if (results[i + 1]) {
  1064. zones.push(results[i + 1]['区号'])
  1065. }
  1066. if (results[i + 1]) {
  1067. deviceNumber.push(results[i + 1]['机号'])
  1068. }
  1069. }
  1070. const obj = {}
  1071. zones = zones.reduce((cur, next) => {
  1072. obj[next] ? '' : obj[next] = true && cur.push(next)
  1073. return cur
  1074. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  1075. const obj2 = {}
  1076. deviceNumber = deviceNumber.reduce((cur, next) => {
  1077. obj2[next] ? '' : obj2[next] = true && cur.push(next)
  1078. return cur
  1079. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  1080. var total_zones = []
  1081. var total_device_number = []
  1082. for (let key in this.partitions) {
  1083. total_zones.push(this.partitions[key].name)
  1084. }
  1085. for (let key in this.partitions) {
  1086. var jihaos = this.partitions[key].jihaos
  1087. for (let i = 0; i < jihaos.length; i++) {
  1088. total_device_number.push(jihaos[i].number)
  1089. }
  1090. }
  1091. for (let i = 0; i < zones.length; i++) {
  1092. if (!total_zones.includes(zones[i])) {
  1093. is_system_zone = false
  1094. }
  1095. }
  1096. for (let i = 0; i < deviceNumber.length; i++) {
  1097. if (!total_device_number.includes(deviceNumber[i])) {
  1098. is_device_number = false
  1099. }
  1100. }
  1101. let tempObj = null
  1102. if (results.length > 0) {
  1103. tempObj = results[0]
  1104. }
  1105. let datas = []
  1106. for (let i = 0; i < results.length; i++) {
  1107. for (let key in results[i + 1]) {
  1108. let tempObjTwo = {partition_name: '', device_number_name: ''}
  1109. //去除空的
  1110. if (key != '区号' && key != '机号' && results[i + 1][key] != "") {
  1111. let obj = {}
  1112. let result = results[i + 1][key].replace(/\s/g, "")
  1113. console.log(result)
  1114. let result_arr = result.split('-')
  1115. obj['name'] =result_arr[0]
  1116. obj['treat_mode'] = this.getModeId(result_arr[1])
  1117. if (tempObj[key] == '上午') {
  1118. obj['schedule_type'] = 1
  1119. } else if (tempObj[key] == '下午') {
  1120. obj['schedule_type'] = 2
  1121. } else if (tempObj[key] == '晚上') {
  1122. obj['schedule_type'] = 3
  1123. } else {
  1124. obj['schedule_type'] = 0
  1125. }
  1126. obj['schedule_week'] = this.getWeekByResultsStr(key)
  1127. obj['schedule_date'] = this.getDateByResultsStr(key)
  1128. obj['template_id'] = this.getTemplateByWeek(key)
  1129. obj['row'] = this.getRow(key)
  1130. tempObjTwo = obj
  1131. }
  1132. tempObjTwo['partition_name'] = results[i + 1]['区号']
  1133. tempObjTwo['device_number_name'] = results[i + 1]['机号']
  1134. tempObjTwo['index'] = i + 3
  1135. console.log(tempObjTwo['name'])
  1136. console.log(tempObjTwo['schedule_week'])
  1137. console.log(tempObjTwo['schedule_type'])
  1138. console.log(tempObjTwo['schedule_date'])
  1139. if (tempObjTwo['schedule_week'] != undefined && tempObjTwo['name'] != undefined && tempObjTwo['schedule_type'] != undefined && tempObjTwo['schedule_date'] != undefined) {
  1140. var current_date = new Date()
  1141. var m_year = current_date.getFullYear()
  1142. var m_month = current_date.getMonth() + 1
  1143. m_month = m_month < 10 ? '0' + m_month.toString() : m_month.toString()
  1144. var m_date = current_date.getDate() < 10 ? '0' + current_date.getDate().toString() : current_date.getDate().toString()
  1145. var current_date_two = new Date(m_year + '-' + m_month + '-' + m_date)
  1146. console.log(tempObjTwo)
  1147. datas.push(tempObjTwo)
  1148. }
  1149. }
  1150. }
  1151. console.log(datas)
  1152. let date_arr = []
  1153. //校验文档是否规范
  1154. for (let i = 0; i < datas.length; i++) {
  1155. if (datas[i].schedule_date !== '0') {
  1156. date_arr.push(datas[i].schedule_date)
  1157. }
  1158. if (datas[i].device_number_name == undefined) {
  1159. is_device_number = false
  1160. }
  1161. if (datas[i].partition_name == undefined) {
  1162. is_system_zone = false
  1163. }
  1164. if (datas[i].schedule_date === '0') {
  1165. is_system_zone = false
  1166. }
  1167. if (datas[i].schedule_week === '0') {
  1168. is_system_zone = false
  1169. }
  1170. if (datas[i].schedule_type === 0) {
  1171. is_system_zone = false
  1172. }
  1173. }
  1174. //校验文档中同一天同个人是否存在多个排班
  1175. let is_exist_repeat = false
  1176. const obj3 = {}
  1177. date_arr = date_arr.reduce((cur, next) => {
  1178. obj3[next] ? '' : obj3[next] = true && cur.push(next)
  1179. return cur
  1180. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  1181. let tempObjArr = []
  1182. for (let i = 0; i < date_arr.length; i++) {
  1183. let obj = {}
  1184. let key = date_arr[i]
  1185. let value = []
  1186. for (let b = 0; b < datas.length; b++) {
  1187. if (key == datas[b].schedule_date) {
  1188. value.push(datas[b].name)
  1189. }
  1190. }
  1191. obj[key] = value
  1192. tempObjArr.push(obj)
  1193. }
  1194. for (let i = 0; i < tempObjArr.length; i++) {
  1195. for (let key in tempObjArr[i]) {
  1196. let arr = tempObjArr[i][key]
  1197. const obj = {}
  1198. arr = arr.reduce((cur, next) => {
  1199. obj[next] ? '' : obj[next] = true && cur.push(next)
  1200. return cur
  1201. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  1202. //这个地方
  1203. console.log(tempObjArr[i][key])
  1204. console.log(arr)
  1205. if (tempObjArr[i][key].length > arr.length) { //比对原数组和去重后的原数组总数,不同的话则存在重复元素
  1206. is_exist_repeat = true
  1207. }
  1208. }
  1209. }
  1210. let isHeader = true
  1211. if (this.template_mode.mode == 1) {
  1212. if (headers.length > 23) {
  1213. isHeader = false
  1214. }
  1215. } else if (this.template_mode.mode == 2) {
  1216. if (headers.length > 44) {
  1217. isHeader = false
  1218. }
  1219. }else if (this.template_mode.mode == 3) {
  1220. if (headers.length > 65) {
  1221. isHeader = false
  1222. }
  1223. }else if (this.template_mode.mode == 4) {
  1224. if (headers.length > 86) {
  1225. isHeader = false
  1226. }
  1227. }
  1228. console.log(isHeader)
  1229. console.log(is_system_zone)
  1230. console.log(is_device_number)
  1231. if (!is_system_zone || !is_device_number) {
  1232. console.log("123123123123")
  1233. this.dialogVisible = true
  1234. } else {
  1235. if (is_exist_repeat) {
  1236. this.isExistRepeatVisible = true
  1237. } else {
  1238. this.$alert('您提交的排班信息已上传成功,系统正在执行导入,请稍候点击当前页面右上角“下载日志”查看导入结果', '上传成功', {
  1239. confirmButtonText: '确定',
  1240. callback: action => {
  1241. }
  1242. });
  1243. let params = {
  1244. schedule: datas
  1245. }
  1246. //今天的时间
  1247. var day2 = new Date()
  1248. day2.setTime(day2.getTime())
  1249. var month = day2.getMonth() + 1 < 10 ? '0' + (day2.getMonth() + 1).toString() : (day2.getMonth() + 1).toString()
  1250. var day = day2.getDate() < 10 ? '0' + (day2.getDate()).toString() : (day2.getMonth() + 1).toString()
  1251. exportScheduleTemplate(params).then(response => {
  1252. if (response.data.state == 0) {
  1253. return false
  1254. }
  1255. this.$message.success("导入成功")
  1256. // this.getWeekPanels("")
  1257. this.getInitData()
  1258. })
  1259. }
  1260. }
  1261. },
  1262. getInitData(){
  1263. let params = {
  1264. patitionid:""
  1265. }
  1266. getTemplateInitData(params).then(rs => {
  1267. var resp = rs.data
  1268. if (resp.state == 1) {
  1269. var mode = resp.data.template_mode
  1270. var device_numbers = resp.data.device_numbers
  1271. var templates = resp.data.templates
  1272. var patients = resp.data.patients
  1273. var schedules = resp.data.schedules
  1274. this.template_mode = mode
  1275. this.origin_mode = mode.mode
  1276. this.device_numbers = device_numbers
  1277. this.patients = patients
  1278. this.first_template = templates[0]
  1279. this.second_template = templates[1]
  1280. this.templates = templates
  1281. this.third_template = templates[2]
  1282. this.four_template = templates[3]
  1283. if(this.activeName == "first"){
  1284. this.$refs.table.setEditData(this.patients,this.first_template,this.device_numbers,this.templates, this.activeName)
  1285. }else if(this.activeName == "second"){
  1286. this.$refs.table.setEditData(this.patients,this.second_template,this.device_numbers,this.templates, this.activeName)
  1287. }else if(this.activeName == "third"){
  1288. this.$refs.table.setEditData(this.patients,this.third_template,this.device_numbers,this.templates, this.activeName)
  1289. }else if(this.activeName == "four"){
  1290. this.$refs.table.setEditData(this.patients,this.four_template,this.device_numbers,this.templates, this.activeName)
  1291. }
  1292. // var fakeTemplateItems = []
  1293. // for (let index = 0; index < schedules.length; index++) {
  1294. // const schedule = schedules[index]
  1295. // var item = {}
  1296. // this.$set(item, 'id', schedule.id)
  1297. // this.$set(item, 'template_id', 0)
  1298. // this.$set(item, 'device_number_id', schedule.bed_id)
  1299. // this.$set(item, 'treat_mode', schedule.mode_id)
  1300. // this.$set(item, 'weekday', schedule.schedule_week)
  1301. // this.$set(item, 'time_type', schedule.schedule_type)
  1302. // var patient = {}
  1303. // this.$set(patient, 'id', schedule.patient_id)
  1304. // this.$set(patient, 'name', schedule.patient)
  1305. // this.$set(item, 'patient', patient)
  1306. //
  1307. // fakeTemplateItems.push(item)
  1308. // }
  1309. // this.this_week_schedules.items = fakeTemplateItems
  1310. } else {
  1311. this.$message(resp.msg)
  1312. }
  1313. })
  1314. }, getTemplateByWeek(key) {
  1315. switch (key) {
  1316. case '周一' : //本周一
  1317. return this.first_template.id
  1318. break
  1319. case '': //本周一
  1320. return this.first_template.id
  1321. break
  1322. case '_1': //本周一
  1323. return this.first_template.id
  1324. break
  1325. case '周一_1': //下周一
  1326. return this.second_template.id
  1327. break
  1328. case '_14': //下周一
  1329. return this.second_template.id
  1330. break
  1331. case '_15': //下周一
  1332. return this.second_template.id
  1333. break
  1334. case '周一_2': //下周一
  1335. return this.third_template.id
  1336. break
  1337. case '_28': //下周一
  1338. return this.third_template.id
  1339. break
  1340. case '_29': //下周一
  1341. return this.third_template.id
  1342. break
  1343. case '周一_3': //下周一
  1344. return this.four_template.id
  1345. break
  1346. case '_42': //下周一
  1347. return this.four_template.id
  1348. break
  1349. case '_43': //下周一
  1350. return this.four_template.id
  1351. break
  1352. case '周二' : //本周二
  1353. return this.first_template.id
  1354. break
  1355. case '_2': //本周二
  1356. return this.first_template.id
  1357. break
  1358. case '_3': //本周二
  1359. return this.first_template.id
  1360. break
  1361. case '周二_1'://下周二
  1362. return this.second_template.id
  1363. break
  1364. case '_16' ://下周二
  1365. return this.second_template.id
  1366. break
  1367. case '_17'://下周二
  1368. return this.second_template.id
  1369. break
  1370. case '周二_2'://下周二
  1371. return this.third_template.id
  1372. break
  1373. case '_30' ://下周二
  1374. return this.third_template.id
  1375. break
  1376. case '_31'://下周二
  1377. return this.third_template.id
  1378. break
  1379. case '周二_3'://下周二
  1380. return this.four_template.id
  1381. break
  1382. case '_44' ://下周二
  1383. return this.four_template.id
  1384. break
  1385. case '_45'://下周二
  1386. return this.four_template.id
  1387. break
  1388. case '周三' : //本周三
  1389. return this.first_template.id
  1390. break
  1391. case '_4': //本周三
  1392. return this.first_template.id
  1393. break
  1394. case '_5': //本周三
  1395. return this.first_template.id
  1396. break
  1397. case '周三_1': //下周三
  1398. return this.second_template.id
  1399. break
  1400. case '_18' : //下周三
  1401. return this.second_template.id
  1402. break
  1403. case '_19': //下周三
  1404. return this.second_template.id
  1405. break
  1406. case '周三_2': //下周三
  1407. return this.third_template.id
  1408. break
  1409. case '_32' : //下周三
  1410. return this.third_template.id
  1411. break
  1412. case '_33': //下周三
  1413. return this.third_template.id
  1414. break
  1415. case '周三_3': //下周三
  1416. return this.four_template.id
  1417. break
  1418. case '_46' : //下周三
  1419. return this.four_template.id
  1420. break
  1421. case '_47': //下周三
  1422. return this.four_template.id
  1423. break
  1424. case '周四':
  1425. return this.first_template.id
  1426. break
  1427. case '_6' :
  1428. return this.first_template.id
  1429. break
  1430. case '_7':
  1431. return this.first_template.id
  1432. break
  1433. case '周四_1':
  1434. return this.second_template.id
  1435. break
  1436. case '_20' :
  1437. return this.second_template.id
  1438. break
  1439. case '_21':
  1440. return this.second_template.id
  1441. break
  1442. case '周四_2':
  1443. return this.third_template.id
  1444. break
  1445. case '_34' :
  1446. return this.third_template.id
  1447. break
  1448. case '_35':
  1449. return this.third_template.id
  1450. break
  1451. case '周四_3':
  1452. return this.four_template.id
  1453. break
  1454. case '_48' :
  1455. return this.four_template.id
  1456. break
  1457. case '_49':
  1458. return this.four_template.id
  1459. break
  1460. case '周五':
  1461. return this.first_template.id
  1462. break
  1463. case '_8':
  1464. return this.first_template.id
  1465. break
  1466. case '_9':
  1467. return this.first_template.id
  1468. break
  1469. case '周五_1' :
  1470. return this.second_template.id
  1471. break
  1472. case '_22' :
  1473. return this.second_template.id
  1474. break
  1475. case '_23':
  1476. return this.second_template.id
  1477. break
  1478. case '周五_2' :
  1479. return this.third_template.id
  1480. break
  1481. case '_36' :
  1482. return this.third_template.id
  1483. break
  1484. case '_37':
  1485. return this.third_template.id
  1486. break
  1487. case '周五_3' :
  1488. return this.four_template.id
  1489. break
  1490. case '_50' :
  1491. return this.four_template.id
  1492. break
  1493. case '_51':
  1494. return this.four_template.id
  1495. break
  1496. case '周六' :
  1497. return this.first_template.id
  1498. break
  1499. case '_10' :
  1500. return this.first_template.id
  1501. break
  1502. case '_11':
  1503. return this.first_template.id
  1504. break
  1505. case '周六_1' :
  1506. return this.second_template.id
  1507. break
  1508. case '_24' :
  1509. return this.second_template.id
  1510. break
  1511. case '_25':
  1512. return this.second_template.id
  1513. break
  1514. case '周六_2' :
  1515. return this.third_template.id
  1516. break
  1517. case '_38' :
  1518. return this.third_template.id
  1519. break
  1520. case '_39':
  1521. return this.third_template.id
  1522. break
  1523. case '周六_3' :
  1524. return this.four_template.id
  1525. break
  1526. case '_52' :
  1527. return this.four_template.id
  1528. break
  1529. case '_53':
  1530. return this.four_template.id
  1531. break
  1532. case '周日' :
  1533. return this.first_template.id
  1534. break
  1535. case '_12' :
  1536. return this.first_template.id
  1537. break
  1538. case '_13':
  1539. return this.first_template.id
  1540. break
  1541. case '周日_1' :
  1542. return this.second_template.id
  1543. break
  1544. case '_26' :
  1545. return this.second_template.id
  1546. break
  1547. case '_27':
  1548. return this.second_template.id
  1549. break
  1550. case '周日_2' :
  1551. return this.third_template.id
  1552. break
  1553. case '_40' :
  1554. return this.third_template.id
  1555. break
  1556. case '_41':
  1557. return this.third_template.id
  1558. break
  1559. case '周日_3' :
  1560. return this.four_template.id
  1561. break
  1562. case '_54' :
  1563. return this.four_template.id
  1564. break
  1565. case '_55':
  1566. return this.four_template.id
  1567. break
  1568. }
  1569. },
  1570. getWeekByResultsStr(key) {
  1571. switch (key) {
  1572. case '周一':
  1573. return '1'
  1574. break
  1575. case '周一_1':
  1576. return '1'
  1577. break
  1578. case '周一_2':
  1579. return '1'
  1580. break
  1581. case '周一_3':
  1582. return '1'
  1583. break
  1584. case '':
  1585. return '1'
  1586. break
  1587. case '_1':
  1588. return '1'
  1589. break
  1590. case '_14':
  1591. return '1'
  1592. break
  1593. case '_15':
  1594. return '1'
  1595. break
  1596. case '_28':
  1597. return '1'
  1598. break
  1599. case '_29':
  1600. return '1'
  1601. break
  1602. case '_42':
  1603. return '1'
  1604. break
  1605. case '_43':
  1606. return '1'
  1607. break
  1608. case '周二' :
  1609. return '2'
  1610. break
  1611. case '周二_1':
  1612. return '2'
  1613. break
  1614. case '周二_2' :
  1615. return '2'
  1616. break
  1617. case '周二_3' :
  1618. return '2'
  1619. break
  1620. case '_2':
  1621. return '2'
  1622. break
  1623. case '_3':
  1624. return '2'
  1625. break
  1626. case '_16' :
  1627. return '2'
  1628. break
  1629. case '_17' :
  1630. return '2'
  1631. break
  1632. case '_30':
  1633. return '2'
  1634. break
  1635. case '_31':
  1636. return '2'
  1637. break
  1638. case '_44':
  1639. return '2'
  1640. break
  1641. case '_45':
  1642. return '2'
  1643. break
  1644. case '周三':
  1645. return '3'
  1646. break
  1647. case '周三_1':
  1648. return '3'
  1649. break
  1650. case '周三_2':
  1651. return '3'
  1652. break
  1653. case '周三_3':
  1654. return '3'
  1655. break
  1656. case '_4' :
  1657. return '3'
  1658. break
  1659. case '_5' :
  1660. return '3'
  1661. break
  1662. case '_18' :
  1663. return '3'
  1664. break
  1665. case '_19' :
  1666. return '3'
  1667. break
  1668. case '_32' :
  1669. return '3'
  1670. break
  1671. case '_33' :
  1672. return '3'
  1673. break
  1674. case '_46' :
  1675. return '3'
  1676. break
  1677. case '_47' :
  1678. return '3'
  1679. break
  1680. case '周四':
  1681. return '4'
  1682. break
  1683. case '周四_1' :
  1684. return '4'
  1685. break
  1686. case'周四_2' :
  1687. return '4'
  1688. break
  1689. case'周四_3' :
  1690. return '4'
  1691. break
  1692. case '_6' :
  1693. return '4'
  1694. break
  1695. case '_7':
  1696. return '4'
  1697. break
  1698. case '_20':
  1699. return '4'
  1700. break
  1701. case '_21':
  1702. return '4'
  1703. break
  1704. case '_34':
  1705. return '4'
  1706. break
  1707. case '_35':
  1708. return '4'
  1709. break
  1710. case '_48':
  1711. return '4'
  1712. break
  1713. case '_49':
  1714. return '4'
  1715. break
  1716. case '周五' :
  1717. return '5'
  1718. break
  1719. case '周五_1':
  1720. return '5'
  1721. break
  1722. case '周五_2' :
  1723. return '5'
  1724. break
  1725. case '周五_3' :
  1726. return '5'
  1727. break
  1728. case '_8':
  1729. return '5'
  1730. break
  1731. case '_9' :
  1732. return '5'
  1733. break
  1734. case '_22' :
  1735. return '5'
  1736. break
  1737. case '_23':
  1738. return '5'
  1739. break
  1740. case '_36':
  1741. return '5'
  1742. break
  1743. case '_37':
  1744. return '5'
  1745. break
  1746. case '_50':
  1747. return '5'
  1748. break
  1749. case '_51':
  1750. return '5'
  1751. break
  1752. case '周六':
  1753. return '6'
  1754. break
  1755. case '周六_1':
  1756. return '6'
  1757. break
  1758. case '周六_2' :
  1759. return '6'
  1760. break
  1761. case '周六_3' :
  1762. return '6'
  1763. break
  1764. case '_10' :
  1765. return '6'
  1766. break
  1767. case '_11':
  1768. return '6'
  1769. break
  1770. case '_24' :
  1771. return '6'
  1772. break
  1773. case '_25' :
  1774. return '6'
  1775. break
  1776. case '_38' :
  1777. return '6'
  1778. break
  1779. case '_39':
  1780. return '6'
  1781. break
  1782. case '_52' :
  1783. return '6'
  1784. break
  1785. case '_53':
  1786. return '6'
  1787. break
  1788. case '周日':
  1789. return '7'
  1790. break
  1791. case '周日_1' :
  1792. return '7'
  1793. break
  1794. case '周日_2' :
  1795. return '7'
  1796. break
  1797. case '周日_3' :
  1798. return '7'
  1799. break
  1800. case '_12' :
  1801. return '7'
  1802. break
  1803. case '_13' :
  1804. return '7'
  1805. break
  1806. case '_26':
  1807. return '7'
  1808. break
  1809. case '_27':
  1810. return '7'
  1811. break
  1812. case '_40' :
  1813. return '7'
  1814. break
  1815. case '_41':
  1816. return '7'
  1817. break
  1818. case '_54' :
  1819. return '7'
  1820. break
  1821. case '_55':
  1822. return '7'
  1823. break
  1824. default:
  1825. return '0'
  1826. break
  1827. }
  1828. },
  1829. getRow(key) {
  1830. switch (key) {
  1831. case '周一' : //本周一
  1832. return 'C'
  1833. break
  1834. case '': //本周一
  1835. return 'D'
  1836. break
  1837. case '_1': //本周一
  1838. return 'E'
  1839. break
  1840. case '周一_1': //下周一
  1841. return 'X'
  1842. break
  1843. case '_14': //下周一
  1844. return 'Y'
  1845. break
  1846. case '_15': //下周一
  1847. return 'Z'
  1848. break
  1849. case '周一_2' : //下下周一
  1850. return 'AS'
  1851. break
  1852. case '_28': //下下周一
  1853. return 'AT'
  1854. break
  1855. case '_29': //下下周一
  1856. return 'AU'
  1857. break
  1858. case '周一_3' : //下下下周一
  1859. return 'BN'
  1860. break
  1861. case '_42': //下下下周一
  1862. return 'BO'
  1863. break
  1864. case '_43': //下下下周一
  1865. return 'BP'
  1866. break
  1867. case '周二' : //本周二
  1868. return 'F'
  1869. break
  1870. case '_2': //本周二
  1871. return 'G'
  1872. break
  1873. case '_3': //本周二
  1874. return 'H'
  1875. break
  1876. case '周二_1'://下周二
  1877. return 'AA'
  1878. break
  1879. case '_16' ://下周二
  1880. return 'AB'
  1881. break
  1882. case '_17'://下周二
  1883. return 'AC'
  1884. break
  1885. case '周二_2' ://下下周二
  1886. return 'AV'
  1887. break
  1888. case '_30' ://下下周二
  1889. return 'AW'
  1890. break
  1891. case '_31'://下下周二
  1892. return 'AX'
  1893. break
  1894. case '周二_3' ://下xia下周二
  1895. return 'BQ'
  1896. break
  1897. case '_44' ://下xia下周二
  1898. return 'BR'
  1899. break
  1900. case '_45'://下xia下周二
  1901. return 'BS'
  1902. break
  1903. case '周三' : //本周三
  1904. return 'I'
  1905. break
  1906. case '_4': //本周三
  1907. return 'J'
  1908. break
  1909. case '_5': //本周三
  1910. return 'K'
  1911. break
  1912. case '周三_1': //下周三
  1913. return 'AD'
  1914. break
  1915. case '_18' : //下周三
  1916. return 'AE'
  1917. break
  1918. case '_19': //下周三
  1919. return 'AF'
  1920. break
  1921. case '周三_2' : //下下周三
  1922. return 'AY'
  1923. break
  1924. case '_32' : //下下周三
  1925. return 'AZ'
  1926. break
  1927. case '_33': //下下周三
  1928. return 'BA'
  1929. break
  1930. case '周三_3' : //下下周三
  1931. return 'BT'
  1932. break
  1933. case '_46' : //下下周三
  1934. return 'BU'
  1935. break
  1936. case '_47': //下下周三
  1937. return 'BV'
  1938. break
  1939. case '周四':
  1940. return 'L'
  1941. break
  1942. case '_6' :
  1943. return 'M'
  1944. break
  1945. case '_7':
  1946. return 'N'
  1947. break
  1948. case '周四_1':
  1949. return 'AG'
  1950. break
  1951. case '_20' :
  1952. return 'AH'
  1953. break
  1954. case '_21':
  1955. return 'AI'
  1956. break
  1957. case '周四_2' :
  1958. return 'BB'
  1959. break
  1960. case '_34':
  1961. return 'BC'
  1962. break
  1963. case '_35':
  1964. return 'BD'
  1965. break
  1966. case '周四_3' :
  1967. return 'BW'
  1968. break
  1969. case '_48':
  1970. return 'BX'
  1971. break
  1972. case '_49':
  1973. return 'BY'
  1974. break
  1975. case '周五':
  1976. return 'O'
  1977. break
  1978. case '_8':
  1979. return 'P'
  1980. break
  1981. case '_9':
  1982. return 'Q'
  1983. break
  1984. case '周五_1' :
  1985. return 'AJ'
  1986. break
  1987. case '_22' :
  1988. return 'AK'
  1989. break
  1990. case '_23':
  1991. return 'AL'
  1992. break
  1993. case '周五_2' :
  1994. return 'BE'
  1995. break
  1996. case '_36':
  1997. return 'BF'
  1998. break
  1999. case '_37':
  2000. return 'BG'
  2001. break
  2002. case '周五_3' :
  2003. return 'BZ'
  2004. break
  2005. case '_50':
  2006. return 'CA'
  2007. break
  2008. case '_51':
  2009. return 'CB'
  2010. break
  2011. case '周六' :
  2012. return 'R'
  2013. break
  2014. case '_10' :
  2015. return 'S'
  2016. break
  2017. case '_11':
  2018. return 'T'
  2019. break
  2020. case '周六_1' :
  2021. return 'AM'
  2022. break
  2023. case '_24' :
  2024. return 'AN'
  2025. break
  2026. case '_25':
  2027. return 'AO'
  2028. break
  2029. case '周六_2' :
  2030. return 'BH'
  2031. break
  2032. case '_38' :
  2033. return 'BI'
  2034. break
  2035. case '_39':
  2036. return 'BJ'
  2037. break
  2038. case '周六_3' :
  2039. return 'CC'
  2040. break
  2041. case '_52' :
  2042. return 'CD'
  2043. break
  2044. case '_53':
  2045. return 'CE'
  2046. break
  2047. case '周日' :
  2048. return 'U'
  2049. break
  2050. case '_12' :
  2051. return 'V'
  2052. break
  2053. case '_13':
  2054. return 'W'
  2055. break
  2056. case '周日_1' :
  2057. return 'AP'
  2058. break
  2059. case '_26' :
  2060. return 'AQ'
  2061. break
  2062. case '_27':
  2063. return 'AR'
  2064. break
  2065. case '周日_2':
  2066. return 'BK'
  2067. break
  2068. case '_40':
  2069. return 'BL'
  2070. break
  2071. case '_41':
  2072. return 'BM'
  2073. break
  2074. case '周日_3':
  2075. return 'CF'
  2076. break
  2077. case '_54':
  2078. return 'CG'
  2079. break
  2080. case '_55':
  2081. return 'CH'
  2082. break
  2083. }
  2084. },
  2085. getDateByResultsStr(key) {
  2086. switch (key) {
  2087. case '周一' : //本周一
  2088. return this.days[0]
  2089. break
  2090. case '': //本周一
  2091. return this.days[0]
  2092. break
  2093. case '_1': //本周一
  2094. return this.days[0]
  2095. break
  2096. case '周一_1': //下周一
  2097. return this.days[7]
  2098. break
  2099. case '_14': //下周一
  2100. return this.days[7]
  2101. break
  2102. case '_15': //下周一
  2103. return this.days[7]
  2104. break
  2105. case '周一_2' : //下下周一
  2106. return this.days[14]
  2107. break
  2108. case '_28': //下下周一
  2109. return this.days[14]
  2110. break
  2111. case '_29': //下下周一
  2112. return this.days[14]
  2113. break
  2114. case '周一_3' : //下下下周一
  2115. return this.days[21]
  2116. break
  2117. case '_42': //下下下周一
  2118. return this.days[21]
  2119. break
  2120. case '_43': //下下下周一
  2121. return this.days[21]
  2122. break
  2123. case '周二' : //本周二
  2124. return this.days[1]
  2125. break
  2126. case '_2': //本周二
  2127. return this.days[1]
  2128. break
  2129. case '_3': //本周二
  2130. return this.days[1]
  2131. break
  2132. case '周二_1'://下周二
  2133. return this.days[8]
  2134. break
  2135. case '_16' ://下周二
  2136. return this.days[8]
  2137. break
  2138. case '_17'://下周二
  2139. return this.days[8]
  2140. break
  2141. case '周二_2' ://下下周二
  2142. return this.days[15]
  2143. break
  2144. case '_30' ://下下周二
  2145. return this.days[15]
  2146. break
  2147. case '_31'://下下周二
  2148. return this.days[15]
  2149. break
  2150. case '周二_3' ://下下下周二
  2151. return this.days[22]
  2152. break
  2153. case '_44' ://下下下周二
  2154. return this.days[22]
  2155. break
  2156. case '_45'://下下下周二
  2157. return this.days[22]
  2158. break
  2159. case '周三' : //本周三
  2160. return this.days[2]
  2161. break
  2162. case '_4': //本周三
  2163. return this.days[2]
  2164. break
  2165. case '_5': //本周三
  2166. return this.days[2]
  2167. break
  2168. case '周三_1': //下周三
  2169. return this.days[9]
  2170. break
  2171. case '_18' : //下周三
  2172. return this.days[9]
  2173. break
  2174. case '_19': //下周三
  2175. return this.days[9]
  2176. break
  2177. case '周三_2' : //下下周三
  2178. return this.days[16]
  2179. break
  2180. case '_32' : //下下周三
  2181. return this.days[16]
  2182. break
  2183. case '_33': //下下周三
  2184. return this.days[16]
  2185. break
  2186. case '周三_3' : //下下下周三
  2187. return this.days[23]
  2188. break
  2189. case '_46' : //下下下周三
  2190. return this.days[23]
  2191. break
  2192. case '_47': //下下下周三
  2193. return this.days[23]
  2194. break
  2195. case '周四':
  2196. return this.days[3]
  2197. break
  2198. case '_6' :
  2199. return this.days[3]
  2200. break
  2201. case '_7':
  2202. return this.days[3]
  2203. break
  2204. case '周四_1':
  2205. return this.days[10]
  2206. break
  2207. case '_20' :
  2208. return this.days[10]
  2209. break
  2210. case '_21':
  2211. return this.days[10]
  2212. break
  2213. case '周四_2' :
  2214. return this.days[17]
  2215. break
  2216. case '_34':
  2217. return this.days[17]
  2218. break
  2219. case '_35':
  2220. return this.days[17]
  2221. break
  2222. case '周四_3' :
  2223. return this.days[24]
  2224. break
  2225. case '_48':
  2226. return this.days[24]
  2227. break
  2228. case '_49':
  2229. return this.days[24]
  2230. break
  2231. case '周五':
  2232. return this.days[4]
  2233. break
  2234. case '_8':
  2235. return this.days[4]
  2236. break
  2237. case '_9':
  2238. return this.days[4]
  2239. break
  2240. case '周五_1' :
  2241. return this.days[11]
  2242. break
  2243. case '_22' :
  2244. return this.days[11]
  2245. break
  2246. case '_23':
  2247. return this.days[11]
  2248. break
  2249. case '周五_2' :
  2250. return this.days[18]
  2251. break
  2252. case '_36':
  2253. return this.days[18]
  2254. break
  2255. case '_37':
  2256. return this.days[18]
  2257. break
  2258. case '周五_3' :
  2259. return this.days[25]
  2260. break
  2261. case '_50':
  2262. return this.days[25]
  2263. break
  2264. case '_51':
  2265. return this.days[25]
  2266. break
  2267. case '周六' :
  2268. return this.days[5]
  2269. break
  2270. case '_10' :
  2271. return this.days[5]
  2272. break
  2273. case '_11':
  2274. return this.days[5]
  2275. break
  2276. case '周六_1' :
  2277. return this.days[12]
  2278. break
  2279. case '_24' :
  2280. return this.days[12]
  2281. break
  2282. case '_25':
  2283. return this.days[12]
  2284. break
  2285. case '周六_2' :
  2286. return this.days[19]
  2287. break
  2288. case '_38' :
  2289. return this.days[19]
  2290. break
  2291. case '_39':
  2292. return this.days[19]
  2293. break
  2294. case '周六_3' :
  2295. return this.days[26]
  2296. break
  2297. case '_52' :
  2298. return this.days[26]
  2299. break
  2300. case '_53':
  2301. return this.days[26]
  2302. break
  2303. case '周日' :
  2304. return this.days[6]
  2305. break
  2306. case '_12' :
  2307. return this.days[6]
  2308. break
  2309. case '_13':
  2310. return this.days[6]
  2311. break
  2312. case '周日_1' :
  2313. return this.days[13]
  2314. break
  2315. case '_26' :
  2316. return this.days[13]
  2317. break
  2318. case '_27':
  2319. return this.days[13]
  2320. break
  2321. case '周日_2':
  2322. return this.days[20]
  2323. break
  2324. case '_40':
  2325. return this.days[20]
  2326. break
  2327. case '_41':
  2328. return this.days[20]
  2329. break
  2330. case '周日_3':
  2331. return this.days[27]
  2332. break
  2333. case '_54':
  2334. return this.days[27]
  2335. break
  2336. case '_55':
  2337. return this.days[27]
  2338. break
  2339. default:
  2340. return '0'
  2341. break
  2342. }
  2343. },
  2344. changeZone(val){
  2345. this.getWeekPanels(val)
  2346. let params = {
  2347. patitionid:val
  2348. }
  2349. console.log(params)
  2350. getTemplateInitDataTwo(params).then(rs => {
  2351. var resp = rs.data
  2352. if (resp.state == 1) {
  2353. var mode = resp.data.template_mode
  2354. var device_numbers = resp.data.device_numbers
  2355. var templates = resp.data.templates
  2356. this.templates = templates
  2357. if(templates.length > 0){
  2358. this.firstWeekData = templates[0].items
  2359. this.first_template = templates[0]
  2360. }
  2361. if(templates.length > 1){
  2362. this.secondWeekData = templates[1].items
  2363. this.second_template = templates[1]
  2364. }
  2365. if(templates.length > 2){
  2366. this.thirdWeekData = templates[2].items
  2367. this.third_template = templates[2]
  2368. }
  2369. if(templates.length > 3){
  2370. this.fourWeekData = templates[3].items
  2371. this.four_template = templates[3]
  2372. }
  2373. var patients = resp.data.patients
  2374. // var schedules = resp.data.schedules
  2375. this.template_mode = mode
  2376. this.origin_mode = mode.mode
  2377. this.device_numbers = device_numbers
  2378. this.patients = patients
  2379. this.$refs.table.setEditData(this.patients,this.first_template,this.device_numbers,this.templates,this.activeName)
  2380. // this.$refs.table_two.setEditData(this.patients,this.second_template,this.device_numbers)
  2381. // this.$refs.table_three.setEditData(this.patients,this.third_template,this.device_numbers)
  2382. // this.$refs.table_four.setEditData(this.patients,this.four_template,this.device_numbers)
  2383. var fakeTemplateItems = []
  2384. // for (let index = 0; index < schedules.length; index++) {
  2385. // const schedule = schedules[index]
  2386. // var item = {}
  2387. // this.$set(item, 'id', schedule.id)
  2388. // this.$set(item, 'template_id', 0)
  2389. // this.$set(item, 'device_number_id', schedule.bed_id)
  2390. // this.$set(item, 'treat_mode', schedule.mode_id)
  2391. // this.$set(item, 'weekday', schedule.schedule_week)
  2392. // this.$set(item, 'time_type', schedule.schedule_type)
  2393. // var patient = {}
  2394. // this.$set(patient, 'id', schedule.patient_id)
  2395. // this.$set(patient, 'name', schedule.patient)
  2396. // this.$set(item, 'patient', patient)
  2397. //
  2398. // fakeTemplateItems.push(item)
  2399. // }
  2400. this.this_week_schedules.items = fakeTemplateItems
  2401. } else {
  2402. this.$message(resp.msg)
  2403. }
  2404. })
  2405. },
  2406. saveData(val,del_data){
  2407. var tempDataOne = []
  2408. for(let i = 0; i < val.length; i++){
  2409. tempDataOne.push(val[i])
  2410. }
  2411. this.$refs.table.SetSmartSch(tempDataOne,del_data)
  2412. },
  2413. getWeekPanels(val) {
  2414. getWeekPanels(1,val).then(response => {
  2415. if (response.data.state == 0) {
  2416. return false
  2417. }
  2418. var partitions = response.data.data.partitions
  2419. var that = this
  2420. if (partitions.length > 0) {
  2421. partitions.forEach(function (partition) {
  2422. if (partition.jihaos.length == 0) {
  2423. return false
  2424. }
  2425. that.partitions[partition.id] = partition
  2426. partition.jihaos.forEach(function (jihao) {
  2427. var thisPa = {
  2428. area: partition.name,
  2429. zone_id: partition.id,
  2430. zone_type: partition.type,
  2431. cut: jihao.number,
  2432. jihao_id: jihao.id,
  2433. Mon_M: {
  2434. schedule_id: 0,
  2435. mode_id: 0,
  2436. mode_name: '',
  2437. patient_id: 0,
  2438. patient: ''
  2439. },
  2440. Mon_A: {
  2441. schedule_id: 0,
  2442. mode_id: 0,
  2443. mode_name: '',
  2444. patient_id: 0,
  2445. patient: ''
  2446. },
  2447. Mon_N: {
  2448. schedule_id: 0,
  2449. mode_id: 0,
  2450. mode_name: '',
  2451. patient_id: 0,
  2452. patient: ''
  2453. },
  2454. Tue_M: {
  2455. schedule_id: 0,
  2456. mode_id: 0,
  2457. mode_name: '',
  2458. patient_id: 0,
  2459. patient: ''
  2460. },
  2461. Tue_A: {
  2462. schedule_id: 0,
  2463. mode_id: 0,
  2464. mode_name: '',
  2465. patient_id: 0,
  2466. patient: ''
  2467. },
  2468. Tue_N: {
  2469. schedule_id: 0,
  2470. mode_id: 0,
  2471. mode_name: '',
  2472. patient_id: 0,
  2473. patient: ''
  2474. },
  2475. Wed_M: {
  2476. schedule_id: 0,
  2477. mode_id: 0,
  2478. mode_name: '',
  2479. patient_id: 0,
  2480. patient: ''
  2481. },
  2482. Wed_A: {
  2483. schedule_id: 0,
  2484. mode_id: 0,
  2485. mode_name: '',
  2486. patient_id: 0,
  2487. patient: ''
  2488. },
  2489. Wed_N: {
  2490. schedule_id: 0,
  2491. mode_id: 0,
  2492. mode_name: '',
  2493. patient_id: 0,
  2494. patient: ''
  2495. },
  2496. Thurs_M: {
  2497. schedule_id: 0,
  2498. mode_id: 0,
  2499. mode_name: '',
  2500. patient_id: 0,
  2501. patient: ''
  2502. },
  2503. Thurs_A: {
  2504. schedule_id: 0,
  2505. mode_id: 0,
  2506. mode_name: '',
  2507. patient_id: 0,
  2508. patient: ''
  2509. },
  2510. Thurs_N: {
  2511. schedule_id: 0,
  2512. mode_id: 0,
  2513. mode_name: '',
  2514. patient_id: 0,
  2515. patient: ''
  2516. },
  2517. Fri_M: {
  2518. schedule_id: 0,
  2519. mode_id: 0,
  2520. mode_name: '',
  2521. patient_id: 0,
  2522. patient: ''
  2523. },
  2524. Fri_A: {
  2525. schedule_id: 0,
  2526. mode_id: 0,
  2527. mode_name: '',
  2528. patient_id: 0,
  2529. patient: ''
  2530. },
  2531. Fri_N: {
  2532. schedule_id: 0,
  2533. mode_id: 0,
  2534. mode_name: '',
  2535. patient_id: 0,
  2536. patient: ''
  2537. },
  2538. Sat_M: {
  2539. schedule_id: 0,
  2540. mode_id: 0,
  2541. mode_name: '',
  2542. patient_id: 0,
  2543. patient: ''
  2544. },
  2545. Sat_A: {
  2546. schedule_id: 0,
  2547. mode_id: 0,
  2548. mode_name: '',
  2549. patient_id: 0,
  2550. patient: ''
  2551. },
  2552. Sat_N: {
  2553. schedule_id: 0,
  2554. mode_id: 0,
  2555. mode_name: '',
  2556. patient_id: 0,
  2557. patient: ''
  2558. },
  2559. Sun_A: {
  2560. schedule_id: 0,
  2561. mode_id: 0,
  2562. mode_name: '',
  2563. patient_id: 0,
  2564. patient: ''
  2565. },
  2566. Sun_N: {
  2567. schedule_id: 0,
  2568. mode_id: 0,
  2569. mode_name: '',
  2570. patient_id: 0,
  2571. patient: ''
  2572. },
  2573. Sun_M: {
  2574. schedule_id: 0,
  2575. mode_id: 0,
  2576. mode_name: '',
  2577. patient_id: 0,
  2578. patient: ''
  2579. },
  2580. total: 0
  2581. }
  2582. })
  2583. })
  2584. }
  2585. })
  2586. },
  2587. editClick:function (){
  2588. this.$nextTick(function() {
  2589. if(this.activeName == "first"){
  2590. this.activeName = "first"
  2591. this.$refs.table.showSmartDialog()
  2592. }else if(this.activeName == "second"){
  2593. this.activeName = "second"
  2594. this.$refs.table.showSmartDialog()
  2595. }else if(this.activeName == "third"){
  2596. this.activeName = "third"
  2597. this.$refs.table.showSmartDialog()
  2598. }else {
  2599. this.activeName = "four"
  2600. this.$refs.table.showSmartDialog()
  2601. }
  2602. })
  2603. },
  2604. // 退出排班模板
  2605. saveClick:function (){
  2606. if(this.template_mode.mode == 0){
  2607. // this.$router.go(-1)
  2608. this.$router.back()
  2609. }else{
  2610. this.schedulingTableVisible=false
  2611. this.$message.success("保存成功")
  2612. this.$router.back()
  2613. }
  2614. },
  2615. setScheduleTemplateAction: function () {
  2616. this.$refs.setup_dialog.show()
  2617. },
  2618. didChangeTemplateMode: function (mode) {
  2619. if (this.origin_mode != mode) {
  2620. if (this.origin_mode == 0) { // 0 -> 1 或 0 -> 2
  2621. // 不处理模板 item
  2622. } else if (mode == 0) { // 1 -> 0 或 2 -> 0 清除所有模板的 item
  2623. this.first_template.items.splice(0, this.first_template.items.length)
  2624. this.second_template.items.splice(0, this.second_template.items.length)
  2625. this.third_template.items.splice(0, this.third_template.items.length)
  2626. this.four_template.items.splice(0, this.four_template.items.length)
  2627. } else if (this.origin_mode == 1 && mode == 2) { // 1 -> 2
  2628. // 不处理模板 item
  2629. }else if (this.origin_mode == 1 && mode == 3) { // 1 -> 2
  2630. // 不处理模板 item
  2631. }else if (this.origin_mode == 1 && mode == 4) { // 1 -> 2
  2632. // 不处理模板 item
  2633. } else if (this.origin_mode == 2 && mode == 1) { // 2 -> 1 清除第二个模板的 item
  2634. this.second_template.items.splice(0, this.second_template.items.length)
  2635. }else if (this.origin_mode == 3 && mode == 1) { // 2 -> 1 清除第二个模板的 item
  2636. this.second_template.items.splice(0, this.second_template.items.length)
  2637. this.third_template.items.splice(0, this.third_template.items.length)
  2638. }else if (this.origin_mode == 3 && mode == 2){
  2639. this.third_template.items.splice(0, this.third_template.items.length)
  2640. }else if (this.origin_mode == 4 && mode == 1) {
  2641. this.second_template.items.splice(0, this.second_template.items.length)
  2642. this.third_template.items.splice(0, this.third_template.items.length)
  2643. this.four_template.items.splice(0, this.four_template.items.length)
  2644. }else if (this.origin_mode == 4 && mode == 2) {
  2645. this.third_template.items.splice(0, this.third_template.items.length)
  2646. this.four_template.items.splice(0, this.four_template.items.length)
  2647. }else if (this.origin_mode == 4 && mode == 3) {
  2648. this.four_template.items.splice(0, this.four_template.items.length)
  2649. }
  2650. this.origin_mode = mode
  2651. let params = {
  2652. patitionid:""
  2653. }
  2654. getTemplateInitData(params).then(rs => {
  2655. var resp = rs.data
  2656. if (resp.state == 1) {
  2657. var mode = resp.data.template_mode
  2658. var device_numbers = resp.data.device_numbers
  2659. var templates = resp.data.templates
  2660. this.templates = templates
  2661. if(templates.length > 0){
  2662. this.firstWeekData = templates[0].items
  2663. this.first_template = templates[0]
  2664. }
  2665. if(templates.length > 1){
  2666. this.secondWeekData = templates[1].items
  2667. this.second_template = templates[1]
  2668. }
  2669. if(templates.length > 2){
  2670. this.thirdWeekData = templates[2].items
  2671. this.third_template = templates[2]
  2672. }
  2673. if(templates.length > 3){
  2674. this.fourWeekData = templates[3].items
  2675. this.four_template = templates[3]
  2676. }
  2677. var patients = resp.data.patients
  2678. // var schedules = resp.data.schedules
  2679. this.template_mode = mode
  2680. this.origin_mode = mode.mode
  2681. this.device_numbers = device_numbers
  2682. this.patients = patients
  2683. this.$refs.table.setEditData(this.patients,this.first_template,this.device_numbers,this.templates, this.activeName)
  2684. // this.$refs.table_two.setEditData(this.patients,this.second_template,this.device_numbers)
  2685. // this.$refs.table_three.setEditData(this.patients,this.third_template,this.device_numbers)
  2686. // this.$refs.table_four.setEditData(this.patients,this.four_template,this.device_numbers)
  2687. var fakeTemplateItems = []
  2688. // for (let index = 0; index < schedules.length; index++) {
  2689. // const schedule = schedules[index]
  2690. // var item = {}
  2691. // this.$set(item, 'id', schedule.id)
  2692. // this.$set(item, 'template_id', 0)
  2693. // this.$set(item, 'device_number_id', schedule.bed_id)
  2694. // this.$set(item, 'treat_mode', schedule.mode_id)
  2695. // this.$set(item, 'weekday', schedule.schedule_week)
  2696. // this.$set(item, 'time_type', schedule.schedule_type)
  2697. // var patient = {}
  2698. // this.$set(patient, 'id', schedule.patient_id)
  2699. // this.$set(patient, 'name', schedule.patient)
  2700. // this.$set(item, 'patient', patient)
  2701. //
  2702. // fakeTemplateItems.push(item)
  2703. // }
  2704. this.this_week_schedules.items = fakeTemplateItems
  2705. } else {
  2706. this.$message(resp.msg)
  2707. }
  2708. })
  2709. }
  2710. },
  2711. formatJson(filterVal, jsonData) {
  2712. return jsonData.map(v =>
  2713. filterVal.map(j => {
  2714. return v[j]
  2715. })
  2716. )
  2717. },
  2718. import_file: function () {
  2719. this.downloadLoading = true
  2720. import('@/vendor/Export2Excel').then(excel => {
  2721. const filterVal = [
  2722. '区号',
  2723. '机号'
  2724. ]
  2725. const multiHeaderForModeOne = [['区号', '机号', '周一', '', '', '周二', '', '', '周三', '', '', '周四', '', '', '周五', '', '', '周六', '', '', '周日', '', '']]
  2726. const multiHeaderForModeTwo = [['区号', '机号', '周一', '', '', '周二', '', '', '周三', '', '', '周四', '', '', '周五', '', '', '周六', '', '', '周日', '', '', '周一', '', '', '周二', '', '', '周三', '', '', '周四', '', '', '周五', '', '', '周六', '', '', '周日', '', '']]
  2727. const multiHeaderForModeThree = [['区号', '机号', '周一', '', '', '周二', '', '', '周三', '', '', '周四', '', '', '周五', '', '', '周六', '', '', '周日', '', '', '周一', '', '', '周二', '', '', '周三', '', '', '周四', '', '', '周五', '', '', '周六', '', '', '周日', '', '', '周一', '', '', '周二', '', '', '周三', '', '', '周四', '', '', '周五', '', '', '周六', '', '', '周日', '', '']]
  2728. const multiHeaderForModeFour = [['区号', '机号', '周一', '', '', '周二', '', '', '周三', '', '', '周四', '', '', '周五', '', '', '周六', '', '', '周日', '', '', '周一', '', '', '周二', '', '', '周三', '', '', '周四', '', '', '周五', '', '', '周六', '', '', '周日', '', '','周一', '', '', '周二', '', '', '周三', '', '', '周四', '', '', '周五', '', '', '周六', '', '', '周日', '', '','周一', '', '', '周二', '', '', '周三', '', '', '周四', '', '', '周五', '', '', '周六', '', '', '周日', '', '']]
  2729. const headerForModeOne = ['', '', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上']
  2730. const headerForModeTwo = ['', '', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上']
  2731. const headerForModeThree = ['', '', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上']
  2732. const headerForModeFour = ['', '', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上', '上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上','上午', '下午', '晚上']
  2733. const merges = ['A1:A2', 'B1:B2', 'C1:E1', 'F1:H1', 'I1:K1', 'L1:N1', 'O1:Q1', 'R1:T1', 'U1:W1']
  2734. const mergesTwo = ['A1:A2', 'B1:B2', 'C1:E1', 'F1:H1', 'I1:K1', 'L1:N1', 'O1:Q1', 'R1:T1', 'U1:W1', 'X1:Z1', 'AA1:AC1', 'AD1:AF1', 'AG1:AI1', 'AJ1:AL1', 'AM1:AO1', 'AP1:AR1']
  2735. const mergesThree = ['A1:A2', 'B1:B2', 'C1:E1', 'F1:H1', 'I1:K1', 'L1:N1', 'O1:Q1', 'R1:T1', 'U1:W1', 'X1:Z1', 'AA1:AC1', 'AD1:AF1', 'AG1:AI1', 'AJ1:AL1', 'AM1:AO1', 'AP1:AR1','AS1:AU1','AV1:AX1','AY1:BA1','BB1:BD1','BE1:BG1','BH1:BJ1','BK1:BM1']
  2736. const mergesFour = ['A1:A2', 'B1:B2', 'C1:E1', 'F1:H1', 'I1:K1', 'L1:N1', 'O1:Q1', 'R1:T1', 'U1:W1', 'X1:Z1', 'AA1:AC1', 'AD1:AF1', 'AG1:AI1', 'AJ1:AL1', 'AM1:AO1', 'AP1:AR1','AS1:AU1','AV1:AX1','AY1:BA1','BB1:BD1','BE1:BG1','BH1:BJ1','BK1:BM1','BN1:BP1','BQ1:BS1','BT1:BV1','BW1:BY1','BZ1:CB1','CC1:CE1','CF1:CH1']
  2737. var list = []
  2738. let i = 0
  2739. for (let key in this.partitions) {
  2740. var tempValue
  2741. var jihaos = this.partitions[key].jihaos
  2742. if (i == 0) {
  2743. let m = 'A3' + ':' + 'A' + (2 + jihaos.length)
  2744. tempValue = (2 + jihaos.length)
  2745. mergesFour.push(m)
  2746. } else {
  2747. let m = 'A' + (tempValue + 1) + ':' + 'A' + ((tempValue + 1) + jihaos.length - 1)
  2748. tempValue = ((tempValue + 1) + jihaos.length - 1)
  2749. mergesFour.push(m)
  2750. }
  2751. for (let b = 0; b < jihaos.length; b++) {
  2752. let obj = {}
  2753. obj['区号'] = this.partitions[key].name
  2754. obj['机号'] = jihaos[b].number.toString()
  2755. obj['shangwu'] = ''
  2756. obj['xiawu'] = ''
  2757. obj['wanshang'] = ''
  2758. obj['shangwu1'] = ''
  2759. obj['xiawu1'] = ''
  2760. obj['wanshang1'] = ''
  2761. obj['shangwu2'] = ''
  2762. obj['xiawu2'] = ''
  2763. obj['wanshang2'] = ''
  2764. obj['shangwu3'] = ''
  2765. obj['xiawu3'] = ''
  2766. obj['wanshang3'] = ''
  2767. obj['shangwu4'] = ''
  2768. obj['xiawu4'] = ''
  2769. obj['wanshang4'] = ''
  2770. obj['shangwu5'] = ''
  2771. obj['xiawu5'] = ''
  2772. obj['wanshang5'] = ''
  2773. obj['shangwu6'] = ''
  2774. obj['xiawu6'] = ''
  2775. obj['wanshang6'] = ''
  2776. obj['shangwu7'] = ''
  2777. obj['xiawu7'] = ''
  2778. obj['wanshang7'] = ''
  2779. obj['shangwu8'] = ''
  2780. obj['xiawu8'] = ''
  2781. obj['wanshang8'] = ''
  2782. obj['shangwu9'] = ''
  2783. obj['xiawu9'] = ''
  2784. obj['wanshang9'] = ''
  2785. obj['shangwu10'] = ''
  2786. obj['xiawu10'] = ''
  2787. obj['wanshang10'] = ''
  2788. obj['shangwu11'] = ''
  2789. obj['xiawu11'] = ''
  2790. obj['wanshang11'] = ''
  2791. obj['shangwu12'] = ''
  2792. obj['xiawu12'] = ''
  2793. obj['wanshang12'] = ''
  2794. obj['shangwu13'] = ''
  2795. obj['xiawu13'] = ''
  2796. obj['wanshang13'] = ''
  2797. obj['shangwu14'] = ''
  2798. obj['xiawu14'] = ''
  2799. obj['wanshang14'] = ''
  2800. obj['shangwu15'] = ''
  2801. obj['xiawu15'] = ''
  2802. obj['wanshang15'] = ''
  2803. obj['shangwu16'] = ''
  2804. obj['xiawu16'] = ''
  2805. obj['wanshang16'] = ''
  2806. obj['shangwu17'] = ''
  2807. obj['xiawu17'] = ''
  2808. obj['wanshang17'] = ''
  2809. obj['shangwu18'] = ''
  2810. obj['xiawu18'] = ''
  2811. obj['wanshang18'] = ''
  2812. obj['shangwu19'] = ''
  2813. obj['xiawu19'] = ''
  2814. obj['wanshang19'] = ''
  2815. obj['shangwu20'] = ''
  2816. obj['xiawu20'] = ''
  2817. obj['wanshang20'] = ''
  2818. obj['shangwu21'] = ''
  2819. obj['xiawu21'] = ''
  2820. obj['wanshang21'] = ''
  2821. obj['shangwu22'] = ''
  2822. obj['xiawu22'] = ''
  2823. obj['wanshang22'] = ''
  2824. obj['shangwu23'] = ''
  2825. obj['xiawu23'] = ''
  2826. obj['wanshang23'] = ''
  2827. obj['shangwu24'] = ''
  2828. obj['xiawu24'] = ''
  2829. obj['wanshang24'] = ''
  2830. obj['shangwu25'] = ''
  2831. obj['xiawu25'] = ''
  2832. obj['wanshang25'] = ''
  2833. obj['shangwu26'] = ''
  2834. obj['xiawu26'] = ''
  2835. obj['wanshang26'] = ''
  2836. obj['shangwu27'] = ''
  2837. obj['xiawu27'] = ''
  2838. obj['wanshang27'] = ''
  2839. list.push(obj)
  2840. }
  2841. i++
  2842. }
  2843. for (let i = 0; i < this.firstWeekData.length; i++) {
  2844. this.firstWeekData[i].name = ""
  2845. this.firstWeekData[i].number_name = ""
  2846. }
  2847. for (let i = 0; i < this.secondWeekData.length; i++) {
  2848. this.secondWeekData[i].name = ""
  2849. this.secondWeekData[i].number_name = ""
  2850. }
  2851. for (let i = 0; i < this.thirdWeekData.length; i++) {
  2852. this.thirdWeekData[i].name = ""
  2853. this.thirdWeekData[i].number_name = ""
  2854. }
  2855. for (let i = 0; i < this.fourWeekData.length; i++) {
  2856. this.fourWeekData[i].name = ""
  2857. this.fourWeekData[i].number_name = ""
  2858. }
  2859. console.log(this.firstWeekData)
  2860. console.log(this.device_numbers)
  2861. for (let i = 0; i < this.firstWeekData.length; i++) {
  2862. for (let j = 0; j < this.device_numbers.length; j++) {
  2863. if (this.firstWeekData[i].device_number_id == this.device_numbers[j].id) {
  2864. this.firstWeekData[i].number_name = this.device_numbers[j].number
  2865. }
  2866. }
  2867. }
  2868. for (let i = 0; i < this.secondWeekData.length; i++) {
  2869. for (let j = 0; j < this.device_numbers.length; j++) {
  2870. if (this.secondWeekData[i].device_number_id == this.device_numbers[j].id) {
  2871. this.secondWeekData[i].number_name = this.device_numbers[j].number
  2872. }
  2873. }
  2874. }
  2875. for (let i = 0; i < this.thirdWeekData.length; i++) {
  2876. for (let j = 0; j < this.device_numbers.length; j++) {
  2877. if (this.thirdWeekData[i].device_number_id == this.device_numbers[j].id) {
  2878. this.thirdWeekData[i].number_name = this.device_numbers[j].number
  2879. }
  2880. }
  2881. }
  2882. for (let i = 0; i < this.fourWeekData.length; i++) {
  2883. for (let j = 0; j < this.device_numbers.length; j++) {
  2884. if (this.fourWeekData[i].device_number_id == this.device_numbers[j].id) {
  2885. this.fourWeekData[i].number_name = this.device_numbers[j].number
  2886. }
  2887. }
  2888. }
  2889. for (let i = 0; i < this.firstWeekData.length; i++) {
  2890. for (let j = 0; j < this.patients.length; j++) {
  2891. if (this.firstWeekData[i].patient_id == this.patients[j].id) {
  2892. this.firstWeekData[i].name = this.patients[j].name
  2893. if(this.firstWeekData.length > 0){
  2894. this.firstWeekData[i].name = this.firstWeekData[i].name +"-" + this.getMode(this.firstWeekData[i].treat_mode)
  2895. }
  2896. }
  2897. }
  2898. }
  2899. for (let i = 0; i < this.secondWeekData.length; i++) {
  2900. for (let j = 0; j < this.patients.length; j++) {
  2901. if (this.secondWeekData[i].patient_id == this.patients[j].id) {
  2902. this.secondWeekData[i].name = this.patients[j].name
  2903. if(this.secondWeekData.length > 0){
  2904. this.secondWeekData[i].name = this.secondWeekData[i].name +"-" + this.getMode(this.secondWeekData[i].treat_mode)
  2905. }
  2906. }
  2907. }
  2908. }
  2909. for (let i = 0; i < this.thirdWeekData.length; i++) {
  2910. for (let j = 0; j < this.patients.length; j++) {
  2911. if (this.thirdWeekData[i].patient_id == this.patients[j].id) {
  2912. this.thirdWeekData[i].name = this.patients[j].name
  2913. if(this.thirdWeekData.length > 0){
  2914. this.thirdWeekData[i].name = this.thirdWeekData[i].name +"-" + this.getMode(this.thirdWeekData[i].treat_mode)
  2915. }
  2916. }
  2917. }
  2918. }
  2919. for (let i = 0; i < this.fourWeekData.length; i++) {
  2920. for (let j = 0; j < this.patients.length; j++) {
  2921. if (this.fourWeekData[i].patient_id == this.patients[j].id) {
  2922. this.fourWeekData[i].name = this.patients[j].name
  2923. if(this.fourWeekData.length > 0){
  2924. this.fourWeekData[i].name = this.fourWeekData[i].name +"-" + this.getMode(this.fourWeekData[i].treat_mode)
  2925. }
  2926. }
  2927. }
  2928. }
  2929. for (let i = 0; i < this.firstWeekData.length; i++) {
  2930. for (let j = 0; j < list.length; j++) {
  2931. if (this.firstWeekData[i].number_name == list[j].机号 && this.firstWeekData[i].devices.zone.name == list[j].区号) {
  2932. //第一周周一上午
  2933. if (this.firstWeekData[i].weekday == 1 && this.firstWeekData[i].time_type == 1) {
  2934. list[j].shangwu = this.firstWeekData[i].name
  2935. }
  2936. //第一周周一下午
  2937. if (this.firstWeekData[i].weekday == 1 && this.firstWeekData[i].time_type == 2) {
  2938. list[j].xiawu = this.firstWeekData[i].name
  2939. }
  2940. //第一周晚上
  2941. if (this.firstWeekData[i].weekday == 1 && this.firstWeekData[i].time_type == 3) {
  2942. list[j].wanshang = this.firstWeekData[i].name
  2943. }
  2944. //第一周周二上午
  2945. if (this.firstWeekData[i].weekday == 2 && this.firstWeekData[i].time_type == 1) {
  2946. list[j].shangwu1 = this.firstWeekData[i].name
  2947. }
  2948. //第一周周二下午
  2949. if (this.firstWeekData[i].weekday == 2 && this.firstWeekData[i].time_type == 2) {
  2950. list[j].xiawu1 = this.firstWeekData[i].name
  2951. }
  2952. //第一周周二晚上
  2953. if (this.firstWeekData[i].weekday == 2 && this.firstWeekData[i].time_type == 3) {
  2954. list[j].wanshang1 = this.firstWeekData[i].name
  2955. }
  2956. //第一周周三上午
  2957. if (this.firstWeekData[i].weekday == 3 && this.firstWeekData[i].time_type == 1) {
  2958. list[j].shangwu2 = this.firstWeekData[i].name
  2959. }
  2960. //第一周周三下午
  2961. if (this.firstWeekData[i].weekday == 3 && this.firstWeekData[i].time_type == 2) {
  2962. list[j].xiawu2 = this.firstWeekData[i].name
  2963. }
  2964. //第一周周三晚上
  2965. if (this.firstWeekData[i].weekday == 3 && this.firstWeekData[i].time_type == 3) {
  2966. list[j].wanshang2 = this.firstWeekData[i].name
  2967. }
  2968. //第一周周四上午
  2969. if (this.firstWeekData[i].weekday == 4 && this.firstWeekData[i].time_type == 1) {
  2970. list[j].shangwu3 = this.firstWeekData[i].name
  2971. }
  2972. //第一周周四下午
  2973. if (this.firstWeekData[i].weekday == 4 && this.firstWeekData[i].time_type == 2) {
  2974. list[j].xiawu3 = this.firstWeekData[i].name
  2975. }
  2976. //第一周周四晚上
  2977. if (this.firstWeekData[i].weekday == 4 && this.firstWeekData[i].time_type == 3) {
  2978. list[j].wanshang3 = this.firstWeekData[i].name
  2979. }
  2980. //第一周周五上午
  2981. if (this.firstWeekData[i].weekday == 5 && this.firstWeekData[i].time_type == 1) {
  2982. list[j].shangwu4 = this.firstWeekData[i].name
  2983. }
  2984. //第一周周五下午
  2985. if (this.firstWeekData[i].weekday == 5 && this.firstWeekData[i].time_type == 2) {
  2986. list[j].xiawu4 = this.firstWeekData[i].name
  2987. }
  2988. //第一周周五晚上
  2989. if (this.firstWeekData[i].weekday == 5 && this.firstWeekData[i].time_type == 3) {
  2990. list[j].wanshang4 = this.firstWeekData[i].name
  2991. }
  2992. //第一周周六上午
  2993. if (this.firstWeekData[i].weekday == 6 && this.firstWeekData[i].time_type == 1) {
  2994. list[j].shangwu5 = this.firstWeekData[i].name
  2995. }
  2996. //第一周周六下午
  2997. if (this.firstWeekData[i].weekday == 6 && this.firstWeekData[i].time_type == 2) {
  2998. list[j].xiawu5 = this.firstWeekData[i].name
  2999. }
  3000. //第一周周六晚上
  3001. if (this.firstWeekData[i].weekday == 6 && this.firstWeekData[i].time_type == 3) {
  3002. list[j].wanshang5 = this.firstWeekData[i].name
  3003. }
  3004. //第一周周日上午
  3005. if (this.firstWeekData[i].weekday == 7 && this.firstWeekData[i].time_type == 1) {
  3006. list[j].shangwu6 = this.firstWeekData[i].name
  3007. }
  3008. //第一周周日下午
  3009. if (this.firstWeekData[i].weekday == 7 && this.firstWeekData[i].time_type == 2) {
  3010. list[j].xiawu6 = this.firstWeekData[i].name
  3011. }
  3012. //第一周周日晚上
  3013. if (this.firstWeekData[i].weekday == 7 && this.firstWeekData[i].time_type == 3) {
  3014. list[j].wanshang6 = this.firstWeekData[i].name
  3015. }
  3016. }
  3017. }
  3018. }
  3019. for (let i = 0; i < this.secondWeekData.length; i++) {
  3020. for (let j = 0; j < list.length; j++) {
  3021. if (list[j].机号 == this.secondWeekData[i].number_name && this.secondWeekData[i].devices.zone.name == list[j].区号) {
  3022. //第二周周一上午
  3023. if (this.secondWeekData[i].weekday == 1 && this.secondWeekData[i].time_type == 1) {
  3024. list[j].shangwu7 = this.secondWeekData[i].name
  3025. }
  3026. //第二周周一下午
  3027. if (this.secondWeekData[i].weekday == 1 && this.secondWeekData[i].time_type == 2) {
  3028. list[j].xiawu7 = this.secondWeekData[i].name
  3029. }
  3030. //第二周周一晚上
  3031. if (this.secondWeekData[i].weekday == 1 && this.secondWeekData[i].time_type == 3) {
  3032. list[j].wanshang7 = this.secondWeekData[i].name
  3033. }
  3034. //第二周周二上午
  3035. if (this.secondWeekData[i].weekday == 2 && this.secondWeekData[i].time_type == 1) {
  3036. list[j].shangwu8 = this.secondWeekData[i].name
  3037. }
  3038. //第二周周二下午
  3039. if (this.secondWeekData[i].weekday == 2 && this.secondWeekData[i].time_type == 2) {
  3040. list[j].xiawu8 = this.secondWeekData[i].name
  3041. }
  3042. //第二周周二晚上
  3043. if (this.secondWeekData[i].weekday == 2 && this.secondWeekData[i].time_type == 3) {
  3044. list[j].wanshang8 = this.secondWeekData[i].name
  3045. }
  3046. //第二周周三上午
  3047. if (this.secondWeekData[i].weekday == 3 && this.secondWeekData[i].time_type == 1) {
  3048. list[j].shangwu9 = this.secondWeekData[i].name
  3049. }
  3050. //第二周周三下午
  3051. if (this.secondWeekData[i].weekday == 3 && this.secondWeekData[i].time_type == 2) {
  3052. list[j].xiawu9 = this.secondWeekData[i].name
  3053. }
  3054. //第二周周三晚上
  3055. if (this.secondWeekData[i].weekday == 3 && this.secondWeekData[i].time_type == 3) {
  3056. list[j].wanshang9 = this.secondWeekData[i].name
  3057. }
  3058. //第二周周四上午
  3059. if (this.secondWeekData[i].weekday == 4 && this.secondWeekData[i].time_type == 1) {
  3060. list[j].shangwu10 = this.secondWeekData[i].name
  3061. }
  3062. //第二周周四下午
  3063. if (this.secondWeekData[i].weekday == 4 && this.secondWeekData[i].time_type == 2) {
  3064. list[j].xiawu10 = this.secondWeekData[i].name
  3065. }
  3066. //第二周周四晚上
  3067. if (this.secondWeekData[i].weekday == 4 && this.secondWeekData[i].time_type == 3) {
  3068. list[j].wanshang10 = this.secondWeekData[i].name
  3069. }
  3070. //第二周周五上午
  3071. if (this.secondWeekData[i].weekday == 5 && this.secondWeekData[i].time_type == 1) {
  3072. list[j].shangwu11 = this.secondWeekData[i].name
  3073. }
  3074. //第二周周五下午
  3075. if (this.secondWeekData[i].weekday == 5 && this.secondWeekData[i].time_type == 2) {
  3076. list[j].xiawu11 = this.secondWeekData[i].name
  3077. }
  3078. //第二周周五晚上
  3079. if (this.secondWeekData[i].weekday == 5 && this.secondWeekData[i].time_type == 3) {
  3080. list[j].wanshang11 = this.secondWeekData[i].name
  3081. }
  3082. //第二周周六上午
  3083. if (this.secondWeekData[i].weekday == 6 && this.secondWeekData[i].time_type == 1) {
  3084. list[j].shangwu12 = this.secondWeekData[i].name
  3085. }
  3086. //第二周周六下午
  3087. if (this.secondWeekData[i].weekday == 6 && this.secondWeekData[i].time_type == 2) {
  3088. list[j].xiawu12 = this.secondWeekData[i].name
  3089. }
  3090. //第二周周六晚上
  3091. if (this.secondWeekData[i].weekday == 6 && this.secondWeekData[i].time_type == 3) {
  3092. list[j].wanshang12 = this.secondWeekData[i].name
  3093. }
  3094. //第二周周日上午
  3095. if (this.secondWeekData[i].weekday == 7 && this.secondWeekData[i].time_type == 1) {
  3096. list[j].shangwu13 = this.secondWeekData[i].name
  3097. }
  3098. //第二周周日下午
  3099. if (this.secondWeekData[i].weekday == 7 && this.secondWeekData[i].time_type == 2) {
  3100. list[j].xiawu13 = this.secondWeekData[i].name
  3101. }
  3102. //第二周周日晚上
  3103. if (this.secondWeekData[i].weekday == 7 && this.secondWeekData[i].time_type == 3) {
  3104. list[j].wanshang13 = this.secondWeekData[i].name
  3105. }
  3106. }
  3107. }
  3108. }
  3109. for (let i = 0; i < this.thirdWeekData.length; i++) {
  3110. for (let j = 0; j < list.length; j++) {
  3111. if (list[j].机号 == this.thirdWeekData[i].number_name && this.thirdWeekData[i].devices.zone.name == list[j].区号) {
  3112. //第二周周一上午
  3113. if (this.thirdWeekData[i].weekday == 1 && this.thirdWeekData[i].time_type == 1) {
  3114. list[j].shangwu14 = this.thirdWeekData[i].name
  3115. }
  3116. //第二周周一下午
  3117. if (this.thirdWeekData[i].weekday == 1 && this.thirdWeekData[i].time_type == 2) {
  3118. list[j].xiawu14 = this.thirdWeekData[i].name
  3119. }
  3120. //第二周周一晚上
  3121. if (this.thirdWeekData[i].weekday == 1 && this.thirdWeekData[i].time_type == 3) {
  3122. list[j].wanshang14 = this.thirdWeekData[i].name
  3123. }
  3124. //第二周周二上午
  3125. if (this.thirdWeekData[i].weekday == 2 && this.thirdWeekData[i].time_type == 1) {
  3126. list[j].shangwu15 = this.thirdWeekData[i].name
  3127. }
  3128. //第二周周二下午
  3129. if (this.thirdWeekData[i].weekday == 2 && this.thirdWeekData[i].time_type == 2) {
  3130. list[j].xiawu15 = this.thirdWeekData[i].name
  3131. }
  3132. //第二周周二晚上
  3133. if (this.thirdWeekData[i].weekday == 2 && this.thirdWeekData[i].time_type == 3) {
  3134. list[j].wanshang15 = this.thirdWeekData[i].name
  3135. }
  3136. //第二周周三上午
  3137. if (this.thirdWeekData[i].weekday == 3 && this.thirdWeekData[i].time_type == 1) {
  3138. list[j].shangwu16 = this.thirdWeekData[i].name
  3139. }
  3140. //第二周周三下午
  3141. if (this.thirdWeekData[i].weekday == 3 && this.thirdWeekData[i].time_type == 2) {
  3142. list[j].xiawu16 = this.thirdWeekData[i].name
  3143. }
  3144. //第二周周三晚上
  3145. if (this.thirdWeekData[i].weekday == 3 && this.thirdWeekData[i].time_type == 3) {
  3146. list[j].wanshang16 = this.thirdWeekData[i].name
  3147. }
  3148. //第二周周四上午
  3149. if (this.thirdWeekData[i].weekday == 4 && this.thirdWeekData[i].time_type == 1) {
  3150. list[j].shangwu17 = this.thirdWeekData[i].name
  3151. }
  3152. //第二周周四下午
  3153. if (this.thirdWeekData[i].weekday == 4 && this.thirdWeekData[i].time_type == 2) {
  3154. list[j].xiawu17 = this.thirdWeekData[i].name
  3155. }
  3156. //第二周周四晚上
  3157. if (this.thirdWeekData[i].weekday == 4 && this.thirdWeekData[i].time_type == 3) {
  3158. list[j].wanshang17 = this.thirdWeekData[i].name
  3159. }
  3160. //第二周周五上午
  3161. if (this.thirdWeekData[i].weekday == 5 && this.thirdWeekData[i].time_type == 1) {
  3162. list[j].shangwu18 = this.thirdWeekData[i].name
  3163. }
  3164. //第二周周五下午
  3165. if (this.thirdWeekData[i].weekday == 5 && this.thirdWeekData[i].time_type == 2) {
  3166. list[j].xiawu18 = this.thirdWeekData[i].name
  3167. }
  3168. //第二周周五晚上
  3169. if (this.thirdWeekData[i].weekday == 5 && this.thirdWeekData[i].time_type == 3) {
  3170. list[j].wanshang18 = this.thirdWeekData[i].name
  3171. }
  3172. //第二周周六上午
  3173. if (this.thirdWeekData[i].weekday == 6 && this.thirdWeekData[i].time_type == 1) {
  3174. list[j].shangwu19 = this.thirdWeekData[i].name
  3175. }
  3176. //第二周周六下午
  3177. if (this.thirdWeekData[i].weekday == 6 && this.thirdWeekData[i].time_type == 2) {
  3178. list[j].xiawu19 = this.thirdWeekData[i].name
  3179. }
  3180. //第二周周六晚上
  3181. if (this.thirdWeekData[i].weekday == 6 && this.thirdWeekData[i].time_type == 3) {
  3182. list[j].wanshang19 = this.thirdWeekData[i].name
  3183. }
  3184. //第二周周日上午
  3185. if (this.thirdWeekData[i].weekday == 7 && this.thirdWeekData[i].time_type == 1) {
  3186. list[j].shangwu20 = this.thirdWeekData[i].name
  3187. }
  3188. //第二周周日下午
  3189. if (this.thirdWeekData[i].weekday == 7 && this.thirdWeekData[i].time_type == 2) {
  3190. list[j].xiawu20 = this.thirdWeekData[i].name
  3191. }
  3192. //第二周周日晚上
  3193. if (this.thirdWeekData[i].weekday == 7 && this.thirdWeekData[i].time_type == 3) {
  3194. list[j].wanshang20 = this.thirdWeekData[i].name
  3195. }
  3196. }
  3197. }
  3198. }
  3199. for (let i = 0; i < this.fourWeekData.length; i++) {
  3200. for (let j = 0; j < list.length; j++) {
  3201. if (list[j].机号 == this.fourWeekData[i].number_name && this.fourWeekData[i].devices.zone.name == list[j].区号) {
  3202. //第二周周一上午
  3203. if (this.fourWeekData[i].weekday == 1 && this.fourWeekData[i].time_type == 1) {
  3204. list[j].shangwu21 = this.fourWeekData[i].name
  3205. }
  3206. //第二周周一下午
  3207. if (this.fourWeekData[i].weekday == 1 && this.fourWeekData[i].time_type == 2) {
  3208. list[j].xiawu21 = this.fourWeekData[i].name
  3209. }
  3210. //第二周周一晚上
  3211. if (this.fourWeekData[i].weekday == 1 && this.fourWeekData[i].time_type == 3) {
  3212. list[j].wanshang21 = this.fourWeekData[i].name
  3213. }
  3214. //第二周周二上午
  3215. if (this.fourWeekData[i].weekday == 2 && this.fourWeekData[i].time_type == 1) {
  3216. list[j].shangwu22 = this.fourWeekData[i].name
  3217. }
  3218. //第二周周二下午
  3219. if (this.fourWeekData[i].weekday == 2 && this.fourWeekData[i].time_type == 2) {
  3220. list[j].xiawu22 = this.fourWeekData[i].name
  3221. }
  3222. //第二周周二晚上
  3223. if (this.fourWeekData[i].weekday == 2 && this.fourWeekData[i].time_type == 3) {
  3224. list[j].wanshang22 = this.fourWeekData[i].name
  3225. }
  3226. //第二周周三上午
  3227. if (this.fourWeekData[i].weekday == 3 && this.fourWeekData[i].time_type == 1) {
  3228. list[j].shangwu23 = this.fourWeekData[i].name
  3229. }
  3230. //第二周周三下午
  3231. if (this.fourWeekData[i].weekday == 3 && this.fourWeekData[i].time_type == 2) {
  3232. list[j].xiawu23 = this.fourWeekData[i].name
  3233. }
  3234. //第二周周三晚上
  3235. if (this.fourWeekData[i].weekday == 3 && this.fourWeekData[i].time_type == 3) {
  3236. list[j].wanshang23 = this.fourWeekData[i].name
  3237. }
  3238. //第二周周四上午
  3239. if (this.fourWeekData[i].weekday == 4 && this.fourWeekData[i].time_type == 1) {
  3240. list[j].shangwu24 = this.fourWeekData[i].name
  3241. }
  3242. //第二周周四下午
  3243. if (this.fourWeekData[i].weekday == 4 && this.fourWeekData[i].time_type == 2) {
  3244. list[j].xiawu24 = this.fourWeekData[i].name
  3245. }
  3246. //第二周周四晚上
  3247. if (this.fourWeekData[i].weekday == 4 && this.fourWeekData[i].time_type == 3) {
  3248. list[j].wanshang24 = this.fourWeekData[i].name
  3249. }
  3250. //第二周周五上午
  3251. if (this.fourWeekData[i].weekday == 5 && this.fourWeekData[i].time_type == 1) {
  3252. list[j].shangwu25 = this.fourWeekData[i].name
  3253. }
  3254. //第二周周五下午
  3255. if (this.fourWeekData[i].weekday == 5 && this.fourWeekData[i].time_type == 2) {
  3256. list[j].xiawu25 = this.fourWeekData[i].name
  3257. }
  3258. //第二周周五晚上
  3259. if (this.fourWeekData[i].weekday == 5 && this.fourWeekData[i].time_type == 3) {
  3260. list[j].wanshang25 = this.fourWeekData[i].name
  3261. }
  3262. //第二周周六上午
  3263. if (this.fourWeekData[i].weekday == 6 && this.fourWeekData[i].time_type == 1) {
  3264. list[j].shangwu26 = this.fourWeekData[i].name
  3265. }
  3266. //第二周周六下午
  3267. if (this.fourWeekData[i].weekday == 6 && this.fourWeekData[i].time_type == 2) {
  3268. list[j].xiawu26 = this.fourWeekData[i].name
  3269. }
  3270. //第二周周六晚上
  3271. if (this.fourWeekData[i].weekday == 6 && this.fourWeekData[i].time_type == 3) {
  3272. list[j].wanshang26 = this.fourWeekData[i].name
  3273. }
  3274. //第二周周日上午
  3275. if (this.fourWeekData[i].weekday == 7 && this.fourWeekData[i].time_type == 1) {
  3276. list[j].shangwu27 = this.fourWeekData[i].name
  3277. }
  3278. //第二周周日下午
  3279. if (this.fourWeekData[i].weekday == 7 && this.fourWeekData[i].time_type == 2) {
  3280. list[j].xiawu27 = this.fourWeekData[i].name
  3281. }
  3282. //第二周周日晚上
  3283. if (this.fourWeekData[i].weekday == 7 && this.fourWeekData[i].time_type == 3) {
  3284. list[j].wanshang27 = this.fourWeekData[i].name
  3285. }
  3286. }
  3287. }
  3288. }
  3289. var multiHeader
  3290. var header
  3291. this.tableList = list
  3292. const filename = "排班模版"
  3293. var data = []
  3294. this.tableList.map(item => {
  3295. data.push(Object.values(item))
  3296. })
  3297. multiHeader = multiHeaderForModeFour
  3298. header = headerForModeFour
  3299. excel.export_json_to_excel({
  3300. multiHeader,
  3301. header,
  3302. mergesFour,
  3303. data,
  3304. filename
  3305. })
  3306. this.downloadLoading = false
  3307. })
  3308. },
  3309. setData() {
  3310. this.newVisible = true
  3311. }, getMode(id) {
  3312. let name = "";
  3313. this.treatment_mode = Object.values(this.$store.getters.treatment_mode);
  3314. this.treatment_mode.map((item) => {
  3315. if (item.id == id) {
  3316. name = item.name;
  3317. }
  3318. });
  3319. return name;
  3320. },getModeId(name) {
  3321. let id = "1";
  3322. this.treatment_mode = Object.values(this.$store.getters.treatment_mode);
  3323. this.treatment_mode.map((item) => {
  3324. if (item.name == name) {
  3325. id = item.id.toString();
  3326. }
  3327. });
  3328. return id;
  3329. },
  3330. submitAction() {
  3331. var template
  3332. if (this.form.firstWeek == 1) {
  3333. template = this.first_template
  3334. }
  3335. if (this.form.firstWeek == 2) {
  3336. template = this.second_template
  3337. }
  3338. if (this.form.firstWeek == 3) {
  3339. template = this.third_template
  3340. }
  3341. if (this.form.firstWeek == 4) {
  3342. template = this.four_template
  3343. }
  3344. var label = ""
  3345. for (let i = 0; i < this.timeOptions.length; i++) {
  3346. if (this.form.copyWeek == this.timeOptions[i].value) {
  3347. label = this.timeOptions[i].label
  3348. }
  3349. }
  3350. var start = label.split('~')
  3351. var copy_startime = this.getTimestamp(start[0])
  3352. var copy_endtime = this.getTimestamp(start[1])
  3353. var params = {
  3354. template_id: template.id,
  3355. copy_startime: copy_startime,
  3356. copy_endtime: copy_endtime,
  3357. }
  3358. if(!this.syncLoading){
  3359. this.syncLoading = true
  3360. synchroSchedule(params).then(response => {
  3361. if (response.data.state == 1) {
  3362. var msg = response.data.data.msg
  3363. this.syncLoading = false
  3364. this.$message.success("同步成功!")
  3365. this.newVisible = false
  3366. }else{
  3367. this.syncLoading = false
  3368. }
  3369. })
  3370. }
  3371. },
  3372. getPatientScheduleTemplate() {
  3373. getPatientScheduleTemplate().then(response => {
  3374. if (response.data.state == 1) {
  3375. var schedule = response.data.data.schedule
  3376. this.schedule = schedule
  3377. }
  3378. })
  3379. }
  3380. }
  3381. }
  3382. </script>
  3383. <style scoped>
  3384. </style>