血透系统PC前端

dialysisSolution.vue 41KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153
  1. <template>
  2. <div class="patient-container">
  3. <patient-sidebar :id="patientID" defaultActive="2-1"></patient-sidebar>
  4. <div class="patient-app-container app-container">
  5. <div class="Total">
  6. <!-- <div class="plan" >透析计划</div> -->
  7. <table-title title="长期透析处方"></table-title>
  8. <div class="sum">
  9. <!-- <span>透析总频率:<el-input :value="totalrate" disabled style="width:180px"></el-input></span> -->
  10. <el-button type="primary" icon="el-icon-plus" size="medium" @click="openNew" :disabled="$store.getters.xt_user.subscibe.state==3?true:false">新增透析处方</el-button>
  11. </div>
  12. </div>
  13. <el-table ref="solutionTable" :data="tableData" border fit highlight-current-row
  14. @current-change="tableCurrentChange" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  15. style="width: 100%">
  16. <el-table-column
  17. type="index"
  18. align="center"
  19. label="序号"
  20. width="60">
  21. </el-table-column>
  22. <el-table-column
  23. prop="mode_name"
  24. align="center"
  25. label="透析模式"
  26. min-width="50">
  27. <template slot-scope="scope" >
  28. {{scope.row.mode_name}}
  29. </template>
  30. </el-table-column>
  31. <el-table-column
  32. prop="dialysis_duration"
  33. align="center"
  34. label="透析时长"
  35. min-width="50">
  36. <template slot-scope="scope" >
  37. {{scope.row.dialysis_duration}}h
  38. </template>
  39. </el-table-column>
  40. <!-- <el-table-column
  41. prop="period"
  42. label="频率"
  43. align="center"
  44. min-width="50">
  45. <template slot-scope="scope" >
  46. <span v-if="scope.row.parent_id === 0" >{{scope.row.period}}{{scope.row.times}}</span>
  47. <span v-else >--</span>
  48. </template>
  49. </el-table-column> -->
  50. <!-- <el-table-column
  51. prop="name"
  52. label="处方名"
  53. align="center"
  54. min-width="50">
  55. <template slot-scope="scope" >
  56. <span >{{scope.row.name}}{{scope.row.sub_name}}</span>
  57. </template>
  58. </el-table-column> -->
  59. <el-table-column
  60. prop="doctor"
  61. label="医生"
  62. align="center"
  63. min-width="110">
  64. <template slot-scope="scope" >
  65. <span >{{getAdminUserName(scope.row.doctor)}}</span>
  66. </template>
  67. </el-table-column>
  68. <el-table-column
  69. prop="updated_time"
  70. align="center"
  71. label="更新日期"
  72. min-width="60">
  73. <template slot-scope="scope">
  74. <span>{{scope.row.updated_time | parseTime('{y}-{m}-{d}')}}</span>
  75. </template>
  76. </el-table-column>
  77. <!-- <el-table-column
  78. prop="state"
  79. label="状态"
  80. align="center"
  81. min-width="40">
  82. <template slot-scope="scope" >
  83. <span v-if="scope.row.initiate_mode==1">启用</span>
  84. <span v-else-if="scope.row.initiate_mode==2">停用</span>
  85. <span v-else>未知</span>
  86. </template>
  87. </el-table-column> -->
  88. <el-table-column label="操作" align="center" min-width="140">
  89. <template slot-scope="scope">
  90. <el-tooltip class="item" effect="dark" content="编辑" placement="top">
  91. <el-button
  92. size="small"
  93. type="primary"
  94. icon="el-icon-edit-outline"
  95. @click="openEdit(scope.$index, scope.row)" ></el-button>
  96. </el-tooltip>
  97. <!-- <el-button
  98. size="mini"
  99. type="primary"
  100. @click="openChildEdit(scope.$index, scope.row)" v-else>编辑</el-button>
  101. <el-button
  102. size="mini"
  103. type="success"
  104. @click="openNewChild(scope.$index, scope.row)" v-if="scope.row.parent_id===0">新增</el-button>
  105. <el-button
  106. size="mini"
  107. type="danger"
  108. @click="handleDelete(scope.$index, scope.row)">删除</el-button>-->
  109. </template>
  110. </el-table-column>
  111. </el-table>
  112. <el-pagination
  113. align="right"
  114. @size-change="handleSizeChange"
  115. @current-change="handleCurrentChange"
  116. :current-page="queryParams.page"
  117. :page-sizes="[10, 20, 50, 100]"
  118. :page-size="10"
  119. background
  120. style="margin-top:20px;"
  121. layout="total, sizes, prev, pager, next, jumper"
  122. :total="total">
  123. </el-pagination>
  124. </div>
  125. <el-dialog
  126. :title="isEdit?'编辑透析处方':'新增透析处方'"
  127. :visible.sync="dialogVisible"
  128. width="850px">
  129. <el-form ref="addPlan" :model="addPlan" :rules="addPlanRules" label-width="160px">
  130. <el-row :gutter="20">
  131. <el-col style="width:380px" :span="12" >
  132. <el-form-item label="透析模式:" prop="mode">
  133. <el-select v-model="addPlan.mode" @change="addPlanModeChange" :disabled="isEdit?true:false" >
  134. <el-option v-for="item in modeOptions" :label="item.name" :key="item.id" :value="item.id"></el-option>
  135. </el-select>
  136. </el-form-item>
  137. </el-col>
  138. <el-col style="width:380px" :span="12" >
  139. <el-form-item label="透析时长(h):" prop="dialysis_duration">
  140. <!-- <el-input v-model="addPlan.dialysis_duration"></el-input> -->
  141. <el-time-picker
  142. v-model="dialysisTimeShow"
  143. :picker-options="{
  144. selectableRange: '00:01:00 - 23:59:00'
  145. }"
  146. placeholder="透析时长"
  147. style="width:100%;"
  148. value-format="H:m"
  149. format="H:m"
  150. @change="selectnDialysisTime"
  151. >
  152. </el-time-picker>
  153. </el-form-item>
  154. </el-col>
  155. <!-- <el-col style="width:380px" :span="12">
  156. <el-form-item label="透析器:" prop="dialyzer">
  157. <el-select v-model="addPlan.dialyzer" placeholder="" >
  158. <el-option v-for="item in deviceList" :label="item.name" :key="item.id" :value="item.id"></el-option>
  159. </el-select>
  160. </el-form-item>
  161. </el-col> -->
  162. <!-- <el-col style="width:380px" :span="12">
  163. <el-form-item label="透析器:" prop="hemodialysis_machine">
  164. <el-select v-model="addPlan.hemodialysis_machine" placeholder="" >
  165. <el-option v-for="item in hemodialysis_machines" :label="item.name" :key="item.id" :value="item.id"></el-option>
  166. </el-select>
  167. </el-form-item>
  168. </el-col> -->
  169. <!-- <el-col style="width:380px" :span="12">
  170. <el-form-item label="灌流器:" prop="perfusion_apparatus">
  171. <el-select v-model="addPlan.perfusion_apparatus" placeholder="" >
  172. <el-option v-for="item in perfusion_apparatus" :label="item.name" :key="item.id" :value="item.id"></el-option>
  173. </el-select>
  174. </el-form-item>
  175. </el-col> -->
  176. <el-col style="width:380px" :span="12">
  177. <el-form-item label="血流量(ml/min):" prop="blood_flow_volume">
  178. <el-input v-model="addPlan.blood_flow_volume" ></el-input>
  179. </el-form-item>
  180. </el-col>
  181. <el-col style="width:380px" :span="12">
  182. <el-form-item label="目标超滤量(ml) : " prop="target_ultrafiltration">
  183. <el-input v-model="addPlan.target_ultrafiltration" type="number"></el-input>
  184. </el-form-item>
  185. </el-col>
  186. <el-col style="width:380px" :span="12">
  187. <el-form-item label="透析液配方:" prop="dialysate_formulation" >
  188. <el-select v-model="addPlan.dialysate_formulation" >
  189. <el-option v-for="item in dialysate_formulation" :label="item.name" :key="item.id" :value="item.id"></el-option>
  190. </el-select>
  191. </el-form-item>
  192. </el-col>
  193. <!-- <el-col style="width:380px" :span="12">
  194. <el-form-item label="脱水量(L):" prop="dewater">
  195. <el-input v-model="addPlan.dewater" ></el-input>
  196. </el-form-item>
  197. </el-col> -->
  198. <!-- <el-col style="width:380px" :span="12">
  199. <el-form-item label="置换液(L):" prop="displace_liqui">
  200. <el-input v-model="addPlan.displace_liqui" ></el-input>
  201. </el-form-item>
  202. </el-col>
  203. <el-col style="width:380px" :span="12">
  204. <el-form-item label="置换方式:" prop="replacement_way" >
  205. <el-select v-model="addPlan.replacement_way" >
  206. <el-option v-for="item in replacementWays" :label="item.name" :key="item.id" :value="item.id"></el-option>
  207. </el-select>
  208. </el-form-item>
  209. </el-col> -->
  210. <el-col style="width:380px" :span="12">
  211. <el-form-item label="抗凝剂:" prop="anticoagulant" >
  212. <el-select v-model="addPlan.anticoagulant" @change="changeThisAnticoagulant" >
  213. <el-option v-for="item in anticoagulantsConfit" :label="item.name" :key="item.id" :value="item.id"></el-option>
  214. </el-select>
  215. </el-form-item>
  216. </el-col>
  217. <el-col style="width:380px" :span="12" v-if="anticoagulant.shouji != -1">
  218. <el-form-item :label="'首剂('+anticoagulant.shouji_unit+'): '" prop="anticoagulant_shouji" >
  219. <el-input v-model="addPlan.anticoagulant_shouji" :disabled="anticoagulant.shouji==1?false:true"></el-input>
  220. </el-form-item>
  221. </el-col>
  222. <el-col style="width:380px" :span="12" v-if="anticoagulant.weichi != -1">
  223. <el-form-item :label="'维持('+anticoagulant.weichi_unit+'): '" prop="anticoagulant_weichi" >
  224. <el-input v-model="addPlan.anticoagulant_weichi" :disabled="anticoagulant.weichi==1?false:true"></el-input>
  225. </el-form-item>
  226. </el-col>
  227. <el-col style="width:380px" :span="12" v-if="anticoagulant.zongliang != -1">
  228. <el-form-item :label="'总量('+anticoagulant.zongliang_unit+'): '" prop="anticoagulant_zongliang" >
  229. <el-input v-model="addPlan.anticoagulant_zongliang" :disabled="anticoagulant.zongliang==1?false:true" ></el-input>
  230. </el-form-item>
  231. </el-col>
  232. <el-col style="width:380px" :span="12" v-if="anticoagulant.gaimingcheng != -1">
  233. <el-form-item :label="'钙('+anticoagulant.gaimingcheng_unit+'): '" prop="anticoagulant_gaimingcheng">
  234. <el-input v-model="addPlan.anticoagulant_gaimingcheng" :disabled="anticoagulant.gaimingcheng==1?false:true" placeholder="钙名称" ></el-input>
  235. </el-form-item>
  236. </el-col>
  237. <el-col style="width:380px" :span="12" v-if="anticoagulant.gaijiliang != -1">
  238. <el-form-item prop="anticoagulant_gaijiliang">
  239. <el-input v-model="addPlan.anticoagulant_gaijiliang" :disabled="anticoagulant.gaijiliang==1?false:true" placeholder="钙剂量"></el-input>
  240. </el-form-item>
  241. </el-col>
  242. <el-col style="width:380px" :span="12">
  243. <el-form-item label="置换量(L) : " prop="replacement_total">
  244. <el-input v-model="addPlan.replacement_total" type="number"></el-input>
  245. </el-form-item>
  246. </el-col>
  247. <el-col style="width:380px" :span="12" >
  248. <el-form-item label="钾(mmol/L): " prop="kalium">
  249. <el-input v-model="addPlan.kalium" ></el-input>
  250. </el-form-item>
  251. </el-col>
  252. <el-col style="width:380px" :span="12" >
  253. <el-form-item label="钠(mmol/L): " prop="sodium">
  254. <el-input v-model="addPlan.sodium" ></el-input>
  255. </el-form-item>
  256. </el-col>
  257. <el-col style="width:380px" :span="12" >
  258. <el-form-item label="钙(mmol/L): " prop="calcium">
  259. <el-input v-model="addPlan.calcium" ></el-input>
  260. </el-form-item>
  261. </el-col>
  262. <el-col style="width:380px" :span="12" >
  263. <el-form-item label="碳酸氢根(mmol/L): " prop="bicarbonate">
  264. <el-input v-model="addPlan.bicarbonate" ></el-input>
  265. </el-form-item>
  266. </el-col>
  267. <el-col style="width:380px" :span="12">
  268. <el-form-item label="葡萄糖(mmol/L): " prop="glucose">
  269. <el-input v-model="addPlan.glucose"></el-input>
  270. </el-form-item>
  271. </el-col>
  272. <!-- <el-col style="width:380px" :span="12">
  273. <el-form-item label="干体重(kg): " prop="dry_weight">
  274. <el-input v-model="addPlan.dry_weight"></el-input>
  275. </el-form-item>
  276. </el-col> -->
  277. <el-col style="width:380px" :span="12">
  278. <el-form-item label="透析液流量(ml/min): " prop="dialysate_flow">
  279. <el-input v-model="addPlan.dialysate_flow"></el-input>
  280. </el-form-item>
  281. </el-col>
  282. <el-col style="width:380px" :span="12">
  283. <el-form-item label="透析液温度(℃): " prop="dialysate_temperature">
  284. <el-input v-model="addPlan.dialysate_temperature"></el-input>
  285. </el-form-item>
  286. </el-col>
  287. <el-col style="width:380px" :span="12">
  288. <el-form-item label="电导率(mS/cm): " prop="conductivity">
  289. <el-input v-model="addPlan.conductivity"></el-input>
  290. </el-form-item>
  291. </el-col>
  292. </el-row>
  293. <el-row :gutter="20">
  294. <el-col style="width:760px" :span="24">
  295. <el-form-item label="备注: " prop="remark">
  296. <el-input
  297. type="textarea"
  298. :rows="2"
  299. placeholder="请输入内容"
  300. v-model="addPlan.remark">
  301. </el-input>
  302. </el-form-item>
  303. </el-col>
  304. </el-row>
  305. </el-form>
  306. <span slot="footer" class="dialog-footer">
  307. <el-button @click="dialogVisible = false">取 消</el-button>
  308. <el-button type="warning" @click="submitEditSolution('addPlan')" v-if="isEdit" :disabled="$store.getters.xt_user.subscibe.state==3?true:false">保 存</el-button>
  309. <el-button type="primary" @click="submitNewSolution('addPlan')" v-else :disabled="$store.getters.xt_user.subscibe.state==3?true:false">保 存</el-button>
  310. </span>
  311. </el-dialog>
  312. </div>
  313. </template>
  314. <script>
  315. import tableTitle from "./components/tableTitle";
  316. import PatientSidebar from './components/PatientSidebar';
  317. import { fetchAllDoctorAndNurse,fetchAllAdminUsers} from "@/api/doctor";
  318. import {createPatientDialysisSolution,fetchPatientDialysisSolutions,editPatientDialysisSolution,createChildPatientDialysisSolution,editChildPatientDialysisSolution,editDialysisSolutionDetail,deleteDialysisSolution} from "@/api/patient";
  319. import {uParseTime,calculateAnticoagulantZL} from "@/utils/tools";
  320. import {
  321. GetDeviceInfo,
  322. } from "@/api/dialysis";
  323. const periodWeek = [
  324. { value: "每周", label: "每周" },
  325. { value: "两周", label: "两周" },
  326. { value: "三周", label: "三周" },
  327. { value: "四周", label: "四周" },
  328. ];
  329. const periodDay = [
  330. { value: "2天", label: "2天" },
  331. { value: "3天", label: "3天" },
  332. { value: "4天", label: "4天" },
  333. { value: "5天", label: "5天" },
  334. { value: "10天", label: "10天" },
  335. { value: "15天", label: "15天" },
  336. { value: "30天", label: "30天" },
  337. ];
  338. const numOptionsWeek = [
  339. { value: "1次", label: "1次" },
  340. { value: "2次", label: "2次" },
  341. { value: "3次", label: "3次" },
  342. { value: "4次", label: "4次" },
  343. { value: "5次", label: "5次" },
  344. { value: "6次", label: "6次" },
  345. { value: "7次", label: "7次" },
  346. ];
  347. const numOptionsDay = [
  348. { value: "1次", label: "1次" },
  349. ];
  350. export default {
  351. name: "Dialysis",
  352. data() {
  353. var checkFirstDialysis = (rule, value, callback)=>{
  354. if (this.addPlan.type == 2 && !value) {
  355. return callback(new Error('请选择首次透析!'));
  356. }
  357. callback();
  358. };
  359. var checkSubName = (rule, value, callback)=>{
  360. var pattern = /^\d*$/
  361. if (!pattern.test(value)) {
  362. return callback(new Error('只填写0-9的数字'));
  363. }
  364. callback();
  365. };
  366. return {
  367. deviceList:[],
  368. dialysisTimeShow: new Date(2018,1,1,3,0),
  369. isEdit:false,
  370. isChildEdit:false,
  371. totalrate:"无/两周一次",
  372. patientID:0,
  373. dialogVisible: false,
  374. dialogFormVisible: false,
  375. formLabelWidth: "80px",
  376. formInputWidth: "80px",
  377. total:0,
  378. tableData: null,
  379. form: {
  380. name: "",
  381. region: "",
  382. date1: "",
  383. date2: "",
  384. delivery: false,
  385. type: [],
  386. resource: "",
  387. desc: ""
  388. },
  389. addPlan: {
  390. id:0,
  391. mode:"",
  392. mode_name:"",
  393. dialyzer:'',
  394. dialysis_duration:"",
  395. dialysis_duration_hour:"",
  396. dialysis_duration_minute:"",
  397. hemodialysis_machine:"",
  398. perfusion_apparatus:"",
  399. blood_flow_volume:"",
  400. dewater:'',
  401. displace_liqui:0,
  402. replacement_way:"",
  403. anticoagulant:"",
  404. anticoagulant_shouji:"",
  405. anticoagulant_weichi:"",
  406. anticoagulant_zongliang:"",
  407. anticoagulant_gaimingcheng:"",
  408. anticoagulant_gaijiliang:"",
  409. kalium:"",
  410. replacement_total:'',
  411. sodium:"",
  412. calcium:"",
  413. bicarbonate:"",
  414. glucose: "",
  415. dry_weight: "",
  416. dialysate_flow:"",
  417. dialysate_temperature: "",
  418. conductivity:"",
  419. doctor: "",
  420. remark:"",
  421. },
  422. childPlan: {
  423. mode: "",
  424. frequency: "",
  425. name: "",
  426. parent_id:0,
  427. sub_name: "",
  428. initiate_mode: "",
  429. doctor: ""
  430. },
  431. modeOptions: null,
  432. anticoagulantsSet: {
  433. type:1,
  434. },
  435. replacementWays: null,
  436. anticoagulantsConfit: null,
  437. dialysate_formulation: [],
  438. timeOptions: [
  439. { value: 1, label: "按周" },
  440. { value: 2, label: "按日" }
  441. ],
  442. periodOptions: periodWeek,
  443. numOptions: numOptionsWeek,
  444. stateOptions: [
  445. { value: 1, label: "启用" },
  446. { value: 2, label: "停用" }
  447. ],
  448. doctorOptions: null,
  449. adminUserOptions:null,
  450. current_index:-1,
  451. addPlanRules:{
  452. mode:[{ required: true, message: "请选择透析模式", trigger: "blur" }],
  453. type:[{ required: true, message: "请选择频率", trigger: "blur" }],
  454. period:[{ required: true, message: "请选择周期", trigger: "blur" }],
  455. times:[{ required: true, message: "请选择次数", trigger: "blur" }],
  456. initiate_mode:[{ required: true, message: "请选择状态", trigger: "blur" }],
  457. doctor:[{ required: true, message: "请选择医生", trigger: "blur" }],
  458. first_dialysis:[{ validator: checkFirstDialysis, trigger: "blur" }],
  459. },
  460. addChildPlanRules:{
  461. sub_name:[{ required: true, message: "请填写处方名", trigger: "blur" },{validator:checkSubName,trigger:"blur"}],
  462. initiate_mode:[{ required: true, message: "请选择状态", trigger: "blur" }],
  463. doctor:[{ required: true, message: "请选择医生", trigger: "blur" }],
  464. },
  465. current_model:{id:0, name:"",dialysis_duration:2, replacement_total:0,replacement_way:2,hemodialysis_machine:2,blood_filter:2,perfusion_apparatus:2,blood_flow_volume:2,dialysate_flow:2,kalium:2,sodium:2,calcium:2,bicarbonate:2},
  466. current_solution:{
  467. id:0,
  468. name:"",
  469. sub_name:"",
  470. period:"",
  471. times:"",
  472. doctor:0,
  473. },
  474. anticoagulant:{id:0, name:"", type:1, shouji:1, weichi:1, zongliang:1, gaimingcheng:-1, gaijiliang:-1, shouji_unit:"mg", weichi_unit:"mg/h", zongliang_unit:"mg", gaimingcheng_unit:"", gaijiliang_unit:""},
  475. blood_filters:null,
  476. perfusion_apparatus:null,
  477. hemodialysis_machines:null,
  478. solution_detail:{
  479. id:0,
  480. affirm_state:0,
  481. dialysis_duration:"",
  482. replacement_way:"",
  483. mode_id:"",
  484. blood_flow_volume:"",
  485. hemodialysis_machine:"",
  486. blood_filter:"",
  487. perfusion_apparatus:"",
  488. dialysate_flow:"",
  489. kalium:"",
  490. replacement_total:'',
  491. sodium:"",
  492. calcium:"",
  493. bicarbonate:"",
  494. anticoagulant:"",
  495. anticoagulant_shouji:"",
  496. anticoagulant_weichi:"",
  497. anticoagulant_zongliang:"",
  498. anticoagulant_gaimingcheng:"",
  499. anticoagulant_gaijiliang:"",
  500. },
  501. queryParams:{
  502. page:1,
  503. limit:10,
  504. id:0,
  505. }
  506. };
  507. },
  508. watch:{
  509. "addPlan.dialysis_duration":function(){
  510. this.addPlan.anticoagulant_zongliang=calculateAnticoagulantZL(this.anticoagulantsSet.type,
  511. this.addPlan.anticoagulant_shouji,
  512. this.addPlan.dialysis_duration,
  513. this.addPlan.anticoagulant_weichi
  514. );
  515. },
  516. "addPlan.anticoagulant_shouji":function(){
  517. this.addPlan.anticoagulant_zongliang=calculateAnticoagulantZL(this.anticoagulantsSet.type,
  518. this.addPlan.anticoagulant_shouji,
  519. this.addPlan.dialysis_duration,
  520. this.addPlan.anticoagulant_weichi
  521. );
  522. },
  523. "addPlan.anticoagulant_weichi":function(){
  524. this.addPlan.anticoagulant_zongliang=calculateAnticoagulantZL(this.anticoagulantsSet.type,
  525. this.addPlan.anticoagulant_shouji,
  526. this.addPlan.dialysis_duration,
  527. this.addPlan.anticoagulant_weichi
  528. );
  529. },
  530. },
  531. components: {
  532. tableTitle,PatientSidebar
  533. },
  534. methods: {
  535. GetDeviceData: function () {
  536. let params = {}
  537. GetDeviceInfo(params).then(response => {
  538. this.deviceList = response.data.data.device
  539. });
  540. },
  541. selectnDialysisTime(val){
  542. var valTime = val.split(':');
  543. this.addPlan.dialysis_duration = valTime[0] + '.' + valTime[1];
  544. this.addPlan.dialysis_duration_hour = valTime[0];
  545. this.addPlan.dialysis_duration_minute = valTime[1];
  546. },
  547. tableCurrentChange(current){
  548. if (typeof(current)=='undefined' || current == null) {
  549. this.current_solution={
  550. id:0,
  551. name:"",
  552. sub_name:"",
  553. period:"",
  554. times:"",
  555. doctor:0,
  556. };
  557. this.solution_detail={
  558. id:0,
  559. affirm_state:0,
  560. dialysis_duration:"",
  561. replacement_way:"",
  562. mode_id:"",
  563. blood_flow_volume:"",
  564. hemodialysis_machine:"",
  565. blood_filter:"",
  566. perfusion_apparatus:"",
  567. dialysate_flow:"",
  568. kalium:"",
  569. replacement_total:'',
  570. sodium:"",
  571. calcium:"",
  572. bicarbonate:"",
  573. anticoagulant:"",
  574. anticoagulant_shouji:"",
  575. anticoagulant_weichi:"",
  576. anticoagulant_zongliang:"",
  577. anticoagulant_gaimingcheng:"",
  578. anticoagulant_gaijiliang:"",
  579. };
  580. return;
  581. }
  582. this.current_solution = current;
  583. this.setCurrentMode(current.mode_id);
  584. this.solution_detail={
  585. id:this.current_solution.id,
  586. affirm_state:this.current_solution.affirm_state,
  587. dialysis_duration:this.current_solution.dialysis_duration!=0?this.current_solution.dialysis_duration:"",
  588. replacement_way:this.current_solution.replacement_way != 0?this.current_solution.replacement_way:"",
  589. replacement_total:this.current_solution.replacement_total != 0 ? this.current_solution.replacement_total:'',
  590. mode_id:this.current_solution.mode_id,
  591. blood_flow_volume:this.current_solution.blood_flow_volume != 0?this.current_solution.blood_flow_volume:"",
  592. hemodialysis_machine:this.current_solution.hemodialysis_machine!=0?this.current_solution.hemodialysis_machine:"",
  593. blood_filter:this.current_solution.blood_filter!=0?this.current_solution.blood_filter:"",
  594. perfusion_apparatus:this.current_solution.perfusion_apparatus!=0?this.current_solution.perfusion_apparatus:"",
  595. dialysate_flow:this.current_solution.dialysate_flow!=0?this.current_solution.dialysate_flow:"",
  596. kalium:this.current_solution.kalium!=0?this.current_solution.kalium:"",
  597. sodium:this.current_solution.sodium!=0?this.current_solution.sodium:"",
  598. calcium:this.current_solution.calcium!=0?this.current_solution.calcium:"",
  599. bicarbonate:this.current_solution.bicarbonate!=0?this.current_solution.bicarbonate:"",
  600. anticoagulant:this.current_solution.anticoagulant!=0?this.current_solution.anticoagulant:"",
  601. anticoagulant_shouji:this.current_solution.anticoagulant_shouji!=0?this.current_solution.anticoagulant_shouji:"",
  602. anticoagulant_weichi:this.current_solution.anticoagulant_weichi!=0?this.current_solution.anticoagulant_weichi:"",
  603. anticoagulant_zongliang:this.current_solution.anticoagulant_zongliang!=0?this.current_solution.anticoagulant_zongliang:"",
  604. };
  605. },
  606. handleDelete(index, row) {
  607. if (row.use_state==1) {
  608. this.$message.error("方案已被使用,不能删除");
  609. return false;
  610. }
  611. this.$confirm('确定删除'+row.name+row.sub_name+'方案吗?', '提示', {
  612. confirmButtonText: '确定',
  613. cancelButtonText: '取消',
  614. type: 'warning'
  615. }).then(() => {
  616. deleteDialysisSolution(row.id).then(response=>{
  617. if (response.data.state == 0) {
  618. this.$message.error(response.data.msg);
  619. return false;
  620. } else {
  621. this.$notify({
  622. title: "成功",
  623. message: "删除成功",
  624. type: "success",
  625. duration: 2000
  626. });
  627. this.tableData.splice(index,1);
  628. // if (row.parent_id>0) {
  629. // this.tableData.splice(index,1);
  630. // }else {
  631. // var resetTableData = this.tableData;
  632. // this.tableData = [];
  633. // var that = this;
  634. // resetTableData.forEach(function(item, itemindex){
  635. // if (item.id != row.id && item.parent_id != row.id) {
  636. // that.tableData.push(item);
  637. // }
  638. // });
  639. // }
  640. }
  641. });
  642. });
  643. },
  644. submitSolution(formName){
  645. editDialysisSolutionDetail(this.patientID, this.solution_detail.id, this.solution_detail).then(response=>{
  646. if (response.data.state == 0) {
  647. this.$message.error(response.data.msg);
  648. return false;
  649. } else {
  650. this.$notify({
  651. title: "成功",
  652. message: "修改成功",
  653. type: "success",
  654. duration: 2000
  655. });
  656. var thisSolution = response.data.data.solution;
  657. var spliceIndex = -1;
  658. for (let index = this.tableData.length-1; ; index--) {
  659. if(this.tableData[index].id === thisSolution.id) {
  660. spliceIndex = index;
  661. break;
  662. }
  663. }
  664. if (spliceIndex > -1) {
  665. var newIndex = spliceIndex + 1;
  666. if (newIndex === this.tableData.length) {
  667. this.tableData.pop();
  668. this.tableData.push(thisSolution);
  669. }else {
  670. var swapData = this.tableData.splice(newIndex);
  671. this.tableData.pop();
  672. this.tableData.push(thisSolution);
  673. this.tableData = this.tableData.concat(swapData);
  674. }
  675. }
  676. this.solution_detail.affirm_state = thisSolution.affirm_state;
  677. this.$refs.solutionTable.setCurrentRow(this.tableData[spliceIndex]);
  678. }
  679. });
  680. },
  681. submitEditChildSolution(formName){
  682. this.$refs[formName].validate(valid=>{
  683. if(valid) {
  684. var editData = {
  685. initiate_mode: this.childPlan.initiate_mode,
  686. doctor:this.childPlan.doctor
  687. }
  688. editChildPatientDialysisSolution(this.patientID, this.childPlan.id, editData).then(response=>{
  689. if (response.data.state == 0) {
  690. this.$message.error(response.data.msg);
  691. return false;
  692. } else {
  693. this.$notify({
  694. title: "成功",
  695. message: "修改成功",
  696. type: "success",
  697. duration: 2000
  698. });
  699. this.$refs[formName].resetFields();
  700. this.dialogFormVisible = false;
  701. this.tableData[this.current_index].doctor = response.data.data.solution.doctor;
  702. this.tableData[this.current_index].updated_time = response.data.data.solution.updated_time;
  703. this.tableData[this.current_index].initiate_mode = response.data.data.solution.initiate_mode;
  704. this.current_index = -1;
  705. return false;
  706. }
  707. });
  708. }
  709. });
  710. },
  711. submitNewChildSolution(formName) {
  712. this.$refs[formName].validate(valid=>{
  713. if(valid) {
  714. var createData = {
  715. parent_id: this.childPlan.parent_id,
  716. sub_name: this.childPlan.sub_name,
  717. initiate_mode: this.childPlan.initiate_mode,
  718. doctor:this.childPlan.doctor
  719. }
  720. createChildPatientDialysisSolution(this.patientID,createData).then(response=>{
  721. if (response.data.state == 0) {
  722. this.$message.error(response.data.msg);
  723. return false;
  724. } else {
  725. this.$notify({
  726. title: "成功",
  727. message: "创建成功",
  728. type: "success",
  729. duration: 2000
  730. });
  731. this.$refs[formName].resetFields();
  732. var spliceIndex = -1;
  733. for (let index = this.tableData.length-1; ; index--) {
  734. if(this.tableData[index].parent_id === createData.parent_id) {
  735. spliceIndex = index;
  736. break;
  737. }else if (this.tableData[index].id === createData.parent_id) {
  738. spliceIndex = index;
  739. break;
  740. }
  741. }
  742. if (spliceIndex > -1) {
  743. spliceIndex += 1;
  744. if (spliceIndex === this.tableData.length) {
  745. this.tableData.push(response.data.data.solution);
  746. }else {
  747. var swapData = this.tableData.splice(spliceIndex);
  748. this.tableData.push(response.data.data.solution);
  749. this.tableData = this.tableData.concat(swapData);
  750. }
  751. }
  752. this.dialogFormVisible = false;
  753. return false;
  754. }
  755. });
  756. }
  757. });
  758. },
  759. submitEditSolution(formName){
  760. this.$refs[formName].validate(valid=>{
  761. if(valid) {
  762. editPatientDialysisSolution(this.patientID,this.addPlan.id, this.addPlan).then(response=>{
  763. if (response.data.state == 0) {
  764. this.$message.error(response.data.msg);
  765. return false;
  766. } else {
  767. this.$notify({
  768. title: "成功",
  769. message: "修改成功",
  770. type: "success",
  771. duration: 2000
  772. });
  773. this.$refs[formName].resetFields();
  774. this.dialogVisible = false;
  775. for(var dindex in response.data.data.solution) {
  776. if (dindex == 'id') {
  777. continue;
  778. }
  779. this.tableData[this.current_index][dindex] = response.data.data.solution[dindex];
  780. }
  781. // this.tableData[this.current_index].dialysis_duration = response.data.data.solution.dialysis_duration;
  782. // this.tableData[this.current_index].doctor = response.data.data.solution.doctor;
  783. // this.tableData[this.current_index].updated_time = response.data.data.solution.updated_time;
  784. this.current_index = -1;
  785. return false;
  786. }
  787. });
  788. }
  789. });
  790. },
  791. submitNewSolution(formName){
  792. this.$refs[formName].validate(valid=>{
  793. if(valid) {
  794. createPatientDialysisSolution(this.patientID,this.addPlan).then(response=>{
  795. if (response.data.state == 0) {
  796. this.$message.error(response.data.msg);
  797. return false;
  798. } else {
  799. this.$notify({
  800. title: "成功",
  801. message: "创建成功",
  802. type: "success",
  803. duration: 2000
  804. });
  805. this.$refs[formName].resetFields();
  806. this.dialogVisible = false;
  807. // this.tableData.push(response.data.data.solution);
  808. this.tableData.unshift(response.data.data.solution);
  809. if (this.tableData.length>10) {
  810. this.tableData.pop();
  811. }
  812. this.total += 1;
  813. return false;
  814. }
  815. });
  816. }
  817. });
  818. },
  819. handleEdit(index, row) {
  820. console.log(index, row);
  821. },
  822. handleSizeChange(val) {
  823. this.queryParams.limit = val;
  824. this.fetchPatientDialysisSolutions();
  825. },
  826. handleCurrentChange(val) {
  827. this.queryParams.page = val;
  828. this.fetchPatientDialysisSolutions();
  829. },
  830. openEdit(index, row) {
  831. this.current_index = index;
  832. this.addPlan.id = row.id;
  833. this.addPlan.mode = row.mode_id;
  834. this.addPlan.mode_name = row.mode_name;
  835. this.addPlan.dialyzer = row.dialyzer?row.dialyzer:'';
  836. // this.addPlan.parent_id = row.parent_id
  837. // this.addPlan.type = row.type
  838. // this.addPlan.period = row.period
  839. // this.addPlan.times = row.times
  840. // this.addPlan.initiate_mode = row.initiate_mode
  841. // this.addPlan.doctor = row.doctor
  842. // this.addPlan.first_dialysis = uParseTime(row.first_dialysis, "{y}-{m}-{d}");
  843. // this.addPlanTypeChange();
  844. this.addPlan.dialysis_duration = '' + row.dialysis_duration;
  845. this.addPlan.dialysis_duration_hour = '' + row.dialysis_duration_hour;
  846. this.addPlan.dialysis_duration_minute = '' + row.dialysis_duration_minute;
  847. this.addPlan.hemodialysis_machine = row.hemodialysis_machine;
  848. this.addPlan.perfusion_apparatus = row.perfusion_apparatus;
  849. this.addPlan.blood_flow_volume = row.blood_flow_volume;
  850. this.addPlan.dewater = row.dewater;
  851. this.addPlan.displace_liqui = row.displace_liqui;
  852. this.addPlan.replacement_way = row.replacement_way;
  853. this.addPlan.anticoagulant = row.anticoagulant;
  854. this.addPlan.replacement_total = row.replacement_total;
  855. this.addPlan.anticoagulant_shouji = row.anticoagulant_shouji;
  856. this.addPlan.anticoagulant_weichi = row.anticoagulant_weichi;
  857. this.addPlan.anticoagulant_zongliang = row.anticoagulant_zongliang;
  858. this.addPlan.anticoagulant_gaimingcheng = row.anticoagulant_gaimingcheng;
  859. this.addPlan.anticoagulant_gaijiliang = row.anticoagulant_gaijiliang;
  860. this.addPlan.kalium = row.kalium;
  861. this.addPlan.sodium = row.sodium;
  862. this.addPlan.calcium = row.calcium;
  863. this.addPlan.bicarbonate = row.bicarbonate;
  864. this.addPlan.glucose = row.glucose;
  865. this.addPlan.dry_weight = row.dry_weight;
  866. this.addPlan.dialysate_flow = row.dialysate_flow;
  867. this.addPlan.dialysate_temperature = row.dialysate_temperature;
  868. this.addPlan.conductivity = row.conductivity;
  869. this.addPlan.remark = row.remark;
  870. this.dialogVisible = true;
  871. this.isEdit=true;
  872. this.addPlan.target_ultrafiltration = row.target_ultrafiltration;
  873. this.addPlan.dialysate_formulation = row.dialysate_formulation;
  874. this.dialysisTimeShow = new Date(2018, 1, 1, this.addPlan.dialysis_duration_hour, this.addPlan.dialysis_duration_minute)
  875. },
  876. openNew(){
  877. this.current_index = -1;
  878. this.addPlan = {
  879. mode:"",
  880. mode_name:"",
  881. id:0,
  882. type: 1,
  883. period: "",
  884. times: "",
  885. initiate_mode:"",
  886. doctor: "",
  887. first_dialysis:"",
  888. dialysis_duration: '3.30',
  889. dialysis_duration_hour: '3',
  890. dialysis_duration_minute: '30',
  891. };
  892. this.addPlanTypeChange();
  893. this.dialogVisible = true;
  894. this.isEdit=false;
  895. },
  896. openNewChild(index, row){
  897. this.childPlan = {
  898. mode: row.mode_name,
  899. frequency: row.period + row.times,
  900. name: row.name,
  901. parent_id:row.id,
  902. sub_name: "",
  903. initiate_mode: "",
  904. doctor: ""
  905. }
  906. this.isChildEdit = false;
  907. this.dialogFormVisible = true;
  908. },
  909. openChildEdit(index, row) {
  910. this.childPlan = {
  911. mode: row.mode_name,
  912. frequency: row.period + row.times,
  913. name: row.name,
  914. parent_id:row.parent_id,
  915. id:row.id,
  916. sub_name: row.sub_name,
  917. initiate_mode: row.initiate_mode,
  918. doctor: row.doctor
  919. }
  920. this.current_index = index;
  921. this.isChildEdit = true;
  922. this.dialogFormVisible = true;
  923. },
  924. fetchAllDoctorAndNurse() {
  925. fetchAllDoctorAndNurse().then(response => {
  926. if (response.data.state == 1) {
  927. this.doctorOptions = response.data.data.doctors;
  928. }
  929. });
  930. },
  931. fetchAllAdminUsers() {
  932. fetchAllAdminUsers().then(response => {
  933. if (response.data.state == 1) {
  934. this.adminUserOptions = response.data.data.users;
  935. }
  936. });
  937. },
  938. fetchPatientDialysisSolutions(){
  939. fetchPatientDialysisSolutions(this.queryParams).then(response=>{
  940. if (response.data.state == 1) {
  941. this.tableData = response.data.data.solutions;
  942. this.total = response.data.data.total;
  943. }
  944. });
  945. },
  946. addPlanTypeChange(){
  947. if (this.addPlan.type == 1) {
  948. this.periodOptions = periodWeek;
  949. this.numOptions = numOptionsWeek;
  950. }else {
  951. this.addPlan.type == 2;
  952. this.periodOptions = periodDay;
  953. this.numOptions = numOptionsDay;
  954. }
  955. },
  956. changeThisAnticoagulant(){
  957. var thismode = parseInt(this.addPlan.anticoagulant);
  958. if (isNaN(thismode) || thismode <=0) {
  959. return false;
  960. }
  961. if (typeof(this.anticoagulantsConfit[thismode]) == 'undefined' || this.anticoagulantsConfit[thismode]==null) {
  962. return false;
  963. }
  964. this.anticoagulant = this.anticoagulantsConfit[thismode];
  965. },
  966. addPlanModeChange(){
  967. var thismode = parseInt(this.addPlan.mode);
  968. if (isNaN(thismode) || thismode <=0) {
  969. return false;
  970. }
  971. if (typeof(this.modeOptions[thismode]) == 'undefined' || this.modeOptions[thismode]==null) {
  972. return false;
  973. }
  974. // this.current_model = this.modeOptions[thismode];
  975. this.addPlan.mode_name = this.modeOptions[thismode].name;
  976. },
  977. setCurrentMode(id){
  978. if (typeof(this.modeOptions[id]) == 'undefined' || this.modeOptions[id]==null) {
  979. return false;
  980. }
  981. this.current_model = this.modeOptions[id];
  982. },
  983. getDoctorName(doctorid){
  984. var name = "";
  985. if (this.doctorOptions==null) {
  986. return name;
  987. }
  988. if (typeof(this.doctorOptions.length) == "undefined") {
  989. return name;
  990. }
  991. var leng = this.doctorOptions.length;
  992. if (leng==0) {
  993. return name;
  994. }
  995. for (let index = 0; index < leng; index++) {
  996. if (this.doctorOptions[index].id == doctorid) {
  997. name = this.doctorOptions[index].name;
  998. break;
  999. }
  1000. }
  1001. return name;
  1002. },
  1003. getAdminUserName(id){
  1004. var name = "";
  1005. if (this.adminUserOptions==null) {
  1006. return name;
  1007. }
  1008. if (typeof(this.adminUserOptions.length) == "undefined") {
  1009. return name;
  1010. }
  1011. var leng = this.adminUserOptions.length;
  1012. if (leng==0) {
  1013. return name;
  1014. }
  1015. for (let index = 0; index < leng; index++) {
  1016. if (this.adminUserOptions[index].id == id) {
  1017. name = this.adminUserOptions[index].name;
  1018. break;
  1019. }
  1020. }
  1021. return name;
  1022. }
  1023. },
  1024. created(){
  1025. const id = this.$route.params && this.$route.params.id;
  1026. this.patientID = parseInt(id);
  1027. if (isNaN(this.patientID) || this.patientID <= 0) {
  1028. this.$notify.error({
  1029. title: "错误",
  1030. message: "无效的id"
  1031. });
  1032. this.$router.back(-1);
  1033. }
  1034. this.GetDeviceData();
  1035. this.modeOptions = this.$store.getters.treatment_mode;
  1036. this.anticoagulantsSet = this.$store.getters.anticoagulants_set;
  1037. this.replacementWays = this.$store.getters.replacement_ways;
  1038. this.anticoagulantsConfit = this.$store.getters.anticoagulants_confit;
  1039. this.blood_filters = this.$store.getters.blood_filters;
  1040. this.perfusion_apparatus = this.$store.getters.perfusion_apparatus;
  1041. this.hemodialysis_machines = this.$store.getters.hemodialysis_machines;
  1042. this.dialysate_formulation = this.$store.getters.dialysate_formulation;
  1043. this.queryParams.id = this.patientID;
  1044. // this.fetchAllDoctorAndNurse();
  1045. this.fetchAllAdminUsers();
  1046. this.fetchPatientDialysisSolutions();
  1047. }
  1048. };
  1049. </script>
  1050. <style rel="stylesheet/scss" lang="scss" scoped>
  1051. .Total {
  1052. .sure {
  1053. float: right;
  1054. margin: 5px 10px 0 0;
  1055. }
  1056. .plan {
  1057. font-size: 15px;
  1058. color: #6caef7;
  1059. background: #ecf5ff;
  1060. height: 42px;
  1061. line-height: 42px;
  1062. border: 1px #ebeef5 solid;
  1063. width: 100%;
  1064. padding-left: 15px;
  1065. span {
  1066. margin: 0 20px 0 0;
  1067. }
  1068. }
  1069. .sum {
  1070. border: 1px #ebeef5 solid;
  1071. border-top: none;
  1072. border-bottom: none;
  1073. padding: 10px 0 10px 15px;
  1074. font-size: 15px;
  1075. color: #909399;
  1076. }
  1077. }
  1078. .form-table {
  1079. border: 1px #ebeef5 solid;
  1080. padding-bottom: 20px;
  1081. .el-col-6{
  1082. width: 380px;
  1083. }
  1084. .el-row {
  1085. margin: 0 !important;
  1086. .el-form-item {
  1087. margin-bottom: 12px;
  1088. .el-form-item__content {
  1089. .el-select {
  1090. width: 100%;
  1091. }
  1092. }
  1093. }
  1094. }
  1095. }
  1096. </style>