dialysisGood.vue 52KB

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