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

dialysisGood.vue 68KB

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