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

finish_dialog.vue 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. <template>
  2. <div>
  3. <el-dialog title="透析下机" class="newDialog" :visible.sync="visible" width="854px"
  4. :modal = 'false' :close-on-click-modal="false"
  5. >
  6. <!-- <div class="txsj">
  7. </div> -->
  8. <div class="warnTxt" v-if="showTxt != ''">{{ showTxt }}</div>
  9. <el-form :model="form" label-width="100px" ref="form">
  10. <el-form-item label="下机护士" >
  11. <el-select v-model="form.nurse_id" :disabled="!(dialysis_order.id != 0)">
  12. <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item label="下机时间 :" :prop="isName('下机时间')"
  16. :rules="isCheckmust('下机时间')" style="width:275px">
  17. <el-date-picker
  18. type="datetime"
  19. format="yyyy-MM-dd HH:mm"
  20. value-format="yyyy-MM-dd HH:mm"
  21. placeholder="选择时间"
  22. v-model="end_time"
  23. style="width:100%;"
  24. ></el-date-picker>
  25. </el-form-item>
  26. <el-form-item label="穿刺处血肿:" :prop="isName('穿刺处血肿')"
  27. :rules="isCheckmust('穿刺处血肿')" v-if="isShowFiled('穿刺处血肿')" :label-width="150">
  28. <el-radio-group v-model="form.puncture_point_haematoma">
  29. <el-radio :label="1">有</el-radio>
  30. <el-radio :label="2">无</el-radio>
  31. </el-radio-group>
  32. </el-form-item>
  33. <el-form-item label="内瘘: " :prop="isName('内瘘')"
  34. :rules="isCheckmust('内瘘')" v-if="isShowFiled('内瘘')">
  35. <el-input v-model="form.internal_fistula" readonly @focus="showInnerDialog('7')" style="width:200px"></el-input>
  36. </el-form-item>
  37. <el-form-item label="导管: " :prop="isName('导管')"
  38. :rules="isCheckmust('导管')" v-if="isShowFiled('导管')">
  39. <el-input v-model="form.catheter" @focus="showInnerDialog('4')" style="width:200px"></el-input>
  40. </el-form-item>
  41. <el-form-item label="透析器凝血: " :prop="isName('透析器凝血')"
  42. :rules="isCheckmust('透析器凝血')" v-if="isShowFiled('透析器凝血')">
  43. <el-input
  44. style="width:200px"
  45. v-model="form.cruor"
  46. readonly
  47. @focus="showInnerDialog('1')"
  48. ></el-input>
  49. </el-form-item>
  50. <el-form-item label="宣教知识:" :prop="isName('宣教知识')"
  51. :rules="isCheckmust('宣教知识')" v-if="isShowFiled('宣教知识')">
  52. <el-select @change="dialysisAfterTeachSelectChange" v-model="form.mission_id">
  53. <el-option
  54. v-for="(item, index) in education"
  55. :label="item.text"
  56. :value="item.value"
  57. :key="index"
  58. ></el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-row :gutter="20">
  62. <el-col v-if="isShowFiled('宣教知识')">
  63. <el-form-item :prop="isName('宣教知识')"
  64. :rules="isCheckmust('宣教知识')">
  65. <el-input
  66. type="textarea"
  67. v-model="form.mission"
  68. :rows="4"
  69. ></el-input>
  70. </el-form-item>
  71. </el-col>
  72. </el-row>
  73. <el-form-item>
  74. <el-button v-if="(dialysis_order.id != 0 && dialysis_order.stage == 1)" @click="submit('form')" :loading="loading"
  75. type="primary">执行下机
  76. </el-button>
  77. <el-button
  78. v-if="dialysis_order.stage == 2 "
  79. type="primary" @click="modifyFinish('form')">修改下机
  80. </el-button>
  81. </el-form-item>
  82. </el-form>
  83. </el-dialog>
  84. <multi-select-box
  85. :propsForm="InnerDialogProps"
  86. v-on:dialog-comfirm="innerDialogComfirm"
  87. v-on:dialog-cancle="innerDialogCancle"
  88. ></multi-select-box>
  89. <el-dialog
  90. title="提示"
  91. :visible.sync="infoDialogVisible"
  92. width="30%">
  93. <span>
  94. <el-form>
  95. <el-row>
  96. <span>申请日期:</span>
  97. <span>
  98. <el-date-picker
  99. type="datetime"
  100. format="yyyy-MM-dd HH:mm"
  101. value-format="yyyy-MM-dd HH:mm"
  102. placeholder="选择时间"
  103. v-model="selected_date"
  104. ></el-date-picker>
  105. </span>
  106. </el-row>
  107. <el-row>
  108. <span>备注:</span>
  109. <span>
  110. <el-input v-model="remark" style="width:200px"></el-input>
  111. </span>
  112. </el-row>
  113. </el-form>
  114. </span>
  115. <span slot="footer" class="dialog-footer">
  116. <el-button @click="infoDialogVisible = false">取 消</el-button>
  117. <el-button type="primary" @click="saveInformation">确 定</el-button>
  118. </span>
  119. </el-dialog>
  120. </div>
  121. </template>
  122. <script>
  123. import axios from 'axios'
  124. import { finishDialysis,PostModifyFinishDialysis } from '@/api/dialysis_record'
  125. import { saveInformation } from '@/api/dialysis'
  126. import { parseTime } from '@/utils'
  127. import multiSelectBox from './MultiSelectBox'
  128. import request from '@/utils/request'
  129. import store from "@/store";
  130. import { getDataConfig } from '@/utils/data'
  131. export default {
  132. components: {
  133. multiSelectBox
  134. },
  135. name: 'FinishDialog',
  136. data() {
  137. return {
  138. showTxt:'',
  139. hasPermission:true,
  140. visible: false,
  141. loading: false,
  142. creator: 0,
  143. patient_id: 0,
  144. schedule_date: 0,
  145. isPremission:false,
  146. end_time: '',
  147. isVisibility: false,
  148. form: {
  149. nurse_id: 0,
  150. puncture_point_haematoma:2,
  151. internal_fistula:"",
  152. catheter:"",
  153. cruor:"",
  154. mission:"",
  155. mission_id:"",
  156. },
  157. internal_fistula: [],
  158. InnerDialogProps: {
  159. values: [],
  160. visibility: false,
  161. isShowTextArea: true,
  162. customContent: '',
  163. titles: '',
  164. type: '' // 不同弹框类型,用来匹配数据
  165. },
  166. catheter: [],
  167. cruorOptions: [],
  168. required:false,
  169. education:[],
  170. infoDialogVisible:false,
  171. selected_date:"",
  172. pickerOptions: {
  173. disabledDate(time) {
  174. return time.getTime() > Date.now()
  175. }
  176. },
  177. remark:"",
  178. infoDialogVisible:false,
  179. selected_date:"",
  180. }
  181. },
  182. props: {
  183. prescription: { // 透析处方
  184. type: Object,
  185. },
  186. dialysis_order: {
  187. type: Object
  188. },
  189. schedule: {
  190. type: Object
  191. },
  192. admins: {
  193. type: Array
  194. }, special_premission: {
  195. type: Array,
  196. },
  197. patient:{
  198. type: Object
  199. }
  200. },
  201. created() {
  202. this.education = getDataConfig('education', 'education')
  203. this.internal_fistula = getDataConfig('hemodialysis', 'internal_fistula')
  204. this.catheter = getDataConfig('hemodialysis', 'catheter')
  205. this.cruorOptions = getDataConfig('hemodialysis', 'cruor')
  206. },
  207. watch: {
  208. 'dialysis_order.id': function() {
  209. if (this.dialysis_order.id == 0) {
  210. this.form.nurse_id = 0
  211. } else if (this.dialysis_order.stage == 1) {
  212. this.form.nurse_id = this.$store.getters.xt_user.user.id
  213. } else {
  214. console.log("orde32332323232332",this.dialysis_order)
  215. this.form.nurse_id = this.dialysis_order.finish_nurse
  216. this.form.catheter = this.dialysis_order.catheter
  217. this.form.cruor = this.dialysis_order.cruor
  218. this.form.internal_fistula = this.dialysis_order.blood_access_internal_fistula
  219. this.form.puncture_point_haematoma = this.dialysis_order.puncture_point_haematoma
  220. this.form.mission = this.dialysis_order.mission
  221. }
  222. },
  223. patient:{
  224. handler(newVal){
  225. this.patient_id = newVal.id
  226. },
  227. deep:true
  228. }
  229. },
  230. methods: {
  231. isName(name) {
  232. let filedList = store.getters.xt_user.fileds;
  233. for (let i = 0; i < filedList.length; i++) {
  234. if (filedList[i].module == 9 && filedList[i].filed_name_cn == name) {
  235. return filedList[i].filed_name;
  236. }
  237. }
  238. },
  239. isCheckmust(name) {
  240. let filedList = store.getters.xt_user.fileds;
  241. for (let i = 0; i < filedList.length; i++) {
  242. if (
  243. filedList[i].module == 9 &&
  244. filedList[i].filed_name_cn == name &&
  245. filedList[i].is_write == 1
  246. ) {
  247. return [{ required: true ,message:`请输入${name}` }];
  248. }
  249. }
  250. },
  251. dialysisAfterTeachSelectChange: function(values) {
  252. if (this.form.mission == '') {
  253. this.form.mission = values
  254. } else {
  255. if (this.form.mission.indexOf(values) == -1) {
  256. if (
  257. this.form.mission
  258. .charAt(this.form.mission.length - 1)
  259. .indexOf('。') == -1
  260. ) {
  261. this.form.mission =
  262. this.form.mission + ',' + values
  263. } else {
  264. this.form.mission =
  265. this.form.mission + values
  266. }
  267. }
  268. }
  269. },
  270. isShowFiled(name) {
  271. var filedList = store.getters.xt_user.fileds
  272. for (let i = 0; i < filedList.length; i++) {
  273. if (filedList[i].module == 9 && filedList[i].filed_name_cn == name && filedList[i].is_show == 1) {
  274. return true
  275. }
  276. if (filedList[i].module == 9 && filedList[i].filed_name_cn == name && filedList[i].is_write!=undefined && filedList[i].is_write == 1) {
  277. this.required = true
  278. }
  279. }
  280. this.required = false
  281. return false
  282. },
  283. isWrite(name){
  284. var filedList = store.getters.xt_user.fileds
  285. for (let i = 0; i < filedList.length; i++) {
  286. if (filedList[i].module == 9 && filedList[i].filed_name_cn == name && filedList[i].is_write == 1) {
  287. return true
  288. }
  289. }
  290. return false
  291. },
  292. show: function(record) {
  293. this.record = record
  294. console.log("下机",record)
  295. this.getPermission()
  296. this.visible = true
  297. var nowDate = new Date()
  298. var nowYear = nowDate.getFullYear()
  299. var nowMonth = nowDate.getMonth() + 1
  300. var nowDay = nowDate.getDate()
  301. var nowHours = nowDate.getHours()
  302. var nowMinutes = nowDate.getMinutes()
  303. var time =
  304. nowYear +
  305. '-' +
  306. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  307. '-' +
  308. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
  309. if(this.$route.query.patient_id){
  310. this.patient_id = this.$route.query.patient_id
  311. }
  312. this.schedule_date = this.$route.query.date
  313. if (this.dialysis_order.id == 0) {
  314. this.form.nurse_id = 0
  315. } else if (this.dialysis_order.stage == 1) {
  316. this.form.nurse_id = this.$store.getters.xt_user.user.id
  317. } else {
  318. this.form.nurse_id = this.dialysis_order.finish_nurse
  319. }
  320. if (this.dialysis_order.finish_creator > 0) {
  321. for (let i = 0; i < this.special_premission.length; i++) {
  322. if (this.$store.getters.xt_user.user.id == this.special_premission[i].admin_user_id) {
  323. this.isPremission = true
  324. }
  325. }
  326. }
  327. if (this.dialysis_order.finish_creator > 0) {
  328. this.creator = this.dialysis_order.finish_creator
  329. }
  330. if (this.dialysis_order.id == "") {
  331. //没有上下机记录
  332. this.end_time = this.dialysis_order.finish_creator == 0 ? time : this.getTime(this.dialysis_order.end_time, '{y}-{m}-{d} {h}:{i}')
  333. } else {
  334. if (this.dialysis_order.start_time > 0) {
  335. if (this.prescription.id != "") {
  336. let endTime = 0;
  337. endTime =
  338. this.dialysis_order.start_time +
  339. this.prescription.dialysis_duration_hour * 3600 +
  340. this.prescription.dialysis_duration_minute * 60;
  341. this.end_time = parseTime(endTime, "{y}-{m}-{d} {h}:{i}");
  342. } else {
  343. this.end_time =
  344. parseTime(Date.parse(new Date()) / 1000, "{y}-{m}-{d} {h}:{i}")
  345. }
  346. if (this.dialysis_order.end_time > 0) {
  347. this.end_time =
  348. parseTime(this.dialysis_order.end_time, "{y}-{m}-{d} {h}:{i}");
  349. }
  350. } else {
  351. this.end_time = this.dialysis_order.finish_creator == 0 ? time : this.getTime(this.dialysis_order.end_time, '{y}-{m}-{d} {h}:{i}')
  352. }
  353. }
  354. },
  355. hide: function() {
  356. this.visible = false
  357. },
  358. modifyFinish:function(formName){
  359. this.$refs[formName].validate(valid=>{
  360. if(valid){
  361. if(this.isWrite("穿刺处血肿") == true && this.form.puncture_point_haematoma == ""){
  362. this.$message.error("请选择穿刺处血肿")
  363. return
  364. }
  365. if(this.isWrite("内瘘") == true && this.form.internal_fistula == ""){
  366. this.$message.error("请选择内瘘")
  367. return
  368. }
  369. if(this.isWrite("导管") == true && this.form.catheter == ""){
  370. this.$message.error("请选择导管")
  371. return
  372. }
  373. if(this.isWrite("透析器凝血") == true && this.form.cruor == ""){
  374. this.$message.error("请选择透析器凝血")
  375. return
  376. }
  377. let ParamsQuery = {};
  378. ParamsQuery["id"] = this.dialysis_order.id;
  379. ParamsQuery["nurse"] = this.form.nurse_id;
  380. ParamsQuery["end_time"] = this.end_time;
  381. ParamsQuery["mode"] = "2"
  382. ParamsQuery["puncture_point_haematoma"] = parseInt(this.form.puncture_point_haematoma)
  383. ParamsQuery["internal_fistula"] = this.form.internal_fistula
  384. ParamsQuery["catheter"] = this.form.catheter
  385. ParamsQuery["cruor"] = this.form.cruor
  386. ParamsQuery["mission"] = this.form.mission
  387. ParamsQuery["mission_id"] = this.form.mission_id
  388. if(this.dialysis_order.finish_creator != this.$store.getters.xt_user.user.id){
  389. ParamsQuery["mode"] = "3"
  390. }
  391. PostModifyFinishDialysis(ParamsQuery).then(response => {
  392. if (response.data.state == 0) {
  393. this.$message.error(response.data.msg)
  394. if(response.data.code == 600000008){
  395. this.infoDialogVisible = true
  396. }
  397. return false;
  398. } else {
  399. this.$message.success("修改成功")
  400. var record = this.dialysis_order;
  401. for (const key in response.data.data.dialysis_order) {
  402. this.$set(record, key, response.data.data.dialysis_order[key]);
  403. }
  404. console.log(response.data.data.after)
  405. this.$emit('assessmentAfterDislysis', response.data.data.after)
  406. }
  407. });
  408. }
  409. })
  410. },
  411. submit: function(formName) {
  412. this.$refs[formName].validate(valid=>{
  413. if(valid){
  414. if(this.isWrite("穿刺处血肿") == true && this.form.puncture_point_haematoma == ""){
  415. this.$message.error("请选择穿刺处血肿")
  416. return
  417. }
  418. if(this.isWrite("内瘘") == true && this.form.internal_fistula == ""){
  419. this.$message.error("请选择内瘘")
  420. return
  421. }
  422. if(this.isWrite("导管") == true && this.form.catheter == ""){
  423. this.$message.error("请选择导管")
  424. return
  425. }
  426. if(this.isWrite("透析器凝血") == true && this.form.cruor == ""){
  427. this.$message.error("请选择透析器凝血")
  428. return
  429. }
  430. this.loading = true
  431. let mode = "1"
  432. console.log("fomr",this.form.mission_id)
  433. finishDialysis(this.patient_id,this.schedule_date ? parseTime(this.schedule_date, '{y}-{m}-{d}') : parseTime(new Date(), '{y}-{m}-{d}'), this.end_time, this.form.nurse_id,mode,parseInt(this.form.puncture_point_haematoma),this.form.internal_fistula,this.form.catheter,this.form.cruor,this.form.mission,this.form.mission_id).then(rs => {
  434. this.loading = false
  435. var resp = rs.data
  436. if (resp.state == 1) {
  437. var dialysis_order = resp.data.dialysis_order
  438. var this_order = this.dialysis_order
  439. for (const key in dialysis_order) {
  440. this.$set(this_order, key, dialysis_order[key])
  441. }
  442. let orgId = parseInt(sessionStorage.getItem("org_id"));
  443. this.hide()
  444. this.$emit('assessmentAfterDislysis', resp.data.assessmentAfterDislysis)
  445. } else {
  446. this.$message.error(resp.msg)
  447. if(response.code == 600000008){
  448. this.infoDialogVisible = true
  449. }
  450. }
  451. })
  452. }else{
  453. return false
  454. }
  455. })
  456. }, getTime(value, temp) {
  457. if (value != undefined) {
  458. return parseTime(value, temp)
  459. }
  460. return ''
  461. },
  462. getPermission(){
  463. request.get("/api/func_per/get",{
  464. params:{
  465. create_url:"/api/dialysis/finish?mode=1",
  466. modify_url:"/api/finish_dialysis/modify?mode=2",
  467. modify_other_url:"/api/finish_dialysis/modify?mode=3",
  468. module:6
  469. }
  470. }).then(res => {
  471. if(res.data.state == 0){
  472. this.hasPermission = false
  473. }else if(res.data.state == 1){
  474. if(this.record.id != "" && this.record.creater != 0){//有数据
  475. if(this.record.creater == this.$store.getters.xt_user.user.id){//创建人是自己
  476. if(res.data.data.is_has_modify == false){
  477. this.hasPermission = false
  478. this.showTxt = "你没有修改执行下机权限"
  479. }
  480. }else{//创建人不是自己
  481. if(res.data.data.is_has_modify_other == false){
  482. this.hasPermission = false
  483. this.showTxt = "你没有修改他人执行下机权限"
  484. }
  485. }
  486. }else if(this.record.id == "" || this.record.creater == 0){
  487. if(res.data.data.is_has_create == false){
  488. this.hasPermission = false
  489. this.showTxt = "你没有执行下机权限"
  490. }
  491. }
  492. }
  493. })
  494. },
  495. showInnerDialog: function(val) {
  496. this.InnerDialogProps.visibility = true
  497. switch (val) {
  498. case '7': // 内瘘
  499. this.InnerDialogProps.values = this.internal_fistula
  500. this.InnerDialogProps.titles = '内瘘'
  501. this.InnerDialogProps.type = 'internal_fistula'
  502. this.InnerDialogProps.selected = this.form.internal_fistula
  503. this.InnerDialogProps.isShowTextArea = false
  504. break
  505. case '4': // 导管
  506. this.InnerDialogProps.values = this.catheter
  507. this.InnerDialogProps.titles = '导管'
  508. this.InnerDialogProps.type = 'catheter'
  509. this.InnerDialogProps.selected = this.form.catheter
  510. this.InnerDialogProps.isShowTextArea = false
  511. break
  512. case '1':
  513. this.InnerDialogProps.values = this.cruorOptions
  514. this.InnerDialogProps.titles = '凝血'
  515. this.InnerDialogProps.type = 'cruor'
  516. this.InnerDialogProps.selected = this.form.cruor
  517. this.InnerDialogProps.isShowTextArea = false
  518. break
  519. }
  520. },
  521. innerDialogComfirm: function(val) {
  522. this.InnerDialogProps.visibility = false
  523. switch (val.type) {
  524. case 'internal_fistula':
  525. this.form.internal_fistula = val.value.join(',')
  526. break
  527. case 'catheter':
  528. this.form.catheter = val.value.join(',')
  529. break
  530. case 'cruor':
  531. this.form.cruor = val.value.join(',')
  532. break
  533. }
  534. },
  535. innerDialogCancle: function() {
  536. this.InnerDialogProps.visibility = false
  537. },
  538. saveInformation(){
  539. var params = {
  540. selected_date:this.selected_date,
  541. patient_id:this.$route.query.patient_id,
  542. record_date:this.$route.query.date,
  543. module:8,
  544. remark:this.remark,
  545. }
  546. saveInformation(params).then(response=>{
  547. if(response.data.state == 1){
  548. var information = response.data.data.information
  549. this.$message.success("提交成功!")
  550. this.infoDialogVisible = false
  551. }
  552. })
  553. }
  554. }
  555. }
  556. </script>
  557. <style scoped>
  558. .txsj {
  559. text-align: center;
  560. margin-bottom: 20px;
  561. }
  562. .warnTxt{
  563. text-align: center;
  564. margin: 0 auto;
  565. background: #faa331;
  566. max-width: 240px;
  567. padding: 10px 20px;
  568. border-radius: 4px;
  569. margin-bottom: 10px;
  570. color:#fff;
  571. }
  572. </style>
  573. <style lang="scss">
  574. .newDialog{
  575. .el-dialog__body{
  576. padding: 10px 20px 30px;
  577. }
  578. }
  579. </style>