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

template.vue 125KB

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