newDoctorAdvice.vue 91KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <div>
  6. <el-button
  7. size="small"
  8. icon="el-icon-printer"
  9. :disabled="selecting_schs.length == 0"
  10. @click="signPrintAction"
  11. type="primary"
  12. style="margin-right:10"
  13. >标签打印
  14. </el-button>
  15. <el-button
  16. size="small"
  17. icon="el-icon-printer"
  18. :disabled="selecting_schs.length == 0"
  19. @click="batchPrintAction"
  20. type="primary"
  21. >医嘱打印
  22. </el-button>
  23. </div>
  24. </div>
  25. <div class="app-container">
  26. <div class="filter-container">
  27. <el-autocomplete
  28. class="checkSearch"
  29. popper-class="my-autocomplete"
  30. v-model.trim="listQuery.keyword"
  31. :fetch-suggestions="querySearchAsync"
  32. :trigger-on-focus="false"
  33. placeholder="患者姓名"
  34. @select="handleSelect"
  35. >
  36. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  37. <template slot-scope="{ item }">
  38. <div class="name">{{ item.name }}</div>
  39. </template>
  40. </el-autocomplete>
  41. <el-button type="primary" @click="toSeach">搜索</el-button>
  42. </div>
  43. <div class="filter-container">
  44. <el-input style="width:200px" placeholder="请输入药品名称" v-model="keyword"></el-input>
  45. <el-button type="primary" @click="toSeachOne">搜索</el-button>
  46. </div>
  47. <div class="cell clearfix">
  48. <label class="title">
  49. <span class="name">日期查询:</span>
  50. </label>
  51. <el-date-picker
  52. v-model="time"
  53. prefix-icon="el-icon-date"
  54. @change="changeTime"
  55. :editable="false"
  56. style="width: 250px;"
  57. type="date"
  58. placeholder="选择日期时间"
  59. align="right"
  60. format="yyyy-MM-dd"
  61. value-format="timestamp"
  62. ></el-date-picker>
  63. </div>
  64. <div class="cell clearfix">
  65. <label class="title">
  66. <span class="name">排序:</span>
  67. </label>
  68. <el-select v-model="sort" placeholder="请选择" @change="selectSortType">
  69. <el-option
  70. v-for="item in options"
  71. :key="item.name"
  72. :label="item.name"
  73. :value="item.id"
  74. >
  75. </el-option>
  76. </el-select>
  77. </div>
  78. <div class="cell clearfix">
  79. <label class="title"> <span class="name">排班班次</span> : </label>
  80. <div class="time">
  81. <ul class>
  82. <li
  83. :class="item.value == schedulType ? 'active' : ''"
  84. @click="selectSchedulType(item.value)"
  85. v-for="item in schedulArr"
  86. :key="item.value"
  87. >
  88. {{ item.label }}
  89. </li>
  90. </ul>
  91. </div>
  92. </div>
  93. <div class="cell clearfix">
  94. <label class="title"> <span class="name">收费状态</span> : </label>
  95. <div class="time">
  96. <ul class>
  97. <li
  98. :class="item.id == costType ? 'active' : ''"
  99. @click="selectCostType(item.id)"
  100. v-for="item in costArr"
  101. :key="item.id"
  102. >
  103. {{ item.name }}
  104. </li>
  105. </ul>
  106. </div>
  107. </div>
  108. <div class="cell clearfix">
  109. <label class="title"> <span class="name">分区</span> : </label>
  110. <div class="time">
  111. <ul class>
  112. <li
  113. :class="item.id == partitionType ? 'active' : ''"
  114. @click="selectPartitionType(item.id)"
  115. v-for="item in partitionArr"
  116. :key="item.id"
  117. >
  118. {{ item.name }}
  119. </li>
  120. </ul>
  121. </div>
  122. </div>
  123. <div class="cell clearfix">
  124. <label class="title"> <span class="name">给药途径</span> : </label>
  125. <div class="time">
  126. <ul class>
  127. <li
  128. :class="item.id == delivery_way ? 'active' : ''"
  129. @click="selectDeliveryWay(item.id)"
  130. v-for="item in deliveryWay"
  131. :key="item.id"
  132. >
  133. {{ item.name }}
  134. </li>
  135. </ul>
  136. </div>
  137. </div>
  138. <div class="cell clearfix">
  139. <label class="title"> <span class="name">执行频率</span> : </label>
  140. <div class="time">
  141. <ul class>
  142. <li
  143. :class="item.id == execution_frequency ? 'active' : ''"
  144. @click="selectFrequencyWay(item.id)"
  145. v-for="item in excutList"
  146. :key="item.id"
  147. >
  148. {{ item.name }}
  149. </li>
  150. </ul>
  151. </div>
  152. </div>
  153. <div class="cell clearfix">
  154. <label class="title"> <span class="name">执行状态</span> : </label>
  155. <div class="time">
  156. <ul class>
  157. <li
  158. :class="item.id == excution_way ? 'active' : ''"
  159. @click="selectExcutionWay(item.id)"
  160. v-for="item in executionList"
  161. :key="item.id"
  162. >
  163. {{ item.name }}
  164. </li>
  165. </ul>
  166. </div>
  167. </div>
  168. <!-- <div style="margin-top: 10px;margin-left:600px;margin-bottom:10px">
  169. <el-button type="primary" size="small" @click="toExcution">执行医嘱</el-button>
  170. <el-button type="primary" size="small" @click="toCheck">医嘱核对</el-button>
  171. <el-button type="primary" size="small" @click="toSettle">收费</el-button>
  172. </div> -->
  173. <div style="margin-top: 10px;margin-bottom:10px">
  174. <el-button type="primary" size="small" @click="toStatic" v-if="org_id!=9671 && org_id!=10340">药品统计</el-button>
  175. <el-button type="primary" size="small" @click="toStaticOne" v-if="org_id == 9671 || org_id==10340">药品统计</el-button>
  176. <el-button type="primary" size="small" @click="toStaticTwo">耗材统计</el-button>
  177. </div>
  178. <el-table :data="scheduleMap" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  179. @selection-change="handleSelectionChange"
  180. :span-method="objectSpanMethod"
  181. :cell-class-name="adviceNameShow"
  182. :modal-append-to-body="false"
  183. highlight-current-row
  184. @current-change="handleCurrentChangeList"
  185. v-show="show"
  186. @row-click="handleRowClick">
  187. <el-table-column type="selection" width="55" align="center"></el-table-column>
  188. <el-table-column prop="date" label="姓名" align="center" min-width="26px">
  189. <template slot-scope="scope">
  190. <span>{{ scope.row.name }}</span>
  191. <br>
  192. ({{ scope.row.parent_id == 0 ? scope.row.dialysis_no : ""}})
  193. <br>
  194. <span v-if="scope.row.mode_id == 1">(HD)</span>
  195. <span v-if="scope.row.mode_id == 2">(HDF)</span>
  196. <span v-if="scope.row.mode_id == 3">(HD+HP)</span>
  197. <span v-if="scope.row.mode_id == 4">(HP)</span>
  198. <span v-if="scope.row.mode_id == 5">(HF)</span>
  199. <span v-if="scope.row.mode_id == 6">(SCUF)</span>
  200. <span v-if="scope.row.mode_id == 7">(IUF)</span>
  201. <span v-if="scope.row.mode_id == 8">(HFHD)</span>
  202. <span v-if="scope.row.mode_id == 9">(HFHD+HP)</span>
  203. <span v-if="scope.row.mode_id == 10">(PHF)</span>
  204. <span v-if="scope.row.mode_id == 11">(HFR)</span>
  205. <span v-if="scope.row.mode_id == 12">(HDF+HP)</span>
  206. <span v-if="scope.row.mode_id == 13">(CRRT)</span>
  207. <span v-if="scope.row.mode_id == 14">(腹水回输)</span>
  208. <span v-if="scope.row.mode_id == 24">I-HDF</span>
  209. </br>
  210. <span v-if="scope.row.anticoagulant == 1" style="color:red">无肝素</span>
  211. </template>
  212. </el-table-column>
  213. <el-table-column label="分区床位" width="100">
  214. <template slot-scope="scope" >
  215. {{scope.row.zone_name}}/{{scope.row.number}}
  216. </template>
  217. </el-table-column>
  218. <el-table-column prop="date" label="透析器" align="center" min-width="26px">
  219. <template slot-scope="scope">
  220. <span>{{ scope.row.dialyzer_perfusion_apparatus }}</span>
  221. <span v-if="scope.row.dialysis_dialyszers!=''">{{scope.row.dialysis_dialyszers}}</span>
  222. <span v-if="scope.row.dialysis_irrigation!=''">{{scope.row.dialysis_irrigation}}</span>
  223. </template>
  224. </el-table-column>
  225. <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
  226. <template slot-scope="scope">
  227. <span>
  228. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  229. </span>
  230. </template>
  231. </el-table-column>
  232. <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">
  233. <template slot-scope="scope">
  234. <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
  235. <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
  236. {{ getAdviceContent(scope.row, 1)}}
  237. </span>
  238. </el-dropdown>
  239. <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
  240. <span class="el-dropdown-link">
  241. &emsp;{{ getAdviceContent(scope.row, 2)}}
  242. </span>
  243. </el-dropdown>
  244. </template>
  245. </el-table-column>
  246. <el-table-column
  247. prop="start_time"
  248. align="center"
  249. min-width="30px"
  250. label="执行时间"
  251. sortable
  252. >
  253. <template slot-scope="scope">
  254. <span v-if="scope.row.execution_time != 0">
  255. {{scope.row.execution_time | parseTime('{m}-{d} {h}:{i}')}}
  256. </span>
  257. <span v-else></span>
  258. </template>
  259. </el-table-column>
  260. <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
  261. <template slot-scope="scope">
  262. <span v-if="scope.row.parent_id == 0">
  263. {{getXuserName(scope.row.execution_staff)}}
  264. </span>
  265. <span v-else>{{getXuserName(scope.row.execution_staff)}}</span>
  266. </template>
  267. </el-table-column>
  268. <el-table-column prop="checker" align="center" min-width="30px" label="校对护士">
  269. <template slot-scope="scope">
  270. <span v-if="scope.row.parent_id == 0">
  271. {{getXuserName(scope.row.checker)}}
  272. </span>
  273. <span v-else>{{getXuserName(scope.row.checker)}}</span>
  274. </template>
  275. </el-table-column>
  276. <el-table-column
  277. prop="check_time"
  278. align="center"
  279. min-width="30px"
  280. label="校对时间"
  281. sortable
  282. >
  283. <template slot-scope="scope">
  284. <span v-if="scope.row.check_time != 0 && org_id!=10460">
  285. {{scope.row.check_time | parseTime('{m}-{d} {h}:{i}')}}
  286. </span>
  287. <span v-else>
  288. </span>
  289. </template>
  290. </el-table-column>
  291. <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
  292. <template slot-scope="scope">
  293. <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
  294. </template>
  295. </el-table-column>
  296. <el-table-column
  297. prop="created_time"
  298. align="center"
  299. min-width="30px"
  300. label="校对时间"
  301. sortable
  302. >
  303. <template slot-scope="scope">
  304. <span v-if="scope.row.created_time != 0 && org_id!=10460">
  305. {{scope.row.created_time | parseTime('{m}-{d} {h}:{i}')}}
  306. </span>
  307. <span v-else></span>
  308. </template>
  309. </el-table-column>
  310. <el-table-column
  311. prop="created_time"
  312. align="center"
  313. min-width="30px"
  314. label="收费状态"
  315. sortable
  316. >
  317. <template slot-scope="scope">
  318. <span v-if="scope.row.is_settle == 1">
  319. 已收费
  320. </span>
  321. <span v-if="scope.row.is_settle == 2 || scope.row.is_settle == 0">
  322. 未收费
  323. </span>
  324. <span v-else></span>
  325. </template>
  326. </el-table-column>
  327. </el-table>
  328. <el-table :data="scheduleMap" border :row-style="{ color: '#303133' }" :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
  329. @selection-change="handleSelectionChangeOne"
  330. @current-change="handleCurrentChangeList"
  331. :span-method="objectSpanMethod"
  332. :cell-class-name="adviceNameShow"
  333. highlight-current-row
  334. :modal-append-to-body="false"
  335. v-show="showOne">
  336. <el-table-column type="selection" width="55" align="center"></el-table-column>
  337. <el-table-column prop="date" label="姓名" align="center" min-width="26px">
  338. <template slot-scope="scope">
  339. <span>{{ scope.row.name }}</span>
  340. <br>
  341. ({{ scope.row.parent_id == 0 ? scope.row.dialysis_no : ""}})
  342. <br>
  343. <span v-if="scope.row.mode_id == 1">(HD)</span>
  344. <span v-if="scope.row.mode_id == 2">(HDF)</span>
  345. <span v-if="scope.row.mode_id == 3">(HD+HP)</span>
  346. <span v-if="scope.row.mode_id == 4">(HP)</span>
  347. <span v-if="scope.row.mode_id == 5">(HF)</span>
  348. <span v-if="scope.row.mode_id == 6">(SCUF)</span>
  349. <span v-if="scope.row.mode_id == 7">(IUF)</span>
  350. <span v-if="scope.row.mode_id == 8">(HFHD)</span>
  351. <span v-if="scope.row.mode_id == 9">(HFHD+HP)</span>
  352. <span v-if="scope.row.mode_id == 10">(PHF)</span>
  353. <span v-if="scope.row.mode_id == 11">(HFR)</span>
  354. <span v-if="scope.row.mode_id == 12">(HDF+HP)</span>
  355. <span v-if="scope.row.mode_id == 13">(CRRT)</span>
  356. <span v-if="scope.row.mode_id == 14">(腹水回输)</span>
  357. <span v-if="scope.row.mode_id == 24">I-HDF</span>
  358. </template>
  359. </el-table-column>
  360. <el-table-column prop="date" label="透析器" align="center" min-width="26px">
  361. <template slot-scope="scope">
  362. <span>
  363. {{ scope.row.dialyzer_perfusion_apparatus }}
  364. <span v-if="scope.row.dialysis_dialyszers!=''">{{scope.row.dialysis_dialyszers}}</span>
  365. <span v-if="scope.row.dialysis_irrigation!=''">{{scope.row.dialysis_irrigation}}</span>
  366. </span>
  367. </template>
  368. </el-table-column>
  369. <el-table-column prop="start_time" label="开始时间" align="center" min-width="35px">
  370. <template slot-scope="scope">
  371. <span>
  372. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  373. </span>
  374. </template>
  375. </el-table-column>
  376. <el-table-column prop="advice_name" min-width="50px" label="医嘱内容" align="center">
  377. <template slot-scope="scope">
  378. <el-dropdown trigger="click" v-if="scope.row.parent_id == 0">
  379. <span class="el-dropdown-link" v-if="scope.row.parent_id == 0">
  380. {{ getAdviceContent(scope.row, 1)}}
  381. </span>
  382. </el-dropdown>
  383. <el-dropdown trigger="click" v-if="scope.row.parent_id > 0">
  384. <span class="el-dropdown-link">
  385. &emsp;{{ getAdviceContent(scope.row, 2)}}
  386. </span>
  387. </el-dropdown>
  388. </template>
  389. </el-table-column>
  390. <el-table-column
  391. prop="start_time"
  392. align="center"
  393. min-width="30px"
  394. label="执行时间"
  395. sortable
  396. >
  397. <template slot-scope="scope">
  398. <span v-if="scope.row.execution_time != 0">
  399. {{scope.row.start_time | parseTime('{m}-{d} {h}:{i}')}}
  400. </span>
  401. <span v-else></span>
  402. </template>
  403. </el-table-column>
  404. <el-table-column prop="execution_staff" align="center" min-width="30px" label="执行护士">
  405. <template slot-scope="scope">
  406. <span v-if="scope.row.parent_id == 0">
  407. {{getXuserName(scope.row.execution_staff)}}
  408. </span>
  409. <span v-else></span>
  410. </template>
  411. </el-table-column>
  412. <el-table-column prop="checker" align="center" min-width="30px" label="校对护士">
  413. <template slot-scope="scope">
  414. <span v-if="scope.row.parent_id == 0">
  415. {{getXuserName(scope.row.checker)}}
  416. </span>
  417. <span v-else></span>
  418. </template>
  419. </el-table-column>
  420. <el-table-column
  421. prop="check_time"
  422. align="center"
  423. min-width="30px"
  424. label="校对时间"
  425. sortable
  426. >
  427. <template slot-scope="scope">
  428. <span v-if="scope.row.check_time != 0">
  429. {{scope.row.check_time | parseTime('{m}-{d} {h}:{i}')}}
  430. </span>
  431. <span v-else></span>
  432. </template>
  433. </el-table-column>
  434. <el-table-column prop="date" label="开嘱医生" align="center" min-width="26px">
  435. <template slot-scope="scope">
  436. <span>{{ getXuserName(scope.row.advice_doctor) }}</span>
  437. </template>
  438. </el-table-column>
  439. <el-table-column
  440. prop="created_time"
  441. align="center"
  442. min-width="30px"
  443. label="校对时间"
  444. sortable
  445. >
  446. <template slot-scope="scope">
  447. <span v-if="scope.row.created_time != 0">
  448. {{scope.row.created_time | parseTime('{m}-{d} {h}:{i}')}}
  449. </span>
  450. <span v-else></span>
  451. </template>
  452. </el-table-column>
  453. <el-table-column
  454. prop="created_time"
  455. align="center"
  456. min-width="30px"
  457. label="收费状态"
  458. sortable
  459. >
  460. <template slot-scope="scope">
  461. <span v-if="scope.row.is_settle == 1">
  462. 已收费
  463. </span>
  464. <span v-if="scope.row.is_settle == 2 || scope.row.is_settle == 0">
  465. 未收费
  466. </span>
  467. <span v-else></span>
  468. </template>
  469. </el-table-column>
  470. </el-table>
  471. <el-dialog
  472. title="选择执行时间"
  473. :visible.sync="execTimeDialogVisible"
  474. width="400px"
  475. :modal-append-to-body="false"
  476. >
  477. <el-date-picker
  478. v-model="execTime"
  479. format="yyyy-MM-dd HH:mm:00"
  480. value-format="yyyy-MM-dd HH:mm:00"
  481. type="datetime"
  482. placeholder="选择执行时间"
  483. style="width:100%"
  484. ></el-date-picker>
  485. <span slot="footer" class="dialog-footer">
  486. <el-button @click="execTimeDialogVisible = false">取 消</el-button>
  487. <el-button type="primary" @click="excutionDoctorAdvice" :loading="exceLoading">保 存</el-button>
  488. </span>
  489. </el-dialog>
  490. <el-dialog
  491. title="选择执行时间"
  492. :visible.sync="execTimeDialogVisibleOne"
  493. width="400px"
  494. :modal-append-to-body="false"
  495. >
  496. <el-date-picker
  497. v-model="execTime"
  498. format="yyyy-MM-dd HH:mm:00"
  499. value-format="yyyy-MM-dd HH:mm:00"
  500. type="datetime"
  501. placeholder="选择执行时间"
  502. style="width:100%"
  503. ></el-date-picker>
  504. <span slot="footer" class="dialog-footer">
  505. <el-button @click="execTimeDialogVisibleOne = false">取 消</el-button>
  506. <el-button type="primary" @click="excutionDoctorAdviceOne" :loading="exceLoading">保 存</el-button>
  507. </span>
  508. </el-dialog>
  509. <el-dialog
  510. title="药品统计表"
  511. :visible.sync="startdialogVisible"
  512. width="60%">
  513. <span>
  514. <div class="cell clearfix" style="margin-bottom:10px">
  515. <label class="title"> <span class="name">排班班次</span> : </label>
  516. <el-select v-model="schedule_type" placeholder="请选择" @change="changeScheduleType" >
  517. <el-option
  518. v-for="item in schedulArr"
  519. :key="item.value"
  520. :label="item.label"
  521. :value="item.value">
  522. </el-option>
  523. </el-select>
  524. <label class="title"> <span class="name">病区选择</span> : </label>
  525. <el-select v-model="partion_type" placeholder="请选择" @change="changePartionType" multiple >
  526. <el-option
  527. v-for="item in partitionArr"
  528. :key="item.id"
  529. :label="item.name"
  530. :value="item.id">
  531. </el-option>
  532. </el-select>
  533. <el-button size="small" icon="el-icon-printer" @click="toPrintOne" type="primary">打印</el-button>
  534. <el-button size="small" @click="toExportListOne" type="primary">导出</el-button>
  535. </div>
  536. <el-table
  537. :data="tableList"
  538. border
  539. :row-style="{ color: '#303133' }"
  540. :header-cell-style="{
  541. backgroundColor: 'rgb(245, 247, 250)',
  542. color: '#606266'
  543. }"
  544. >
  545. <el-table-column align="center" label="序号">
  546. <template slot-scope="scope">
  547. {{scope.$index+1}}
  548. </template>
  549. </el-table-column>
  550. <el-table-column align="center" label="药品名称">
  551. <template slot-scope="scope">
  552. {{scope.row.advice_name}}
  553. </template>
  554. </el-table-column>
  555. <el-table-column align="center" label="规格">
  556. <template slot-scope="scope">
  557. {{scope.row.specification_name}}
  558. </template>
  559. </el-table-column>
  560. <el-table-column align="center" label="数量">
  561. <template slot-scope="scope">
  562. <span v-if="config.is_open!=1">{{getCount(scope.row.child)}}</span>
  563. <span v-if="config.is_open ==1">{{getHisCount(scope.row.child,scope.row.max_unit,scope.row.min_unit,scope.row.min_number)}}</span>
  564. </template>
  565. </el-table-column>
  566. </el-table>
  567. </span>
  568. <span slot="footer" class="dialog-footer">
  569. <el-button @click="startdialogVisible = false">取 消</el-button>
  570. <el-button type="primary" @click="startdialogVisible = false">确 定</el-button>
  571. </span>
  572. </el-dialog>
  573. <!-- 长沙南雅 -->
  574. <el-dialog
  575. title="药品统计表"
  576. :visible.sync="startdialogVisibleOne"
  577. width="70%">
  578. <span>
  579. <div class="cell clearfix" style="margin-bottom:10px">
  580. <label class="title"> <span class="name">排班班次</span> : </label>
  581. <el-select v-model="schedule_type" placeholder="请选择" @change="changeScheduleTypeOne" >
  582. <el-option
  583. v-for="item in schedulArr"
  584. :key="item.value"
  585. :label="item.label"
  586. :value="item.value">
  587. </el-option>
  588. </el-select>
  589. <label class="title"> <span class="name">病区选择</span> : </label>
  590. <el-select v-model="partion_type" placeholder="请选择" @change="changePartionTypeOne" multiple>
  591. <el-option
  592. v-for="item in partitionArr"
  593. :key="item.id"
  594. :label="item.name"
  595. :value="item.id">
  596. </el-option>
  597. </el-select>
  598. <el-button size="small" icon="el-icon-printer" @click="toPrintTwo" type="primary">打印</el-button>
  599. <!-- <el-button size="small" @click="toExportListOne" type="primary">导出</el-button> -->
  600. <!-- <el-button @click="toJiao()">脚本</el-button> -->
  601. </div>
  602. <el-table
  603. :data="tableDataList"
  604. border
  605. :row-style="{ color: '#303133' }"
  606. :header-cell-style="{
  607. backgroundColor: 'rgb(245, 247, 250)',
  608. color: '#606266'
  609. }"
  610. >
  611. <el-table-column
  612. align="center"
  613. prop="name"
  614. label="序号"
  615. width="100"
  616. >
  617. <template slot-scope="scope" >
  618. <span v-if="scope.row.is_total == 1">{{scope.$index+1}}</span>
  619. <span v-if="scope.row.is_total == 0">总计</span>
  620. </template>
  621. </el-table-column>
  622. <el-table-column
  623. align="center"
  624. prop="name"
  625. label="区域"
  626. width="100"
  627. >
  628. <template slot-scope="scope" >
  629. <span v-if="scope.row.is_total ==1">
  630. <!-- {{getZoneName(scope.row.child)}} -->
  631. {{scope.row.zone_name }}
  632. </span>
  633. </template>
  634. </el-table-column>
  635. <!-- <el-table-column
  636. align="center"
  637. prop="name"
  638. label="责护"
  639. width="100"
  640. >
  641. <template slot-scope="scope">
  642. <span v-if="scope.row.is_total ==1">
  643. {{getAdminUserName(scope.row.execution_staff)}}
  644. </span>
  645. </template>
  646. </el-table-column> -->
  647. <el-table-column
  648. align="center"
  649. prop="name"
  650. label="透析模式"
  651. width="150"
  652. >
  653. <template slot-scope="scope">
  654. <span v-if="scope.row.is_total == 1">
  655. {{getModeId(scope.row.child)}}
  656. </span>
  657. </template>
  658. </el-table-column>
  659. <el-table-column
  660. align="center"
  661. prop="name"
  662. v-for="(item,index) in tabHead"
  663. :key="index"
  664. :label="item.advice_name"
  665. >
  666. <template slot-scope="scope">
  667. <span v-if="scope.row.is_total ==1">
  668. <span v-if="scope.row.child[index]!=null">{{getDrugCount(scope.row.child,item.advice_name)}}</span>
  669. <span v-if="item&&item.advice_name == '肝素钠注射剂'">
  670. {{getDrugAdviceCount(item.advice_name,scope.row.zone_name)}}
  671. </span>
  672. <span v-if="scope.row.child[index]==null && getDrugCount(scope.row.child,item.advice_name)>0">
  673. {{getDrugCount(scope.row.child,item.advice_name)}}
  674. <span v-if="item&&item.advice_name == '肝素钠注射剂'">
  675. {{getDrugAdviceCount(item.advice_name,scope.row.zone_name)}}
  676. </span>
  677. </span>
  678. </span>
  679. <span v-if="scope.row.is_total == 0">
  680. {{getAllSumCount(item.advice_name)}}
  681. </span>
  682. </template>
  683. </el-table-column>
  684. </el-table>
  685. </span>
  686. <span slot="footer" class="dialog-footer">
  687. <el-button @click="startdialogVisibleOne = false">取 消</el-button>
  688. <el-button type="primary" @click="startdialogVisibleOne = false">确 定</el-button>
  689. </span>
  690. </el-dialog>
  691. <el-dialog
  692. title="耗材统计表"
  693. :visible.sync="startdialogVisibleTwo"
  694. width="60%">
  695. <span>
  696. <div class="cell clearfix" style="margin-bottom:10px">
  697. <label class="title"> <span class="name">排班班次</span> : </label>
  698. <el-select v-model="schedule_type" placeholder="请选择" @change="changeScheduleTypeTwo" >
  699. <el-option
  700. v-for="item in schedulArr"
  701. :key="item.value"
  702. :label="item.label"
  703. :value="item.value">
  704. </el-option>
  705. </el-select>
  706. <label class="title"> <span class="name">病区选择</span> : </label>
  707. <el-select v-model="partion_type" placeholder="请选择" @change="changePartionTypeTwo" multiple >
  708. <el-option
  709. v-for="item in partitionArr"
  710. :key="item.id"
  711. :label="item.name"
  712. :value="item.id">
  713. </el-option>
  714. </el-select>
  715. <el-button size="small" icon="el-icon-printer" @click="toPrintThree" type="primary">打印</el-button>
  716. <el-button size="small" @click="toExportListTwo" type="primary">导出</el-button>
  717. </div>
  718. <el-table
  719. :data="tableProjectList"
  720. border
  721. :row-style="{ color: '#303133' }"
  722. :header-cell-style="{
  723. backgroundColor: 'rgb(245, 247, 250)',
  724. color: '#606266'
  725. }"
  726. >
  727. <el-table-column align="center" label="序号">
  728. <template slot-scope="scope">
  729. {{scope.$index+1}}
  730. </template>
  731. </el-table-column>
  732. <el-table-column align="center" label="耗材名称">
  733. <template slot-scope="scope">
  734. {{scope.row.good_name}}
  735. </template>
  736. </el-table-column>
  737. <el-table-column align="center" label="规格">
  738. <template slot-scope="scope">
  739. {{scope.row.specification_name}}
  740. </template>
  741. </el-table-column>
  742. <el-table-column align="center" label="数量">
  743. <template slot-scope="scope">
  744. {{scope.row.count}}
  745. </template>
  746. </el-table-column>
  747. </el-table>
  748. </span>
  749. <span slot="footer" class="dialog-footer">
  750. <el-button @click="startdialogVisibleTwo = false">取 消</el-button>
  751. <el-button type="primary" @click="startdialogVisibleTwo = false">确 定</el-button>
  752. </span>
  753. </el-dialog>
  754. </div>
  755. </div>
  756. </template>
  757. <script>
  758. const moment = require('moment')
  759. import { getSchedualPatient, GetAllZone,getDialysisAdviceToday,getDialysisProject } from "@/api/dialysis";
  760. import { parseTime } from "@/utils";
  761. import { uParseTime } from '@/utils/tools'
  762. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  763. import { getPrintTemplate } from "@/api/data";
  764. import { getNewSchedualDoctors,excutionDoctorAdvice,checkNewDoctorAdvice,settleNewDoctorAdvice,excutionDoctorAdviceById,GetMobileScheduleList } from '@/api/advice'
  765. import { PostSearch } from '@/api/patient'
  766. export default {
  767. name: "Patient",
  768. data() {
  769. return {
  770. crumbs: [
  771. { path: false, name: "透析管理" },
  772. { path: false, name: "透析监测" }
  773. ],
  774. loading: false,
  775. time: "",
  776. search_mode: 1, // 搜索模式 1.日期搜索 2.病人搜索
  777. patient_search_keyword: "",
  778. SchedualPatientsTableData: [],
  779. active: true,
  780. schedulType: 0,
  781. schedulArr: [
  782. { value: 0, label: "全部" },
  783. { value: 1, label: "上午" },
  784. { value: 2, label: "下午" },
  785. { value: 3, label: "晚上" }
  786. ],
  787. template_id: 0,
  788. partitionType: 0,
  789. costType:0,
  790. total: 0,
  791. listQuery: {
  792. page: 1,
  793. limit: 10,
  794. schedul_type: 0,
  795. partition_type: 0,
  796. schedul_time: "",
  797. keywords: "",
  798. },
  799. selecting_schs: [],
  800. partitionArr: [],
  801. scheduleMap:[],
  802. show:true,
  803. showOne:false,
  804. deliveryWay:[],
  805. executionList:[
  806. {id:0,name:"全部"},
  807. {id:1,name:"已执行"},
  808. {id:2,name:"未执行"},
  809. ],
  810. delivery_way:0,
  811. patient_id:0,
  812. org_id:0,
  813. excution_way:0,
  814. options:[
  815. {id:0,name:"请选择"},
  816. {id:1,name:"按床位排序"},
  817. {id:2,name:"按签到时间排序"},
  818. ],
  819. costArr:[
  820. {id:0,name:"全部"},
  821. {id:1,name:"已收费"},
  822. {id:2,name:"未收费"}
  823. ],
  824. sort:0,
  825. config:{},
  826. execTime: '',
  827. execTimeDialogVisible:false,
  828. exceLoading:false,
  829. is_sort:0,
  830. hoverOrderArr:[],
  831. is_status:0,
  832. execTimeDialogVisibleOne:false,
  833. current_row:{},
  834. tableList:[],
  835. startdialogVisible:false,
  836. startdialogVisibleOne:false,
  837. startdialogVisibleTwo:false,
  838. schedule_type:0,
  839. partion_type:0,
  840. druglist:[],
  841. config:{},
  842. tabHead:[],
  843. tableDataList:[],
  844. adminUserList:[],
  845. doctorMap:[],
  846. excutList:[],
  847. execution_frequency:"",
  848. zoneIdList:[],
  849. partion_str:"",
  850. keyword:"",
  851. tableProjectList:[],
  852. };
  853. },
  854. created() {
  855. var date = new Date();
  856. this.time = date;
  857. var year = date.getFullYear();
  858. var month = date.getMonth() + 1;
  859. var day = date.getDate();
  860. if (month < 10) {
  861. month = "0" + month;
  862. }
  863. if (day < 10) {
  864. day = "0" + day;
  865. }
  866. var nowDate = year + "-" + month + "-" + day;
  867. var date = new Date(nowDate + " 00:00:00");
  868. this.listQuery.schedul_time = date.getTime();
  869. this.getAllZone();
  870. this.getTemplateInfo();
  871. this.requestSchedualDoctors(this.time)
  872. this.org_id = this.$store.getters.xt_user.template_info.org_id;
  873. },
  874. methods: {
  875. getTemplateInfo() {
  876. getPrintTemplate().then(response => {
  877. if (response.data.state == 0) {
  878. this.$message.error(response.data.msg);
  879. return false;
  880. } else {
  881. var template = response.data.data.template;
  882. this.template_id = template.template_id;
  883. }
  884. });
  885. },
  886. clickCurrent(val) {
  887. //console.log(val);
  888. this.$router.push({
  889. path: "/dialysis/details",
  890. query: { patient_id: val.patient_id, date: val.sch_time_int,mode_id:val.mode_id }
  891. });
  892. },
  893. selectSchedulType(scheduleType) {
  894. this.schedulType = scheduleType;
  895. this.listQuery.schedul_type = scheduleType;
  896. this.requestSchedualDoctors(this.time);
  897. },
  898. selectPartitionType(partitionType) {
  899. this.partitionType = partitionType;
  900. this.listQuery.partition_type = partitionType;
  901. this.requestSchedualDoctors(this.time);
  902. },
  903. selectCostType(costType){
  904. this.costType = costType
  905. this.requestSchedualDoctors(this.time);
  906. },
  907. selectDeliveryWay(val){
  908. this.delivery_way = val
  909. this.requestSchedualDoctors(this.time)
  910. },
  911. selectFrequencyWay(val){
  912. this.execution_frequency = val
  913. this.requestSchedualDoctors(this.time)
  914. },
  915. selectExcutionWay(val){
  916. this.excution_way = val
  917. this.requestSchedualDoctors(this.time)
  918. },
  919. changeTime() {
  920. this.listQuery.schedul_time = this.time;
  921. this.requestSchedualDoctors(this.time)
  922. },
  923. getAllZone: function() {
  924. GetAllZone().then(response => {
  925. if (response.data.state == 0) {
  926. this.$message.error(response.data.msg);
  927. return false;
  928. } else {
  929. this.partitionArr = response.data.data.zone;
  930. for(let i=0;i<this.partitionArr.length;i++){
  931. this.zoneIdList.push(this.partitionArr[i].id)
  932. }
  933. // this.partitionArr.unshift({ id: 0, name: "全部" });
  934. var dics = response.data.data.dics
  935. var obj = {id:0,name:"全部"}
  936. this.deliveryWay.push(obj)
  937. this.deliveryWay.push(...dics)
  938. var objOne = {id:0,name:"全部"}
  939. this.excutList.push(objOne)
  940. var efs = response.data.data.efs
  941. this.excutList.push(...efs)
  942. console.log("执行瓶绿",this.excutList)
  943. }
  944. });
  945. },
  946. requestSchedualDoctors (time) {
  947. var name = ""
  948. for(let i=0;i<this.deliveryWay.length;i++){
  949. if(this.delivery_way == this.deliveryWay[i].id){
  950. name = this.deliveryWay[i].name
  951. }
  952. }
  953. if(name == '全部'){
  954. name = ""
  955. }
  956. var nameOne = ""
  957. for(let i=0;i<this.excutList.length;i++){
  958. if(this.execution_frequency == this.excutList[i].id){
  959. nameOne = this.excutList[i].name
  960. }
  961. }
  962. if(nameOne == '全部'){
  963. nameOne = ""
  964. }
  965. let newTime = moment(time).format('YYYY-MM-DD')
  966. var schedule_type = this.listQuery.schedul_type
  967. var partition_type = this.listQuery.partition_type
  968. getNewSchedualDoctors({date: newTime,patient_type: 0,advice_type: 2,delivery_way:name,schedule_type:schedule_type,partition_type:partition_type,patient_id:this.patient_id,excution_way:this.excution_way,cost_type:this.costType,execution_frequency:nameOne,keyword:this.keyword}).then(rs => {
  969. var resp = rs.data
  970. if (resp.state == 1) {
  971. this.admin_users = resp.data.adminUser
  972. var config = resp.data.config
  973. this.config = config
  974. let project_config = resp.data.project_config
  975. if(project_config.is_open == 1){
  976. this.project = resp.data.project
  977. console.log("wode 2o2o3o3o23o32o32o23o32o32o", this.project)
  978. let projectArr = []
  979. if(this.org_id!= 10318 && this.org_id!=10265){
  980. this.project.map(item => {
  981. resp.data.hisAdvices.map(it => {
  982. if(item.patient_id == it.patient_id){
  983. projectArr.push(item)
  984. }
  985. })
  986. })
  987. console.log("projectArr2332323232323232",projectArr)
  988. resp.data.hisAdvices.map((item,index) => {
  989. if(projectArr[index].project && projectArr[index].project.length > 0){
  990. projectArr[index].project.map(it => {
  991. let obj = {
  992. advice_doctor: it.doctor,
  993. start_time:it.start_time,
  994. advice_name:it.team_id > 0 && it.is_check_team == 1 ? it.team.project_team : it.type == 2 ? it.project.project_name+' '+it.count + it.project.unit : it.good_info.good_name +' '+it.count+ it.good_info.packing_unit,
  995. execution_time:it.execution_time,
  996. execution_state:it.execution_state,
  997. execution_staff:it.execution_staff,
  998. check_time:it.check_time,
  999. check_state:it.check_state,
  1000. checker:it.checker,
  1001. created_time:it.ctime,
  1002. delivery_way:'',
  1003. execution_frequency:'',
  1004. remark:'',
  1005. id:it.id,
  1006. patient_id:it.patient_id,
  1007. parent_id:0,
  1008. groupno:0,
  1009. sort:item.device_number.sort,
  1010. assess_time:item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  1011. }
  1012. item.doctor_advice.push(obj)
  1013. })
  1014. }
  1015. })
  1016. console.log("中国人民名份反反复复方法 ",resp.data.hisAdvices)
  1017. }
  1018. }
  1019. if(config.is_open == 0 || config.is_open == 2){
  1020. var schedules = resp.data.scheduals
  1021. var newList = []
  1022. if(this.is_sort == 0){
  1023. newList = schedules
  1024. }
  1025. if(this.is_sort == 0 || this.is_sort == 1){
  1026. schedules.map(item => {
  1027. item.is_sort = item.device_number.sort
  1028. item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  1029. })
  1030. newList = schedules.sort(this.compare('is_sort'))
  1031. }
  1032. if(this.is_sort == 2){
  1033. schedules.map(item => {
  1034. item.is_sort = item.device_number.sort
  1035. item.assess_time = item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  1036. })
  1037. newList = schedules.sort(this.compare('assess_time'))
  1038. }
  1039. this.show = true
  1040. this.showOne = false
  1041. let arr = []
  1042. let newArr = []
  1043. let newSchedules = []
  1044. newList.map(item => {
  1045. item.doctor_advice.map(it =>{
  1046. it.name = item.patient.name
  1047. if(item.prescription != null){
  1048. it.dialyzer_perfusion_apparatus = item.prescription.dialyzer_perfusion_apparatus
  1049. it.dialysis_dialyszers = item.prescription.dialysis_dialyszers
  1050. it.dialysis_irrigation = item.prescription.dialysis_irrigation
  1051. it.anticoagulant = item.prescription.anticoagulant
  1052. }
  1053. it.schedule_type = item.schedule_type
  1054. it.zoneId = item.device_number.zone.id
  1055. it.dialysis_no = item.patient.dialysis_no
  1056. it.mode_id = item.mode_id
  1057. it.number = item.device_number.number
  1058. it.zone_name = item.device_number.zone.name
  1059. it.sort = item.device_number.sort,
  1060. arr.push(it)
  1061. })
  1062. item.is_sort = item.device_number.sort
  1063. item.assess_time = item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  1064. })
  1065. console.log("schedules9999999998888888888",schedules)
  1066. if(this.schedulType == 0){
  1067. newSchedules = arr
  1068. }else{
  1069. arr.map(item => {
  1070. if (item.schedule_type == this.schedulType) {
  1071. newSchedules.push(item)
  1072. }
  1073. })
  1074. }
  1075. if(this.partitionType == 0){
  1076. this.scheduleMap = newSchedules
  1077. }else {
  1078. let a = []
  1079. arr.map(item => {
  1080. if(this.partitionType == item.zoneId){
  1081. a.push(item)
  1082. }
  1083. })
  1084. this.scheduleMap = a
  1085. }
  1086. this.scheduleMap.map(ele => {
  1087. let firstIndex = this.scheduleMap.findIndex(item => {
  1088. return item.patient_id === ele.patient_id // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
  1089. })
  1090. if (this.scheduleMap.findIndex(item => { return item.patient_id === firstIndex}) === -1) {
  1091. newArr.push({
  1092. length: this.scheduleMap.filter(item => {
  1093. return item.patient_id === ele.patient_id //利用数组的filter方法,过滤出相同category的数组的长度。数组长度-即为跨多少行
  1094. }).length,
  1095. firstIndex: firstIndex // firstIndex 返回的是第一个catergory就满足的第一个Index,即为rowIndex开始于第几行。
  1096. })
  1097. }
  1098. })
  1099. this.indexInfoList = newArr
  1100. console.log("this.scheduleMap", this.scheduleMap)
  1101. }
  1102. if(config.is_open == 1){
  1103. this.show = false
  1104. this.showOne = true
  1105. var schedules = resp.data.hisAdvices
  1106. let arr = []
  1107. let newArr = []
  1108. let newSchedules = []
  1109. var newList = []
  1110. if(this.is_sort == 0){
  1111. newList = schedules
  1112. }
  1113. if(this.is_sort == 1){
  1114. schedules.map(item => {
  1115. item.is_sort = item.device_number.sort
  1116. item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  1117. })
  1118. newList = schedules.sort(this.compare('is_sort'))
  1119. }
  1120. if(this.is_sort == 2){
  1121. schedules.map(item => {
  1122. item.is_sort = item.device_number.sort
  1123. item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  1124. })
  1125. newList = schedules.sort(this.compare('assess_time'))
  1126. }
  1127. newList.map(item => {
  1128. item.doctor_advice.map(it =>{
  1129. it.name = item.patient.name
  1130. if(item.prescription != null){
  1131. it.dialyzer_perfusion_apparatus = item.prescription.dialyzer_perfusion_apparatus
  1132. it.dialysis_dialyszers = item.prescription.dialysis_dialyszers
  1133. it.dialysis_irrigation = item.prescription.dialysis_irrigation
  1134. it.anticoagulant = item.prescription.anticoagulant
  1135. }
  1136. it.schedule_type = item.schedule_type
  1137. it.zoneId = item.device_number.zone.id
  1138. it.dialysis_no = item.patient.dialysis_no
  1139. it.mode_id = item.mode_id
  1140. it.number = item.device_number.number
  1141. it.zone_name = item.device_number.zone.name
  1142. it.sort = item.device_number.sort,
  1143. arr.push(it)
  1144. })
  1145. item.is_sort = item.device_number.sort
  1146. item.assess_time = item.dialysisassesmentbefor&&item.dialysisassesmentbefor?item.dialysisassesmentbefor.created_time:"3753619200"
  1147. })
  1148. if(this.schedulType == 0){
  1149. newSchedules = arr
  1150. }else{
  1151. arr.map(item => {
  1152. if (item.schedule_type == this.schedulType) {
  1153. newSchedules.push(item)
  1154. }
  1155. })
  1156. }
  1157. if(this.partitionType == 0){
  1158. this.scheduleMap = newSchedules
  1159. }else {
  1160. let a = []
  1161. arr.map(item => {
  1162. if(this.partitionType == item.zoneId){
  1163. a.push(item)
  1164. }
  1165. })
  1166. this.scheduleMap = a
  1167. }
  1168. this.scheduleMap.map(ele => {
  1169. let firstIndex = this.scheduleMap.findIndex(item => {
  1170. return item.patient_id === ele.patient_id // 当category相同的时候,返回第一个相同的Index 赋值给 firstIndex
  1171. })
  1172. if (this.scheduleMap.findIndex(item => { return item.patient_id === firstIndex}) === -1) {
  1173. newArr.push({
  1174. length: this.scheduleMap.filter(item => {
  1175. return item.patient_id === ele.patient_id //利用数组的filter方法,过滤出相同category的数组的长度。数组长度-即为跨多少行
  1176. }).length,
  1177. firstIndex: firstIndex // firstIndex 返回的是第一个catergory就满足的第一个Index,即为rowIndex开始于第几行。
  1178. })
  1179. }
  1180. })
  1181. this.indexInfoList = newArr
  1182. }
  1183. }
  1184. })
  1185. },
  1186. compare:function (k) {
  1187. return function (a, b) {
  1188. var M = a[k];
  1189. var N = b[k];
  1190. return M - N; // 从低向高排
  1191. // return N - M; // 从高向低排
  1192. }
  1193. },
  1194. getValue: function(val) {
  1195. if (val != undefined) {
  1196. return val.value;
  1197. } else {
  1198. return "";
  1199. }
  1200. },
  1201. handleCurrentChange(val) {
  1202. this.listQuery.page = val;
  1203. this.getSchedualPatientList();
  1204. },
  1205. changeSearchMode: function() {
  1206. if (this.search_mode == 1) {
  1207. this.search_mode = 2;
  1208. } else {
  1209. this.search_mode = 1;
  1210. }
  1211. },
  1212. searchPatientAction: function() {
  1213. this.listQuery.keywords = this.patient_search_keyword;
  1214. console.log(this.patient_search_keyword);
  1215. if (this.patient_search_keyword.length == 0) {
  1216. return;
  1217. }
  1218. this.getSchedualPatientList();
  1219. },
  1220. handleSizeChange(val) {
  1221. this.listQuery.limit = val;
  1222. this.getSchedualPatientList();
  1223. },
  1224. batchPrintAction: function() {
  1225. if (this.selecting_schs.length === 0) {
  1226. this.$message.error("请至少选择一条需要打印的内容");
  1227. return false;
  1228. }
  1229. // 模板ID为6
  1230. var sch_ids = [];
  1231. for (let index = 0; index < this.selecting_schs.length; index++) {
  1232. sch_ids.push(this.selecting_schs[index].patient_id);
  1233. }
  1234. this.$store.dispatch("SetAdviceIDs", sch_ids);
  1235. var name = ""
  1236. for(let i=0;i<this.deliveryWay.length;i++){
  1237. if(this.delivery_way == this.deliveryWay[i].id){
  1238. name = this.deliveryWay[i].name
  1239. }
  1240. }
  1241. if(name == '全部'){
  1242. name = ""
  1243. }
  1244. if(this.org_id == 9671 || this.org_id == 10340){
  1245. this.$router.push({ path: "/dialysis/doctorAdvicePrint/one",query:{time: new Date(this.time).getTime(),delivery_way:name} });
  1246. }
  1247. if(this.org_id != 9671 && this.org_id != 10340){
  1248. this.$router.push({ path: "/dialysis/doctorAdvicePrint",query:{time: new Date(this.time).getTime(),delivery_way:name} });
  1249. }
  1250. },
  1251. signPrintAction:function(){
  1252. if (this.selecting_schs.length === 0) {
  1253. this.$message.error("请至少选择一条需要打印的内容");
  1254. return false;
  1255. }
  1256. // 模板ID为6
  1257. var sch_ids = [];
  1258. for (let index = 0; index < this.selecting_schs.length; index++) {
  1259. sch_ids.push(this.selecting_schs[index].patient_id);
  1260. }
  1261. this.$store.dispatch("SetAdviceIDs", sch_ids);
  1262. var name = ""
  1263. for(let i=0;i<this.deliveryWay.length;i++){
  1264. if(this.delivery_way == this.deliveryWay[i].id){
  1265. name = this.deliveryWay[i].name
  1266. }
  1267. }
  1268. if(name == '全部'){
  1269. name = ""
  1270. }
  1271. var nameOne = ""
  1272. for(let i=0;i<this.excutList.length;i++){
  1273. if(this.execution_frequency == this.excutList[i].id){
  1274. nameOne = this.excutList[i].name
  1275. }
  1276. }
  1277. if(nameOne == '全部'){
  1278. nameOne = ""
  1279. }
  1280. this.$router.push({ path: "/dialysis/signPrint",query:{time: new Date(this.time).getTime(),delivery_way:name,execution_frequency:nameOne,patient_id:this.patient_id,keyword:this.keyword,excution_way:this.excution_way} });
  1281. },
  1282. batchPrintActionOne: function() {
  1283. if (this.selecting_schs.length === 0) {
  1284. this.$message.error("请至少选择一条需要打印的内容");
  1285. return false;
  1286. }
  1287. var sch_ids = [];
  1288. for (let index = 0; index < this.selecting_schs.length; index++) {
  1289. sch_ids.push(this.selecting_schs[index].sch_id);
  1290. }
  1291. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  1292. if (this.template_id == 2 || this.template_id == 0) {
  1293. this.$router.push({ path: "/dialysis/print/batch/otherone" });
  1294. } else if (this.template_id == 1) {
  1295. this.$router.push({ path: "/dialysis/print/batch" });
  1296. } else if (this.template_id == 5) {
  1297. this.$router.push({ path: "/dialysis/print/batch/fiveone" });
  1298. } else if (this.template_id == 22) {
  1299. this.$router.push({ path: "/dialysis/print/batch/twentyTwo_one" });
  1300. }
  1301. },
  1302. batchPrintActionTwo: function() {
  1303. if (this.selecting_schs.length === 0) {
  1304. this.$message.error("请至少选择一条需要打印的内容");
  1305. return false;
  1306. }
  1307. var sch_ids = [];
  1308. for (let index = 0; index < this.selecting_schs.length; index++) {
  1309. sch_ids.push(this.selecting_schs[index].sch_id);
  1310. }
  1311. this.$store.dispatch("SetBatchPrintDialysisRecordIDs", sch_ids);
  1312. if (this.template_id == 2 || this.template_id == 0) {
  1313. this.$router.push({ path: "/dialysis/print/batch/othertwo" });
  1314. } else if (this.template_id == 1) {
  1315. this.$router.push({ path: "/dialysis/print/batch" });
  1316. } else if (this.template_id == 5) {
  1317. this.$router.push({ path: "/dialysis/print/batch/fivetwo" });
  1318. } else if (this.template_id == 22) {
  1319. this.$router.push({ path: "/dialysis/print/batch/twentyTwo_two" });
  1320. }
  1321. },
  1322. compare (property) {
  1323. return function (a, b) {
  1324. var value1 = a[property]
  1325. var value2 = b[property]
  1326. return value1 - value2
  1327. }
  1328. },
  1329. // tableRowClassName({ row, rowIndex }) {
  1330. // if (row.stop_state == 1 || row.execution_state == 1) {
  1331. // return 'stoped-row';
  1332. // }
  1333. // return 'success-rows'
  1334. // row.index = rowIndex
  1335. // const arr = this.hoverOrderArr
  1336. // for (let i = 0; i < arr.length; i++) {
  1337. // if (rowIndex == arr[i]) {
  1338. // return 'success-row'
  1339. // }
  1340. // }
  1341. // },
  1342. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  1343. if (columnIndex === 0) {
  1344. let index = this.indexInfoList.findIndex(item => { //遍历数组
  1345. return item.firstIndex === rowIndex
  1346. })
  1347. if (index > -1) {
  1348. return {
  1349. rowspan: this.indexInfoList[index].length,
  1350. colspan: 1
  1351. }
  1352. } else {
  1353. return {
  1354. rowspan: 0,
  1355. colspan: 0
  1356. }
  1357. }
  1358. }
  1359. if (columnIndex === 1) {
  1360. let index = this.indexInfoList.findIndex(item => { //遍历数组
  1361. return item.firstIndex === rowIndex
  1362. })
  1363. if (index > -1) {
  1364. return {
  1365. rowspan: this.indexInfoList[index].length,
  1366. colspan: 1
  1367. }
  1368. } else {
  1369. return {
  1370. rowspan: 0,
  1371. colspan: 0
  1372. }
  1373. }
  1374. }
  1375. if (columnIndex === 2) {
  1376. let index = this.indexInfoList.findIndex(item => { //遍历数组
  1377. return item.firstIndex === rowIndex
  1378. })
  1379. if (index > -1) {
  1380. return {
  1381. rowspan: this.indexInfoList[index].length,
  1382. colspan: 1
  1383. }
  1384. } else {
  1385. return {
  1386. rowspan: 0,
  1387. colspan: 0
  1388. }
  1389. }
  1390. }
  1391. },
  1392. adviceNameShow({ row, column, rowIndex, columnIndex }) {
  1393. if (columnIndex == 2) {
  1394. return 'dialysisadvicenamedisplay'
  1395. } else {
  1396. return ''
  1397. }
  1398. },
  1399. getXuserName(id) {
  1400. if (id <= 0) {
  1401. return ''
  1402. }
  1403. var name = ''
  1404. if (
  1405. this.admin_users == null ||
  1406. typeof this.admin_users.length === 'undefined'
  1407. ) {
  1408. return name
  1409. }
  1410. var leng = this.admin_users.length
  1411. if (leng == 0) {
  1412. return name
  1413. }
  1414. for (let index = 0; index < leng; index++) {
  1415. if (this.admin_users[index].id == id) {
  1416. name = this.admin_users[index].name
  1417. break
  1418. }
  1419. }
  1420. return name
  1421. },
  1422. getAdviceContent(row, isChild) {
  1423. console.log("rwoo22222222222222333",row)
  1424. let tempSingleDoseDesc = ''
  1425. let tempDrugSpecDesc = ''
  1426. let tempPrescribingNumberDesc = ''
  1427. if (row.prescribing_number) {
  1428. tempPrescribingNumberDesc = row.prescribing_number + '' + row.prescribing_number_unit
  1429. }
  1430. if (row.single_dose) {
  1431. if (this.template_id != 6) {
  1432. tempSingleDoseDesc =' 单次用量 ' + ' ' + row.single_dose + '' + row.single_dose_unit
  1433. } else {
  1434. tempSingleDoseDesc = row.single_dose + row.single_dose_unit
  1435. }
  1436. }
  1437. if (row.advice_desc) {
  1438. tempDrugSpecDesc = '(' + row.advice_desc + row.drug_spec_unit + ')'
  1439. }
  1440. if (isChild == 1) {
  1441. // 不是子药
  1442. // console.log(tempDrugSpecDesc)
  1443. // console.log(tempPrescribingNumberDesc)
  1444. // console.log(tempSingleDoseDesc)
  1445. // console.log(11,row.delivery_way)
  1446. // console.log(22,row.execution_frequency)
  1447. return (row.advice_name + tempDrugSpecDesc + ' ' + tempPrescribingNumberDesc + tempSingleDoseDesc +' ' + row.delivery_way +' ' +row.execution_frequency)
  1448. } else {
  1449. // 是子药
  1450. return (row.advice_name +tempDrugSpecDesc +' ' + tempPrescribingNumberDesc + tempSingleDoseDesc)
  1451. }
  1452. },
  1453. handleSelectionChange(val){
  1454. this.selecting_schs = val;
  1455. this.is_status = 1
  1456. },
  1457. handleSelectionChangeOne(val){
  1458. this.selecting_schs = val;
  1459. this.is_status = 1
  1460. console.log("val32323323223",val)
  1461. },
  1462. querySearchAsync(keyword, cb) {
  1463. let key = '';
  1464. if (keyword != undefined) {
  1465. key = keyword
  1466. }
  1467. let searchArray = []
  1468. PostSearch(key).then(response => {
  1469. if (response.data.state == 1) {
  1470. searchArray = response.data.data.patient
  1471. console.log('searcharrya', searchArray)
  1472. cb(searchArray)
  1473. }
  1474. })
  1475. return searchArray
  1476. },
  1477. handleSelect(val) {
  1478. this.patient_id = val.id
  1479. this.listQuery.keyword = val.name
  1480. this.requestSchedualDoctors(this.time)
  1481. },
  1482. toSeach(){
  1483. this.patient_id = 0
  1484. this.requestSchedualDoctors(this.time)
  1485. },
  1486. toSeachOne(){
  1487. this.requestSchedualDoctors(this.time)
  1488. },
  1489. toExcution(){
  1490. if(this.selecting_schs.length ==0){
  1491. this.$message.error("请勾选需要执行的医嘱")
  1492. return false
  1493. }
  1494. console.log("hhhahhhahhh",this.is_status)
  1495. if(this.is_status == 1){
  1496. this.execTimeDialogVisible = true
  1497. }
  1498. if(this.is_status == 2){
  1499. this.execTimeDialogVisibleOne = true
  1500. }
  1501. },
  1502. excutionDoctorAdvice(){
  1503. if (this.execTime.length == 0) {
  1504. this.$message.error('请选择执行时间!')
  1505. return false
  1506. }
  1507. var execTime = Math.round(new Date(this.execTime).getTime() / 1000)
  1508. var ids=[]
  1509. if(this.selecting_schs!=null && this.selecting_schs.length >0){
  1510. for(let i=0;i<this.selecting_schs.length;i++){
  1511. ids.push(this.selecting_schs[i].patient_id)
  1512. }
  1513. }
  1514. var str = ids.join(",")
  1515. var params = {
  1516. str:str,
  1517. advice_date: moment(this.time).format('YYYY-MM-DD'),
  1518. is_open:this.config.is_open,
  1519. exec_time:execTime
  1520. }
  1521. console.log("params232322323wo",params)
  1522. this.exceLoading = true
  1523. excutionDoctorAdvice(params).then(response=>{
  1524. if(response.data.state == 1){
  1525. if(response.data.data.msg == 2){
  1526. var drug_name = response.data.data.drug.drug_name
  1527. var dose = response.data.data.drug.dose
  1528. var dose_unit = response.data.data.drug.dose_unit
  1529. var min_number = response.data.data.drug.min_number
  1530. var max_unit = response.data.data.drug.max_unit
  1531. var min_unit = response.data.data.drug.min_unit
  1532. var str = drug_name + " "+dose+dose_unit +"*"+min_number +max_unit +"/"+min_unit
  1533. this.$message.error(str +"库存不足,执行失败!")
  1534. this.exceLoading = false
  1535. this.execTimeDialogVisible = false
  1536. this.requestSchedualDoctors(this.time)
  1537. }
  1538. if(response.data.data.msg == 3){
  1539. this.$message.error("执行人和核对人不能是同一个人,执行失败!")
  1540. }
  1541. }
  1542. })
  1543. },
  1544. toCheck(){
  1545. if(this.selecting_schs.length ==0){
  1546. this.$message.error("请勾选需要执行的医嘱")
  1547. return false
  1548. }
  1549. var ids=[]
  1550. if(this.selecting_schs!=null && this.selecting_schs.length >0){
  1551. for(let i=0;i<this.selecting_schs.length;i++){
  1552. ids.push(this.selecting_schs[i].patient_id)
  1553. }
  1554. }
  1555. var str = ids.join(",")
  1556. var params = {
  1557. str:str,
  1558. advice_date: moment(this.time).format('YYYY-MM-DD'),
  1559. is_open:this.config.is_open,
  1560. }
  1561. checkNewDoctorAdvice(params).then(response=>{
  1562. if(response.data.state == 1){
  1563. if(response.data.data.msg == 2){
  1564. var advice = response.data.data.advice
  1565. this.$message.error(advice.advice_name +"执行人和核对人不能是同一个人,核对失败!")
  1566. this.requestSchedualDoctors(this.time)
  1567. }else{
  1568. this.$message.success("核对成功!")
  1569. this.requestSchedualDoctors(this.time)
  1570. }
  1571. }
  1572. })
  1573. },
  1574. toSettle(){
  1575. if(this.selecting_schs.length ==0){
  1576. this.$message.error("请勾选需要执行的医嘱")
  1577. return false
  1578. }
  1579. var ids=[]
  1580. if(this.selecting_schs!=null && this.selecting_schs.length >0){
  1581. for(let i=0;i<this.selecting_schs.length;i++){
  1582. ids.push(this.selecting_schs[i].patient_id)
  1583. }
  1584. }
  1585. var str = ids.join(",")
  1586. var params = {
  1587. str:str,
  1588. advice_date: moment(this.time).format('YYYY-MM-DD'),
  1589. is_open:this.config.is_open,
  1590. }
  1591. settleNewDoctorAdvice(params).then(response=>{
  1592. if(response.data.state == 1){
  1593. this.$message.success("收费成功!")
  1594. this.requestSchedualDoctors(this.time)
  1595. }
  1596. })
  1597. },
  1598. selectSortType(id){
  1599. this.is_sort = id
  1600. this.requestSchedualDoctors(this.time);
  1601. },
  1602. handleRowClick (row) {
  1603. },
  1604. tableRowClassName({row, rowIndex}) {
  1605. row.index = rowIndex
  1606. if(row.index = rowIndex){
  1607. return 'success-row'
  1608. }
  1609. },
  1610. handleCurrentChangeList(row){
  1611. this.selecting_schs.push(row)
  1612. this.current_row= row
  1613. this.is_status = 2
  1614. },
  1615. excutionDoctorAdviceOne(){
  1616. if(this.current_row.execution_state == 1){
  1617. this.$message.error("所选医嘱已核对,无需再核对!")
  1618. return false
  1619. }
  1620. if (this.execTime.length == 0) {
  1621. this.$message.error('请选择执行时间!')
  1622. return false
  1623. }
  1624. var execTime = Math.round(new Date(this.execTime).getTime() / 1000)
  1625. var params= {
  1626. advice_id:this.current_row.id,
  1627. advice_date: moment(this.time).format('YYYY-MM-DD'),
  1628. exec_time:execTime,
  1629. }
  1630. excutionDoctorAdviceById(params).then(response=>{
  1631. if(response.data.state == 1){
  1632. if(response.data.data.msg == 2){
  1633. var drug_name = response.data.data.drug.drug_name
  1634. var dose = response.data.data.drug.dose
  1635. var dose_unit = response.data.data.drug.dose_unit
  1636. var min_number = response.data.data.drug.min_number
  1637. var max_unit = response.data.data.drug.max_unit
  1638. var min_unit = response.data.data.drug.min_unit
  1639. var str = drug_name + " "+dose+dose_unit +"*"+min_number +max_unit +"/"+min_unit
  1640. this.$message.error(str +"库存不足,执行失败!")
  1641. this.exceLoading = false
  1642. this.execTimeDialogVisibleOne = false
  1643. this.requestSchedualDoctors(this.time)
  1644. }
  1645. if(response.data.data.msg == 1){
  1646. var msg = response.data.data.msg
  1647. this.$message.success("执行成功!")
  1648. this.exceLoading = false
  1649. this.execTimeDialogVisibleOne = false
  1650. this.requestSchedualDoctors(this.time)
  1651. }
  1652. if(response.data.data.msg == 3){
  1653. this.$message.error("执行人与核对人不能是同一个人,执行失败!")
  1654. }
  1655. }
  1656. })
  1657. },
  1658. toStatic() {
  1659. var str = ""
  1660. if(this.partion_type==0){
  1661. str = this.zoneIdList.join(",")
  1662. }
  1663. if(this.partion_type!=0){
  1664. str = this.partion_type.join(",")
  1665. }
  1666. this.partion_str = ""
  1667. this.partion_str = str
  1668. this.tableList = []
  1669. var params = {
  1670. schedule_type:this.schedule_type,
  1671. partion_type:str,
  1672. selected_date: moment(this.time).format('YYYY-MM-DD'),
  1673. }
  1674. console.log("params2332232wo",params)
  1675. getDialysisAdviceToday(params).then(response=>{
  1676. if(response.data.state == 1){
  1677. var doctorList = []
  1678. var druglist = response.data.data.drug
  1679. this.druglist = druglist
  1680. this.startdialogVisible = true
  1681. var list = response.data.data.list
  1682. var config = response.data.data.config
  1683. console.log("dcotor---------------",this.doctorList)
  1684. if(list!=null && list.length > 0){
  1685. for(let i=0;i<list.length;i++){
  1686. for(let j=0;j<list[i].xt_doctor_advice.length;j++){
  1687. doctorList.push(list[i].xt_doctor_advice[j])
  1688. }
  1689. }
  1690. }
  1691. if(config.is_open!=1){
  1692. if(doctorList!=null && doctorList.length > 0){
  1693. let dataInfo = {}
  1694. doctorList.forEach((item, index) => {
  1695. let { advice_name } = item
  1696. if (!dataInfo[advice_name]) {
  1697. dataInfo[advice_name] = {
  1698. advice_name:item.advice_name,
  1699. child: [],
  1700. count:0,
  1701. drug_id:item.drug_id,
  1702. specification_name:item.advice_desc +item.drug_spec_unit,
  1703. patient_id:item.patient_id,
  1704. }
  1705. }
  1706. })
  1707. let arr = Object.values(dataInfo)
  1708. // console.log("arr23332323232",arr)
  1709. if(arr.length > 0){
  1710. for(let i=0;i<doctorList.length;i++){
  1711. for(let j=0;j<arr.length;j++){
  1712. if(doctorList[i].advice_name == arr[j].advice_name){
  1713. arr[j].child.push(doctorList[i])
  1714. }
  1715. }
  1716. }
  1717. }
  1718. this.tableList = []
  1719. for(let i=0;i<list.length;i++){
  1720. for(let j=0;j<arr.length;j++){
  1721. if(list[i].patient_id == arr[j].patient_id){
  1722. this.tableList.push(arr[j])
  1723. }
  1724. }
  1725. }
  1726. }
  1727. }
  1728. var his_doctor_advice = []
  1729. for(let i=0;i<list.length;i++){
  1730. for(let j=0;j<list[i].his_doctor_advice.length;j++){
  1731. his_doctor_advice.push(list[i].his_doctor_advice[j])
  1732. }
  1733. }
  1734. console.log("his_doctor_advice",his_doctor_advice)
  1735. var newHisArr = []
  1736. for(let i=0;i<his_doctor_advice.length;i++){
  1737. his_doctor_advice[i].count_one = 0
  1738. if(his_doctor_advice[i].prescribing_number_unit == his_doctor_advice[i].drug.max_unit){
  1739. his_doctor_advice[i].prescribing_number = parseInt(his_doctor_advice[i].prescribing_number) * his_doctor_advice[i].drug.min_number
  1740. his_doctor_advice[i].count_one = parseInt(his_doctor_advice[i].prescribing_number) * his_doctor_advice[i].drug.min_number
  1741. }
  1742. }
  1743. for(let i=0;i<his_doctor_advice.length;i++){
  1744. for(let j=0;j<druglist.length;j++){
  1745. if(his_doctor_advice[i].drug_id == druglist[j].id){
  1746. newHisArr.push(his_doctor_advice[i])
  1747. }
  1748. }
  1749. }
  1750. console.log("下盘子3223323223",newHisArr)
  1751. if(config.is_open == 1){
  1752. if(newHisArr!=null && newHisArr.length > 0){
  1753. let dataInfoOne = {}
  1754. newHisArr.forEach((item, index) => {
  1755. let { drug_id } = item
  1756. if (!dataInfoOne[drug_id]) {
  1757. dataInfoOne[drug_id] = {
  1758. advice_name:item.advice_name,
  1759. child: [],
  1760. count:0,
  1761. specification_name:this.getSpecification(item.drug_id),
  1762. drug_id:item.drug_id,
  1763. patient_id:item.patient_id,
  1764. min_number:item.drug.min_number,
  1765. max_unit:item.drug.max_unit,
  1766. min_unit:item.drug.min_unit
  1767. }
  1768. }
  1769. })
  1770. let hisarr = Object.values(dataInfoOne)
  1771. console.log("hisarr233232233232",hisarr)
  1772. if(hisarr.length > 0){
  1773. for(let i=0;i<newHisArr.length;i++){
  1774. for(let j=0;j<hisarr.length;j++){
  1775. if(newHisArr[i].drug_id == hisarr[j].drug_id){
  1776. hisarr[j].child.push(newHisArr[i])
  1777. }
  1778. }
  1779. }
  1780. }
  1781. console.log("hisarr",hisarr)
  1782. this.tableList = []
  1783. this.tableList = hisarr
  1784. }
  1785. }
  1786. }
  1787. })
  1788. },
  1789. toStaticOne() {
  1790. var str = ""
  1791. if(this.partion_type==0){
  1792. str = this.zoneIdList.join(",")
  1793. }
  1794. if(this.partion_type!=0){
  1795. str = this.partion_type.join(",")
  1796. }
  1797. this.partion_str = ""
  1798. this.partion_str = str
  1799. this.tableList = []
  1800. var params = {
  1801. schedule_type:this.schedule_type,
  1802. partion_type:str,
  1803. selected_date: moment(this.time).format('YYYY-MM-DD'),
  1804. }
  1805. getDialysisAdviceToday(params).then(response=>{
  1806. if(response.data.state == 1){
  1807. var doctorList = []
  1808. var druglist = response.data.data.drug
  1809. this.druglist = druglist
  1810. this.startdialogVisibleOne = true
  1811. var list = response.data.data.list
  1812. var config = response.data.data.config
  1813. this.adminUserList = response.data.data.doctorList
  1814. if(list!=null && list.length > 0){
  1815. for(let i=0;i<list.length;i++){
  1816. for(let j=0;j<list[i].xt_doctor_advice.length;j++){
  1817. list[i].xt_doctor_advice[j].mode_id = list[i].mode_id
  1818. list[i].xt_doctor_advice[j].zone_name = list[i].device_number.zone.name
  1819. list[i].xt_doctor_advice[j].sort = list[i].device_number.zone.sort
  1820. doctorList.push(list[i].xt_doctor_advice[j])
  1821. }
  1822. }
  1823. }
  1824. if(config.is_open!=1){
  1825. if(doctorList!=null && doctorList.length > 0){
  1826. let dataInfo = {}
  1827. doctorList.forEach((item, index) => {
  1828. item.advice_name = item.advice_name.replace(/\s/g,"")
  1829. let { advice_name } = item
  1830. if (!dataInfo[advice_name]) {
  1831. dataInfo[advice_name] = {
  1832. advice_name:item.advice_name,
  1833. child: [],
  1834. count:0,
  1835. execution_staff:item.execution_staff,
  1836. specification_name:item.advice_desc +item.drug_spec_unit,
  1837. patient_id:item.patient_id,
  1838. }
  1839. }
  1840. })
  1841. let arr = Object.values(dataInfo)
  1842. for(let i=0;i<arr.length;i++){
  1843. for(let j=0;j<doctorList.length;j++){
  1844. if(arr[i].advice_name == doctorList[j].advice_name){
  1845. arr[i].child.push(doctorList[j])
  1846. }
  1847. }
  1848. }
  1849. this.tabHead = arr
  1850. console.log("tabHead",this.tabHead)
  1851. }
  1852. this.doctorMap = []
  1853. if(doctorList!=null && doctorList.length > 0){
  1854. let dataInfoOne = {}
  1855. doctorList.forEach((item, index) => {
  1856. if(item.advice_name == "肝素钠注射剂"){
  1857. this.doctorMap.push(item)
  1858. }
  1859. let { zone_name } = item
  1860. if (!dataInfoOne[zone_name]) {
  1861. dataInfoOne[zone_name] = {
  1862. zone_name:item.zone_name,
  1863. child: [],
  1864. count:0,
  1865. sort:item.sort,
  1866. }
  1867. }
  1868. })
  1869. let newArr = Object.values(dataInfoOne)
  1870. if(newArr!=null && newArr.length >0){
  1871. for(let i=0;i<newArr.length;i++){
  1872. for(let j=0;j<doctorList.length;j++){
  1873. if(newArr[i].zone_name == doctorList[j].zone_name){
  1874. newArr[i].child.push(doctorList[j])
  1875. }
  1876. }
  1877. }
  1878. }
  1879. var newList = newArr.sort(this.compareList('sort'))
  1880. if(newList!=null && newList.length >0){
  1881. for(let i=0;i<newList.length;i++){
  1882. newList[i].is_total = 1
  1883. }
  1884. }
  1885. var obj = {is_total:0,count:0,execution_staff:0,child:[],zone_name:""}
  1886. newList.push(obj)
  1887. this.tableDataList = newList
  1888. console.log("999999999999999999-------",this.tableDataList)
  1889. }
  1890. }
  1891. }
  1892. })
  1893. },
  1894. toStaticTwo(){
  1895. var str = ""
  1896. if(this.partion_type==0){
  1897. str = this.zoneIdList.join(",")
  1898. }
  1899. if(this.partion_type!=0){
  1900. str = this.partion_type.join(",")
  1901. }
  1902. this.partion_str = ""
  1903. this.partion_str = str
  1904. this.tableList = []
  1905. var params = {
  1906. schedule_type:this.schedule_type,
  1907. partion_type:str,
  1908. selected_date: moment(this.time).format('YYYY-MM-DD'),
  1909. }
  1910. getDialysisProject(params).then(response=>{
  1911. if(response.data.state ==1){
  1912. var list = response.data.data.list
  1913. var newArr = []
  1914. if(list!=null && list.length>0){
  1915. for(let i=0;i<list.length;i++){
  1916. for(let j=0;j<list[i].his_doctor_project.length;j++){
  1917. newArr.push(list[i].his_doctor_project[j])
  1918. }
  1919. }
  1920. }
  1921. let dataInfo = {}
  1922. newArr.forEach((item, index) => {
  1923. let { project_id } = item
  1924. if (!dataInfo[project_id]) {
  1925. dataInfo[project_id] = {
  1926. project_id:item.project_id,
  1927. good_name:item.good.good_name,
  1928. specification_name:item.good.specification_name,
  1929. child: [],
  1930. count:0,
  1931. }
  1932. }
  1933. })
  1934. let arr = Object.values(dataInfo)
  1935. if(arr!=null && arr.length >0){
  1936. for(let i =0;i<arr.length;i++){
  1937. for(let j=0;j<newArr.length;j++){
  1938. if(arr[i].project_id == newArr[j].project_id){
  1939. arr[i].child.push(newArr[j])
  1940. }
  1941. }
  1942. }
  1943. for(let i =0;i<arr.length;i++){
  1944. for(let j=0;j<arr[i].child.length;j++){
  1945. arr[i].count += parseInt(arr[i].child[j].count)
  1946. }
  1947. }
  1948. console.log("arr0000000000000000000000",arr)
  1949. this.startdialogVisibleTwo = true
  1950. this.tableProjectList = []
  1951. this.tableProjectList = arr
  1952. }
  1953. }
  1954. })
  1955. },
  1956. getDrugAdviceCount(advice_name,zone_name){
  1957. var str = ""
  1958. var arr =[]
  1959. var arrOne = []
  1960. if(this.doctorMap!=null && this.doctorMap.length>0){
  1961. for(let i=0;i<this.doctorMap.length;i++){
  1962. if(this.doctorMap[i].advice_name!="" || this.doctorMap[i].advice_name!=undefined){
  1963. this.doctorMap[i].advice_name = this.doctorMap[i].advice_name.replace(/\s/g,"")
  1964. }
  1965. if(this.doctorMap[i].advice_name == advice_name && this.doctorMap[i].zone_name == zone_name && this.doctorMap[i].delivery_way =="导管封管"){
  1966. arr.push(this.doctorMap[i])
  1967. }
  1968. if(this.doctorMap[i].advice_name == advice_name && this.doctorMap[i].zone_name == zone_name && this.doctorMap[i].delivery_way.indexOf("泵入")!=-1){
  1969. arrOne.push(this.doctorMap[i])
  1970. }
  1971. }
  1972. }
  1973. if(arr!=null && arr.length >0){
  1974. var total = 0
  1975. for(let i=0;i<arr.length;i++){
  1976. total +=arr[i].prescribing_number
  1977. }
  1978. str = "封管" +"("+total+")"
  1979. }
  1980. if(arrOne!=null && arrOne.length >0){
  1981. var total_one = 0
  1982. for(let i=0;i<arrOne.length;i++){
  1983. total_one +=arrOne[i].prescribing_number
  1984. }
  1985. str = str + "泵入" +"("+total_one+")"
  1986. }
  1987. return str
  1988. },
  1989. getSpecification(id){
  1990. var specification_name = ""
  1991. for(let i=0;i<this.druglist.length;i++){
  1992. if(id == this.druglist[i].id){
  1993. specification_name = this.druglist[i].dose+this.druglist[i].dose_unit +"*"+this.druglist[i].min_number+this.druglist[i].min_unit +"/"+this.druglist[i].max_unit
  1994. }
  1995. }
  1996. return specification_name
  1997. },
  1998. getCount(val){
  1999. var count = 0
  2000. if(val!=null && val.length > 0){
  2001. for(let i=0;i<val.length;i++){
  2002. count += parseInt(val[i].prescribing_number)
  2003. }
  2004. }
  2005. if(count > 0){
  2006. return count
  2007. }else{
  2008. return 0
  2009. }
  2010. },
  2011. getHisCount(val,max_unit,min_unit,min_number){
  2012. var total = 0
  2013. var max_str = "";
  2014. var min_str = "";
  2015. for(let i=0;i<val.length;i++){
  2016. total+=parseInt(val[i].prescribing_number)
  2017. }
  2018. if (total < min_number) {
  2019. min_str = total + min_unit;
  2020. }
  2021. if (total == 0) {
  2022. min_str = "";
  2023. max_str = "";
  2024. }
  2025. if (total >= min_number) {
  2026. if (parseInt(total / min_number) != 0) {
  2027. max_str = parseInt(total / min_number) + max_unit;
  2028. }
  2029. if (total % min_number != 0) {
  2030. min_str = (total % min_number) + min_unit;
  2031. }
  2032. }
  2033. return max_str + min_str;
  2034. },
  2035. toPrintOne(){
  2036. var schedule_date = moment(this.time).format('YYYY-MM-DD')
  2037. this.$router.push({path:"/dialysis/doctorAdviceStaticPrint?schedule_type="+this.schedule_type+"&partion_type="+this.partion_str+"&schedule_date="+schedule_date+"&is_open="+this.config.is_open})
  2038. },
  2039. toPrintTwo(){
  2040. var schedule_date = moment(this.time).format('YYYY-MM-DD')
  2041. this.$router.push({path:"/dialysis/doctorNewAdviceStaticPrint?schedule_type="+this.schedule_type+"&partion_type="+this.partion_str+"&schedule_date="+schedule_date+"&is_open="+this.config.is_open})
  2042. },
  2043. toPrintThree(){
  2044. var schedule_date = moment(this.time).format('YYYY-MM-DD')
  2045. this.$router.push({path:"/dialysis/doctorNewProjectStaticPrint?schedule_type="+this.schedule_type+"&partion_type="+this.partion_str+"&schedule_date="+schedule_date+"&is_open="+this.config.is_open})
  2046. },
  2047. toExportListOne(){
  2048. import('@/vendor/Export2Excel').then(excel => {
  2049. if(this.tableList!=null && this.tableList.length > 0){
  2050. for(let i=0;i<this.tableList.length;i++){
  2051. this.tableList[i].index = i+1
  2052. if(this.config.is_open == 1){
  2053. this.tableList[i].total_count = this.getHisCount(this.tableList[i].child,this.tableList[i].max_unit,this.tableList[i].min_unit,this.tableList[i].min_number)
  2054. }
  2055. if(this.config.is_open!=1){
  2056. this.tableList[i].total_count = this.getCount(this.tableList[i].child)
  2057. }
  2058. }
  2059. }
  2060. const tHeader = ['序号','药品名称','规格','数量']
  2061. const filterVal = ['index','advice_name','specification_name','total_count']
  2062. const data = this.formatJson(filterVal, this.tableList)
  2063. excel.export_json_to_excel({
  2064. header: tHeader,
  2065. data,
  2066. filename: '药品统计'
  2067. })
  2068. this.downloadLoading = false
  2069. })
  2070. },
  2071. toExportListTwo(){
  2072. import('@/vendor/Export2Excel').then(excel => {
  2073. if(this.tableProjectList!=null && this.tableProjectList.length > 0){
  2074. for(let i=0;i<this.tableProjectList.length;i++){
  2075. this.tableProjectList[i].index = i+1
  2076. }
  2077. }
  2078. const tHeader = ['序号','耗材名称','规格','数量']
  2079. const filterVal = ['index','good_name','specification_name','count']
  2080. const data = this.formatJson(filterVal, this.tableProjectList)
  2081. excel.export_json_to_excel({
  2082. header: tHeader,
  2083. data,
  2084. filename: '耗材统计'
  2085. })
  2086. this.downloadLoading = false
  2087. })
  2088. },
  2089. formatJson(filterVal, jsonData) {
  2090. return jsonData.map(v => filterVal.map(j => v[j]));
  2091. },
  2092. changeScheduleType(){
  2093. this.tableList = []
  2094. this.toStatic()
  2095. },
  2096. changePartionType(){
  2097. this.tableList = []
  2098. this.toStatic()
  2099. },
  2100. changeScheduleTypeOne(){
  2101. this.tableDataList = []
  2102. this.toStaticOne()
  2103. },
  2104. changePartionTypeOne(){
  2105. this.tableDataList = []
  2106. this.toStaticOne()
  2107. },
  2108. changeScheduleTypeTwo(){
  2109. this.tableProjectList = []
  2110. this.toStaticTwo()
  2111. },
  2112. changePartionTypeTwo(){
  2113. this.tableProjectList=[]
  2114. this.toStaticTwo()
  2115. },
  2116. getModeId(val){
  2117. if(val!=null && val.length > 0){
  2118. let dataInfo = {}
  2119. val.forEach((item, index) => {
  2120. let { patient_id } = item
  2121. if (!dataInfo[patient_id]) {
  2122. dataInfo[patient_id] = {
  2123. patient_id:item.patient_id,
  2124. child: [],
  2125. count:0,
  2126. mode_id:item.mode_id,
  2127. }
  2128. }
  2129. })
  2130. let newArr = Object.values(dataInfo)
  2131. if(newArr!=null && newArr.length >0){
  2132. let dataInfo = {}
  2133. newArr.forEach((item, index) => {
  2134. let { mode_id } = item
  2135. if (!dataInfo[mode_id]) {
  2136. dataInfo[mode_id] = {
  2137. mode_id:item.mode_id,
  2138. child: [],
  2139. count:0,
  2140. }
  2141. }
  2142. })
  2143. let hisNewArr = Object.values(dataInfo)
  2144. if(hisNewArr!=null && hisNewArr.length >0){
  2145. for(let i=0;i<hisNewArr.length;i++){
  2146. for(let j=0;j<newArr.length;j++){
  2147. if(hisNewArr[i].mode_id == newArr[j].mode_id){
  2148. hisNewArr[i].child.push(newArr[j])
  2149. }
  2150. }
  2151. }
  2152. }
  2153. var str = ""
  2154. for(let i=0;i<hisNewArr.length;i++){
  2155. if(hisNewArr[i].mode_id == 1){
  2156. hisNewArr[i].mode_id = "HD"
  2157. }
  2158. if(hisNewArr[i].mode_id == 2){
  2159. hisNewArr[i].mode_id = "HDF"
  2160. }
  2161. if(hisNewArr[i].mode_id == 3){
  2162. hisNewArr[i].mode_id = "HD+HP"
  2163. }
  2164. if(hisNewArr[i].mode_id == 4){
  2165. hisNewArr[i].mode_id = "HP"
  2166. }
  2167. if(hisNewArr[i].mode_id == 5){
  2168. hisNewArr[i].mode_id = "HF"
  2169. }
  2170. if(hisNewArr[i].mode_id == 6){
  2171. hisNewArr[i].mode_id = "SCUF"
  2172. }
  2173. if(hisNewArr[i].mode_id == 7){
  2174. hisNewArr[i].mode_id = "IUF"
  2175. }
  2176. if(hisNewArr[i].mode_id == 8){
  2177. hisNewArr[i].mode_id = "HFHD"
  2178. }
  2179. if(hisNewArr[i].mode_id == 9){
  2180. hisNewArr[i].mode_id = "HFHD+HP"
  2181. }
  2182. if(hisNewArr[i].mode_id == 10){
  2183. hisNewArr[i].mode_id = "PHF"
  2184. }
  2185. if(hisNewArr[i].mode_id == 11){
  2186. hisNewArr[i].mode_id = "HFR"
  2187. }
  2188. if(hisNewArr[i].mode_id == 12){
  2189. hisNewArr[i].mode_id = "HDF+HP"
  2190. }
  2191. if(hisNewArr[i].mode_id == 13){
  2192. hisNewArr[i].mode_id = "CRRT"
  2193. }
  2194. if(hisNewArr[i].mode_id == 14){
  2195. hisNewArr[i].mode_id = "腹水回输"
  2196. }
  2197. if(hisNewArr[i].mode_id == 15){
  2198. hisNewArr[i].mode_id = "IUF+HD"
  2199. }
  2200. if(hisNewArr[i].mode_id == 20){
  2201. hisNewArr[i].mode_id = "UF"
  2202. }
  2203. if(hisNewArr[i].mode_id == 21){
  2204. hisNewArr[i].mode_id = "HD+"
  2205. }
  2206. if(hisNewArr[i].mode_id == 22){
  2207. hisNewArr[i].mode_id = "血浆胆红素吸附+HDF"
  2208. }
  2209. if(hisNewArr[i].mode_id == 23){
  2210. hisNewArr[i].mode_id = "血浆胆红素吸附"
  2211. }
  2212. if(hisNewArr[i].mode_id == 24){
  2213. hisNewArr[i].mode_id = "I-HDF"
  2214. }
  2215. if(hisNewArr[i].mode_id == 25){
  2216. hisNewArr[i].mode_id = "HD高通"
  2217. }
  2218. if(hisNewArr[i].mode_id == 26){
  2219. hisNewArr[i].mode_id = "CVVH"
  2220. }
  2221. if(hisNewArr[i].mode_id == 27){
  2222. hisNewArr[i].mode_id = "CVVHD"
  2223. }
  2224. if(hisNewArr[i].mode_id == 28){
  2225. hisNewArr[i].mode_id = "CVVHDF"
  2226. }
  2227. if(hisNewArr[i].mode_id == 29){
  2228. hisNewArr[i].mode_id = "PE"
  2229. }
  2230. if(hisNewArr[i].mode_id == 30){
  2231. hisNewArr[i].mode_id = "血浆胆红素吸附+HP"
  2232. }
  2233. if(hisNewArr[i].mode_id == 31){
  2234. hisNewArr[i].mode_id = "HPD"
  2235. }
  2236. if(hisNewArr[i].mode_id == 32){
  2237. hisNewArr[i].mode_id = "HDP"
  2238. }
  2239. if(hisNewArr[i].mode_id == 33){
  2240. hisNewArr[i].mode_id = "HFD"
  2241. }
  2242. if(hisNewArr[i].mode_id == 34){
  2243. hisNewArr[i].mode_id = "HDF100"
  2244. }
  2245. if(hisNewArr[i].mode_id == 35){
  2246. hisNewArr[i].mode_id = "HDF600"
  2247. }
  2248. if(hisNewArr[i].mode_id == 36){
  2249. hisNewArr[i].mode_id = "HDF800"
  2250. }
  2251. if(hisNewArr[i].mode_id == 37){
  2252. hisNewArr[i].mode_id = "HDF1000"
  2253. }
  2254. str += hisNewArr[i].mode_id +"("+hisNewArr[i].child.length+")" +"\n"
  2255. }
  2256. return str
  2257. }
  2258. // return newArr.length
  2259. }
  2260. },
  2261. getDrugCount(val,advice_name){
  2262. if(val!=null){
  2263. for(let i=0;i<val.length;i++){
  2264. val[i].advice_name = val[i].advice_name.replace(/\s/g,"")
  2265. }
  2266. }
  2267. if(val!=null && val.length >0){
  2268. let dataInfo = {}
  2269. val.forEach((item, index) => {
  2270. let { advice_name } = item
  2271. if (!dataInfo[advice_name]) {
  2272. dataInfo[advice_name] = {
  2273. advice_name:item.advice_name,
  2274. child: [],
  2275. count:0,
  2276. }
  2277. }
  2278. })
  2279. let newArr = Object.values(dataInfo)
  2280. if(newArr!=null && newArr.length >0){
  2281. for(let i=0;i<newArr.length;i++){
  2282. for(let j=0;j<val.length;j++){
  2283. if(newArr[i].advice_name == val[j].advice_name){
  2284. newArr[i].child.push(val[j])
  2285. }
  2286. }
  2287. }
  2288. }
  2289. var total = 0
  2290. var newHisArr =[]
  2291. if(newArr!=null && newArr.length >0){
  2292. for(let i=0;i<newArr.length;i++){
  2293. if(newArr[i].advice_name == advice_name){
  2294. newHisArr.push(newArr[i])
  2295. }
  2296. }
  2297. }
  2298. if(newHisArr!=null && newHisArr.length>0){
  2299. for(let i=0;i<newHisArr.length;i++){
  2300. for(let j=0;j<newHisArr[i].child.length;j++){
  2301. total += parseInt(newHisArr[i].child[j].prescribing_number)
  2302. }
  2303. }
  2304. }
  2305. return total
  2306. }
  2307. },
  2308. getAdminUserName(id){
  2309. var name = ""
  2310. for(let i=0;i<this.adminUserList.length;i++){
  2311. if(id == this.adminUserList[i].id){
  2312. name = this.adminUserList[i].name
  2313. }
  2314. }
  2315. return name
  2316. },
  2317. getZoneName(val){
  2318. var zone_name = ""
  2319. if(val!=null && val.length >0){
  2320. zone_name = val[0].zone_name
  2321. }
  2322. return zone_name
  2323. },
  2324. compareList: function (k) {
  2325. return function (a, b) {
  2326. var M = a[k]
  2327. var N = b[k]
  2328. return M - N // 从低向高排
  2329. // return N - M; // 从高向低排
  2330. }
  2331. },
  2332. getSummaries(param) {
  2333. const { columns, data } = param;
  2334. const sums = [];
  2335. columns.forEach((column, index) => {
  2336. if (index === 0) {
  2337. sums[index] = '总数';
  2338. return;
  2339. }
  2340. if(index > 2){
  2341. const values = data.map(item => item[column.property]);
  2342. }
  2343. });
  2344. return sums;
  2345. },
  2346. getAllSumCount(advice_name){
  2347. var hisNewArr =[]
  2348. if(this.tabHead.length!=null && this.tabHead.length >0){
  2349. for(let i=0;i<this.tabHead.length;i++){
  2350. if(this.tabHead[i].advice_name == advice_name){
  2351. hisNewArr.push(this.tabHead[i])
  2352. }
  2353. }
  2354. }
  2355. var total = 0
  2356. if(hisNewArr!=null && hisNewArr.length > 0){
  2357. for(let i=0;i<hisNewArr.length;i++){
  2358. for(let j=0;j<hisNewArr[i].child.length;j++){
  2359. total += parseInt(hisNewArr[i].child[j].prescribing_number)
  2360. }
  2361. }
  2362. }
  2363. if (total > 0) {
  2364. return total
  2365. }else{
  2366. return 0
  2367. }
  2368. },
  2369. getTimeSix(val) {
  2370. if(val == ""){
  2371. return ""
  2372. }else {
  2373. return uParseTime(val, '{y}-{m}-{d}')
  2374. }
  2375. },
  2376. toJiao(){
  2377. GetMobileScheduleList().then(response=>{
  2378. if(response.data.state == 1){
  2379. var schedule = response.data.data.schedule
  2380. this.$message.success("保存成功!")
  2381. // console.log("schedule---------------",schedule)
  2382. // var arr = []
  2383. // for(let i=0;i<schedule.length;i++){
  2384. // if(schedule[i].monitor_record.ultrafiltration_volume!=schedule[i].xt_assesment_after_dislysis.actual_ultrafiltration){
  2385. // arr.push(schedule[i])
  2386. // }
  2387. // }
  2388. // import('@/vendor/Export2Excel').then(excel => {
  2389. // if(arr!=null && arr.length > 0){
  2390. // for(let i=0;i<arr.length;i++){
  2391. // arr[i].patient_name = arr[i].patient.name
  2392. // arr[i].target_ultrafiltration = arr[i].dialysis_prescription.target_ultrafiltration
  2393. // arr[i].ultrafiltration_volume = arr[i].monitor_record.ultrafiltration_volume
  2394. // arr[i].actual_ultrafiltration = arr[i].xt_assesment_after_dislysis.actual_ultrafiltration
  2395. // arr[i].start_time = this.getTimeSix(arr[i].schedule_date)
  2396. // }
  2397. // }
  2398. // const tHeader = ['序号','日期','患者姓名','目标超滤量','监测超滤量','实际超滤量']
  2399. // const filterVal = ['index','start_time','patient_name','target_ultrafiltration','ultrafiltration_volume','actual_ultrafiltration']
  2400. // const data = this.formatJson(filterVal, arr)
  2401. // excel.export_json_to_excel({
  2402. // header: tHeader,
  2403. // data,
  2404. // filename: '监测数据统计'
  2405. // })
  2406. // })
  2407. }
  2408. })
  2409. },
  2410. },
  2411. components: {
  2412. BreadCrumb
  2413. }
  2414. };
  2415. </script>
  2416. <style rel="stylesheet/scss" lang="scss" scoped>
  2417. .app-container {
  2418. // margin: 20px;
  2419. font-size: 15px;
  2420. .filter-container {
  2421. padding-bottom: 5px;
  2422. }
  2423. .cqd-dataTitle {
  2424. color: #303133;
  2425. font-size: 14px;
  2426. border-bottom: 2px #e4e7ed solid;
  2427. height: 36px;
  2428. line-height: 36px;
  2429. margin: 0 0 25px 0;
  2430. position: relative;
  2431. }
  2432. .cqd-dataTitle::before {
  2433. position: absolute;
  2434. left: 0;
  2435. bottom: -2px;
  2436. content: "";
  2437. width: 42px;
  2438. height: 2px;
  2439. background: #409eff;
  2440. }
  2441. .search-component {
  2442. width: 500px;
  2443. .searchBox {
  2444. width: 300px;
  2445. height: 36px;
  2446. line-height: 36px;
  2447. padding-left: 15px;
  2448. border: 1px #dcdfe6 solid;
  2449. border-right: none;
  2450. outline: none;
  2451. float: left;
  2452. border-radius: 6px 0 0 6px;
  2453. font-size: 14px;
  2454. color: #333;
  2455. background: #fff;
  2456. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  2457. }
  2458. .searchBtn {
  2459. background-color: #409eff;
  2460. color: #fff;
  2461. font-size: 15px;
  2462. text-align: center;
  2463. height: 36px;
  2464. line-height: 36px;
  2465. float: left;
  2466. outline: none;
  2467. width: 70px;
  2468. border: none;
  2469. border-radius: 0 6px 6px 0;
  2470. font-family: "Microsoft Yahei";
  2471. cursor: pointer;
  2472. }
  2473. }
  2474. .amount {
  2475. font-weight: normal;
  2476. padding: 10px 0 0 0;
  2477. color: #606266;
  2478. font-size: 14px;
  2479. span {
  2480. color: #ef2525;
  2481. font-family: "Arial";
  2482. padding: 0 2px;
  2483. }
  2484. }
  2485. .el-table td .cell{
  2486. white-space: pre-wrap;
  2487. }
  2488. }
  2489. .el-table td,
  2490. .el-table th.is-leaf,
  2491. .el-table--border,
  2492. .el-table--group {
  2493. border-color: #d0d3da;
  2494. }
  2495. .el-table--border::after,
  2496. .el-table--group::after,
  2497. .el-table::before {
  2498. background-color: #d0d3da;
  2499. }
  2500. .el-checkbox__inner::after {
  2501. height: 10px;
  2502. left: 7px;
  2503. }
  2504. .el-checkbox__inner {
  2505. width: 20px;
  2506. height: 20px;
  2507. }
  2508. </style>