dialysisGood.vue 71KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195
  1. <template>
  2. <div class="page_consumables">
  3. <div class="cell clearfix">
  4. <label class="title"> <span class="name">排班班次</span> : </label>
  5. <div class="time">
  6. <ul class>
  7. <li
  8. :class="item.value == schedulType ? 'active' : ''"
  9. @click="selectSchedulType(item.value)"
  10. v-for="item in schedulArr"
  11. :key="item.value"
  12. >
  13. {{ item.label }}
  14. </li>
  15. </ul>
  16. </div>
  17. <label class="title"><span class="name">日期查询</span> : </label>
  18. <el-date-picker size="small" v-model="selected_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange"
  19. :editable="false" :clearable="false" style="width: 196px;margin-right:10px;" type="date"
  20. format="yyyy-MM-dd"
  21. value-format="yyyy-MM-dd"
  22. placeholder="选择日期时间" align="right"></el-date-picker>
  23. <el-input size="small" style="width: 180px;" @keyup.enter.native='searchAction' v-model.trim="search_input"
  24. class="filter-item" v-model="query.keywords"/>
  25. <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="search">搜索</el-button>
  26. </div>
  27. <div class="cell clearfix" style="justify-content: space-between;">
  28. <div style="display:flex;">
  29. <label class="title"> <span class="name">分区</span> : </label>
  30. <div class="time">
  31. <ul class>
  32. <li
  33. :class="item.id == partitionType ? 'active' : ''"
  34. @click="selectPartitionType(item.id)"
  35. v-for="item in partitionArr"
  36. :key="item.id"
  37. >
  38. {{ item.name }}
  39. </li>
  40. </ul>
  41. </div>
  42. </div>
  43. <div>
  44. <el-button size="small" icon="el-icon-printer" @click="toSett" type="primary" v-if="his_config.is_open == 1">设置</el-button>
  45. <!-- <el-button size="small" icon="el-icon-printer" @click="toClick" type="primary">脚本</el-button>-->
  46. <el-button size="small" icon="el-icon-printer" @click="toPrint" type="primary">打印</el-button>
  47. <el-button size="small" @click="exportListOne" type="primary" v-if="his_config.is_open == 1">导出</el-button>
  48. <el-button size="small" @click="exportList" type="primary" v-if="his_config.is_open != 1">导出</el-button>
  49. <el-button size="small" type="primary" v-if="his_config.is_open != 1" @click="statistics">统计表</el-button>
  50. <el-button size="small" type="primary" v-if="his_config.is_open == 1" @click="toStatistics">统计表</el-button>
  51. </div>
  52. </div>
  53. <div v-if="his_config.is_open != 1">
  54. <el-table
  55. @selection-change="handleSelectionChange"
  56. :data="list"
  57. border
  58. :row-style="{ color: '#303133' }"
  59. :header-cell-style="{
  60. backgroundColor: 'rgb(245, 247, 250)',
  61. color: '#606266'
  62. }"
  63. >
  64. <el-table-column
  65. align="center"
  66. type="selection"
  67. width="55">
  68. </el-table-column>
  69. <el-table-column align="center" width="55" label="序号">
  70. <template slot-scope="scope">
  71. {{scope.$index + 1}}
  72. </template>
  73. </el-table-column>
  74. <el-table-column align="center" width="100" label="透析机号">
  75. <template slot-scope="scope">
  76. {{scope.row.device_number.zone.name}} {{scope.row.device_number.number}}
  77. </template>
  78. </el-table-column>
  79. <el-table-column align="center" width="80" label="姓名">
  80. <template slot-scope="scope">
  81. {{scope.row.patient.name}}
  82. </template>
  83. </el-table-column>
  84. <el-table-column align="center" width="55" label="透析号">
  85. <template slot-scope="scope">
  86. {{scope.row.patient.dialysis_no}}
  87. </template>
  88. </el-table-column>
  89. <el-table-column
  90. align="center"
  91. prop="name"
  92. v-for="(item,index) in rowList"
  93. :key="item.id"
  94. :label="item.filed_name_cn"
  95. >
  96. <template slot-scope="scope">
  97. <!-- <span v-if="org_id !=10599 && org_id!=10138 && org_id!=10278">
  98. {{getName(scope.row.rowList[index].filed_name_cn,scope.row.dialysis_solution)}}
  99. </span> -->
  100. <span>
  101. <span v-if="scope.row.dialysis_prescription==null"> {{getName(scope.row.rowList[index].filed_name_cn,scope.row.dialysis_solution)}}</span>
  102. <span v-if="scope.row.dialysis_prescription!=null"> {{getName(scope.row.rowList[index].filed_name_cn,scope.row.dialysis_prescription)}}</span>
  103. </span>
  104. <!-- {{getName(scope.row.rowList[index].filed_name_cn,scope.row.dialysis_solution)}} -->
  105. </template>
  106. </el-table-column>
  107. <el-table-column align="center" width="100" label="备注">
  108. <template slot-scope="scope">
  109. {{scope.row.dialysis_solution.remark}}
  110. </template>
  111. </el-table-column>
  112. </el-table>
  113. <el-pagination
  114. @size-change="handleSizeChange"
  115. @current-change="handleCurrentChange"
  116. :page-sizes="[10, 50, 100]"
  117. :page-size="10"
  118. background
  119. align="right"
  120. style="margin-top:20px;"
  121. layout="total, sizes, prev, pager, next, jumper"
  122. :total="total"
  123. >
  124. </el-pagination>
  125. </div>
  126. <div v-if="his_config.is_open == 1">
  127. <el-table
  128. @selection-change="handleSelectionChange"
  129. :data="list"
  130. border
  131. :row-style="{ color: '#303133' }"
  132. :header-cell-style="{
  133. backgroundColor: 'rgb(245, 247, 250)',
  134. color: '#606266'
  135. }"
  136. >
  137. <el-table-column
  138. align="center"
  139. type="selection"
  140. width="55">
  141. </el-table-column>
  142. <el-table-column align="center" width="55" label="序号">
  143. <template slot-scope="scope">
  144. {{scope.$index + 1}}
  145. </template>
  146. </el-table-column>
  147. <el-table-column align="center" width="100" label="透析机号">
  148. <template slot-scope="scope">
  149. {{scope.row.device_number.zone.name}} {{scope.row.device_number.number}}
  150. </template>
  151. </el-table-column>
  152. <el-table-column align="center" width="55" label="姓名">
  153. <template slot-scope="scope">
  154. {{scope.row.patient.name}}
  155. </template>
  156. </el-table-column>
  157. <el-table-column align="center" width="55" label="透析号">
  158. <template slot-scope="scope">
  159. {{scope.row.patient.dialysis_no}}
  160. </template>
  161. </el-table-column>
  162. <el-table-column
  163. align="center"
  164. prop="name"
  165. v-for="(item,index) in typeList"
  166. :key="item.id"
  167. :label="item.type_name"
  168. >
  169. <template slot-scope="scope">
  170. <span v-if="scope.row.his_prescription_project.length>0"> {{getStr(scope.row.typeList[index].id,scope.row.his_prescription_project,scope.row.patient_id)}}</span>
  171. <span v-if="scope.row.his_prescription_project.length==0"> {{getStr(scope.row.typeList[index].id,scope.row.projectList,scope.row.patient_id)}}</span>
  172. </template>
  173. </el-table-column>
  174. </el-table>
  175. <el-pagination
  176. @size-change="handleSizeChangeOne"
  177. @current-change="handleCurrentChangeOne"
  178. :page-sizes="[10, 50, 100]"
  179. :page-size="10"
  180. background
  181. align="right"
  182. style="margin-top:20px;"
  183. layout="total, sizes, prev, pager, next, jumper"
  184. :total="total"
  185. >
  186. </el-pagination>
  187. </div>
  188. <el-dialog
  189. title="耗材统计表"
  190. :visible.sync="startDialogVisible"
  191. width="70%">
  192. <span>
  193. <div class="cell clearfix">
  194. <label class="title"> <span class="name">排班班次</span> : </label>
  195. <el-select v-model="schedule_type" placeholder="请选择" @change="changeScheduleType">
  196. <el-option
  197. v-for="item in schedulArr"
  198. :key="item.value"
  199. :label="item.label"
  200. :value="item.value">
  201. </el-option>
  202. </el-select>
  203. <label class="title"> <span class="name">病区选择</span> : </label>
  204. <el-select v-model="partion_type" placeholder="请选择" multiple @change="changePartionType" >
  205. <el-option
  206. v-for="item in partitionArr"
  207. :key="item.id"
  208. :label="item.name"
  209. :value="item.id">
  210. </el-option>
  211. </el-select>
  212. <el-button size="small" icon="el-icon-printer" @click="toPrintOne" type="primary">打印</el-button>
  213. <el-button size="small" @click="toExportListOne" type="primary">导出</el-button>
  214. </div>
  215. <el-table
  216. :data="tableList"
  217. border
  218. :row-style="{ color: '#303133' }"
  219. :header-cell-style="{
  220. backgroundColor: 'rgb(245, 247, 250)',
  221. color: '#606266'
  222. }"
  223. >
  224. <el-table-column align="center" label="序号">
  225. <template slot-scope="scope">
  226. {{scope.$index+1}}
  227. </template>
  228. </el-table-column>
  229. <el-table-column align="center" label="耗材名称">
  230. <template slot-scope="scope">
  231. {{scope.row.name}}
  232. </template>
  233. </el-table-column>
  234. <el-table-column align="center" label="规格">
  235. <template slot-scope="scope">
  236. {{scope.row.specification_name}}
  237. </template>
  238. </el-table-column>
  239. <el-table-column align="center" label="数量">
  240. <template slot-scope="scope">
  241. {{scope.row.count}}
  242. </template>
  243. </el-table-column>
  244. </el-table>
  245. </span>
  246. <span slot="footer" class="dialog-footer">
  247. <el-button @click="startDialogVisible = false">取 消</el-button>
  248. <el-button type="primary" @click="startDialogVisible = false">确 定</el-button>
  249. </span>
  250. </el-dialog>
  251. <el-dialog
  252. title="设置"
  253. :visible.sync="startDialogVisibleOne"
  254. width="60%">
  255. <span>
  256. <div v-for="(item,index) in goodTypeList" :key="index">
  257. <span v-if="index == 0"><el-checkbox v-model="checkedOne" >{{item.type_name}}</el-checkbox></span>
  258. <span v-if="index == 1"><el-checkbox v-model="checkedTwo" >{{item.type_name}}</el-checkbox></span>
  259. <span v-if="index == 2"><el-checkbox v-model="checkedThree" >{{item.type_name}}</el-checkbox></span>
  260. <span v-if="index == 3"><el-checkbox v-model="checkedFour" >{{item.type_name}}</el-checkbox></span>
  261. <span v-if="index == 4"><el-checkbox v-model="checkedFive" >{{item.type_name}}</el-checkbox></span>
  262. <span v-if="index == 5"><el-checkbox v-model="checkedSix" >{{item.type_name}}</el-checkbox></span>
  263. <span v-if="index == 6"><el-checkbox v-model="checkedSeven" >{{item.type_name}}</el-checkbox></span>
  264. <span v-if="index == 7"><el-checkbox v-model="checkedEnight" >{{item.type_name}}</el-checkbox></span>
  265. <span v-if="index == 8"><el-checkbox v-model="checkedNight" >{{item.type_name}}</el-checkbox></span>
  266. <span v-if="index == 9"><el-checkbox v-model="checkedTen" >{{item.type_name}}</el-checkbox></span>
  267. <span v-if="index == 10"><el-checkbox v-model="checkedEleven">{{item.type_name}}</el-checkbox></span>
  268. <span v-if="index == 11"><el-checkbox v-model="checkedTwenty">{{item.type_name}}</el-checkbox></span>
  269. <span v-if="index == 12"><el-checkbox v-model="checkedTwentyOne">{{item.type_name}}</el-checkbox></span>
  270. <span v-if="index == 13"><el-checkbox v-model="checkedTwentyTwo">{{item.type_name}}</el-checkbox></span>
  271. <span v-if="index == 14"><el-checkbox v-model="checkedTwentyThree">{{item.type_name}}</el-checkbox></span>
  272. <span v-if="index == 15"><el-checkbox v-model="checkedTwentyFour">{{item.type_name}}</el-checkbox></span>
  273. <span v-if="index == 16"><el-checkbox v-model="checkedTwentyFive">{{item.type_name}}</el-checkbox></span>
  274. <span v-if="index == 17"><el-checkbox v-model="checkedTwentySix">{{item.type_name}}</el-checkbox></span>
  275. <span v-if="index == 18"><el-checkbox v-model="checkedTwentySeven">{{item.type_name}}</el-checkbox></span>
  276. <span v-if="index == 19"><el-checkbox v-model="checkedTwentyEight">{{item.type_name}}</el-checkbox></span>
  277. <span v-if="index == 20"><el-checkbox v-model="checkedTwentyNight">{{item.type_name}}</el-checkbox></span>
  278. </div>
  279. </span>
  280. <span slot="footer" class="dialog-footer">
  281. <el-button @click="startDialogVisibleOne = false">取 消</el-button>
  282. <el-button type="primary" @click="saveHisDialysis">确 定</el-button>
  283. </span>
  284. </el-dialog>
  285. <el-dialog
  286. title="耗材统计表"
  287. :visible.sync="startHisDialogVisible"
  288. width="70%">
  289. <span>
  290. <div class="cell clearfix">
  291. <label class="title"> <span class="name">排班班次</span> : </label>
  292. <el-select v-model="schedule_type" placeholder="请选择" @change="changeScheduleType">
  293. <el-option
  294. v-for="item in schedulArr"
  295. :key="item.value"
  296. :label="item.label"
  297. :value="item.value">
  298. </el-option>
  299. </el-select>
  300. <label class="title"> <span class="name">病区选择</span> : </label>
  301. <el-select v-model="partion_type" placeholder="请选择" multiple @change="changePartionType">
  302. <el-option
  303. v-for="item in partitionArr"
  304. :key="item.id"
  305. :label="item.name"
  306. :value="item.id">
  307. </el-option>
  308. </el-select>
  309. <el-button size="small" icon="el-icon-printer" @click="toHisPrint" type="primary">打印</el-button>
  310. <el-button size="small" @click="toExportListTwo" type="primary">导出</el-button>
  311. </div>
  312. <el-table
  313. :data="tableList"
  314. border
  315. :row-style="{ color: '#303133' }"
  316. :header-cell-style="{
  317. backgroundColor: 'rgb(245, 247, 250)',
  318. color: '#606266'
  319. }"
  320. >
  321. <el-table-column align="center" label="序号">
  322. <template slot-scope="scope">
  323. {{scope.$index+1}}
  324. </template>
  325. </el-table-column>
  326. <el-table-column align="center" label="耗材名称">
  327. <template slot-scope="scope">
  328. {{scope.row.good_name}}
  329. </template>
  330. </el-table-column>
  331. <el-table-column align="center" label="规格">
  332. <template slot-scope="scope">
  333. {{scope.row.specification_name}}
  334. </template>
  335. </el-table-column>
  336. <el-table-column align="center" label="数量">
  337. <template slot-scope="scope">
  338. {{scope.row.count}}
  339. </template>
  340. </el-table-column>
  341. </el-table>
  342. </span>
  343. <span slot="footer" class="dialog-footer">
  344. <el-button @click="startHisDialogVisible = false">取 消</el-button>
  345. <el-button type="primary" @click="startHisDialogVisible = false">确 定</el-button>
  346. </span>
  347. </el-dialog>
  348. </div>
  349. </template>
  350. <script>
  351. import { GetAllZone,getPatientDialysisSolutionGroupList,getDialysisGoodTotalCount,saveHisDialysis,getHisDialysisGoodCount,getSolutionlistByOrgId } from '@/api/dialysis'
  352. import {GetAllGoodType} from '@/api/stock'
  353. import { uParseTime } from "@/utils/tools";
  354. import { getDataConfig } from '@/utils/data'
  355. export default {
  356. components: {
  357. },
  358. data() {
  359. return {
  360. query:{
  361. total:"",
  362. schedule_date:"",
  363. schedule_type:0,
  364. partition_id:0,
  365. page:1,
  366. limit:10,
  367. keywords:"",
  368. good_type:0,
  369. ids:""
  370. },
  371. schedulType: 0,
  372. schedulArr: [
  373. { value: 0, label: '全部' },
  374. { value: 1, label: '上午' },
  375. { value: 2, label: '下午' },
  376. { value: 3, label: '晚上' }
  377. ],
  378. selected_date: "",
  379. partitionArr: [],
  380. goodList:[
  381. { id: 0, name: '全部' },
  382. { id: 1, name: '已出库' },
  383. { id: 2, name: '未出库' },
  384. ],
  385. partitionType: 0,
  386. goodType:0,
  387. tableData: [{
  388. date: '2016-05-03',
  389. name: '王小虎',
  390. address: '上海市普陀区金沙江路 1518 弄'
  391. }
  392. ],
  393. search_input: '',
  394. searchAction: '',
  395. allGoodInfo:[],
  396. list:[],
  397. new_list:[],
  398. good_types: [],
  399. arrKey:[],
  400. arrList:[],
  401. total:0,
  402. pickerOptions:{ //禁用当前日期之前的日期
  403. disabledDate(v) {
  404. //Date.now()是javascript中的内置函数,它返回自1970年1月1日00:00:00 UTC以来经过的毫秒数。
  405. return v.getTime() < new Date().getTime() - 86400000;
  406. },
  407. },
  408. rowList:[],
  409. dialysate_formulation:[],
  410. body_fluid_option:[],
  411. displace_liqui_part_option:[],
  412. blood_access_option:[],
  413. hemodialysisPipelinesOptions:[],
  414. startDialogVisible:false,
  415. tableList:[],
  416. schedule_type:0,
  417. partion_type:0,
  418. goodTypeList:[],
  419. his_config:{},
  420. startDialogVisibleOne:false,
  421. type_name:false,
  422. checkedOne:false,
  423. checkedTwo:false,
  424. checkedThree:false,
  425. checkedFour:false,
  426. checkedFive:false,
  427. checkedSix:false,
  428. checkedSeven:false,
  429. checkedEnight:false,
  430. checkedNight:false,
  431. checkedTen:false,
  432. checkedEleven:false,
  433. checkedTwenty:false,
  434. checkedTwentyOne:false,
  435. checkedTwentyTwo:false,
  436. checkedTwentyThree:false,
  437. checkedTwentyFour:false,
  438. checkedTwentyFive:false,
  439. checkedTwentySix:false,
  440. checkedTwentySeven:false,
  441. checkedTwentyEight:false,
  442. checkedTwentyNight:false,
  443. startHisDialogVisible:false,
  444. typeList:[],
  445. ids:"",
  446. org_id:0,
  447. zoneIdList:[],
  448. pationType_str:"",
  449. }
  450. },
  451. created() {
  452. this.org_id = this.$store.getters.xt_user.org.id
  453. let date = uParseTime(new Date(), "{y}-{m}-{d}")
  454. var newDate = new Date();
  455. var y = newDate.getFullYear();
  456. var m = newDate.getMonth() + 1;
  457. var d = newDate.getDate();
  458. var schedule_date =
  459. y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d);
  460. this.selected_date = date
  461. this.query.schedule_date = schedule_date
  462. this.query.schedule_type = 0
  463. this.query.partition_id = 0
  464. this.query.page = 1
  465. this.query.ids = this.ids
  466. this.getAllZone()
  467. this.dialysate_formulation = getDataConfig(
  468. 'hemodialysis',
  469. 'dialysate_formulation'
  470. )
  471. this.body_fluid_option = this.$store.getters.body_fluid
  472. this.displace_liqui_part_option = this.$store.getters.displace_liqui
  473. this.blood_access_option = this.$store.getters.blood_access
  474. this.blood_access_option = getDataConfig('hemodialysis', 'vascular_access_desc')
  475. this.hemodialysisPipelinesOptions = getDataConfig('hemodialysis', 'hemodialysis_pipelines')
  476. var filedList = this.$store.getters.xt_user.fileds
  477. for (let i = 0; i < filedList.length; i++) {
  478. if ( filedList[i].module == 1 && filedList[i].is_show == 1 && (filedList[i].filed_name_cn == '透析器/灌流器' || filedList[i].filed_name_cn == '透析器' || filedList[i].filed_name_cn == '灌流器' || filedList[i].filed_name_cn == '钾' || filedList[i].filed_name_cn == '钠' || filedList[i].filed_name_cn == '钙' || filedList[i].filed_name_cn == '葡萄糖' || filedList[i].filed_name_cn == '穿刺针' || filedList[i].filed_name_cn == '滤过器')) {
  479. this.rowList.push(filedList[i])
  480. }
  481. }
  482. this.getlist()
  483. },
  484. methods: {
  485. exportList(){
  486. import('@/vendor/Export2Excel').then(excel => {
  487. var arr= []
  488. arr.push('序号')
  489. arr.push('透析机号')
  490. arr.push('姓名')
  491. arr.push('透析号')
  492. // console.log("list23322323232",this.rowList)
  493. if(this.rowList!=null && this.rowList.length > 0){
  494. for(let i=0;i<this.rowList.length;i++){
  495. arr.push(this.rowList[i].filed_name_cn)
  496. }
  497. }
  498. arr.push("备注")
  499. // console.log("arr",arr)
  500. var arrTwo = []
  501. for(let i=0;i<arr.length;i++){
  502. arrTwo.push('name'+i)
  503. }
  504. // console.log("arrTwo",arrTwo)
  505. const tHeader = arr
  506. const filterVal = arrTwo
  507. if(this.list!=null && this.list.length > 0){
  508. for(let i=0;i<this.list.length;i++){
  509. this.list[i].name0 = i+1
  510. this.list[i].name1= this.list[i].device_number.zone.name + this.list[i].device_number.number
  511. this.list[i].name2 = this.list[i].patient.name
  512. this.list[i].name3 = this.list[i].patient.dialysis_no
  513. if(this.rowList!=null && this.rowList.length > 0){
  514. for(let j=0;j<this.rowList.length;j++){
  515. this.list[i]['name'+(j+4)] = this.getName(this.list[i].rowList[j].filed_name_cn,this.list[i].dialysis_solution)
  516. this.list[i]['name'+(this.rowList.length+4)] = this.list[i].dialysis_solution.remark
  517. }
  518. }
  519. }
  520. }
  521. // console.log("list32232232323wi",this.list)
  522. const data = this.formatJson(filterVal, this.list)
  523. excel.export_json_to_excel({
  524. header: tHeader,
  525. data,
  526. filename: '透析耗材查询'
  527. })
  528. this.downloadLoading = false
  529. })
  530. },
  531. exportListOne(){
  532. import('@/vendor/Export2Excel').then(excel => {
  533. var arr= []
  534. arr.push('序号')
  535. arr.push('透析机号')
  536. arr.push('姓名')
  537. arr.push('透析号')
  538. // console.log("list23322323232",this.typeList)
  539. if(this.typeList!=null && this.typeList.length > 0){
  540. for(let i=0;i<this.typeList.length;i++){
  541. arr.push(this.typeList[i].type_name)
  542. }
  543. }
  544. // console.log("arr",arr)
  545. var arrTwo = []
  546. for(let i=0;i<arr.length;i++){
  547. arrTwo.push('name'+i)
  548. }
  549. // console.log("arrTwo",arrTwo)
  550. const tHeader = arr
  551. const filterVal = arrTwo
  552. console.log("list23323223wo",this.list)
  553. if(this.list!=null && this.list.length > 0){
  554. for(let i=0;i<this.list.length;i++){
  555. this.list[i].name0 = i+1
  556. this.list[i].name1= this.list[i].device_number.zone.name + this.list[i].device_number.number
  557. this.list[i].name2 = this.list[i].patient.name
  558. this.list[i].name3 = this.list[i].patient.dialysis_no
  559. if(this.typeList!=null && this.typeList.length > 0){
  560. for(let j=0;j<this.typeList.length;j++){
  561. if(this.list[i].his_prescription_project.length>0){
  562. this.list[i]['name'+(j+4)] = this.getStr(this.list[i].typeList[j].id,this.list[i].his_prescription_project,this.list[i].patient_id)
  563. }
  564. if(this.list[i].his_prescription_project.length == 0){
  565. this.list[i]['name'+(j+4)] = this.getStr(this.list[i].typeList[j].id,this.list[i].projectList,this.list[i].patient_id)
  566. }
  567. }
  568. }
  569. }
  570. }
  571. console.log("list32232232323wi",this.list)
  572. const data = this.formatJson(filterVal, this.list)
  573. excel.export_json_to_excel({
  574. header: tHeader,
  575. data,
  576. filename: '透析耗材查询'
  577. })
  578. this.downloadLoading = false
  579. })
  580. },
  581. formatJson(filterVal, jsonData) {
  582. return jsonData.map(v => filterVal.map(j => v[j]));
  583. },
  584. createKeys(arr){
  585. const obj = {};
  586. arr.forEach((value,index)=>{
  587. obj['name' + index] = value;
  588. })
  589. return obj;
  590. },
  591. open(){
  592. this.rowList = []
  593. var filedList = this.$store.getters.xt_user.fileds
  594. for (let i = 0; i < filedList.length; i++) {
  595. if ( filedList[i].module == 1 && filedList[i].is_show == 1 && (filedList[i].filed_name_cn == '透析器/灌流器' || filedList[i].filed_name_cn == '透析器' || filedList[i].filed_name_cn == '灌流器' || filedList[i].filed_name_cn == '钾' || filedList[i].filed_name_cn == '钠' || filedList[i].filed_name_cn == '钙' || filedList[i].filed_name_cn == '葡萄糖' || filedList[i].filed_name_cn == '穿刺针')) {
  596. this.rowList.push(filedList[i])
  597. }
  598. }
  599. this.getlist()
  600. },
  601. getlist(){
  602. getPatientDialysisSolutionGroupList(this.query).then(response=>{
  603. if(response.data.state == 1){
  604. var list = response.data.data.list
  605. var total = response.data.data.total
  606. this.total = total
  607. var goodType = response.data.data.goodType
  608. var config = response.data.data.config
  609. this.his_config = config
  610. if(config.is_open !=1){
  611. if(list!=null){
  612. for(let i=0;i<list.length;i++){
  613. list[i].rowList = []
  614. list[i].rowList = this.rowList
  615. }
  616. }
  617. this.list= []
  618. this.list = list
  619. }
  620. if(config.is_open == 1){
  621. if(list!=null){
  622. this.typeList= []
  623. for(let i=0;i<goodType.length;i++){
  624. if(goodType[i].is_open == 1){
  625. this.typeList.push(goodType[i])
  626. }
  627. }
  628. for(let i=0;i<list.length;i++){
  629. list[i].projectList = []
  630. list[i].typeList = []
  631. list[i].typeList = this.typeList
  632. }
  633. for(let i=0;i<list.length;i++){
  634. if(list[i].his_prescription_template.his_prescription_info!=null && list[i].his_prescription_template.his_prescription_info.length >0){
  635. for(let j=0;j<list[i].his_prescription_template.his_prescription_info.length;j++){
  636. for(let z=0;z<list[i].his_prescription_template.his_prescription_info[j].project.length;z++){
  637. list[i].projectList.push(list[i].his_prescription_template.his_prescription_info[j].project[z])
  638. }
  639. }
  640. }
  641. }
  642. console.log("list--------------------",list)
  643. this.list = list
  644. }
  645. }
  646. }
  647. })
  648. },
  649. handleSizeChangeOne(val) {
  650. this.query.limit = val;
  651. this.getlist();
  652. },
  653. handleCurrentChangeOne(val) {
  654. this.query.page = val;
  655. this.getlist();
  656. },
  657. handleSizeChange(val) {
  658. this.query.limit = val;
  659. this.getlist();
  660. },
  661. handleCurrentChange(val) {
  662. this.query.page = val;
  663. this.getlist();
  664. },
  665. calCount(query_warehouseout_info) {
  666. let total = 0
  667. var array = []
  668. array = query_warehouseout_info
  669. for (let i = 0; i < array.length; i++) {
  670. total = total + array[i].count
  671. }
  672. return total
  673. },
  674. getGoodUserInfo(good_type_id,good_user,last_good_user) {
  675. var arrlist =[]
  676. if (good_user != null && good_user.length > 0) {
  677. let desc = ""
  678. for (let b = 0; b < good_user.length; b++){
  679. if(good_type_id == good_user[b].good_type_id)
  680. desc = desc + "\n" + good_user[b].info.specification_name +"*" +good_user[b].count
  681. }
  682. arrlist.push(desc)
  683. return desc
  684. }
  685. return ""
  686. },
  687. selectSchedulType(scheduleType) {
  688. this.schedulType = scheduleType
  689. this.query.schedule_type = scheduleType
  690. this.query.page = 1
  691. this.getlist()
  692. },
  693. selectPartitionType(partitionType) {
  694. this.partitionType = partitionType
  695. this.query.partition_id = partitionType
  696. this.query.page = 1
  697. this.getlist()
  698. },
  699. selectGoodType(goodType){
  700. this.goodType = goodType
  701. this.query.good_type = goodType
  702. this.getlist()
  703. },
  704. getAllZone: function() {
  705. GetAllZone().then(response => {
  706. if (response.data.state == 0) {
  707. this.$message.error(response.data.msg)
  708. return false
  709. } else {
  710. this.partitionArr = response.data.data.zone
  711. for(let i=0;i<this.partitionArr.length;i++){
  712. this.zoneIdList.push(this.partitionArr[i].id)
  713. }
  714. // this.partitionArr.unshift({ id: 0, name: '全部' })
  715. }
  716. })
  717. },
  718. statistics() {
  719. this.tableList = []
  720. var arr = this.zoneIdList.join(",")
  721. var str = ""
  722. if(this.partion_type == 0){
  723. str = arr
  724. }
  725. if(this.partion_type != 0){
  726. str = this.partion_type.join(',')
  727. }
  728. this.pationType_str = ""
  729. this.pationType_str = str
  730. console.log("str-==-------",str)
  731. var params = {
  732. schedule_type:this.schedule_type,
  733. partion_type:str,
  734. selected_date:this.query.schedule_date,
  735. }
  736. getDialysisGoodTotalCount(params).then(response=>{
  737. if(response.data.state == 1){
  738. this.startDialogVisible = true
  739. var list = response.data.data.list
  740. console.log("list===========",list)
  741. var kaliumCount = 0
  742. var sodiumCount = 0
  743. var calciumCount = 0
  744. var glucoseCount = 0
  745. var kaliumArr = []
  746. var sodiumArr = []
  747. var calciumArr = []
  748. var glucoseArr = []
  749. console.log("rowlist233223323223w",this.rowList)
  750. if(list!=null && list.length>0){
  751. for(let i=0;i<list.length;i++){
  752. list[i].dialysis_dialyszers_arr = []
  753. list[i].dialyzer_perfusion_apparatus_arr = []
  754. list[i].dialysis_irrigation_arr = []
  755. list[i].puncture_needle_arr = []
  756. list[i].dialysis_strainer_arr = []
  757. if(list[i].dialysis_prescription.dialysis_dialyszers!=""){
  758. if(list[i].dialysis_prescription.dialysis_dialyszers!=""){
  759. list[i].dialysis_dialyszers_arr = list[i].dialysis_prescription.dialysis_dialyszers.split(",")
  760. }
  761. }else{
  762. if(list[i].dialysis_solution.dialysis_dialyszers!=""){
  763. list[i].dialysis_dialyszers_arr = list[i].dialysis_solution.dialysis_dialyszers.split(",")
  764. }
  765. }
  766. if(list[i].dialysis_prescription.dialyzer_perfusion_apparatus!=""){
  767. if(list[i].dialysis_prescription.dialyzer_perfusion_apparatus!=""){
  768. list[i].dialyzer_perfusion_apparatus_arr = list[i].dialysis_prescription.dialyzer_perfusion_apparatus.split(",")
  769. }
  770. }else{
  771. if(list[i].dialysis_solution.dialyzer_perfusion_apparatus!=""){
  772. list[i].dialyzer_perfusion_apparatus_arr = list[i].dialysis_solution.dialyzer_perfusion_apparatus.split(",")
  773. }
  774. }
  775. if(list[i].dialysis_prescription.dialysis_irrigation!=""){
  776. if(list[i].dialysis_prescription.dialysis_irrigation!=""){
  777. list[i].dialysis_irrigation_arr = list[i].dialysis_prescription.dialysis_irrigation.split(",")
  778. }
  779. }else{
  780. if(list[i].dialysis_solution.dialysis_irrigation!=""){
  781. list[i].dialysis_irrigation_arr = list[i].dialysis_solution.dialysis_irrigation.split(",")
  782. }
  783. }
  784. if(list[i].dialysis_prescription.dialysis_strainer!=""){
  785. if(list[i].dialysis_prescription.dialysis_strainer!=""){
  786. list[i].dialysis_strainer_arr = list[i].dialysis_prescription.dialysis_strainer.split(",")
  787. }
  788. }else{
  789. if(list[i].dialysis_solution.dialysis_strainer!=""){
  790. list[i].dialysis_strainer_arr = list[i].dialysis_solution.dialysis_strainer.split(",")
  791. }
  792. }
  793. if(list[i].dialysis_prescription.puncture_needle!=""){
  794. if(list[i].dialysis_prescription.puncture_needle!="" ){
  795. list[i].puncture_needle_arr = list[i].dialysis_prescription.puncture_needle.split(",")
  796. }
  797. }else{
  798. if(list[i].dialysis_solution.puncture_needle!="" ){
  799. list[i].puncture_needle_arr = list[i].dialysis_solution.puncture_needle.split(",")
  800. }
  801. }
  802. kaliumCount += parseInt(list[i].dialysis_solution.kalium)
  803. sodiumCount += parseInt(list[i].dialysis_solution.sodium)
  804. calciumCount +=parseInt(list[i].dialysis_solution.calcium)
  805. glucoseCount += parseInt(list[i].dialysis_solution.glucose)
  806. if(list[i].dialysis_solution!=null &&list[i].dialysis_solution.kalium > 0){
  807. list[i].dialysis_solution.specification = "钾" + list[i].dialysis_solution.kalium
  808. kaliumArr.push(list[i].dialysis_solution)
  809. }
  810. if(list[i].dialysis_solution!=null&&list[i].dialysis_solution.sodium > 0){
  811. list[i].dialysis_solution.specification_one = "钠" + list[i].dialysis_solution.sodium
  812. sodiumArr.push(list[i].dialysis_solution)
  813. }
  814. if(list[i].dialysis_solution!=null&&list[i].dialysis_solution.calcium > 0){
  815. list[i].dialysis_solution.specification_two = "钙" + list[i].dialysis_solution.calcium
  816. calciumArr.push(list[i].dialysis_solution)
  817. }
  818. if(list[i].dialysis_solution!=null&&list[i].dialysis_solution.amylaceum !=0){
  819. list[i].dialysis_solution.specification_three = "葡萄糖" + list[i].dialysis_solution.amylaceum
  820. glucoseArr.push(list[i].dialysis_solution)
  821. }
  822. }
  823. }
  824. console.log("glucoseArr",glucoseArr)
  825. if(kaliumArr!=null && kaliumArr.length > 0){
  826. let dataInfo = {}
  827. kaliumArr.forEach((item, index) => {
  828. let { specification } = item
  829. if (!dataInfo[specification]) {
  830. dataInfo[specification] = {
  831. name:"钾(mmol/L)",
  832. specification:item.specification,
  833. specification_name:item.kalium,
  834. child: [],
  835. count:0,
  836. }
  837. }
  838. })
  839. let newArr = Object.values(dataInfo)
  840. for(let i=0;i<kaliumArr.length;i++){
  841. for(let j=0;j<newArr.length;j++){
  842. if(kaliumArr[i].specification == newArr[j].specification){
  843. newArr[j].child.push(kaliumArr[i])
  844. }
  845. }
  846. }
  847. for(let i=0;i<newArr.length;i++){
  848. newArr[i].count = newArr[i].child.length
  849. }
  850. console.log("newArr",newArr)
  851. for(let i=0;i<newArr.length;i++){
  852. this.tableList.push(newArr[i])
  853. }
  854. }
  855. if(sodiumArr!=null && sodiumArr.length > 0){
  856. let dataInfo = {}
  857. sodiumArr.forEach((item, index) => {
  858. let { specification_one } = item
  859. if (!dataInfo[specification_one]) {
  860. dataInfo[specification_one] = {
  861. name:"钠(mmol/L)",
  862. specification_one:item.specification_one,
  863. specification_name:item.sodium,
  864. child: [],
  865. count:0,
  866. }
  867. }
  868. })
  869. let newArr = Object.values(dataInfo)
  870. for(let i=0;i<sodiumArr.length;i++){
  871. for(let j=0;j<newArr.length;j++){
  872. if(sodiumArr[i].specification_one == newArr[j].specification_one){
  873. newArr[j].child.push(sodiumArr[i])
  874. }
  875. }
  876. }
  877. for(let i=0;i<newArr.length;i++){
  878. newArr[i].count += newArr[i].child.length
  879. }
  880. console.log("newArr",newArr)
  881. for(let i=0;i<newArr.length;i++){
  882. this.tableList.push(newArr[i])
  883. }
  884. }
  885. if(calciumArr!=null && calciumArr.length > 0){
  886. let dataInfo = {}
  887. calciumArr.forEach((item, index) => {
  888. let { specification_two } = item
  889. if (!dataInfo[specification_two]) {
  890. dataInfo[specification_two] = {
  891. name:"钠(mmol/L)",
  892. specification_two:item.specification_two,
  893. specification_name:item.calcium,
  894. child: [],
  895. count:0,
  896. }
  897. }
  898. })
  899. let newArr = Object.values(dataInfo)
  900. for(let i=0;i<calciumArr.length;i++){
  901. for(let j=0;j<newArr.length;j++){
  902. if(calciumArr[i].specification_two == newArr[j].specification_two){
  903. newArr[j].child.push(calciumArr[i])
  904. }
  905. }
  906. }
  907. for(let i=0;i<newArr.length;i++){
  908. newArr[i].count = newArr[i].child.length
  909. }
  910. console.log("newArr",newArr)
  911. for(let i=0;i<newArr.length;i++){
  912. this.tableList.push(newArr[i])
  913. }
  914. }
  915. if(glucoseArr!=null && glucoseArr.length > 0){
  916. let dataInfo = {}
  917. glucoseArr.forEach((item, index) => {
  918. let { specification_three } = item
  919. if (!dataInfo[specification_three]) {
  920. dataInfo[specification_three] = {
  921. name:"葡萄糖",
  922. specification_three:item.specification_three,
  923. specification_name:item.amylaceum,
  924. child: [],
  925. count:0,
  926. }
  927. }
  928. })
  929. let newArr = Object.values(dataInfo)
  930. for(let i=0;i<glucoseArr.length;i++){
  931. for(let j=0;j<newArr.length;j++){
  932. if(glucoseArr[i].specification_three == newArr[j].specification_three){
  933. newArr[j].child.push(glucoseArr[i])
  934. }
  935. }
  936. }
  937. for(let i=0;i<newArr.length;i++){
  938. newArr[i].count += newArr[i].child.length
  939. }
  940. console.log("newArr",newArr)
  941. for(let i=0;i<newArr.length;i++){
  942. this.tableList.push(newArr[i])
  943. }
  944. }
  945. var dialysisDialyszersArr = []
  946. var dialyzerPerfusionApparaArr = []
  947. var dialysisIrrigationArr = []
  948. var dialysisStrainerArr = []
  949. var punctureNeedleArr = []
  950. for(let i=0;i<list.length;i++){
  951. for(let j=0;j<list[i].dialysis_dialyszers_arr.length;j++){
  952. dialysisDialyszersArr.push(list[i].dialysis_dialyszers_arr[j])
  953. }
  954. for(let z=0;z<list[i].dialyzer_perfusion_apparatus_arr.length;z++){
  955. dialyzerPerfusionApparaArr.push(list[i].dialyzer_perfusion_apparatus_arr[z])
  956. }
  957. for(let y=0;y<list[i].dialysis_irrigation_arr.length;y++){
  958. dialysisIrrigationArr.push(list[i].dialysis_irrigation_arr[y])
  959. }
  960. for(let h=0;h<list[i].puncture_needle_arr.length;h++){
  961. punctureNeedleArr.push(list[i].puncture_needle_arr[h])
  962. }
  963. for(let w=0;w<list[i].dialysis_strainer_arr.length;w++){
  964. dialysisStrainerArr.push(list[i].dialysis_strainer_arr[w])
  965. }
  966. }
  967. let obj = {}
  968. let objOne = {}
  969. let objTwo = {}
  970. let objThree = {}
  971. let objFour = {}
  972. for(let i = 0 ; i < dialysisDialyszersArr.length; i++){
  973. if(obj[dialysisDialyszersArr[i]]){
  974. obj[dialysisDialyszersArr[i]] +=1
  975. }else{
  976. obj[dialysisDialyszersArr[i]] = 1
  977. }
  978. }
  979. let Arr = [];
  980. for (let i in obj) {
  981. let a = {};
  982. a[i] = obj[i];
  983. a.name = "透析器"
  984. a.count = obj[i]
  985. a.specification_name = i
  986. Arr.push(a);
  987. }
  988. for(let i=0;i<dialyzerPerfusionApparaArr.length;i++){
  989. if(objOne[dialyzerPerfusionApparaArr[i]]){
  990. objOne[dialyzerPerfusionApparaArr[i]] +=1
  991. }else{
  992. objOne[dialyzerPerfusionApparaArr[i]] = 1
  993. }
  994. }
  995. for (let i in objOne) {
  996. let a = {};
  997. a[i] = objOne[i];
  998. a.name = "透析器/灌流器"
  999. a.count = objOne[i]
  1000. a.specification_name = i
  1001. Arr.push(a);
  1002. }
  1003. for(let i=0;i<dialysisIrrigationArr.length;i++){
  1004. if(objTwo[dialysisIrrigationArr[i]]){
  1005. objTwo[dialysisIrrigationArr[i]] +=1
  1006. }else{
  1007. objTwo[dialysisIrrigationArr[i]] = 1
  1008. }
  1009. }
  1010. for (let i in objTwo) {
  1011. let a = {};
  1012. a[i] = objTwo[i];
  1013. a.name = "灌流器"
  1014. a.count = objTwo[i]
  1015. a.specification_name = i
  1016. Arr.push(a);
  1017. }
  1018. for(let i = 0 ; i < punctureNeedleArr.length; i++){
  1019. if(objThree[punctureNeedleArr[i]]){
  1020. objThree[punctureNeedleArr[i]] +=1
  1021. }else{
  1022. objThree[punctureNeedleArr[i]] = 1
  1023. }
  1024. }
  1025. for (let i in objThree) {
  1026. let a = {};
  1027. a[i] = objThree[i];
  1028. a.name = "穿刺针"
  1029. a.count = objThree[i]
  1030. a.specification_name = i
  1031. Arr.push(a);
  1032. }
  1033. for(let i=0;i<dialysisStrainerArr.length;i++){
  1034. if(objFour[dialysisStrainerArr[i]]){
  1035. objFour[dialysisStrainerArr[i]] +=1
  1036. }else{
  1037. objFour[dialysisStrainerArr[i]] = 1
  1038. }
  1039. }
  1040. for (let i in objFour) {
  1041. let a = {};
  1042. a[i] = objFour[i];
  1043. a.name = "滤过器"
  1044. a.count = objFour[i]
  1045. a.specification_name = i
  1046. Arr.push(a);
  1047. }
  1048. // var objfive = {name:"钾(mmol/L)",specification_name:"2.0",count:""}
  1049. // var objsix = {name:"钠(mmol/L)",specification_name:"1.25",count:""}
  1050. // var objseven = {name:"钙(mmol/L)",specification_name:"1.5",count:""}
  1051. // var objeight = {name:"葡萄糖(mmol/L)",specification_name:"无糖",count:""}
  1052. // objfive.count = kaliumCount
  1053. // objsix.count = sodiumCount
  1054. // objseven.count = calciumCount
  1055. // objeight.count = glucoseCount
  1056. // this.tableList.push(objfive)
  1057. // this.tableList.push(objsix)
  1058. // this.tableList.push(objseven)
  1059. // this.tableList.push(objeight)
  1060. console.log("arARRRR2323223232=------------",Arr)
  1061. for(let i=0;i<Arr.length;i++){
  1062. for(let j=0;j<this.rowList.length;j++){
  1063. if(Arr[i].name == this.rowList[j].filed_name_cn){
  1064. this.tableList.push(Arr[i])
  1065. }
  1066. }
  1067. }
  1068. console.log("tablistlist233323232",this.tableList)
  1069. }
  1070. })
  1071. },
  1072. toStatistics(){
  1073. this.tableList = []
  1074. var arr = this.zoneIdList.join(",")
  1075. var str = ""
  1076. if(this.partion_type == 0){
  1077. str = arr
  1078. }
  1079. if(this.partion_type != 0){
  1080. str = this.partion_type.join(',')
  1081. }
  1082. this.pationType_str=""
  1083. this.pationType_str = str
  1084. var params = {
  1085. schedule_type:this.schedule_type,
  1086. partion_type:str,
  1087. selected_date:this.query.schedule_date,
  1088. }
  1089. getHisDialysisGoodCount(params).then(response=>{
  1090. if(response.data.state == 1){
  1091. var list = response.data.data.list
  1092. // console.log("list23233223232wode",list)
  1093. this.startHisDialogVisible = true
  1094. var projectList = []
  1095. for(let i=0;i<list.length;i++){
  1096. if(list[i].his_prescription_template.his_prescription_info!=null && list[i].his_prescription_template.his_prescription_info.length>0){
  1097. for(let j=0;j<list[i].his_prescription_template.his_prescription_info.length;j++){
  1098. for(let z=0;z<list[i].his_prescription_template.his_prescription_info[j].project.length;z++){
  1099. projectList.push(list[i].his_prescription_template.his_prescription_info[j].project[z])
  1100. }
  1101. }
  1102. }
  1103. }
  1104. console.log("projectList",projectList)
  1105. if(projectList!=null && projectList.length > 0){
  1106. for(let i=0;i<projectList.length;i++){
  1107. projectList[i].good_id = 0
  1108. projectList[i].good_id = projectList[i].good_info.id
  1109. }
  1110. }
  1111. let dataInfo = {}
  1112. projectList.forEach((item, index) => {
  1113. let { good_id } = item
  1114. if (!dataInfo[good_id]) {
  1115. dataInfo[good_id] = {
  1116. good_id:item.good_info.id,
  1117. child: [],
  1118. count:0,
  1119. specification_name:item.good_info.specification_name,
  1120. good_name:item.good_info.good_name
  1121. }
  1122. }
  1123. })
  1124. let newArr = Object.values(dataInfo)
  1125. for(let i=0;i<projectList.length;i++){
  1126. for(let j=0;j<newArr.length;j++){
  1127. if(projectList[i].good_id == newArr[j].good_id){
  1128. newArr[j].child.push(projectList[i])
  1129. }
  1130. }
  1131. }
  1132. for(let i=0;i<newArr.length;i++){
  1133. for(let j=0;j<newArr[i].child.length;j++){
  1134. newArr[i].count += parseInt(newArr[i].child[j].count)
  1135. }
  1136. }
  1137. console.log("newArr32323233223wo",newArr)
  1138. this.tableList = newArr
  1139. }
  1140. })
  1141. },
  1142. handleScheduleDateChange(val) {
  1143. this.query.schedule_date = val
  1144. this.query.page = 1
  1145. this.getlist()
  1146. },
  1147. search() {
  1148. this.query.page = 1
  1149. this.getlist()
  1150. },
  1151. formatJson(filterVal, jsonData) {
  1152. return jsonData.map(v => filterVal.map(j => v[j]));
  1153. },
  1154. getName(filed_name_cn,val){
  1155. if(filed_name_cn == "透析模式"){
  1156. return this.getModeName(val.mode_id)
  1157. }
  1158. if(filed_name_cn == "血流量"){
  1159. if(val.blood_flow_volume > 0){
  1160. return val.blood_flow_volume
  1161. }else{
  1162. return ""
  1163. }
  1164. }
  1165. if(filed_name_cn == "目标超滤量"){
  1166. return val.target_ultrafiltration?val.target_ultrafiltration:""
  1167. }
  1168. if(filed_name_cn == "透析液配方"){
  1169. return this.getDialysateFormulation(val.dialysate_formulation)
  1170. }
  1171. if(filed_name_cn == "抗凝剂"){
  1172. return this.getAnticoagulant(val.anticoagulant)
  1173. }
  1174. if(filed_name_cn == "首剂"){
  1175. return val.anticoagulant_shouji?val.anticoagulant_shouji:""
  1176. }
  1177. if(filed_name_cn == "维持"){
  1178. return val.anticoagulant_weichi?val.anticoagulant_weichi:""
  1179. }
  1180. if(filed_name_cn == "总量"){
  1181. return val.anticoagulant_zongliang?val.anticoagulant_zongliang:""
  1182. }
  1183. if(filed_name_cn == "置换量"){
  1184. return val.replacement_total?val.replacement_total:""
  1185. }
  1186. if(filed_name_cn == "钾"){
  1187. return val.kalium?val.kalium:""
  1188. }
  1189. if(filed_name_cn == "钠"){
  1190. return val.sodium?val.sodium:""
  1191. }
  1192. if(filed_name_cn == "钙"){
  1193. return val.calcium?val.calcium:""
  1194. }
  1195. if(filed_name_cn == "碳酸氢盐"){
  1196. return val.bicarbonate?val.bicarbonate:""
  1197. }
  1198. if(filed_name_cn == "透析液流量"){
  1199. return val.dialysate_flow?val.dialysate_flow:""
  1200. }
  1201. if(filed_name_cn == "透析液温度"){
  1202. return val.dialysate_temperature?val.dialysate_temperature:""
  1203. }
  1204. if(filed_name_cn == "电导度"){
  1205. return val.conductivity?val.conductivity:""
  1206. }
  1207. if(filed_name_cn == "透析器/灌流器"){
  1208. return val.dialyzer_perfusion_apparatus
  1209. }
  1210. if(filed_name_cn == "钙名称"){
  1211. return val.anticoagulant_gaimingcheng?val.anticoagulant_gaimingcheng:""
  1212. }
  1213. if(filed_name_cn == "钙剂量"){
  1214. return val.anticoagulant_gaijiliang?val.anticoagulant_gaijiliang:""
  1215. }
  1216. if(filed_name_cn == "体液过多症状"){
  1217. return this.getBodyFluid(val.body_fluid)
  1218. }
  1219. if(filed_name_cn == "透析前使用特殊药物"){
  1220. return val.special_medicine
  1221. }
  1222. if(filed_name_cn == "透析前使用其他特殊药物"){
  1223. return val.special_medicine_other
  1224. }
  1225. if(filed_name_cn == "置换液"){
  1226. return this.getDisplace(val.displace_liqui_part)
  1227. }
  1228. if(filed_name_cn == "血管通路"){
  1229. return this.getBloodAccess(val.blood_access)
  1230. }
  1231. if(filed_name_cn == "体液过多其他症状"){
  1232. return val.body_fluid_other
  1233. }
  1234. if(filed_name_cn == "透析时长"){
  1235. return val.dialysis_duration_hour + "小时" + val.dialysis_duration_minute + "分钟"
  1236. }
  1237. if(filed_name_cn == "置换液总量"){
  1238. return val.displace_liqui_value?val.displace_liqui_value:""
  1239. }
  1240. if(filed_name_cn == "透析器"){
  1241. return val.dialysis_dialyszers
  1242. }
  1243. if(filed_name_cn == "注射器"){
  1244. return ""
  1245. }
  1246. if(filed_name_cn == "抗凝提前停止"){
  1247. return ""
  1248. }
  1249. if(filed_name_cn == "肝素钠"){
  1250. return ""
  1251. }
  1252. if(filed_name_cn == "鱼精蛋白"){
  1253. return ""
  1254. }
  1255. if(filed_name_cn == "下机前推住鱼精蛋白"){
  1256. return ""
  1257. }
  1258. if(filed_name_cn == "无肝素钠备注"){
  1259. return ""
  1260. }
  1261. if(filed_name_cn == "灌流器"){
  1262. return val.dialysis_irrigation
  1263. }
  1264. if(filed_name_cn == "抗凝剂商品名称"){
  1265. return ""
  1266. }
  1267. if(filed_name_cn == "置换速度"){
  1268. return ""
  1269. }
  1270. if(filed_name_cn == "病情"){
  1271. return ""
  1272. }
  1273. if(filed_name_cn == "葡萄糖"){
  1274. return val.amylaceum?val.amylaceum:""
  1275. }
  1276. if(filed_name_cn == "单超时长"){
  1277. return ""
  1278. }
  1279. if(filed_name_cn == "单超脱水"){
  1280. return ""
  1281. }
  1282. if(filed_name_cn == "置换流量"){
  1283. return ""
  1284. }
  1285. if(filed_name_cn == "血浆分离器"){
  1286. return val.plasma_separator?val.plasma_separator:""
  1287. }
  1288. if(filed_name_cn == "透析管路"){
  1289. return this.getHemodialysisPipelines(val.hemodialysis_pipelines)
  1290. }
  1291. if(filed_name_cn == "透析管路支数"){
  1292. return ""
  1293. }
  1294. if(filed_name_cn == "穿刺针"){
  1295. return val.puncture_needle?val.puncture_needle:""
  1296. }
  1297. // if(filed_name_cn == "穿刺针支数"){
  1298. // return val.puncture_needle_count
  1299. // }
  1300. if(filed_name_cn == "促红素"){
  1301. return val.epo_count?val.epo_count:""
  1302. }
  1303. if(filed_name_cn == "促红素支数"){
  1304. return val.epo_count?val.epo_count:""
  1305. }
  1306. if(filed_name_cn == "最大超滤率"){
  1307. return val.max_ultrafiltration_rate?val.max_ultrafiltration_rate:""
  1308. }
  1309. if(filed_name_cn == "滤过器"){
  1310. return val.dialysis_strainer?val.dialysis_strainer:""
  1311. }
  1312. },
  1313. getModeName(id){
  1314. var name = ""
  1315. if(id == 1){
  1316. name = "HD"
  1317. }
  1318. if(id == 2){
  1319. name = "HDF"
  1320. }
  1321. if(id == 3){
  1322. name = "HD+HP"
  1323. }
  1324. if(id == 4){
  1325. name = "HP"
  1326. }
  1327. if(id == 5){
  1328. name = "HF"
  1329. }
  1330. if(id == 6){
  1331. name = "SCUF"
  1332. }
  1333. if(id == 7){
  1334. name = "IUF"
  1335. }
  1336. if(id == 8){
  1337. name = "HFHD"
  1338. }
  1339. if(id == 9){
  1340. name = "HFHD+HP"
  1341. }
  1342. if(id == 10){
  1343. name = "PHF"
  1344. }
  1345. if(id == 11){
  1346. name = "HFR"
  1347. }
  1348. if(id == 12){
  1349. name = "HDF+HP"
  1350. }
  1351. if(id == 13){
  1352. name = "CRRT"
  1353. }
  1354. if(id == 14){
  1355. name = "腹水回输"
  1356. }
  1357. if(id == 19){
  1358. name = "IUF+HD"
  1359. }
  1360. if(id == 20){
  1361. name = "UF"
  1362. }
  1363. if(id == 21){
  1364. name = "HD+"
  1365. }
  1366. if(id == 22){
  1367. name = "血浆胆红素吸附+HDF"
  1368. }
  1369. if(id == 23){
  1370. name = "血浆胆红素吸附"
  1371. }
  1372. if(id == 24){
  1373. name = "I-HDF"
  1374. }
  1375. if(id == 25){
  1376. name = "HD高通"
  1377. }
  1378. if(id == 26){
  1379. name = "CVVH"
  1380. }
  1381. if(id == 27){
  1382. name = "CVVHD"
  1383. }
  1384. if(id == 28){
  1385. name = "CVVHDF"
  1386. }
  1387. if(id == 29){
  1388. name = "PE"
  1389. }
  1390. if(id == 30){
  1391. name = "血浆胆红素吸附+HP"
  1392. }
  1393. if(id == 31){
  1394. name = "HPD"
  1395. }
  1396. if(id == 32){
  1397. name = "HDP"
  1398. }
  1399. return name
  1400. },
  1401. getDialysateFormulation(id){
  1402. var name = ""
  1403. for(let i=0;i<this.dialysate_formulation.length;i++){
  1404. if(id == this.dialysate_formulation[i].id){
  1405. name = this.dialysate_formulation[i].name
  1406. }
  1407. }
  1408. return name
  1409. },
  1410. getAnticoagulant(id){
  1411. var name = ""
  1412. if(id == 1){
  1413. name = "无肝素"
  1414. }
  1415. if(id == 2){
  1416. name = "普通肝素"
  1417. }
  1418. if(id == 3){
  1419. name = "低分子肝素"
  1420. }
  1421. if(id == 4){
  1422. name = "阿加曲班"
  1423. }
  1424. if(id == 5){
  1425. name ="枸橼酸钠"
  1426. }
  1427. if(id == 6){
  1428. name = "低分子肝素钙"
  1429. }
  1430. if(id == 7){
  1431. name = "低分子肝素钠"
  1432. }
  1433. if(id ==8){
  1434. name = "依诺肝素"
  1435. }
  1436. if(id ==9){
  1437. name = "达肝素"
  1438. }
  1439. if(id ==10){
  1440. name = "体外抗凝"
  1441. }
  1442. if(id ==11){
  1443. name = "那曲肝素"
  1444. }
  1445. if(id ==12){
  1446. name = "无抗凝剂"
  1447. }
  1448. if(id ==13){
  1449. name = "那曲肝素钙"
  1450. }
  1451. return name
  1452. },
  1453. getBodyFluid(id){
  1454. var name = ""
  1455. for(let i=0;i<this.body_fluid_option.length;i++){
  1456. if(id == this.body_fluid_option[i].id){
  1457. name = this.body_fluid_option[i].name
  1458. }
  1459. }
  1460. return name
  1461. },
  1462. getDisplace(id){
  1463. var name = ""
  1464. for(let i=0;i<this.displace_liqui_part_option.length;i++){
  1465. if(id == this.displace_liqui_part_option[i].id){
  1466. name = this.displace_liqui_part_option[i].name
  1467. }
  1468. }
  1469. return name
  1470. },
  1471. getBloodAccess(id){
  1472. var name = ""
  1473. for(let i=0;i<this.blood_access_option.length;i++){
  1474. if(id == this.blood_access_option[i].id){
  1475. name = this.blood_access_option[i].name
  1476. }
  1477. }
  1478. return name
  1479. },
  1480. getHemodialysisPipelines(id){
  1481. var name = ""
  1482. for(let i=0;i<this.hemodialysisPipelinesOptions.length;i++){
  1483. if(id == this.hemodialysisPipelinesOptions[i].id){
  1484. name = this.hemodialysisPipelinesOptions[i].name
  1485. }
  1486. }
  1487. return name
  1488. },
  1489. toSett(){
  1490. GetAllGoodType().then(response=>{
  1491. if(response.data.state == 1){
  1492. this.goodTypeList = []
  1493. this.goodTypeList = response.data.data.goodType
  1494. // console.log("typelist2332233223wo",this.goodTypeList)
  1495. for(let i=0;i<this.goodTypeList.length;i++){
  1496. if(i == 0 && this.goodTypeList[i].is_open == 1){
  1497. this.checkedOne = true
  1498. }
  1499. if(i == 1 && this.goodTypeList[i].is_open == 1){
  1500. this.checkedTwo = true
  1501. }
  1502. if(i == 2 && this.goodTypeList[i].is_open == 1){
  1503. this.checkedThree = true
  1504. }
  1505. if(i == 3 && this.goodTypeList[i].is_open == 1){
  1506. this.checkedFour = true
  1507. }
  1508. if(i == 4 && this.goodTypeList[i].is_open == 1){
  1509. // console.log("进来22323")
  1510. this.checkedFive = true
  1511. }
  1512. if(i == 5 && this.goodTypeList[i].is_open == 1){
  1513. this.checkedSix = true
  1514. }
  1515. if(i == 6 && this.goodTypeList[i].is_open == 1){
  1516. this.checkedSeven= true
  1517. }
  1518. if(i == 7 && this.goodTypeList[i].is_open == 1){
  1519. this.checkedEnight= true
  1520. }
  1521. if(i == 8 && this.goodTypeList[i].is_open == 1){
  1522. this.checkedNight= true
  1523. }
  1524. if(i == 9 && this.goodTypeList[i].is_open == 1){
  1525. this.checkedTen= true
  1526. }
  1527. if(i == 10 && this.goodTypeList[i].is_open == 1){
  1528. this.checkedEleven= true
  1529. }
  1530. if(i == 11 && this.goodTypeList[i].is_open == 1){
  1531. this.checkedTwenty= true
  1532. }
  1533. if(i == 12 && this.goodTypeList[i].is_open == 1){
  1534. this.checkedTwentyOne= true
  1535. }
  1536. if(i == 13 && this.goodTypeList[i].is_open == 1){
  1537. this.checkedTwentyTwo= true
  1538. }
  1539. if(i == 14 && this.goodTypeList[i].is_open == 1){
  1540. this.checkedTwentyThree= true
  1541. }
  1542. if(i == 15 && this.goodTypeList[i].is_open == 1){
  1543. this.checkedTwentyFour= true
  1544. }
  1545. if(i == 16 && this.goodTypeList[i].is_open == 1){
  1546. this.checkedTwentyFive= true
  1547. }
  1548. if(i == 17 && this.goodTypeList[i].is_open == 1){
  1549. this.checkedTwentySix= true
  1550. }
  1551. if(i == 18 && this.goodTypeList[i].is_open == 1){
  1552. this.checkedTwentySeven= true
  1553. }
  1554. if(i == 19 && this.goodTypeList[i].is_open == 1){
  1555. this.checkedTwentyEight= true
  1556. }
  1557. if(i == 20 && this.goodTypeList[i].is_open == 1){
  1558. this.checkedTwentyNight= true
  1559. }
  1560. }
  1561. this.startDialogVisibleOne = true
  1562. }
  1563. })
  1564. },
  1565. saveHisDialysis(){
  1566. var index = 0
  1567. var arr = []
  1568. if(this.checkedOne == true){
  1569. index = 0
  1570. }else{
  1571. index = -1
  1572. }
  1573. for(let i=0;i<this.goodTypeList.length;i++){
  1574. if(index == i){
  1575. arr.push(this.goodTypeList[i].id)
  1576. }
  1577. }
  1578. var index_one = 0
  1579. if(this.checkedTwo == true){
  1580. index_one = 1
  1581. }else{
  1582. index_one = -1
  1583. }
  1584. for(let i=0;i<this.goodTypeList.length;i++){
  1585. if(index_one == i){
  1586. arr.push(this.goodTypeList[i].id)
  1587. }
  1588. }
  1589. var index_two = 0
  1590. if(this.checkedThree == true){
  1591. index_two = 2
  1592. }else{
  1593. index_two = -1
  1594. }
  1595. for(let i=0;i<this.goodTypeList.length;i++){
  1596. if(index_two == i){
  1597. arr.push(this.goodTypeList[i].id)
  1598. }
  1599. }
  1600. var index_three = 0
  1601. if(this.checkedFour == true){
  1602. index_three = 3
  1603. }else{
  1604. index_three = -1
  1605. }
  1606. for(let i=0;i<this.goodTypeList.length;i++){
  1607. if(index_three == i){
  1608. arr.push(this.goodTypeList[i].id)
  1609. }
  1610. }
  1611. var index_four = 0
  1612. if(this.checkedFive == true){
  1613. index_four = 4
  1614. }else{
  1615. index_four = -1
  1616. }
  1617. for(let i=0;i<this.goodTypeList.length;i++){
  1618. if(index_four == i){
  1619. arr.push(this.goodTypeList[i].id)
  1620. }
  1621. }
  1622. var index_five = 0
  1623. if(this.checkedSix == true){
  1624. index_five = 5
  1625. }else{
  1626. index_five = -1
  1627. }
  1628. for(let i=0;i<this.goodTypeList.length;i++){
  1629. if(index_five == i){
  1630. arr.push(this.goodTypeList[i].id)
  1631. }
  1632. }
  1633. var index_six = 0
  1634. if(this.checkedSeven == true){
  1635. index_six = 6
  1636. }else{
  1637. index_six = -1
  1638. }
  1639. for(let i=0;i<this.goodTypeList.length;i++){
  1640. if(index_six == i){
  1641. arr.push(this.goodTypeList[i].id)
  1642. }
  1643. }
  1644. var index_seven = 0
  1645. if(this.checkedEnight == true){
  1646. index_seven = 7
  1647. }else{
  1648. index_seven = -1
  1649. }
  1650. for(let i=0;i<this.goodTypeList.length;i++){
  1651. if(index_seven == i){
  1652. arr.push(this.goodTypeList[i].id)
  1653. }
  1654. }
  1655. var index_eight =0
  1656. if(this.checkedNight == true){
  1657. index_eight = 8
  1658. }else{
  1659. index_eight = -1
  1660. }
  1661. for(let i=0;i<this.goodTypeList.length;i++){
  1662. if(index_eight == i){
  1663. arr.push(this.goodTypeList[i].id)
  1664. }
  1665. }
  1666. var index_night = 0
  1667. if(this.checkedTen == true){
  1668. index_night = 9
  1669. }else{
  1670. index_night = -1
  1671. }
  1672. for(let i=0;i<this.goodTypeList.length;i++){
  1673. if(index_night == i){
  1674. arr.push(this.goodTypeList[i].id)
  1675. }
  1676. }
  1677. var index_ten = 0
  1678. if(this.checkedEleven == true){
  1679. index_ten = 10
  1680. }else{
  1681. index_ten = -1
  1682. }
  1683. for(let i=0;i<this.goodTypeList.length;i++){
  1684. if(index_ten == i){
  1685. arr.push(this.goodTypeList[i].id)
  1686. }
  1687. }
  1688. var index_eleven =0
  1689. if(this.checkedTwenty == true){
  1690. index_eleven = 11
  1691. }else{
  1692. index_eleven = -1
  1693. }
  1694. for(let i=0;i<this.goodTypeList.length;i++){
  1695. if(index_eleven == i){
  1696. arr.push(this.goodTypeList[i].id)
  1697. }
  1698. }
  1699. var index_twenty_one = 0
  1700. if(this.checkedTwentyOne == true){
  1701. index_twenty_one = 12
  1702. }else{
  1703. index_twenty_one = -1
  1704. }
  1705. for(let i=0;i<this.goodTypeList.length;i++){
  1706. if(index_twenty_one == i){
  1707. arr.push(this.goodTypeList[i].id)
  1708. }
  1709. }
  1710. var index_twenty_two = 0
  1711. if(this.checkedTwentyTwo == true){
  1712. index_twenty_two = 13
  1713. }else{
  1714. index_twenty_two = -1
  1715. }
  1716. for(let i=0;i<this.goodTypeList.length;i++){
  1717. if(index_twenty_two == i){
  1718. arr.push(this.goodTypeList[i].id)
  1719. }
  1720. }
  1721. var index_twenty_three = 0
  1722. if(this.checkedTwentyThree == true){
  1723. index_twenty_three = 14
  1724. }else{
  1725. index_twenty_three = -1
  1726. }
  1727. for(let i=0;i<this.goodTypeList.length;i++){
  1728. if(index_twenty_three == i){
  1729. arr.push(this.goodTypeList[i].id)
  1730. }
  1731. }
  1732. var index_twenty_four = 0
  1733. if(this.checkedTwentyFour == true){
  1734. index_twenty_four = 15
  1735. }else{
  1736. index_twenty_four = -1
  1737. }
  1738. for(let i=0;i<this.goodTypeList.length;i++){
  1739. if(index_twenty_four == i){
  1740. arr.push(this.goodTypeList[i].id)
  1741. }
  1742. }
  1743. var index_twenty_five = 0
  1744. if(this.checkedTwentyFive == true){
  1745. index_twenty_five = 16
  1746. }else{
  1747. index_twenty_five = -1
  1748. }
  1749. for(let i=0;i<this.goodTypeList.length;i++){
  1750. if(index_twenty_five == i){
  1751. arr.push(this.goodTypeList[i].id)
  1752. }
  1753. }
  1754. var index_twenty_six = 0
  1755. if(this.checkedTwentySix == true){
  1756. index_twenty_six = 17
  1757. }else{
  1758. index_twenty_six = -1
  1759. }
  1760. for(let i=0;i<this.goodTypeList.length;i++){
  1761. if(index_twenty_six == i){
  1762. arr.push(this.goodTypeList[i].id)
  1763. }
  1764. }
  1765. var index_twenty_seven = 0
  1766. if(this.checkedTwentySeven == true){
  1767. index_twenty_seven = 18
  1768. }else{
  1769. index_twenty_seven = -1
  1770. }
  1771. for(let i=0;i<this.goodTypeList.length;i++){
  1772. if(index_twenty_seven == i){
  1773. arr.push(this.goodTypeList[i].id)
  1774. }
  1775. }
  1776. var index_twenty_eight = 0
  1777. if(this.checkedTwentyEight == true){
  1778. index_twenty_eight = 19
  1779. }else{
  1780. index_twenty_eight = -1
  1781. }
  1782. for(let i=0;i<this.goodTypeList.length;i++){
  1783. if(index_twenty_eight == i){
  1784. arr.push(this.goodTypeList[i].id)
  1785. }
  1786. }
  1787. var index_twenty_night =0
  1788. if(this.checkedTwentyNight == true){
  1789. index_twenty_night = 20
  1790. }else{
  1791. index_twenty_night = -1
  1792. }
  1793. for(let i=0;i<this.goodTypeList.length;i++){
  1794. if(index_twenty_night == i){
  1795. arr.push(this.goodTypeList[i].id)
  1796. }
  1797. }
  1798. var params = {
  1799. ids:arr.join(","),
  1800. }
  1801. // console.log("params23322322332",params)
  1802. saveHisDialysis(params).then(response=>{
  1803. if(response.data.state == 1){
  1804. var msg = response.data.data.msg
  1805. this.$message.success("保存成功!")
  1806. this.startDialogVisibleOne = false
  1807. this.getlist()
  1808. }
  1809. })
  1810. },
  1811. getTypeName(val,patient_id){
  1812. var str = ""
  1813. var arrNew = []
  1814. if(val.project!=null){
  1815. if(val.patient_id == patient_id){
  1816. var arr = []
  1817. if(val.project!=null){
  1818. for(let i=0;i<val.project.length;i++){
  1819. arr.push(val.project[i])
  1820. }
  1821. for(let i=0;i<arr.length;i++){
  1822. arr[i].good_type_id = 0
  1823. arr[i].good_type_id = arr[i].good_info.good_type_id
  1824. }
  1825. let dataInfo = {}
  1826. arr.forEach((item, index) => {
  1827. let { good_type_id } = item
  1828. if (!dataInfo[good_type_id]) {
  1829. dataInfo[good_type_id] = {
  1830. good_type_id:item.good_type_id,
  1831. child: [],
  1832. count:0,
  1833. specification_name:item.good_info.specification_name,
  1834. }
  1835. }
  1836. })
  1837. let newArr = Object.values(dataInfo)
  1838. for(let i=0;i<newArr.length;i++){
  1839. for(let j=0;j<arr.length;j++){
  1840. if(newArr[i].good_type_id == arr[j].good_type_id){
  1841. newArr[i].child.push(arr[j])
  1842. }
  1843. }
  1844. }
  1845. if(newArr!=null && newArr.length > 0){
  1846. for(let i=0;i<newArr.length;i++){
  1847. for(let j=0;j<newArr[i].child.length;j++){
  1848. newArr[i].count += parseInt(newArr[i].child[j].count)
  1849. }
  1850. }
  1851. }
  1852. if(newArr!=null && newArr.length >0){
  1853. for(let i=0;i<newArr.length;i++){
  1854. arrNew.push(newArr[i])
  1855. }
  1856. }
  1857. }
  1858. }
  1859. return arrNew
  1860. }
  1861. },
  1862. getStr(good_type_id,arrNew,patient_id){
  1863. // console.log("ARR233323",arrNew)
  1864. var arr= []
  1865. var str = ""
  1866. if(arrNew!=null && arrNew.length > 0){
  1867. for(let i=0;i<arrNew.length;i++){
  1868. arrNew[i].good_type_id = 0
  1869. arrNew[i].good_type_id = arrNew[i].good_info.good_type_id
  1870. arrNew[i].good_id = 0
  1871. arrNew[i].good_id = arrNew[i].good_info.id
  1872. if(arrNew[i].patient_id == patient_id && arrNew[i].good_info.good_type_id == good_type_id){
  1873. arr.push(arrNew[i])
  1874. }
  1875. }
  1876. }
  1877. let dataInfo = {}
  1878. if(arr!=null && arr.length > 0){
  1879. arr.forEach((item, index) => {
  1880. let { good_id } = item
  1881. if (!dataInfo[good_id]) {
  1882. dataInfo[good_id] = {
  1883. good_id:item.good_id,
  1884. child: [],
  1885. count:0,
  1886. specification_name:item.good_info.specification_name
  1887. }
  1888. }
  1889. })
  1890. let newArr = Object.values(dataInfo)
  1891. // console.log("newArr",newArr)
  1892. for(let i=0;i<arr.length;i++){
  1893. for(let j=0;j<newArr.length;j++){
  1894. if( arr[i].good_info.id == newArr[j].good_id){
  1895. newArr[j].child.push(arr[i])
  1896. }
  1897. }
  1898. }
  1899. if(newArr!=null && newArr.length > 0){
  1900. for(let j=0;j<newArr.length;j++){
  1901. for(let z=0;z<newArr[j].child.length;z++){
  1902. newArr[j].count += parseInt(newArr[j].child[z].count)
  1903. }
  1904. }
  1905. for(let j=0;j<newArr.length;j++){
  1906. str += newArr[j].specification_name + "*" + newArr[j].count + " "
  1907. }
  1908. }
  1909. }
  1910. return str
  1911. },
  1912. toPrint(){
  1913. this.$router.push({path:'/dialysis/consumable/dialysisgoodprint?limit='+this.query.limit+"&page="+this.query.page+"&partition_id="+this.query.partition_id+"&schedule_date="+this.query.schedule_date+"&schedule_type="+this.query.schedule_type+"&keywords="+this.query.keywords+"&ids="+this.ids})
  1914. },
  1915. toPrintOne(){
  1916. this.$router.push({path:"/dialysis/consumable/dialysisgoodcountprint?schedule_type="+this.schedule_type+"&partion_type="+this.pationType_str+"&schedule_date="+this.query.schedule_date+"&is_open="+this.his_config.is_open})
  1917. },
  1918. toHisPrint(){
  1919. this.$router.push({path:"/dialysis/consumable/dialysisgoodcountprint?schedule_type="+this.schedule_type+"&partion_type="+this.pationType_str+"&schedule_date="+this.query.schedule_date+"&is_open="+this.his_config.is_open})
  1920. },
  1921. toExportListOne(){
  1922. import('@/vendor/Export2Excel').then(excel => {
  1923. if(this.tableList!=null && this.tableList.length > 0){
  1924. for(let i=0;i<this.tableList.length;i++){
  1925. this.tableList[i].index = i+1
  1926. }
  1927. }
  1928. const tHeader = ['序号','耗材名称','规格','数量']
  1929. const filterVal = ['index', 'name','specification_name','count']
  1930. const data = this.formatJson(filterVal, this.tableList)
  1931. excel.export_json_to_excel({
  1932. header: tHeader,
  1933. data,
  1934. filename: '透析耗材统计'
  1935. })
  1936. this.downloadLoading = false
  1937. })
  1938. },
  1939. toExportListTwo(){
  1940. import('@/vendor/Export2Excel').then(excel => {
  1941. if(this.tableList!=null && this.tableList.length > 0){
  1942. for(let i=0;i<this.tableList.length;i++){
  1943. this.tableList[i].index = i+1
  1944. }
  1945. }
  1946. const tHeader = ['序号','耗材名称','规格','数量']
  1947. const filterVal = ['index', 'good_name','specification_name','count']
  1948. const data = this.formatJson(filterVal, this.tableList)
  1949. excel.export_json_to_excel({
  1950. header: tHeader,
  1951. data,
  1952. filename: '透析耗材统计'
  1953. })
  1954. this.downloadLoading = false
  1955. })
  1956. },
  1957. handleSelectionChange(val){
  1958. var arr = []
  1959. for(let i=0;i<val.length;i++){
  1960. arr.push(val[i].id)
  1961. }
  1962. this.ids = arr.join(",")
  1963. // console.log("ids23323232",this.ids)
  1964. },
  1965. changeScheduleType(){
  1966. console.log("changeScheduleType",this.his_config)
  1967. if(this.his_config.is_open != 1){
  1968. this.tableList = []
  1969. this.statistics()
  1970. }
  1971. if(this.his_config.is_open == 1){
  1972. this.tableList = []
  1973. this.toStatistics()
  1974. }
  1975. },
  1976. changePartionType(){
  1977. if(this.his_config.is_open != 1){
  1978. this.tableList = []
  1979. this.statistics()
  1980. }
  1981. if(this.his_config.is_open == 1){
  1982. this.tableList = []
  1983. this.toStatistics()
  1984. }
  1985. },
  1986. toClick(){
  1987. const loading = this.$loading({
  1988. lock: true,
  1989. text: 'Loading',
  1990. spinner: 'el-icon-loading',
  1991. background: 'rgba(0, 0, 0, 0.7)'
  1992. })
  1993. getSolutionlistByOrgId().then(response=>{
  1994. if(response.data.state == 1){
  1995. var list = response.data.data.list
  1996. console.log("list23322323",list)
  1997. loading.close()
  1998. this.$message.success("更新成功!")
  1999. }
  2000. })
  2001. }
  2002. }
  2003. }
  2004. </script>
  2005. <style lang="scss" scoped>
  2006. .page_consumables {
  2007. .clearfix:after {
  2008. content: none;
  2009. }
  2010. }
  2011. </style>