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

tableData.vue 84KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799
  1. <template>
  2. <div id="table_data">
  3. <div class="cell clearfix" v-if="weekTime == 'thisWeek' || weekTime == 'nextWeek' || weekTime == 'nextTwoWeek' ">
  4. <div class="select_list">
  5. <!-- <span>班次:</span>-->
  6. <!-- <el-select-->
  7. <!-- v-model="schedule_type"-->
  8. <!-- placeholder="请选择"-->
  9. <!-- multiple-->
  10. <!-- >-->
  11. <!-- <el-option-->
  12. <!-- v-for="item in options"-->
  13. <!-- :key="item.id"-->
  14. <!-- :label="item.name"-->
  15. <!-- :value="item.id"-->
  16. <!-- >-->
  17. <!-- </el-option>-->
  18. <!-- </el-select>-->
  19. <span>日期:</span>
  20. <el-select
  21. v-model="week_type"
  22. placeholder="请选择"
  23. multiple
  24. @change="changeWeekDay"
  25. >
  26. <el-option
  27. v-for="(item,index) in weeks"
  28. :key="index"
  29. :label="item"
  30. :value="item"
  31. >
  32. </el-option>
  33. </el-select>
  34. <span>分区:</span>
  35. <el-select
  36. v-model="partition_id"
  37. multiple
  38. placeholder="请选择"
  39. @change="changePartiton"
  40. >
  41. <el-option
  42. v-for="item in this.zones"
  43. :key="item.id"
  44. :label="item.name"
  45. :value="item.id"
  46. >
  47. </el-option>
  48. </el-select>
  49. </div>
  50. <el-input
  51. size="small"
  52. style="width: 200px;margin-left: 20px"
  53. class="filter-item"
  54. v-model.trim="keywords"
  55. placeholder="病人名称/透析号"
  56. @keyup.enter.native='search'
  57. />
  58. <el-button
  59. size="small"
  60. class="filter-item"
  61. type="primary"
  62. icon="el-icon-search"
  63. @click="search"
  64. >搜索</el-button>
  65. </div>
  66. <el-dialog :visible.sync="searchTableVisible" width="80%">
  67. <el-table
  68. :data="schedulePatients"
  69. :header-cell-style="{
  70. backgroundColor: 'rgb(245, 247, 250)',
  71. color: '#606266'
  72. }"
  73. :row-style="{ color: '#303133' }"
  74. style="width: 100%"
  75. border
  76. >
  77. <el-table-column label="姓名" width="120">
  78. <template slot-scope="scope">
  79. {{ scope.row.patient }}
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="透析日期" width="200">
  83. <template slot-scope="scope">
  84. {{ getDialysisDate(scope.row) }}
  85. </template>
  86. </el-table-column>
  87. <el-table-column label="分区">
  88. <template slot-scope="scope">
  89. {{ scope.row.zone.name }}
  90. </template>
  91. </el-table-column>
  92. <el-table-column label="班次" width="80">
  93. <template slot-scope="scope">
  94. {{ getSchedulesType(scope.row.schedule_type,scope.row) }}
  95. </template>
  96. </el-table-column>
  97. <el-table-column label="机号" width="80">
  98. <template slot-scope="scope">
  99. {{ scope.row.number.number }}
  100. </template>
  101. </el-table-column>
  102. <el-table-column label="透析模式" width="100">
  103. <template slot-scope="scope">
  104. {{ scope.row.mode.name }}
  105. </template>
  106. </el-table-column>
  107. <el-table-column label="操作" align="center" width="300">
  108. <template slot-scope="scope">
  109. <span v-if="now_time>scope.row.schedule_date">
  110. <el-button
  111. size="mini"
  112. type="primary"
  113. :disable="true"
  114. >
  115. 取消排班
  116. </el-button>
  117. <el-button
  118. size="mini"
  119. type="primary"
  120. :disable="true"
  121. >
  122. 调整机号
  123. </el-button>
  124. <el-button
  125. size="mini"
  126. type="primary"
  127. :disable="true"
  128. >
  129. 调整模式
  130. </el-button>
  131. </span>
  132. </template>
  133. <template slot-scope="scope">
  134. <span v-if="now_time <=scope.row.schedule_date">
  135. <el-button
  136. size="mini"
  137. type="primary"
  138. @click="CancelSchedule(scope.row.id)"
  139. >
  140. 取消排班
  141. </el-button>
  142. <el-button
  143. size="mini"
  144. type="primary"
  145. @click="changeMachineNumber(scope.$index, scope.row)"
  146. >
  147. 调整机号
  148. </el-button>
  149. <el-button
  150. size="mini"
  151. type="primary"
  152. @click="changeMode(scope.$index, scope.row)"
  153. >
  154. 调整模式
  155. </el-button>
  156. </span>
  157. </template>
  158. </el-table-column>
  159. </el-table>
  160. </el-dialog>
  161. <el-table
  162. :row-style="{ color: '#303133' }"
  163. :header-cell-style="{
  164. backgroundColor: 'rgb(245, 247, 250)',
  165. color: '#606266'
  166. }"
  167. :data="scheduleZone"
  168. :span-method="objectSpanMethod"
  169. @cell-click="clickThis"
  170. @cell-mouse-enter="hoverMouse"
  171. :summary-method="getSummaries"
  172. show-summary
  173. :row-class-name="tableRowClassName"
  174. :cell-class-name="cellClass"
  175. sum-text="总数"
  176. :height="tableContainHeight"
  177. ref="table"
  178. style="width: 100%;cursor: pointer;"
  179. >
  180. <el-table-column
  181. prop="area"
  182. label="分区"
  183. width="80"
  184. align="center"
  185. fixed
  186. ></el-table-column>
  187. <el-table-column
  188. prop="cut"
  189. label="机号"
  190. width="80"
  191. align="center"
  192. fixed
  193. ></el-table-column>
  194. <el-table-column
  195. :label="'周一 (' + weekTitle[0] + ')'"
  196. width="335"
  197. v-if="isShowOne"
  198. align="center"
  199. >
  200. <el-table-column prop="Mon_M" label="上" width="110" align="center" v-if="isShowShangWu">
  201. <schedule-item
  202. slot-scope="scope"
  203. :schedule-detail="scope.row.Mon_M"
  204. ></schedule-item>
  205. </el-table-column>
  206. <el-table-column prop="Mon_A" label="下" width="110" align="center" v-if="isShowXiaWu">
  207. <schedule-item
  208. slot-scope="scope"
  209. :schedule-detail="scope.row.Mon_A"
  210. ></schedule-item>
  211. </el-table-column>
  212. <el-table-column prop="Mon_N" label="晚" width="110" align="center" v-if="isShowWanShang">
  213. <schedule-item
  214. slot-scope="scope"
  215. :schedule-detail="scope.row.Mon_N"
  216. ></schedule-item>
  217. </el-table-column>
  218. </el-table-column>
  219. <el-table-column
  220. :label="'周二 (' + weekTitle[1] + ')'"
  221. width="335"
  222. v-if="isShowTwo"
  223. align="center"
  224. >
  225. <el-table-column prop="Tue_M" label="上" width="110" align="center" v-if="isShowShangWu">
  226. <schedule-item
  227. slot-scope="scope"
  228. :schedule-detail="scope.row.Tue_M"
  229. ></schedule-item>
  230. </el-table-column>
  231. <el-table-column prop="Tue_A" label="下" width="110" align="center" v-if="isShowXiaWu">
  232. <schedule-item
  233. slot-scope="scope"
  234. :schedule-detail="scope.row.Tue_A"
  235. ></schedule-item>
  236. </el-table-column>
  237. <el-table-column prop="Tue_N" label="晚" width="110" align="center" v-if="isShowWanShang">
  238. <schedule-item
  239. slot-scope="scope"
  240. :schedule-detail="scope.row.Tue_N"
  241. ></schedule-item>
  242. </el-table-column>
  243. </el-table-column>
  244. <el-table-column
  245. :label="'周三 (' + weekTitle[2] + ')'"
  246. width="335"
  247. v-if="isShowThree"
  248. align="center"
  249. >
  250. <el-table-column prop="Wed_M" label="上" width="110" align="center" v-if="isShowShangWu">
  251. <schedule-item
  252. slot-scope="scope"
  253. :schedule-detail="scope.row.Wed_M"
  254. ></schedule-item>
  255. </el-table-column>
  256. <el-table-column prop="Wed_A" label="下" width="110" align="center" v-if="isShowXiaWu">
  257. <schedule-item
  258. slot-scope="scope"
  259. :schedule-detail="scope.row.Wed_A"
  260. ></schedule-item>
  261. </el-table-column>
  262. <el-table-column prop="Wed_N" label="晚" width="110" align="center" v-if="isShowWanShang">
  263. <schedule-item
  264. slot-scope="scope"
  265. :schedule-detail="scope.row.Wed_N"
  266. ></schedule-item>
  267. </el-table-column>
  268. </el-table-column>
  269. <el-table-column
  270. :label="'周四 (' + weekTitle[3] + ')'"
  271. width="335"
  272. align="center"
  273. v-if="isShowFour"
  274. >
  275. <el-table-column prop="Thurs_M" label="上" width="110" align="center" v-if="isShowShangWu">
  276. <schedule-item
  277. slot-scope="scope"
  278. :schedule-detail="scope.row.Thurs_M"
  279. ></schedule-item>
  280. </el-table-column>
  281. <el-table-column prop="Thurs_A" label="下" width="110" align="center" v-if="isShowXiaWu">
  282. <schedule-item
  283. slot-scope="scope"
  284. :schedule-detail="scope.row.Thurs_A"
  285. ></schedule-item>
  286. </el-table-column>
  287. <el-table-column prop="Thurs_N" label="晚" width="110" align="center" v-if="isShowWanShang">
  288. <schedule-item
  289. slot-scope="scope"
  290. :schedule-detail="scope.row.Thurs_N"
  291. ></schedule-item>
  292. </el-table-column>
  293. </el-table-column>
  294. <el-table-column
  295. :label="'周五 (' + weekTitle[4] + ')'"
  296. width="335"
  297. align="center"
  298. v-if="isShowFive"
  299. >
  300. <el-table-column prop="Fri_M" label="上" width="110" align="center" v-if="isShowShangWu">
  301. <schedule-item
  302. slot-scope="scope"
  303. :schedule-detail="scope.row.Fri_M"
  304. ></schedule-item>
  305. </el-table-column>
  306. <el-table-column prop="Fri_A" label="下" width="110" align="center" v-if="isShowXiaWu">
  307. <schedule-item
  308. slot-scope="scope"
  309. :schedule-detail="scope.row.Fri_A"
  310. ></schedule-item>
  311. </el-table-column>
  312. <el-table-column prop="Fri_N" label="晚" width="110" align="center" v-if="isShowWanShang">
  313. <schedule-item
  314. slot-scope="scope"
  315. :schedule-detail="scope.row.Fri_N"
  316. ></schedule-item>
  317. </el-table-column>
  318. </el-table-column>
  319. <el-table-column
  320. :label="'周六 (' + weekTitle[5] + ')'"
  321. width="335"
  322. align="center"
  323. v-if="isShowSix"
  324. >
  325. <el-table-column prop="Sat_M" label="上" width="110" align="center" v-if="isShowShangWu">
  326. <schedule-item
  327. slot-scope="scope"
  328. :schedule-detail="scope.row.Sat_M"
  329. ></schedule-item>
  330. </el-table-column>
  331. <el-table-column prop="Sat_A" label="下" width="110" align="center" v-if="isShowXiaWu">
  332. <schedule-item
  333. slot-scope="scope"
  334. :schedule-detail="scope.row.Sat_A"
  335. ></schedule-item>
  336. </el-table-column>
  337. <el-table-column prop="Sat_N" label="晚" width="110" align="center" v-if="isShowWanShang">
  338. <schedule-item
  339. slot-scope="scope"
  340. :schedule-detail="scope.row.Sat_N"
  341. ></schedule-item>
  342. </el-table-column>
  343. </el-table-column>
  344. <el-table-column
  345. :label="'周日 (' + weekTitle[6] + ')'"
  346. min-width="335"
  347. align="center"
  348. v-if="isShowSeven"
  349. >
  350. <el-table-column prop="Sun_M" label="上" min-width="110" align="center" v-if="isShowShangWu">
  351. <schedule-item
  352. slot-scope="scope"
  353. :schedule-detail="scope.row.Sun_M"
  354. ></schedule-item>
  355. </el-table-column>
  356. <el-table-column prop="Sun_A" label="下" min-width="110" align="center" v-if="isShowXiaWu">
  357. <schedule-item
  358. slot-scope="scope"
  359. :schedule-detail="scope.row.Sun_A"
  360. ></schedule-item>
  361. </el-table-column>
  362. <el-table-column prop="Sun_N" label="晚" min-width="110" align="center" v-if="isShowWanShang">
  363. <schedule-item
  364. slot-scope="scope"
  365. :schedule-detail="scope.row.Sun_N"
  366. ></schedule-item>
  367. </el-table-column>
  368. </el-table-column>
  369. <!-- <el-table-column-->
  370. <!-- prop="total"-->
  371. <!-- label="总数"-->
  372. <!-- width="60"-->
  373. <!-- align="center"-->
  374. <!-- fixed="right"-->
  375. <!-- ></el-table-column>-->
  376. </el-table>
  377. <el-dialog
  378. title="排班"
  379. :visible.sync="dialogTableVisible"
  380. width="1000px;"
  381. :v-model="dialog"
  382. v-loading="creating_schedule"
  383. >
  384. <div>
  385. <div class="cell clearfix">
  386. <label class="title"><span class="name">当前排班</span> : </label>
  387. <div class="time ">
  388. <ul class="">
  389. <span class="current"
  390. >日期 : {{ currentData.schedule_date }} &nbsp;&nbsp; 班次 :
  391. {{ currentData.type_name }} &nbsp;&nbsp; 病房 :
  392. {{ currentData.zone_name }} &nbsp;&nbsp; 透析机 :
  393. {{ currentData.bed_name }}
  394. </span>
  395. </ul>
  396. </div>
  397. </div>
  398. <div class="cell clearfix">
  399. <label class="title"><span class="name">患者搜索</span> : </label>
  400. <div class="time ">
  401. <ul class="">
  402. <el-input
  403. size="medium"
  404. v-model="searchKey"
  405. placeholder="请输入搜索的内容"
  406. style="width:260px"
  407. @keyup.enter.native='SubmitSearch'
  408. ></el-input>
  409. <el-button
  410. type="primary"
  411. icon="el-icon-search"
  412. @click="SubmitSearch"
  413. >搜索</el-button
  414. >
  415. </ul>
  416. </div>
  417. </div>
  418. <div class="cell clearfix">
  419. <label class="title"><span class="name">排班</span> : </label>
  420. <div class="time ">
  421. <ul class="">
  422. <li
  423. v-for="item in schedulArr"
  424. @click="changeSearchSchedule(item.value)"
  425. :key="item.value"
  426. :class="patientQuery.schedule == item.value ? 'active' : ''"
  427. >
  428. {{ item.label }}
  429. </li>
  430. </ul>
  431. </div>
  432. </div>
  433. <!-- <div class="cell clearfix">
  434. <label class="title"><span class="name">标签</span> : </label>
  435. <div class="time ">
  436. <ul class="">
  437. <li v-for="item in tagArr" :key="item.value" >{{item.label}}</li>
  438. </ul>
  439. </div>
  440. </div> -->
  441. <div class="cell clearfix">
  442. <label class="title"><span class="name">传染病</span> : </label>
  443. <div class="time ">
  444. <ul class="">
  445. <li
  446. v-for="item in diseasesArr"
  447. @click="changeSearchContagion(item.value)"
  448. :key="item.value"
  449. :class="patientQuery.contagion == item.value ? 'active' : ''"
  450. >
  451. {{ item.label }}
  452. </li>
  453. </ul>
  454. </div>
  455. </div>
  456. </div>
  457. <el-table
  458. ref="singleTable"
  459. :data="patients"
  460. border
  461. highlight-current-row
  462. @current-change="handleCurrentChange"
  463. :header-cell-style="{ backgroundColor: 'rgb(236, 245, 255)' }"
  464. >
  465. <el-table-column
  466. type="index"
  467. label="序号"
  468. width="89"
  469. align="center"
  470. ></el-table-column>
  471. <el-table-column
  472. property="dialysis_no"
  473. label="透析号"
  474. min-width="110"
  475. align="center"
  476. ></el-table-column>
  477. <el-table-column
  478. property="name"
  479. label="姓名"
  480. min-width="110"
  481. align="center"
  482. ></el-table-column>
  483. <el-table-column
  484. property="schedules"
  485. label="双周已排"
  486. min-width="80"
  487. align="center"
  488. >
  489. <template slot-scope="scope">
  490. <span>{{ scope.row.schedules.length }}次</span>
  491. </template>
  492. </el-table-column>
  493. <el-table-column
  494. property="solutions"
  495. label="治疗频率"
  496. min-width="200"
  497. align="center"
  498. >
  499. <template slot-scope="scope">
  500. <span v-for="solution in scope.row.solutions" :key="solution.id"
  501. >{{ solution.name }}({{ solution.period }}{{ solution.times }})
  502. </span>
  503. </template>
  504. </el-table-column>
  505. <el-table-column
  506. property="sch_remark"
  507. label="备注"
  508. min-width="200"
  509. align="center"
  510. >
  511. </el-table-column>
  512. </el-table>
  513. <div slot="footer" class="dialog-footer">
  514. <el-button @click="closePatientPanel()">取 消</el-button>
  515. <el-button
  516. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  517. type="primary"
  518. @click="setSchedule"
  519. >保 存
  520. </el-button>
  521. </div>
  522. </el-dialog>
  523. <el-dialog title="调整排班" :visible.sync="tzDialogVisible" width="500px">
  524. <div style="width:100%;margin:0 auto">
  525. <el-radio-group v-model="tiaoZhengType" :class="tiaozhengclass">
  526. <el-radio :label="1">取消排班</el-radio>
  527. <el-radio :label="2">调整机号</el-radio>
  528. <el-radio :label="3">调整模式</el-radio>
  529. </el-radio-group>
  530. </div>
  531. <span slot="footer" class="dialog-footer">
  532. <el-button
  533. @click="
  534. tzDialogVisible = false;
  535. tiaoZhengType = 1;
  536. "
  537. >取 消</el-button
  538. >
  539. <el-button
  540. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  541. type="primary"
  542. @click="submitTiaoX"
  543. >
  544. <span v-if='tiaoZhengType == 1'>保存</span>
  545. <span v-if='tiaoZhengType == 2'>下一步</span>
  546. <span v-if='tiaoZhengType == 3'>下一步</span>
  547. </el-button>
  548. </span>
  549. </el-dialog>
  550. <el-dialog
  551. title="调整模式"
  552. :visible.sync="msDialogVisible"
  553. width="500px"
  554. v-loading="changing_mode"
  555. >
  556. <div>
  557. <el-form
  558. :model="changeSchedule"
  559. ref="changeSchedule"
  560. :rules="changeRules"
  561. >
  562. <el-form-item label="" prop="mode_id">
  563. <el-select
  564. v-model="changeSchedule.mode_id"
  565. placeholder="请选择"
  566. style="width:100%"
  567. >
  568. <el-option
  569. :disabled="item.id == currentData.mode_id"
  570. v-for="item in modeOptions"
  571. :key="item.id"
  572. :label="item.name"
  573. :value="item.id"
  574. >
  575. </el-option>
  576. </el-select>
  577. </el-form-item>
  578. </el-form>
  579. </div>
  580. <span slot="footer" class="dialog-footer">
  581. <el-button @click="msDialogVisible = false">取 消</el-button>
  582. <el-button
  583. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  584. type="primary"
  585. @click="submitMode('changeSchedule')"
  586. >保 存</el-button
  587. >
  588. </span>
  589. </el-dialog>
  590. <el-dialog
  591. title="调整机号"
  592. :visible.sync="jhDialogVisible"
  593. width="500px"
  594. v-loading="changing_bed"
  595. >
  596. <div>
  597. <el-form
  598. :model="changeSchedule"
  599. ref="changeSchedule"
  600. :rules="changeRules"
  601. label-width="90px"
  602. >
  603. <el-form-item label="排班日期: ">
  604. <el-input v-model="currentData.schedule_date" disabled></el-input>
  605. </el-form-item>
  606. <el-form-item label="班次: " prop="schedule_type">
  607. <el-select
  608. v-model="changeSchedule.schedule_type"
  609. placeholder="请选择"
  610. style="width:100%"
  611. @change="changeScheduleType"
  612. >
  613. <el-option
  614. v-for="item in scheduleType"
  615. :key="item.id"
  616. :label="item.name"
  617. :value="item.id"
  618. >
  619. </el-option>
  620. </el-select>
  621. </el-form-item>
  622. <el-form-item label="病房: " prop="partition_id">
  623. <el-select
  624. v-model="zone_name"
  625. placeholder="请选择"
  626. style="width:100%"
  627. @change="changePartition"
  628. >
  629. <el-option
  630. v-for="(item, index) in zones"
  631. :key="index"
  632. :label="item.name"
  633. :value="item.id"
  634. >
  635. </el-option>
  636. </el-select>
  637. </el-form-item>
  638. <el-form-item label="透析机: " prop="bed_id">
  639. <el-select
  640. v-model="device_id"
  641. placeholder="请选择"
  642. style="width:100%"
  643. >
  644. <el-option
  645. v-for="item in current_devices"
  646. :key="item.id"
  647. :label="item.number"
  648. :value="item.id"
  649. >
  650. </el-option>
  651. </el-select>
  652. </el-form-item>
  653. </el-form>
  654. </div>
  655. <span slot="footer" class="dialog-footer">
  656. <el-button @click="jhDialogVisible = false">取 消</el-button>
  657. <el-button
  658. :disabled="$store.getters.xt_user.subscibe.state == 3 ? true : false"
  659. type="primary"
  660. @click="submitTiaoZJH('changeSchedule')"
  661. >保 存</el-button
  662. >
  663. </span>
  664. </el-dialog>
  665. </div>
  666. </template>
  667. <script>
  668. import { uParseTime } from "@/utils/tools";
  669. import print from 'print-js'
  670. const moment = require('moment')
  671. import {
  672. CancelSchedule,
  673. ChangeSchedule,
  674. CreateSchedule,
  675. getSchedulePatients,
  676. getSchedulesOne,
  677. getSearchResult,
  678. getUrgentScheduleInitData,
  679. getWeekPanelsOne,
  680. getAllZones,
  681. } from "@/api/schedule";
  682. import {
  683. getSmartDevices
  684. } from "@/api/schedule_template/sch_template";
  685. import ScheduleItem from "./ScheduleItem";
  686. const weekOptions = ['周一','周二','周三','周四','周五','周六','周日'];
  687. let rowNumber = 0;
  688. export default {
  689. name: "tableData",
  690. props: {
  691. is_edit:{
  692. type: Boolean,
  693. default: false,
  694. },
  695. weekTime: {
  696. type: String,
  697. default: "thisWeek"
  698. },
  699. scheduleZoneRowProp: {
  700. type: Array,
  701. dafault: []
  702. },
  703. // scheduleZoneProp: {
  704. // type: Array,
  705. // dafault: []
  706. // },
  707. partitionsProp: {
  708. type: Object,
  709. dafault: {}
  710. }
  711. },
  712. data() {
  713. return {
  714. // tableContainHeight:400,
  715. // tableHeight:'window.innerHeight - 0',
  716. // rowClass: "table-row-new-class schedule-table-row",
  717. weeks:weekOptions,
  718. searchKey: "",
  719. tiaoZhengType: 1,
  720. modeOptions: null,
  721. keywords: "",
  722. schedulePatients: [],
  723. searchTableVisible: false,
  724. dialog: {
  725. tag: ""
  726. },
  727. patients: [],
  728. toDay: "",
  729. schedulArr: [
  730. { value: 0, label: "不限" },
  731. { value: 2, label: "未排班" },
  732. { value: 1, label: "已排班" }
  733. ],
  734. tagArr: [
  735. { value: 1, label: "不限" },
  736. { value: 2, label: "透析记录" },
  737. { value: 3, label: "传染病" }
  738. ],
  739. diseasesArr: [{ value: 0, label: "不限" }],
  740. scheduleType: [
  741. { id: 1, name: "上午" },
  742. { id: 2, name: "下午" },
  743. { id: 3, name: "晚上" }
  744. ],
  745. dialogTableVisible: false,
  746. tzDialogVisible: false,
  747. msDialogVisible: false,
  748. jhDialogVisible: false,
  749. // scheduleZone: this.scheduleZoneProp,
  750. scheduleZoneRow: -1,
  751. partitions: [],
  752. jihaos: [],
  753. weekTitle: ["", "", "", "", "", "", ""],
  754. weekList: ["", "", "", "", "", "", ""],
  755. weekDays: ["", "", "", "", "", "", ""],
  756. currentData: {
  757. id: 0,
  758. schedule_date: "",
  759. schedule_type: 0,
  760. bed_id: 0,
  761. partition_id: 0,
  762. patient_id: 0,
  763. schedule_week: 0,
  764. mode_id: 0,
  765. type_name: "",
  766. bed_name: "",
  767. partition_type: 0,
  768. contagions: [],
  769. patient: ""
  770. },
  771. changeSchedule: {
  772. mode_id: "",
  773. schedule_type: "",
  774. partition_id: "",
  775. bed_id: "",
  776. schedule_week: "",
  777. partition_type: ""
  778. },
  779. patientQuery: {
  780. keywords: "",
  781. schedule: 0,
  782. contagion: 0
  783. },
  784. tiaozhengclass: "tiaozhengclass",
  785. changeRules: {
  786. mode_id: [{ required: true, message: "请选择模式", trigger: "blur" }],
  787. schedule_type: [
  788. { required: true, message: "请选择班次", trigger: "blur" }
  789. ],
  790. partition_id: [
  791. { required: true, message: "请选择病房", trigger: "blur" }
  792. ],
  793. bed_id: [{ required: true, message: "请选择透析机", trigger: "blur" }]
  794. },
  795. weekday: 0,
  796. creating_schedule: false,
  797. changing_mode: false,
  798. changing_bed: false,
  799. tableHeight: document.documentElement.clientHeight,
  800. origin_schedules: [],
  801. origin_device_numbers: [],
  802. zone_device_map: {},
  803. device_id: 0,
  804. zone_name: "",
  805. current_devices: [],
  806. zone_names: [],
  807. zone_device_options: [],
  808. options:[
  809. {id:1,name:"上午"},
  810. {id:2,name:"下午"},
  811. {id:3,name:"晚上"},
  812. ],
  813. partition_id:0,
  814. schedule_type:[],
  815. week_type:[],
  816. zones:[],
  817. theType:"",
  818. scheduleZone:[],
  819. source_scheduleZone:[],
  820. theWeek: {
  821. lastWeek: 0,
  822. thisWeek: 0,
  823. nextWeek: 0,
  824. nextTwoWeek: 0
  825. },
  826. zoneIdList:[],
  827. strArr:"",
  828. patient_id_hover:0,
  829. now_time:"",
  830. isShowOne:true,
  831. isShowTwo:true,
  832. isShowThree:true,
  833. isShowFour:true,
  834. isShowFive:true,
  835. isShowSix:true,
  836. isShowSeven:true,
  837. isShowShangWu:true,
  838. isShowXiaWu:true,
  839. isShowWanShang:true,
  840. };
  841. },
  842. watch: {
  843. schedule_type:function (){
  844. this.isShowShangWu = false
  845. this.isShowXiaWu = false
  846. this.isShowWanShang = false
  847. if(this.schedule_type.length > 0) {
  848. for (let i = 0; i < this.schedule_type.length; i++) {
  849. if (this.schedule_type[i] == 1) {
  850. this.isShowShangWu = true
  851. } else if (this.schedule_type[i] == 2) {
  852. this.isShowXiaWu = true
  853. } else if (this.schedule_type[i] == 3) {
  854. this.isShowWanShang = true
  855. }
  856. }
  857. }else{
  858. this.isShowShangWu = true
  859. this.isShowXiaWu = true
  860. this.isShowWanShang = true
  861. }
  862. console.log(this.source_scheduleZone)
  863. //删除对应数据
  864. var list = this.source_scheduleZone
  865. var list1 = this.source_scheduleZone
  866. var list2 = this.source_scheduleZone
  867. //
  868. // if(this.isShowShangWu){
  869. // for(let i = 0; i < list.length; i++){
  870. // for(var key in list[i]){
  871. // if(key.indexOf("_A") != -1 || key.indexOf("_N") != -1 ){
  872. // delete list[i][key]
  873. // }
  874. // }
  875. // }
  876. // }
  877. //
  878. // if(this.isShowXiaWu){
  879. // for(let i = 0; list1.length; i++){
  880. // for(var key in list1[i]){
  881. // if(key.indexOf("_M") != -1 || key.indexOf("_N") != -1 ){
  882. // delete list1[i][key]
  883. // }
  884. // }
  885. // }
  886. // }
  887. //
  888. // if(this.isShowWanShang){
  889. // for(let i = 0; list2.length; i++){
  890. // for(var key in list2[i]){
  891. // if(key.indexOf("_A") != -1 || key.indexOf("_M") != -1 ){
  892. // delete list2[i][key]
  893. // }
  894. // }
  895. // }
  896. //
  897. // }
  898. // if(this.week_type.length > 0){
  899. // if(this.week_type.indexOf("周一") != -1){
  900. //
  901. // }
  902. // if(this.week_type.indexOf("周二") != -1){
  903. //
  904. //
  905. // }
  906. // if(this.week_type.indexOf("周三") != -1){
  907. //
  908. //
  909. // }
  910. // if(this.week_type.indexOf("周四") != -1){
  911. //
  912. //
  913. // }
  914. // if(this.week_type.indexOf("周五") != -1){
  915. //
  916. //
  917. // }
  918. // if(this.week_type.indexOf("周六") != -1){
  919. //
  920. //
  921. // }
  922. // if(this.week_type.indexOf("周日") != -1){
  923. //
  924. //
  925. // }
  926. //
  927. // }
  928. }, week_type:function () {
  929. console.log(this.week_type)
  930. console.log(this.schedule_type)
  931. console.log(this.scheduleZone)
  932. this.isShowOne = false
  933. this.isShowTwo = false
  934. this.isShowThree = false
  935. this.isShowFour = false
  936. this.isShowFive = false
  937. this.isShowSix = false
  938. this.isShowSeven = false
  939. if(this.week_type.length > 0) {
  940. for (let i = 0; i < this.week_type.length; i++) {
  941. if (this.week_type[i] == "周一") {
  942. this.isShowOne = true
  943. } else if (this.week_type[i] == "周二") {
  944. this.isShowTwo = true
  945. } else if (this.week_type[i] == "周三") {
  946. this.isShowThree = true
  947. } else if (this.week_type[i] == "周四") {
  948. this.isShowFour = true
  949. } else if (this.week_type[i] == "周五") {
  950. this.isShowFive = true
  951. } else if (this.week_type[i] == "周六") {
  952. this.isShowSix = true
  953. } else if (this.week_type[i] == "周日") {
  954. this.isShowSeven = true
  955. }
  956. }
  957. }else{
  958. this.isShowOne = true
  959. this.isShowTwo = true
  960. this.isShowThree = true
  961. this.isShowFour = true
  962. this.isShowFive = true
  963. this.isShowSix = true
  964. this.isShowSeven = true
  965. }
  966. },
  967. weekTime: function() {
  968. var theType = this.weekType(this.weekTime);
  969. // console.log("999999999",theType)
  970. this.theType = theType
  971. this.getSchedules();
  972. },
  973. scheduleZoneRow: function() {
  974. var theType = this.weekType(this.weekTime);
  975. this.theType = theType
  976. this.getSchedules();
  977. },
  978. tableHeight(val) {
  979. if (!this.timer) {
  980. this.tableHeight = val;
  981. this.timer = true;
  982. const that = this;
  983. setTimeout(function() {
  984. that.timer = false;
  985. }, 400);
  986. }
  987. }
  988. },
  989. methods: {
  990. getData(){
  991. return this.scheduleZone
  992. },
  993. compare(p){ //这是比较函数
  994. return function(m,n){
  995. var a = m[p];
  996. var b = n[p];
  997. return a - b; //升序
  998. }
  999. },
  1000. getWeekPanels() {
  1001. this.scheduleZone=[]
  1002. var partionStr = this.partition_id
  1003. var arr = this.zoneIdList.join(',')
  1004. var str = ""
  1005. if(partionStr == 0){
  1006. str = arr
  1007. }
  1008. if(partionStr != 0){
  1009. str = partionStr.join(',')
  1010. }
  1011. getWeekPanelsOne(1,str).then(response => {
  1012. if (response.data.state == 0) {
  1013. return false
  1014. }
  1015. var partitions = response.data.data.partitions
  1016. console.log("partitions",partitions)
  1017. this.theWeek.thisWeek = response.data.data.theWeek
  1018. console.log("这个周",response.data.data.theWeek)
  1019. this.theWeek.lastWeek = this.theWeek.thisWeek - 1
  1020. this.theWeek.nextWeek = this.theWeek.thisWeek + 1
  1021. this.theWeek.nextTwoWeek = this.theWeek.thisWeek + 2
  1022. var that = this
  1023. if (partitions.length > 0) {
  1024. partitions.forEach(function(partition) {
  1025. if (partition.jihaos.length == 0) {
  1026. return false
  1027. }
  1028. that.scheduleZoneRow.push(partition.jihaos.length)
  1029. that.partitions[partition.id] = partition
  1030. partition.jihaos.forEach(function(jihao) {
  1031. var thisPa = {
  1032. area: partition.name,
  1033. zone_id: partition.id,
  1034. zone_type: partition.type,
  1035. cut: jihao.number,
  1036. jihao_id: jihao.id,
  1037. sort:jihao.sort,
  1038. Mon_M: {
  1039. schedule_id: 0,
  1040. mode_id: 0,
  1041. mode_name: '',
  1042. patient_id: 0,
  1043. patient: '',
  1044. dialysis_machine_name:'',
  1045. },
  1046. Mon_A: {
  1047. schedule_id: 0,
  1048. mode_id: 0,
  1049. mode_name: '',
  1050. patient_id: 0,
  1051. patient: '',
  1052. dialysis_machine_name:'',
  1053. },
  1054. Mon_N: {
  1055. schedule_id: 0,
  1056. mode_id: 0,
  1057. mode_name: '',
  1058. patient_id: 0,
  1059. patient: '',
  1060. dialysis_machine_name:'',
  1061. },
  1062. Tue_M: {
  1063. schedule_id: 0,
  1064. mode_id: 0,
  1065. mode_name: '',
  1066. patient_id: 0,
  1067. patient: '',
  1068. dialysis_machine_name:'',
  1069. },
  1070. Tue_A: {
  1071. schedule_id: 0,
  1072. mode_id: 0,
  1073. mode_name: '',
  1074. patient_id: 0,
  1075. patient: '',
  1076. dialysis_machine_name:'',
  1077. },
  1078. Tue_N: {
  1079. schedule_id: 0,
  1080. mode_id: 0,
  1081. mode_name: '',
  1082. patient_id: 0,
  1083. patient: '',
  1084. dialysis_machine_name:'',
  1085. },
  1086. Wed_M: {
  1087. schedule_id: 0,
  1088. mode_id: 0,
  1089. mode_name: '',
  1090. patient_id: 0,
  1091. patient: '',
  1092. dialysis_machine_name:'',
  1093. },
  1094. Wed_A: {
  1095. schedule_id: 0,
  1096. mode_id: 0,
  1097. mode_name: '',
  1098. patient_id: 0,
  1099. patient: '',
  1100. dialysis_machine_name:'',
  1101. },
  1102. Wed_N: {
  1103. schedule_id: 0,
  1104. mode_id: 0,
  1105. mode_name: '',
  1106. patient_id: 0,
  1107. patient: '',
  1108. dialysis_machine_name:'',
  1109. },
  1110. Thurs_M: {
  1111. schedule_id: 0,
  1112. mode_id: 0,
  1113. mode_name: '',
  1114. patient_id: 0,
  1115. patient: '',
  1116. dialysis_machine_name:'',
  1117. },
  1118. Thurs_A: {
  1119. schedule_id: 0,
  1120. mode_id: 0,
  1121. mode_name: '',
  1122. patient_id: 0,
  1123. patient: '',
  1124. dialysis_machine_name:'',
  1125. },
  1126. Thurs_N: {
  1127. schedule_id: 0,
  1128. mode_id: 0,
  1129. mode_name: '',
  1130. patient_id: 0,
  1131. patient: '',
  1132. dialysis_machine_name:'',
  1133. },
  1134. Fri_M: {
  1135. schedule_id: 0,
  1136. mode_id: 0,
  1137. mode_name: '',
  1138. patient_id: 0,
  1139. patient: '',
  1140. dialysis_machine_name:'',
  1141. },
  1142. Fri_A: {
  1143. schedule_id: 0,
  1144. mode_id: 0,
  1145. mode_name: '',
  1146. patient_id: 0,
  1147. patient: '',
  1148. dialysis_machine_name:'',
  1149. },
  1150. Fri_N: {
  1151. schedule_id: 0,
  1152. mode_id: 0,
  1153. mode_name: '',
  1154. patient_id: 0,
  1155. patient: '',
  1156. dialysis_machine_name:'',
  1157. },
  1158. Sat_M: {
  1159. schedule_id: 0,
  1160. mode_id: 0,
  1161. mode_name: '',
  1162. patient_id: 0,
  1163. patient: '',
  1164. dialysis_machine_name:'',
  1165. },
  1166. Sat_A: {
  1167. schedule_id: 0,
  1168. mode_id: 0,
  1169. mode_name: '',
  1170. patient_id: 0,
  1171. patient: '',
  1172. dialysis_machine_name:'',
  1173. },
  1174. Sat_N: {
  1175. schedule_id: 0,
  1176. mode_id: 0,
  1177. mode_name: '',
  1178. patient_id: 0,
  1179. patient: '',
  1180. dialysis_machine_name:'',
  1181. },
  1182. Sun_A: {
  1183. schedule_id: 0,
  1184. mode_id: 0,
  1185. mode_name: '',
  1186. patient_id: 0,
  1187. patient: '',
  1188. dialysis_machine_name:'',
  1189. },
  1190. Sun_N: {
  1191. schedule_id: 0,
  1192. mode_id: 0,
  1193. mode_name: '',
  1194. patient_id: 0,
  1195. patient: '',
  1196. dialysis_machine_name:'',
  1197. },
  1198. Sun_M: {
  1199. schedule_id: 0,
  1200. mode_id: 0,
  1201. mode_name: '',
  1202. patient_id: 0,
  1203. patient: '',
  1204. dialysis_machine_name:'',
  1205. },
  1206. total: 0
  1207. }
  1208. that.scheduleZone.push(thisPa)
  1209. })
  1210. })
  1211. }
  1212. console.log("34455555566666",this.scheduleZone)
  1213. this.scheduleZone.sort(this.compare('sort'))
  1214. this.source_scheduleZone = this.scheduleZone
  1215. })
  1216. },
  1217. cellClass({ row, column, rowIndex, columnIndex }) {
  1218. if (columnIndex == 0 || columnIndex == 1 || columnIndex == 23) {
  1219. return "";
  1220. } else {
  1221. if (this.weekTime == "lastWeek") {
  1222. if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
  1223. return 'hover-td schedule-table-cell-disable'
  1224. }else {
  1225. return 'schedule-table-cell-disable'
  1226. }
  1227. // return "schedule-table-cell-disable";
  1228. } else if (this.weekTime == "thisWeek") {
  1229. var weekday = Math.floor((columnIndex - 2) / 3 + 1);
  1230. if (weekday < this.weekday) {
  1231. if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
  1232. return 'hover-td schedule-table-cell-disable'
  1233. }else {
  1234. return 'schedule-table-cell-disable'
  1235. }
  1236. // return "schedule-table-cell-disable";
  1237. }else {
  1238. if(row[column.property].patient_id > 0 && row[column.property].patient_id == this.patient_id_hover){
  1239. return 'hover-td'
  1240. }else {
  1241. return ''
  1242. }
  1243. }
  1244. }
  1245. }
  1246. return "";
  1247. },
  1248. SubmitSearch() {
  1249. this.patientQuery.keywords = this.searchKey;
  1250. this.getSchedulePatients();
  1251. },
  1252. changeSearchContagion(id) {
  1253. this.patientQuery.contagion = id;
  1254. this.getSchedulePatients();
  1255. },
  1256. changeSearchSchedule(id) {
  1257. this.patientQuery.schedule = id;
  1258. this.getSchedulePatients();
  1259. },
  1260. getSummaries(param) {
  1261. const { columns, data } = param;
  1262. const sums = [];
  1263. columns.forEach((column, index) => {
  1264. if (index === 0 ) {
  1265. sums[index] = "总数";
  1266. return;
  1267. }
  1268. if (index === 1 ) {
  1269. sums[index] = data.length;
  1270. return;
  1271. }
  1272. const values = data.map(item => item[column.property]);
  1273. console.log(values)
  1274. // if (index === 23) {
  1275. // sums[index] = values.reduce((prev, curr) => {
  1276. // const value = Number(curr);
  1277. // if (!isNaN(value)) {
  1278. // return prev + curr;
  1279. // } else {
  1280. // return prev;
  1281. // }
  1282. // }, 0);
  1283. // sums[index];
  1284. // return;
  1285. // }
  1286. sums[index] = values.reduce((prev, curr) => {
  1287. if (typeof curr["mode_id"] === "undefined") {
  1288. return prev;
  1289. }
  1290. const value = Number(curr["mode_id"]);
  1291. if (!isNaN(value) && value > 0) {
  1292. return prev + 1;
  1293. } else {
  1294. return prev;
  1295. }
  1296. }, 0);
  1297. sums[index];
  1298. });
  1299. this.$nextTick(() => {
  1300. this.$refs.table.doLayout();
  1301. });
  1302. return sums;
  1303. },
  1304. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  1305. var that = this;
  1306. var rowNum = 0;
  1307. rowNumber = 0;
  1308. var rutrnData = {};
  1309. if (columnIndex === 0) {
  1310. var rowLen = this.scheduleZoneRow.length;
  1311. if (rowLen > 0) {
  1312. for (let index = 0; index < rowLen; index++) {
  1313. rowNum = this.scheduleZoneRow[index];
  1314. rowNumber += rowNum;
  1315. var f = rowNumber - rowNum;
  1316. if (f == rowIndex) {
  1317. rutrnData = {
  1318. rowspan: rowNum,
  1319. colspan: 1
  1320. };
  1321. break;
  1322. } else if (rowIndex < rowNumber) {
  1323. rutrnData = {
  1324. rowspan: 0,
  1325. colspan: 0
  1326. };
  1327. break;
  1328. }
  1329. }
  1330. return rutrnData;
  1331. }
  1332. }
  1333. },
  1334. handleCurrentChange(row) {
  1335. if (typeof row === "undefined" || row == null) {
  1336. this.currentData.patient_id = 0;
  1337. this.currentData.contagions = [];
  1338. } else {
  1339. this.currentData.patient_id = row.id;
  1340. this.currentData.contagions = row.contagions;
  1341. }
  1342. },
  1343. closePatientPanel(row) {
  1344. this.dialogTableVisible = false;
  1345. this.$refs.singleTable.setCurrentRow(row);
  1346. this.currentData.patient_id = 0;
  1347. },
  1348. getSchedules() {
  1349. var partionStr = this.partition_id
  1350. var arr = this.zoneIdList.join(',')
  1351. var str = ""
  1352. if(partionStr == 0){
  1353. str = arr
  1354. }
  1355. if(partionStr != 0){
  1356. str = partionStr.join(',')
  1357. }
  1358. const params = {
  1359. weekTime:this.theType,
  1360. patitionid:str,
  1361. schedule_type:this.schedule_type,
  1362. }
  1363. getSchedulesOne(params).then(response => {
  1364. if (response.data.state == 1) {
  1365. this.weekTitle = response.data.data.weekTitle;
  1366. this.weekDays = response.data.data.days;
  1367. this.toDay = response.data.data.today;
  1368. var theSchedules = response.data.data.schdules;
  1369. var that = this;
  1370. this.scheduleZone.forEach(function(zone, index) {
  1371. that.scheduleZone[index].Mon_M = {
  1372. mode_id: 0,
  1373. mode_name: "",
  1374. patient_id: 0,
  1375. patient: "",
  1376. dialysis_machine_name:"",
  1377. };
  1378. that.scheduleZone[index].Mon_A = {
  1379. mode_id: 0,
  1380. mode_name: "",
  1381. patient_id: 0,
  1382. patient: "",
  1383. dialysis_machine_name:"",
  1384. };
  1385. that.scheduleZone[index].Mon_N = {
  1386. mode_id: 0,
  1387. mode_name: "",
  1388. patient_id: 0,
  1389. patient: "",
  1390. dialysis_machine_name:"",
  1391. };
  1392. that.scheduleZone[index].Tue_M = {
  1393. mode_id: 0,
  1394. mode_name: "",
  1395. patient_id: 0,
  1396. patient: "",
  1397. dialysis_machine_name:"",
  1398. };
  1399. that.scheduleZone[index].Tue_A = {
  1400. mode_id: 0,
  1401. mode_name: "",
  1402. patient_id: 0,
  1403. patient: "",
  1404. dialysis_machine_name:"",
  1405. };
  1406. that.scheduleZone[index].Tue_N = {
  1407. mode_id: 0,
  1408. mode_name: "",
  1409. patient_id: 0,
  1410. patient: "",
  1411. dialysis_machine_name:"",
  1412. };
  1413. that.scheduleZone[index].Wed_M = {
  1414. mode_id: 0,
  1415. mode_name: "",
  1416. patient_id: 0,
  1417. patient: "",
  1418. dialysis_machine_name:"",
  1419. };
  1420. that.scheduleZone[index].Wed_A = {
  1421. mode_id: 0,
  1422. mode_name: "",
  1423. patient_id: 0,
  1424. patient: "",
  1425. dialysis_machine_name:"",
  1426. };
  1427. that.scheduleZone[index].Wed_N = {
  1428. mode_id: 0,
  1429. mode_name: "",
  1430. patient_id: 0,
  1431. patient: "",
  1432. dialysis_machine_name:"",
  1433. };
  1434. that.scheduleZone[index].Thurs_M = {
  1435. mode_id: 0,
  1436. mode_name: "",
  1437. patient_id: 0,
  1438. patient: "",
  1439. dialysis_machine_name:"",
  1440. };
  1441. that.scheduleZone[index].Thurs_A = {
  1442. mode_id: 0,
  1443. mode_name: "",
  1444. patient_id: 0,
  1445. patient: "",
  1446. dialysis_machine_name:"",
  1447. };
  1448. that.scheduleZone[index].Thurs_N = {
  1449. mode_id: 0,
  1450. mode_name: "",
  1451. patient_id: 0,
  1452. patient: "",
  1453. dialysis_machine_name:"",
  1454. };
  1455. that.scheduleZone[index].Fri_M = {
  1456. mode_id: 0,
  1457. mode_name: "",
  1458. patient_id: 0,
  1459. patient: "",
  1460. dialysis_machine_name:"",
  1461. };
  1462. that.scheduleZone[index].Fri_A = {
  1463. mode_id: 0,
  1464. mode_name: "",
  1465. patient_id: 0,
  1466. patient: "",
  1467. dialysis_machine_name:"",
  1468. };
  1469. that.scheduleZone[index].Fri_N = {
  1470. mode_id: 0,
  1471. mode_name: "",
  1472. patient_id: 0,
  1473. patient: "",
  1474. dialysis_machine_name:"",
  1475. };
  1476. that.scheduleZone[index].Sat_M = {
  1477. mode_id: 0,
  1478. mode_name: "",
  1479. patient_id: 0,
  1480. patient: "",
  1481. dialysis_machine_name:"",
  1482. };
  1483. that.scheduleZone[index].Sat_A = {
  1484. mode_id: 0,
  1485. mode_name: "",
  1486. patient_id: 0,
  1487. patient: "",
  1488. dialysis_machine_name:"",
  1489. };
  1490. that.scheduleZone[index].Sat_N = {
  1491. mode_id: 0,
  1492. mode_name: "",
  1493. patient_id: 0,
  1494. patient: "",
  1495. dialysis_machine_name:"",
  1496. };
  1497. that.scheduleZone[index].Sun_A = {
  1498. mode_id: 0,
  1499. mode_name: "",
  1500. patient_id: 0,
  1501. patient: "",
  1502. dialysis_machine_name:"",
  1503. };
  1504. that.scheduleZone[index].Sun_N = {
  1505. mode_id: 0,
  1506. mode_name: "",
  1507. patient_id: 0,
  1508. patient: "",
  1509. dialysis_machine_name:"",
  1510. };
  1511. that.scheduleZone[index].Sun_M = {
  1512. mode_id: 0,
  1513. mode_name: "",
  1514. patient_id: 0,
  1515. patient: "",
  1516. dialysis_machine_name:"",
  1517. };
  1518. that.scheduleZone[index].total = 0;
  1519. if (response.data.data.schdules.length > 0) {
  1520. theSchedules.forEach(function(schedule, sindex) {
  1521. if (zone.jihao_id == schedule.bed_id) {
  1522. var weekPath = that.weekPath(
  1523. schedule.schedule_week,
  1524. schedule.schedule_type
  1525. );
  1526. if (weekPath.length == 2) {
  1527. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1528. that.scheduleZone[index][weekPathKey] = {
  1529. schedule_id: schedule.id,
  1530. mode_id: schedule.mode_id,
  1531. patient_id: schedule.patient_id,
  1532. patient: schedule.patient,
  1533. dialysis_machine_name:schedule.dialysis_machine_name,
  1534. patient_contagions: schedule.patient_contagions,
  1535. mode_name:
  1536. typeof that.modeOptions[schedule.mode_id] ===
  1537. "undefined"
  1538. ? ""
  1539. : that.modeOptions[schedule.mode_id].name
  1540. };
  1541. that.scheduleZone[index].total += 1;
  1542. }
  1543. }
  1544. });
  1545. }
  1546. });
  1547. this.source_scheduleZone = this.scheduleZone
  1548. } else {
  1549. this.$message.error("网络错误");
  1550. return false;
  1551. }
  1552. });
  1553. },
  1554. getSchedulePatients() {
  1555. getSchedulePatients(this.patientQuery).then(response => {
  1556. if (response.data.state == 1) {
  1557. this.patients = response.data.data.patients;
  1558. }
  1559. });
  1560. },
  1561. CancelSchedule(id) {
  1562. this.$confirm("确定要取消当前排班?", "提示", {
  1563. confirmButtonText: "确定",
  1564. cancelButtonText: "取消",
  1565. type: "warning"
  1566. })
  1567. .then(() => {
  1568. CancelSchedule(id).then(response => {
  1569. if (response.data.state == 0) {
  1570. this.$message.error(response.data.msg);
  1571. } else {
  1572. this.$message({
  1573. type: "success",
  1574. message: "排班已取消!"
  1575. });
  1576. var that = this;
  1577. var schedule = response.data.data.schedule;
  1578. this.scheduleZone.forEach(function(zone, index) {
  1579. if (
  1580. zone.zone_id == schedule.partition_id &&
  1581. zone.jihao_id == schedule.bed_id
  1582. ) {
  1583. var weekPath = that.weekPath(
  1584. schedule.schedule_week,
  1585. schedule.schedule_type
  1586. );
  1587. if (weekPath.length == 2) {
  1588. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1589. that.scheduleZone[index][weekPathKey] = {
  1590. schedule_id: 0,
  1591. mode_id: 0,
  1592. patient_id: 0,
  1593. patient: "",
  1594. mode_name: "",
  1595. dialysis_machine_name:'',
  1596. };
  1597. that.scheduleZone[index].total -= 1;
  1598. }
  1599. }
  1600. });
  1601. this.tzDialogVisible = false;
  1602. this.searchTableVisible = false;
  1603. }
  1604. });
  1605. })
  1606. .catch(() => {});
  1607. },
  1608. changeScheduleActon(formName) {
  1609. this.changing_bed = true;
  1610. ChangeSchedule(this.currentData.id, this.changeSchedule)
  1611. .then(response => {
  1612. if (response.data.state == 0) {
  1613. this.$message.error(response.data.msg);
  1614. } else {
  1615. this.$message({
  1616. type: "success",
  1617. message: "修改成功!"
  1618. });
  1619. var that = this;
  1620. var schedule = response.data.data.schedule;
  1621. this.scheduleZone.forEach(function(zone, index) {
  1622. if (
  1623. zone.zone_id == schedule.partition_id &&
  1624. zone.jihao_id == schedule.bed_id
  1625. ) {
  1626. var weekPath = that.weekPath(
  1627. schedule.schedule_week,
  1628. schedule.schedule_type
  1629. );
  1630. if (weekPath.length == 2) {
  1631. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1632. that.scheduleZone[index][weekPathKey] = {
  1633. schedule_id: schedule.id,
  1634. mode_id: schedule.mode_id,
  1635. patient_id: schedule.patient_id,
  1636. patient: that.currentData.patient,
  1637. dialysis_machine_name:schedule.dialysis_machine_name,
  1638. patient_contagions: that.currentData.contagions,
  1639. mode_name:
  1640. typeof that.modeOptions[schedule.mode_id] === "undefined"
  1641. ? ""
  1642. : that.modeOptions[schedule.mode_id].name
  1643. };
  1644. that.scheduleZone[index].total += 1;
  1645. }
  1646. }
  1647. if (
  1648. zone.zone_id == that.currentData.partition_id &&
  1649. zone.jihao_id == that.currentData.bed_id
  1650. ) {
  1651. var weekPath = that.weekPath(
  1652. that.currentData.schedule_week,
  1653. that.currentData.schedule_type
  1654. );
  1655. if (weekPath.length == 2) {
  1656. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1657. that.scheduleZone[index][weekPathKey] = {
  1658. schedule_id: 0,
  1659. mode_id: 0,
  1660. patient_id: 0,
  1661. patient: "",
  1662. mode_name: "",
  1663. dialysis_machine_name:"",
  1664. patient_contagions: []
  1665. };
  1666. that.scheduleZone[index].total -= 1;
  1667. }
  1668. }
  1669. });
  1670. this.$refs[formName].resetFields();
  1671. this.jhDialogVisible = false;
  1672. }
  1673. this.changing_bed = false;
  1674. })
  1675. .catch(err => {
  1676. this.$message.error(err);
  1677. this.changing_bed = false;
  1678. });
  1679. },
  1680. CreateSchedule(id, data) {
  1681. this.creating_schedule = true;
  1682. CreateSchedule(id, data)
  1683. .then(response => {
  1684. if (response.data.state == 0) {
  1685. this.$message.error(response.data.msg);
  1686. } else {
  1687. this.$message({
  1688. type: "success",
  1689. message: "排班成功!"
  1690. });
  1691. var that = this;
  1692. var schedule = response.data.data.schedule;
  1693. this.scheduleZone.forEach(function(zone, index) {
  1694. if (
  1695. zone.zone_id == schedule.partition_id &&
  1696. zone.jihao_id == schedule.bed_id
  1697. ) {
  1698. var weekPath = that.weekPath(
  1699. schedule.schedule_week,
  1700. schedule.schedule_type
  1701. );
  1702. if (weekPath.length == 2) {
  1703. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1704. that.scheduleZone[index][weekPathKey] = {
  1705. schedule_id: schedule.id,
  1706. mode_id: schedule.mode_id,
  1707. patient_id: schedule.patient_id,
  1708. patient: schedule.patient,
  1709. dialysis_machine_name:schedule.dialysis_machine_name,
  1710. patient_contagions: that.currentData.contagions,
  1711. mode_name:
  1712. typeof that.modeOptions[schedule.mode_id] === "undefined"
  1713. ? ""
  1714. : that.modeOptions[schedule.mode_id].name
  1715. };
  1716. that.scheduleZone[index].total += 1;
  1717. }
  1718. }
  1719. });
  1720. this.closePatientPanel();
  1721. }
  1722. this.creating_schedule = false;
  1723. })
  1724. .catch(err => {
  1725. this.$message.error(err);
  1726. this.creating_schedule = false;
  1727. });
  1728. },
  1729. hoverMouse(row, column, cell, event){
  1730. if (row[column.property].schedule_id > 0) {
  1731. let patient_id = row[column.property].patient_id
  1732. this.patient_id_hover = patient_id
  1733. } else {
  1734. this.patient_id_hover = -1
  1735. }
  1736. },
  1737. clickThis(row, column, cell, event) {
  1738. if(!this.is_edit){
  1739. this.$message.error("当前页面不可编辑");
  1740. return
  1741. }
  1742. // debugger
  1743. var week = this.weekDay(column.property);
  1744. if (week[0] == -1 || week[1] == -1) {
  1745. return false;
  1746. }
  1747. if (this.toDay > this.weekDays[week[0] - 1]) {
  1748. return false;
  1749. }
  1750. this.currentData.schedule_date = this.weekDays[week[0] - 1];
  1751. this.currentData.schedule_type = week[1];
  1752. this.currentData.bed_id = row.jihao_id;
  1753. this.currentData.partition_id = row.zone_id;
  1754. this.currentData.schedule_week = week[0];
  1755. this.currentData.type_name = this.dayType(week[1]);
  1756. this.currentData.zone_name = row.area;
  1757. this.currentData.bed_name = row.cut;
  1758. this.currentData.partition_type = row.zone_type;
  1759. if (row[column.property].schedule_id > 0) {
  1760. this.currentData.mode_id = row[column.property].mode_id;
  1761. this.currentData.id = row[column.property].schedule_id;
  1762. this.currentData.patient_id = row[column.property].patient_id;
  1763. this.currentData.patient = row[column.property].patient;
  1764. this.currentData.contagions = row[column.property].patient_contagions;
  1765. this.tiaoZhengType = 1;
  1766. this.tzDialogVisible = true;
  1767. } else {
  1768. this.currentData.mode_id = 1;
  1769. this.currentData.id = 0;
  1770. this.currentData.patient_id = 0;
  1771. this.currentData.patient = "";
  1772. this.currentData.contagions = [];
  1773. this.getSchedulePatients();
  1774. this.dialogTableVisible = true;
  1775. }
  1776. },
  1777. submitTiaoZJH(formName) {
  1778. this.$refs[formName].validate(valid => {
  1779. if (valid) {
  1780. var weekPath = this.weekPath(
  1781. this.changeSchedule.schedule_week,
  1782. this.changeSchedule.schedule_type
  1783. );
  1784. if (weekPath.length != 2) {
  1785. this.$message.error("数据异常");
  1786. return false;
  1787. }
  1788. this.changeSchedule.bed_id = this.device_id;
  1789. for (let i = 0; i < this.origin_device_numbers.length; i++) {
  1790. if (this.origin_device_numbers[i].id == this.device_id) {
  1791. this.changeSchedule.partition_id = this.origin_device_numbers[
  1792. i
  1793. ].zone_id;
  1794. }
  1795. }
  1796. this.changeSchedule.partition_id = this.zone_name
  1797. this.changeSchedule.change_action = "change_device";
  1798. this.changeScheduleActon(formName);
  1799. // this.changeSchedule.spartition_type = this.scheduleZone[index].zone_type
  1800. // var weekPathKey = weekPath[0] + '_' + weekPath[1]
  1801. // for (var index in this.scheduleZone) {
  1802. // if (this.scheduleZone[index].jihao_id == this.changeSchedule.bed_id) {
  1803. // if (this.scheduleZone[index][weekPathKey].mode_id > 0) {
  1804. // this.$message.error('选中的区域已经存在排班,不能再排班!')
  1805. // return false
  1806. // }
  1807. // break
  1808. // }
  1809. // }
  1810. // 可能
  1811. // 患者有传染病,与选择的机器类型(传染病)不匹配
  1812. // 患者没有传染病,但机器是某个传染病的专用透析器
  1813. // 机器的透析模式与患者不匹配
  1814. // if (this.currentData.contagions.length > 0) {
  1815. // var cflag = false
  1816. // for (var index in this.currentData.contagions) {
  1817. // if (this.currentData.contagions[index].disease_id == this.changeSchedule.partition_type) {
  1818. // cflag = true
  1819. // }
  1820. // }
  1821. // if (!cflag) {
  1822. // this.$confirm('此患者有传染病,与此透析机不匹配,确定在此排班吗?', '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
  1823. // .then(() => {
  1824. //
  1825. // }).catch(() => {
  1826. // })
  1827. // } else {
  1828. // this.changeSchedule.change_action = 'change_device'
  1829. // this.changeScheduleActon(formName)
  1830. // }
  1831. // } else if (this.changeSchedule.partition_type > 1) {
  1832. // this.$confirm('此患者没有传染病,与此透析机不匹配,确定在此排班吗?', '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
  1833. // .then(() => {
  1834. // this.changeSchedule.change_action = 'change_device'
  1835. // this.changeScheduleActon(formName)
  1836. // }).catch(() => {
  1837. // })
  1838. // } else {
  1839. // this.changeSchedule.change_action = 'change_device'
  1840. // this.changeScheduleActon(formName)
  1841. // }
  1842. }
  1843. });
  1844. },
  1845. submitMode(formName) {
  1846. this.changing_mode = true;
  1847. this.changeSchedule.change_action = "change_mode";
  1848. ChangeSchedule(this.currentData.id, this.changeSchedule)
  1849. .then(response => {
  1850. if (response.data.state == 0) {
  1851. this.$message.error(response.data.msg);
  1852. } else {
  1853. this.$message({
  1854. type: "success",
  1855. message: "修改成功!"
  1856. });
  1857. var that = this;
  1858. var schedule = response.data.data.schedule;
  1859. this.scheduleZone.forEach(function(zone, index) {
  1860. if (
  1861. zone.zone_id == schedule.partition_id &&
  1862. zone.jihao_id == schedule.bed_id
  1863. ) {
  1864. var weekPath = that.weekPath(
  1865. schedule.schedule_week,
  1866. schedule.schedule_type
  1867. );
  1868. if (weekPath.length == 2) {
  1869. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1870. that.scheduleZone[index][weekPathKey].mode_id =
  1871. schedule.mode_id;
  1872. that.scheduleZone[index][weekPathKey].mode_name =
  1873. typeof that.modeOptions[schedule.mode_id] === "undefined"
  1874. ? ""
  1875. : that.modeOptions[schedule.mode_id].name;
  1876. }
  1877. }
  1878. });
  1879. this.msDialogVisible = false;
  1880. }
  1881. this.changing_mode = false;
  1882. })
  1883. .catch(err => {
  1884. this.$message.error(err);
  1885. this.changing_mode = false;
  1886. });
  1887. },
  1888. submitTiaoZMS(formName) {
  1889. this.$refs[formName].validate(valid => {
  1890. if (valid) {
  1891. this.changing_mode = true;
  1892. this.changeSchedule.change_action = "change_mode";
  1893. ChangeSchedule(this.currentData.id, this.changeSchedule)
  1894. .then(response => {
  1895. if (response.data.state == 0) {
  1896. this.$message.error(response.data.msg);
  1897. } else {
  1898. this.$message({
  1899. type: "success",
  1900. message: "修改成功!"
  1901. });
  1902. var that = this;
  1903. var schedule = response.data.data.schedule;
  1904. this.scheduleZone.forEach(function(zone, index) {
  1905. if (
  1906. zone.zone_id == schedule.partition_id &&
  1907. zone.jihao_id == schedule.bed_id
  1908. ) {
  1909. var weekPath = that.weekPath(
  1910. schedule.schedule_week,
  1911. schedule.schedule_type
  1912. );
  1913. if (weekPath.length == 2) {
  1914. var weekPathKey = weekPath[0] + "_" + weekPath[1];
  1915. that.scheduleZone[index][weekPathKey].mode_id =
  1916. schedule.mode_id;
  1917. that.scheduleZone[index][weekPathKey].mode_name =
  1918. typeof that.modeOptions[schedule.mode_id] ===
  1919. "undefined"
  1920. ? ""
  1921. : that.modeOptions[schedule.mode_id].name;
  1922. }
  1923. }
  1924. });
  1925. this.$refs[formName].resetFields();
  1926. this.msDialogVisible = false;
  1927. }
  1928. this.changing_mode = false;
  1929. })
  1930. .catch(err => {
  1931. this.$message.error(err);
  1932. this.changing_mode = false;
  1933. });
  1934. }
  1935. });
  1936. },
  1937. changePartition(value) {
  1938. let params = {
  1939. zone_id: value,
  1940. sch_type: this.currentData.schedule_type,
  1941. schedule_date: this.currentData.schedule_date,
  1942. patient_id: this.currentData.patient_id,
  1943. };
  1944. //进行网络请求,获取空排班机位
  1945. getSmartDevices(params).then((response) => {
  1946. if (response.data.state == 0) {
  1947. return false;
  1948. } else {
  1949. var devices = response.data.data.devices;
  1950. this.current_devices = [];
  1951. this.current_devices = devices;
  1952. this.device_id = devices[0].id
  1953. }
  1954. });
  1955. },
  1956. changeScheduleType(schedule_type) {
  1957. this.currentData.schedule_type = schedule_type
  1958. let params = {
  1959. zone_id: this.currentData.partition_id,
  1960. sch_type: schedule_type,
  1961. schedule_date: this.currentData.schedule_date,
  1962. patient_id: this.currentData.patient_id,
  1963. };
  1964. //进行网络请求,获取空排班机位
  1965. getSmartDevices(params).then((response) => {
  1966. if (response.data.state == 0) {
  1967. return false;
  1968. } else {
  1969. var devices = response.data.data.devices;
  1970. this.current_devices = [];
  1971. this.current_devices = devices;
  1972. this.device_id = ""
  1973. }
  1974. });
  1975. // const params = {
  1976. // type: schedule_type,
  1977. // date: this.currentData.schedule_date
  1978. // };
  1979. // getUrgentScheduleInitData(params)
  1980. // .then(rs => {
  1981. // if (rs.data.state == 1) {
  1982. // this.origin_schedules = rs.data.data.schedules;
  1983. // this.origin_device_numbers = rs.data.data.device_numbers;
  1984. //
  1985. // var zone_device_map = {};
  1986. // for (
  1987. // let index = 0;
  1988. // index < this.origin_device_numbers.length;
  1989. // index++
  1990. // ) {
  1991. // const device_number = this.origin_device_numbers[index];
  1992. // if (
  1993. // zone_device_map[device_number.zone_name] == null ||
  1994. // zone_device_map[device_number.zone_name] == undefined
  1995. // ) {
  1996. // zone_device_map[device_number.zone_name] = [];
  1997. // }
  1998. // zone_device_map[device_number.zone_name].push(device_number);
  1999. // }
  2000. // this.zone_device_map = zone_device_map;
  2001. //
  2002. // this.zone_names = Object.keys(this.zone_device_map);
  2003. // // console.log('8989898989898989',this.zone_names)
  2004. //
  2005. // // console.log(this.current_devices);
  2006. //
  2007. // if (this.zone_names.length > 0) {
  2008. // this.zone_name = this.zone_names[0];
  2009. // this.current_devices = this.zone_device_map[this.zone_name];
  2010. // this.device_id = this.current_devices[0].id;
  2011. // }
  2012. //
  2013. //
  2014. // this.zone_device_options = [
  2015. // { values: this.zone_names },
  2016. // // { values: this.getDeviceNumberNames(this.current_devices) },
  2017. // { values: this.current_devices }
  2018. // ];
  2019. //
  2020. // } else {
  2021. // }
  2022. // })
  2023. // .catch(err => {
  2024. // this.loading = false;
  2025. // });
  2026. },
  2027. submitTiaoX() {
  2028. // if (this.tiaoZhengType==1) {
  2029. // this.$confirm('确定要取消当前排班?', '提示', {
  2030. // confirmButtonText: '确定',
  2031. // cancelButtonText: '取消',
  2032. // type: 'warning'
  2033. // }).then(() => {
  2034. // this.CancelSchedule(this.currentData.id);
  2035. // }).catch(() => {});
  2036. // }
  2037. switch (this.tiaoZhengType) {
  2038. case 1:
  2039. this.CancelSchedule(this.currentData.id);
  2040. break;
  2041. case 2:
  2042. this.changeSchedule = {
  2043. mode_id: this.currentData.mode_id,
  2044. schedule_type: this.currentData.schedule_type,
  2045. partition_id: this.currentData.partition_id,
  2046. bed_id: this.currentData.bed_id,
  2047. schedule_week: this.currentData.schedule_week,
  2048. partition_type: ""
  2049. };
  2050. if (
  2051. typeof this.partitions[this.currentData.partition_id].jihaos !==
  2052. "undefined"
  2053. ) {
  2054. this.jihaos = this.partitions[this.currentData.partition_id].jihaos;
  2055. } else {
  2056. this.jihaos = [];
  2057. }
  2058. const params = {
  2059. type: this.currentData.schedule_type,
  2060. date: this.currentData.schedule_date
  2061. };
  2062. getUrgentScheduleInitData(params)
  2063. .then(response => {
  2064. if (response.data.state == 0) {
  2065. this.$message.error(response.data.msg);
  2066. } else {
  2067. if (response.data.state == 1) {
  2068. this.origin_schedules = response.data.data.schedules;
  2069. this.origin_device_numbers =
  2070. response.data.data.device_numbers;
  2071. var zone_device_map = {};
  2072. for (
  2073. let index = 0;
  2074. index < this.origin_device_numbers.length;
  2075. index++
  2076. ) {
  2077. const device_number = this.origin_device_numbers[index];
  2078. if (
  2079. zone_device_map[device_number.zone_name] == null ||
  2080. zone_device_map[device_number.zone_name] == undefined
  2081. ) {
  2082. zone_device_map[device_number.zone_name] = [];
  2083. }
  2084. zone_device_map[device_number.zone_name].push(
  2085. device_number
  2086. );
  2087. }
  2088. this.zone_device_map = zone_device_map;
  2089. this.zone_names = Object.keys(this.zone_device_map);
  2090. if (this.zone_names.length > 0) {
  2091. this.zone_name = this.zone_names[0];
  2092. this.current_devices = this.zone_device_map[this.zone_name];
  2093. this.device_id = this.current_devices[0].id;
  2094. }
  2095. this.zone_device_options = [
  2096. { values: this.zone_names },
  2097. // { values: this.getDeviceNumberNames(this.current_devices) },
  2098. { values: this.current_devices }
  2099. ];
  2100. //
  2101. // for (let i = this.origin_schedules.length - 1; i >= 0; i--) {
  2102. // for (let y = this.origin_device_numbers.length - 1; y >= 0; y--) {
  2103. // if (this.origin_device_numbers[y].id == this.origin_schedules[i].bed_id) {
  2104. // this.origin_device_numbers.splice(y, 1)
  2105. // }
  2106. // }
  2107. // }
  2108. // // debugger
  2109. // var zone_device_map = {}
  2110. // for (let index = 0; index < this.origin_device_numbers.length; index++) {
  2111. // const device_number = this.origin_device_numbers[index]
  2112. // if (zone_device_map[device_number.zone.name] == null || zone_device_map[device_number.zone.name] == undefined) {
  2113. // zone_device_map[device_number.zone.name] = []
  2114. // }
  2115. // zone_device_map[device_number.zone.name].push(device_number)
  2116. // }
  2117. // this.zone_device_map = zone_device_map
  2118. //
  2119. // this.zone_names = Object.keys(this.zone_device_map)
  2120. // if (this.zone_names.length > 0) {
  2121. // this.zone_name = this.zone_names[0]
  2122. // this.current_devices = this.zone_device_map[this.zone_name]
  2123. // this.device_id = this.current_devices[0].id
  2124. // }
  2125. //
  2126. // this.zone_device_options = [
  2127. // { values: this.zone_names },
  2128. // // { values: this.getDeviceNumberNames(this.current_devices) },
  2129. // { values: this.current_devices }
  2130. // ]
  2131. } else {
  2132. }
  2133. }
  2134. })
  2135. .catch(err => {
  2136. this.$message.error(err);
  2137. });
  2138. this.tzDialogVisible = false;
  2139. this.jhDialogVisible = true;
  2140. break;
  2141. case 3:
  2142. this.changeSchedule = {
  2143. mode_id: "",
  2144. schedule_type: "",
  2145. partition_id: "",
  2146. bed_id: "",
  2147. schedule_week: "",
  2148. partition_type: ""
  2149. };
  2150. this.tzDialogVisible = false;
  2151. this.msDialogVisible = true;
  2152. break;
  2153. default:
  2154. break;
  2155. }
  2156. },
  2157. setSchedule() {
  2158. var that = this;
  2159. var submitFlag = true;
  2160. if (this.currentData.patient_id <= 0) {
  2161. this.$message.error("请先选择患者");
  2162. return false;
  2163. }
  2164. if (
  2165. this.currentData.schedule_date.length == 0 ||
  2166. this.currentData.schedule_type < 1 ||
  2167. this.currentData.schedule_type > 3 ||
  2168. this.currentData.bed_id < 1 ||
  2169. this.currentData.partition_id < 1 ||
  2170. this.currentData.schedule_week < 1 ||
  2171. this.currentData.schedule_week > 7
  2172. ) {
  2173. this.$message.error("请先选择排班时间或机号");
  2174. return false;
  2175. }
  2176. // 可能
  2177. // 患者有传染病,与选择的机器类型(传染病)不匹配
  2178. // 患者没有传染病,但机器是某个传染病的专用透析器
  2179. // 机器的透析模式与患者不匹配
  2180. if (this.currentData.contagions.length > 0) {
  2181. var cflag = false;
  2182. this.currentData.contagions.forEach(function(contagion) {
  2183. if (contagion.disease_id == that.currentData.partition_type) {
  2184. cflag = true;
  2185. }
  2186. });
  2187. if (!cflag) {
  2188. this.$confirm(
  2189. "此患者有传染病,与此透析机不匹配,确定在此排班吗?",
  2190. "提示",
  2191. {
  2192. confirmButtonText: "确 定",
  2193. cancelButtonText: "取 消",
  2194. type: "warning"
  2195. }
  2196. )
  2197. .then(() => {
  2198. this.CreateSchedule(
  2199. this.currentData.patient_id,
  2200. this.currentData
  2201. );
  2202. })
  2203. .catch(() => {});
  2204. } else {
  2205. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  2206. }
  2207. } else if (that.currentData.partition_type > 1) {
  2208. this.$confirm(
  2209. "此患者没有传染病,与此透析机不匹配,确定在此排班吗?",
  2210. "提示",
  2211. {
  2212. confirmButtonText: "确 定",
  2213. cancelButtonText: "取 消",
  2214. type: "warning"
  2215. }
  2216. )
  2217. .then(() => {
  2218. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  2219. })
  2220. .catch(() => {});
  2221. } else {
  2222. this.CreateSchedule(this.currentData.patient_id, this.currentData);
  2223. }
  2224. },
  2225. weekType(weekTime) {
  2226. var theType = 2;
  2227. switch (weekTime) {
  2228. case "lastWeek":
  2229. theType = 1;
  2230. break;
  2231. case "thisWeek":
  2232. theType = 2;
  2233. break;
  2234. case "nextWeek":
  2235. theType = 3;
  2236. break;
  2237. case "nextTwoWeek":
  2238. theType = 4;
  2239. break;
  2240. default:
  2241. theType = 2;
  2242. break;
  2243. }
  2244. return theType;
  2245. },
  2246. dayType(theType) {
  2247. var jType = "";
  2248. switch (theType) {
  2249. case 1:
  2250. jType = "上午";
  2251. break;
  2252. case 2:
  2253. jType = "下午";
  2254. break;
  2255. case 3:
  2256. jType = "晚上";
  2257. break;
  2258. default:
  2259. break;
  2260. }
  2261. return jType;
  2262. },
  2263. weekPath(week, schedule_type) {
  2264. var weekArr = {
  2265. 1: "Mon",
  2266. 2: "Tue",
  2267. 3: "Wed",
  2268. 4: "Thurs",
  2269. 5: "Fri",
  2270. 6: "Sat",
  2271. 7: "Sun"
  2272. };
  2273. var typeArr = { 1: "M", 2: "A", 3: "N" };
  2274. if (
  2275. typeof weekArr[week] === "undefined" ||
  2276. typeof typeArr[schedule_type] === "undefined"
  2277. ) {
  2278. return [];
  2279. }
  2280. return [weekArr[week], typeArr[schedule_type]];
  2281. },
  2282. weekDay(prop) {
  2283. var week = prop.split("_");
  2284. if (week.length != 2) {
  2285. return [-1, -1];
  2286. }
  2287. var w = -1;
  2288. var n = -1;
  2289. switch (week[0]) {
  2290. case "Mon":
  2291. w = 1;
  2292. break;
  2293. case "Tue":
  2294. w = 2;
  2295. break;
  2296. case "Wed":
  2297. w = 3;
  2298. break;
  2299. case "Thurs":
  2300. w = 4;
  2301. break;
  2302. case "Fri":
  2303. w = 5;
  2304. break;
  2305. case "Sat":
  2306. w = 6;
  2307. break;
  2308. case "Sun":
  2309. w = 7;
  2310. break;
  2311. default:
  2312. w = -1;
  2313. break;
  2314. }
  2315. switch (week[1]) {
  2316. case "M":
  2317. n = 1;
  2318. break;
  2319. case "A":
  2320. n = 2;
  2321. break;
  2322. case "N":
  2323. n = 3;
  2324. break;
  2325. default:
  2326. n = -1;
  2327. break;
  2328. }
  2329. if (w == -1 || n == -1) {
  2330. return [-1, -1];
  2331. }
  2332. return [w, n];
  2333. },
  2334. search: function() {
  2335. let week_type = 0
  2336. var weeklist = moment().format('E');//计算今天是这周第几天
  2337. var first_monday = moment().subtract(weeklist-1, 'days').format('YYYY-MM-DD');//周一日期
  2338. var end_monday = moment().add(7-weeklist, 'days').format('YYYY-MM-DD')
  2339. if (this.weekTime == 'thisWeek'){
  2340. week_type = 1
  2341. }else if(this.weekTime == 'nextWeek'){
  2342. week_type = 2
  2343. }else if(this.weekTime == 'nextTwoWeek'){
  2344. week_type = 3
  2345. }
  2346. const params = {
  2347. keywords: this.keywords,
  2348. week_type: week_type,
  2349. start_sch:first_monday,
  2350. end_sch:end_monday,
  2351. };
  2352. console.log("params",params)
  2353. getSearchResult(params).then(response => {
  2354. if (response.data.state == 1) {
  2355. this.schedulePatients = response.data.data.schdules;
  2356. this.searchTableVisible = true;
  2357. }
  2358. });
  2359. },
  2360. changeMachineNumber: function(index, row) {
  2361. this.currentData.schedule_type = row.schedule_type;
  2362. this.currentData.bed_id = row.bed_id;
  2363. this.currentData.partition_id = row.partition_id;
  2364. this.currentData.schedule_week = row.schedule_week;
  2365. switch (row.schedule_type) {
  2366. case 1:
  2367. this.currentData.type_name = "上午";
  2368. break;
  2369. case 2:
  2370. this.currentData.type_name = "下午";
  2371. break;
  2372. case 3:
  2373. this.currentData.type_name = "晚上";
  2374. break;
  2375. }
  2376. this.currentData.zone_name = row.zone.name;
  2377. this.currentData.bed_name = row.number.number;
  2378. this.currentData.partition_type = row.zone.type;
  2379. this.currentData.mode_id = row.mode_id;
  2380. this.currentData.patient_id = row.patient_id;
  2381. this.currentData.patient = row.patient;
  2382. this.currentData.contagions = row.patient_contagions;
  2383. this.currentData.id = row.id;
  2384. this.currentData.schedule_date = uParseTime(
  2385. row.schedule_date,
  2386. "{y}-{m}-{d}"
  2387. );
  2388. this.zone_name = row.partition_id;
  2389. this.device_id = row.bed_id;
  2390. // this.current_devices = this.partitions[row.partition_id].jihaos
  2391. let params = {
  2392. zone_id: row.partition_id,
  2393. sch_type: row.schedule_type,
  2394. schedule_date: this.currentData.schedule_date,
  2395. patient_id: this.currentData.patient_id,
  2396. };
  2397. //进行网络请求,获取空排班机位
  2398. getSmartDevices(params).then((response) => {
  2399. if (response.data.state == 0) {
  2400. return false;
  2401. } else {
  2402. var devices = response.data.data.devices;
  2403. this.current_devices = [];
  2404. this.current_devices = devices;
  2405. this.device_id = devices[0].id
  2406. }
  2407. });
  2408. this.changeSchedule = {
  2409. mode_id: row.mode_id,
  2410. schedule_type: row.schedule_type,
  2411. partition_id: row.partition_id,
  2412. bed_id: row.bed_id,
  2413. schedule_week: row.schedule_week,
  2414. partition_type: ""
  2415. };
  2416. if (typeof this.partitions[row.partition_id].jihaos !== "undefined") {
  2417. this.jihaos = this.partitions[row.partition_id].jihaos;
  2418. } else {
  2419. this.jihaos = [];
  2420. }
  2421. this.searchTableVisible = false;
  2422. this.jhDialogVisible = true;
  2423. },
  2424. getDialysisDate: function(row) {
  2425. let week = "";
  2426. switch (row.schedule_week) {
  2427. case 7:
  2428. week = "周日";
  2429. break;
  2430. case 1:
  2431. week = "周一";
  2432. break;
  2433. case 2:
  2434. week = "周二";
  2435. break;
  2436. case 3:
  2437. week = "周三";
  2438. break;
  2439. case 4:
  2440. week = "周四";
  2441. break;
  2442. case 5:
  2443. week = "周五";
  2444. break;
  2445. case 6:
  2446. week = "周六";
  2447. break;
  2448. }
  2449. return week + "(" + uParseTime(row.schedule_date, "{y}-{m}-{d}") + ")";
  2450. },
  2451. getSchedulesType: function(type,row) {
  2452. let type_name = "";
  2453. switch (type) {
  2454. case 1:
  2455. type_name = "上午";
  2456. break;
  2457. case 2:
  2458. type_name = "下午";
  2459. break;
  2460. case 3:
  2461. type_name = "晚上";
  2462. break;
  2463. }
  2464. return type_name;
  2465. },
  2466. changeMode: function(index, row) {
  2467. this.changeSchedule = {
  2468. mode_id: "",
  2469. schedule_type: "",
  2470. partition_id: "",
  2471. bed_id: "",
  2472. schedule_week: "",
  2473. partition_type: ""
  2474. };
  2475. this.currentData.id = row.id;
  2476. this.searchTableVisible = false;
  2477. this.msDialogVisible = true;
  2478. },
  2479. tableRowClassName({row, rowIndex}) {
  2480. if(row.zone_type == 1){
  2481. return 'table-row-new-class schedule-table-row'
  2482. }else {
  2483. return 'table-row-new-class schedule-table-row backPurple'
  2484. }
  2485. },
  2486. getAllZones(){
  2487. getAllZones().then(response=>{
  2488. if(response.data.state == 1){
  2489. var zones = response.data.data.zones
  2490. for(let i=0;i<zones.length;i++){
  2491. this.zoneIdList.push(zones[i].id)
  2492. }
  2493. this.zones.push(...zones)
  2494. var strArr = this.zoneIdList.join(",")
  2495. this.strArr = strArr
  2496. this.getWeekPanels()
  2497. }
  2498. })
  2499. },
  2500. changePartiton(val){
  2501. this.$emit('event1', val)
  2502. this.partition_id = val
  2503. this.getWeekPanels()
  2504. this.getSchedules()
  2505. },
  2506. changeSchedule_type(val){
  2507. this.$emit('event2', val)
  2508. this.schedule_type = val
  2509. this.getSchedules()
  2510. },
  2511. changeWeekDay(val){
  2512. this.$emit('event3', val)
  2513. }
  2514. },
  2515. components: {
  2516. ScheduleItem
  2517. },
  2518. mounted() {
  2519. this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 120;
  2520. // var theType = this.weekType(this.weekTime);
  2521. // this.getSchedules(theType);
  2522. const that = this;
  2523. window.onresize = () => {
  2524. return (() => {
  2525. window.fullHeight = document.documentElement.clientHeight;
  2526. if (window.fullHeight < 200) {
  2527. that.tableHeight = 200;
  2528. } else {
  2529. that.tableHeight = window.fullHeight - 160;
  2530. }
  2531. })();
  2532. };
  2533. },
  2534. // mounted:function(){
  2535. // this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 160
  2536. // },
  2537. created() {
  2538. var date = new Date()
  2539. this.time = date
  2540. var year = date.getFullYear()
  2541. var month = date.getMonth() + 1
  2542. if (month < 10) {
  2543. month = "0" + month
  2544. }
  2545. var day = date.getDate()
  2546. if (day < 10) {
  2547. day = "0" + day
  2548. }
  2549. var nowDate = year + "-" + month + "-" + day
  2550. var date = new Date(nowDate + " 00:00:00")
  2551. console.log("date23232323232323",date.getTime()/1000)
  2552. this.now_time = date.getTime()/1000
  2553. this.getAllZones()
  2554. this.changeScheduleType(1)
  2555. rowNumber = 0;
  2556. this.modeOptions = this.$store.getters.treatment_mode;
  2557. this.partitions = this.partitionsProp;
  2558. var contagions = this.$store.getters.contagions;
  2559. if (contagions.length > 0) {
  2560. var that = this;
  2561. contagions.forEach(function(citem) {
  2562. if (citem.type == 2) {
  2563. that.diseasesArr.push({ value: citem.id, label: citem.name });
  2564. }
  2565. });
  2566. }
  2567. this.scheduleZoneRow = this.scheduleZoneRowProp;
  2568. this.weekday = new Date().getDay();
  2569. if (this.weekday == 0) {
  2570. this.weekday = 7;
  2571. }
  2572. }
  2573. };
  2574. </script>
  2575. <style rel="stylesheet/css" lang="scss">
  2576. .tiaozhengclass {
  2577. display: block;
  2578. margin: 0 auto;
  2579. }
  2580. // .el-table tr {
  2581. // background-color: #111 !important;
  2582. // }
  2583. .schedule-table-row {
  2584. background: #fff !important;
  2585. }
  2586. .schedule-table-row:hover {
  2587. background: #fff !important;
  2588. }
  2589. .schedule-table-row td:hover {
  2590. background: rgb(88, 162, 236) !important;
  2591. }
  2592. .schedule-table-row td .cell {
  2593. font-size: 12px;
  2594. white-space: nowrap !important;
  2595. }
  2596. .schedule-table-cell-disable {
  2597. background-color: rgb(245, 245, 245) !important;
  2598. }
  2599. #table_data {
  2600. min-height: calc(100vh - 350px);
  2601. }
  2602. #table_data ::-webkit-scrollbar {
  2603. height: 15px;
  2604. }
  2605. .el-table td,
  2606. .el-table th.is-leaf,
  2607. .el-table--border,
  2608. .el-table--group {
  2609. border-color: #d0d3da;
  2610. }
  2611. .el-table--border::after,
  2612. .el-table--group::after,
  2613. .el-table::before {
  2614. background-color: #d0d3da;
  2615. }
  2616. .el-table--border th {
  2617. border-color: #d0d3da;
  2618. }
  2619. .el-table--border td {
  2620. border-color: #d0d3da;
  2621. }
  2622. .el-table td {
  2623. border-color: #d0d3da;
  2624. }
  2625. // .hover-td{
  2626. // color: red;
  2627. // }
  2628. // .el-table__body tr.current-row > td {
  2629. // background-color: #409eff !important;
  2630. // color: #fff;
  2631. // }
  2632. // .el-table__body tr > td:hover {
  2633. // background-color: #409eff !important;
  2634. // }
  2635. #table_data {
  2636. .el-table__body tr.current-row > td {
  2637. background-color: #ecf5ff !important;
  2638. color: #3a8ee6;
  2639. }
  2640. .el-table__body tr > td:hover {
  2641. background-color: #409eff !important;
  2642. color: #fff;
  2643. }
  2644. .el-table__body tr .hover-td {
  2645. background-color: #409eff !important;
  2646. color: #fff;
  2647. }
  2648. }
  2649. .backPurple{
  2650. color: #08c3df !important;
  2651. }
  2652. </style>