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

finish_dialog.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. <template>
  2. <div>
  3. <el-dialog title="透析下机" class="newDialog" :visible.sync="visible" width="854px" :modal-append-to-body="false">
  4. <!-- <div class="txsj">
  5. </div> -->
  6. <div class="warnTxt" v-if="showTxt != ''">{{ showTxt }}</div>
  7. <el-form :model="form" label-width="100px">
  8. <el-form-item label="下机护士">
  9. <el-select v-model="form.nurse_id" :disabled="!(dialysis_order.id != 0)">
  10. <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
  11. </el-select>
  12. </el-form-item>
  13. <el-form-item label="下机时间 :" style="width:275px">
  14. <el-date-picker
  15. type="datetime"
  16. format="yyyy-MM-dd HH:mm"
  17. value-format="yyyy-MM-dd HH:mm"
  18. placeholder="选择时间"
  19. v-model="end_time"
  20. style="width:100%;"
  21. ></el-date-picker>
  22. </el-form-item>
  23. <el-form-item label="穿刺处血肿:" v-if="isShowFiled('穿刺处血肿')" :label-width="150">
  24. <el-radio-group v-model="form.puncture_point_haematoma">
  25. <el-radio :label="1">有</el-radio>
  26. <el-radio :label="2">无</el-radio>
  27. </el-radio-group>
  28. </el-form-item>
  29. <el-form-item label="内瘘: " v-if="isShowFiled('内瘘')">
  30. <el-input v-model="form.internal_fistula" readonly @focus="showInnerDialog('7')" style="width:200px"></el-input>
  31. </el-form-item>
  32. <el-form-item label="导管: " v-if="isShowFiled('导管')">
  33. <el-input v-model="form.catheter" @focus="showInnerDialog('4')" style="width:200px"></el-input>
  34. </el-form-item>
  35. <el-form-item label="透析器凝血: " v-if="isShowFiled('透析器凝血')">
  36. <el-input
  37. style="width:200px"
  38. v-model="form.cruor"
  39. readonly
  40. @focus="showInnerDialog('1')"
  41. ></el-input>
  42. </el-form-item>
  43. <el-form-item>
  44. <el-button v-if="(dialysis_order.id != 0 && dialysis_order.stage == 1)" @click="submit" :loading="loading"
  45. type="primary">执行下机
  46. </el-button>
  47. <el-button
  48. v-if="dialysis_order.stage == 2 "
  49. type="primary" @click="modifyFinish">修改下机
  50. </el-button>
  51. </el-form-item>
  52. </el-form>
  53. </el-dialog>
  54. <multi-select-box
  55. :propsForm="InnerDialogProps"
  56. v-on:dialog-comfirm="innerDialogComfirm"
  57. v-on:dialog-cancle="innerDialogCancle"
  58. ></multi-select-box>
  59. </div>
  60. </template>
  61. <script>
  62. import axios from 'axios'
  63. import { finishDialysis,PostModifyFinishDialysis } from '@/api/dialysis_record'
  64. import { parseTime } from '@/utils'
  65. import multiSelectBox from './MultiSelectBox'
  66. import request from '@/utils/request'
  67. import store from "@/store";
  68. import { getDataConfig } from '@/utils/data'
  69. export default {
  70. components: {
  71. multiSelectBox
  72. },
  73. name: 'FinishDialog',
  74. data() {
  75. return {
  76. showTxt:'',
  77. hasPermission:true,
  78. visible: false,
  79. loading: false,
  80. creator: 0,
  81. patient_id: 0,
  82. schedule_date: 0,
  83. isPremission:false,
  84. end_time: '',
  85. isVisibility: false,
  86. form: {
  87. nurse_id: 0,
  88. puncture_point_haematoma:2,
  89. internal_fistula:"",
  90. catheter:"",
  91. cruor:"",
  92. },
  93. internal_fistula: [],
  94. InnerDialogProps: {
  95. values: [],
  96. visibility: false,
  97. isShowTextArea: true,
  98. customContent: '',
  99. titles: '',
  100. type: '' // 不同弹框类型,用来匹配数据
  101. },
  102. catheter: [],
  103. cruorOptions: [],
  104. }
  105. },
  106. props: {
  107. prescription: { // 透析处方
  108. type: Object,
  109. },
  110. dialysis_order: {
  111. type: Object
  112. },
  113. schedule: {
  114. type: Object
  115. },
  116. admins: {
  117. type: Array
  118. }, special_premission: {
  119. type: Array,
  120. },
  121. patient:{
  122. type: Object
  123. }
  124. },
  125. created() {
  126. this.internal_fistula = getDataConfig('hemodialysis', 'internal_fistula')
  127. this.catheter = getDataConfig('hemodialysis', 'catheter')
  128. this.cruorOptions = getDataConfig('hemodialysis', 'cruor')
  129. },
  130. watch: {
  131. 'dialysis_order.id': function() {
  132. if (this.dialysis_order.id == 0) {
  133. this.form.nurse_id = 0
  134. } else if (this.dialysis_order.stage == 1) {
  135. this.form.nurse_id = this.$store.getters.xt_user.user.id
  136. } else {
  137. console.log("orde32332323232332",this.dialysis_order)
  138. this.form.nurse_id = this.dialysis_order.finish_nurse
  139. this.form.catheter = this.dialysis_order.catheter
  140. this.form.cruor = this.dialysis_order.cruor
  141. this.form.internal_fistula = this.dialysis_order.blood_access_internal_fistula
  142. this.form.puncture_point_haematoma = this.dialysis_order.puncture_point_haematoma
  143. }
  144. },
  145. patient:{
  146. handler(newVal){
  147. this.patient_id = newVal.id
  148. },
  149. deep:true
  150. }
  151. },
  152. methods: {
  153. isShowFiled(name) {
  154. var filedList = store.getters.xt_user.fileds
  155. for (let i = 0; i < filedList.length; i++) {
  156. if (filedList[i].module == 9 && filedList[i].filed_name_cn == name && filedList[i].is_show == 1) {
  157. return true
  158. }
  159. }
  160. return false
  161. },
  162. show: function(record) {
  163. this.record = record
  164. console.log("下机",record)
  165. this.getPermission()
  166. this.visible = true
  167. var nowDate = new Date()
  168. var nowYear = nowDate.getFullYear()
  169. var nowMonth = nowDate.getMonth() + 1
  170. var nowDay = nowDate.getDate()
  171. var nowHours = nowDate.getHours()
  172. var nowMinutes = nowDate.getMinutes()
  173. var time =
  174. nowYear +
  175. '-' +
  176. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  177. '-' +
  178. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
  179. if(this.$route.query.patient_id){
  180. this.patient_id = this.$route.query.patient_id
  181. }
  182. this.schedule_date = this.$route.query.date
  183. if (this.dialysis_order.id == 0) {
  184. this.form.nurse_id = 0
  185. } else if (this.dialysis_order.stage == 1) {
  186. this.form.nurse_id = this.$store.getters.xt_user.user.id
  187. } else {
  188. this.form.nurse_id = this.dialysis_order.finish_nurse
  189. }
  190. if (this.dialysis_order.finish_creator > 0) {
  191. for (let i = 0; i < this.special_premission.length; i++) {
  192. if (this.$store.getters.xt_user.user.id == this.special_premission[i].admin_user_id) {
  193. this.isPremission = true
  194. }
  195. }
  196. }
  197. if (this.dialysis_order.finish_creator > 0) {
  198. this.creator = this.dialysis_order.finish_creator
  199. }
  200. if (this.dialysis_order.id == "") {
  201. //没有上下机记录
  202. this.end_time = this.dialysis_order.finish_creator == 0 ? time : this.getTime(this.dialysis_order.end_time, '{y}-{m}-{d} {h}:{i}')
  203. } else {
  204. if (this.dialysis_order.start_time > 0) {
  205. if (this.prescription.id != "") {
  206. let endTime = 0;
  207. endTime =
  208. this.dialysis_order.start_time +
  209. this.prescription.dialysis_duration_hour * 3600 +
  210. this.prescription.dialysis_duration_minute * 60;
  211. this.end_time = parseTime(endTime, "{y}-{m}-{d} {h}:{i}");
  212. } else {
  213. this.end_time =
  214. parseTime(Date.parse(new Date()) / 1000, "{y}-{m}-{d} {h}:{i}")
  215. }
  216. if (this.dialysis_order.end_time > 0) {
  217. this.end_time =
  218. parseTime(this.dialysis_order.end_time, "{y}-{m}-{d} {h}:{i}");
  219. }
  220. } else {
  221. this.end_time = this.dialysis_order.finish_creator == 0 ? time : this.getTime(this.dialysis_order.end_time, '{y}-{m}-{d} {h}:{i}')
  222. }
  223. }
  224. },
  225. hide: function() {
  226. this.visible = false
  227. },
  228. modifyFinish:function(){
  229. let ParamsQuery = {};
  230. ParamsQuery["id"] = this.dialysis_order.id;
  231. ParamsQuery["nurse"] = this.form.nurse_id;
  232. ParamsQuery["end_time"] = this.end_time;
  233. ParamsQuery["mode"] = "2"
  234. ParamsQuery["puncture_point_haematoma"] = parseInt(this.form.puncture_point_haematoma)
  235. ParamsQuery["internal_fistula"] = this.form.internal_fistula
  236. ParamsQuery["catheter"] = this.form.catheter
  237. ParamsQuery["cruor"] = this.form.cruor
  238. if(this.dialysis_order.finish_creator != this.$store.getters.xt_user.user.id){
  239. ParamsQuery["mode"] = "3"
  240. }
  241. PostModifyFinishDialysis(ParamsQuery).then(response => {
  242. if (response.data.state == 0) {
  243. this.$message.error(response.data.msg)
  244. return false;
  245. } else {
  246. this.$message.success("修改成功")
  247. var record = this.dialysis_order;
  248. for (const key in response.data.data.dialysis_order) {
  249. this.$set(record, key, response.data.data.dialysis_order[key]);
  250. }
  251. console.log(response.data.data.after)
  252. this.$emit('assessmentAfterDislysis', response.data.data.after)
  253. }
  254. });
  255. },
  256. submit: function() {
  257. this.loading = true
  258. let mode = "1"
  259. 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).then(rs => {
  260. this.loading = false
  261. var resp = rs.data
  262. if (resp.state == 1) {
  263. var dialysis_order = resp.data.dialysis_order
  264. var this_order = this.dialysis_order
  265. for (const key in dialysis_order) {
  266. this.$set(this_order, key, dialysis_order[key])
  267. }
  268. let orgId = parseInt(sessionStorage.getItem("org_id"));
  269. this.hide()
  270. this.$emit('assessmentAfterDislysis', resp.data.assessmentAfterDislysis)
  271. } else {
  272. this.$message.error(resp.msg)
  273. }
  274. })
  275. }, getTime(value, temp) {
  276. if (value != undefined) {
  277. return parseTime(value, temp)
  278. }
  279. return ''
  280. },
  281. getPermission(){
  282. request.get("/api/func_per/get",{
  283. params:{
  284. create_url:"/api/dialysis/finish?mode=1",
  285. modify_url:"/api/finish_dialysis/modify?mode=2",
  286. modify_other_url:"/api/finish_dialysis/modify?mode=3",
  287. module:6
  288. }
  289. }).then(res => {
  290. if(res.data.state == 0){
  291. this.hasPermission = false
  292. }else if(res.data.state == 1){
  293. if(this.record.id != "" && this.record.creater != 0){//有数据
  294. if(this.record.creater == this.$store.getters.xt_user.user.id){//创建人是自己
  295. if(res.data.data.is_has_modify == false){
  296. this.hasPermission = false
  297. this.showTxt = "你没有修改执行下机权限"
  298. }
  299. }else{//创建人不是自己
  300. if(res.data.data.is_has_modify_other == false){
  301. this.hasPermission = false
  302. this.showTxt = "你没有修改他人执行下机权限"
  303. }
  304. }
  305. }else if(this.record.id == "" || this.record.creater == 0){
  306. if(res.data.data.is_has_create == false){
  307. this.hasPermission = false
  308. this.showTxt = "你没有执行下机权限"
  309. }
  310. }
  311. }
  312. })
  313. },
  314. showInnerDialog: function(val) {
  315. this.InnerDialogProps.visibility = true
  316. switch (val) {
  317. case '7': // 内瘘
  318. this.InnerDialogProps.values = this.internal_fistula
  319. this.InnerDialogProps.titles = '内瘘'
  320. this.InnerDialogProps.type = 'internal_fistula'
  321. this.InnerDialogProps.selected = this.form.internal_fistula
  322. this.InnerDialogProps.isShowTextArea = false
  323. break
  324. case '4': // 导管
  325. this.InnerDialogProps.values = this.catheter
  326. this.InnerDialogProps.titles = '导管'
  327. this.InnerDialogProps.type = 'catheter'
  328. this.InnerDialogProps.selected = this.form.catheter
  329. this.InnerDialogProps.isShowTextArea = false
  330. break
  331. case '1':
  332. this.InnerDialogProps.values = this.cruorOptions
  333. this.InnerDialogProps.titles = '凝血'
  334. this.InnerDialogProps.type = 'cruor'
  335. this.InnerDialogProps.selected = this.form.cruor
  336. this.InnerDialogProps.isShowTextArea = false
  337. break
  338. }
  339. },
  340. innerDialogComfirm: function(val) {
  341. this.InnerDialogProps.visibility = false
  342. switch (val.type) {
  343. case 'internal_fistula':
  344. this.form.internal_fistula = val.value.join(',')
  345. break
  346. case 'catheter':
  347. this.form.catheter = val.value.join(',')
  348. break
  349. case 'cruor':
  350. this.form.cruor = val.value.join(',')
  351. break
  352. }
  353. },
  354. innerDialogCancle: function() {
  355. this.InnerDialogProps.visibility = false
  356. },
  357. }
  358. }
  359. </script>
  360. <style scoped>
  361. .txsj {
  362. text-align: center;
  363. margin-bottom: 20px;
  364. }
  365. .warnTxt{
  366. text-align: center;
  367. margin: 0 auto;
  368. background: #faa331;
  369. max-width: 240px;
  370. padding: 10px 20px;
  371. border-radius: 4px;
  372. margin-bottom: 10px;
  373. color:#fff;
  374. }
  375. </style>
  376. <style lang="scss">
  377. .newDialog{
  378. .el-dialog__body{
  379. padding: 10px 20px 30px;
  380. }
  381. }
  382. </style>