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

computer_dialog.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <template>
  2. <div>
  3. <el-dialog title="透析上机" class="newDialog" :visible.sync="visible" width="854px" :modal-append-to-body="false">
  4. <div class="warnTxt" v-if="showTxt != ''">{{ showTxt }}</div>
  5. <el-form :model="form" label-width="100px">
  6. <el-form-item label="班次">
  7. <el-select v-model="schedual_type" placeholder="请选择班次" @change="changeSchedualType">
  8. <el-option v-for="(item, index) in schedules_type" :key="index" :value="item.id"
  9. :label="item.name"></el-option>
  10. </el-select>
  11. </el-form-item>
  12. <el-form-item label="上机床位">
  13. <el-select v-model="form.bed_id" placeholder="请选择上机床位">
  14. <el-option v-for="(bed, index) in zone_beds" :key="index" :value="bed.id" :label="bed.number"></el-option>
  15. </el-select>
  16. </el-form-item>
  17. <el-form-item label="上机护士">
  18. <el-select v-model="form.nurse_id" placeholder="请选择上机护士">
  19. <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item label="穿刺护士">
  23. <el-select v-model="form.puncture_nurse_id" placeholder="请选择穿刺护士">
  24. <el-option v-for="(admin, index) in admins" :key="index" :value="admin.id" :label="admin.name"></el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="引血(ml/min)" v-if="template_id == 6">
  28. <el-input type="number" v-model="form.blood_drawing" style="width:200px;"></el-input>
  29. </el-form-item>
  30. <el-form-item label="上机时间 :" style="width:300px">
  31. <el-date-picker
  32. type="datetime"
  33. format="yyyy-MM-dd HH:mm"
  34. value-format="yyyy-MM-dd HH:mm"
  35. placeholder="选择时间"
  36. v-model="form.start_time"
  37. style="width:100%;"
  38. ></el-date-picker>
  39. </el-form-item>
  40. <el-form-item>
  41. <el-button v-if="dialysis_order.id == 0" @click="submit" type="primary" :loading="loading">执行上机</el-button>
  42. <el-button v-else type="info" :disabled="true">已上机</el-button>
  43. <el-button
  44. v-if="dialysis_order.id > 0"
  45. type="primary" @click="editOrder">修改上机
  46. </el-button>
  47. </el-form-item>
  48. </el-form>
  49. </el-dialog>
  50. </div>
  51. </template>
  52. <script>
  53. import { GetSchedualNumber, PostModifyStartDialysis, startDialysis } from '@/api/dialysis_record'
  54. import { parseTime } from '@/utils'
  55. import request from '@/utils/request'
  56. export default {
  57. name: 'ComputerDialog',
  58. data() {
  59. return {
  60. showTxt:'',
  61. hasPermission:true,
  62. zone_beds: [],
  63. visible: false,
  64. loading: false,
  65. template_id: 0,
  66. patient_id: 0,
  67. schedule_date: 0,
  68. start_time: 0,
  69. creator: 0,
  70. form: {
  71. bed_id: '',
  72. nurse_id: '',
  73. start_time: '',
  74. puncture_nurse_id: '',
  75. blood_drawing: 100
  76. },
  77. schedual_type: 0,
  78. schedules_type: [
  79. { id: 1, name: '上午' },
  80. { id: 2, name: '下午' },
  81. { id: 3, name: '晚上' }
  82. ], // 该排班的区里的床位
  83. isPremission: false
  84. }
  85. },
  86. props: {
  87. dialysis_order: {
  88. type: Object
  89. },
  90. schedule: {
  91. type: Object
  92. },
  93. admins: {
  94. type: Array
  95. },
  96. device_numbers: {
  97. type: Array
  98. },
  99. special_premission: {
  100. type: Array
  101. }
  102. }, mounted() {
  103. },
  104. created() {
  105. this.template_id = this.$store.getters.xt_user.template_info.template_id
  106. this.patient_id = this.$route.query.patient_id
  107. this.schedule_date = this.$route.query.date
  108. this.form.nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.start_nurse
  109. this.form.puncture_nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.puncture_nurse
  110. if (this.form.puncture_nurse_id == 0) {
  111. this.form.puncture_nurse_id = this.$store.getters.xt_user.user.id
  112. }
  113. },
  114. watch: {
  115. 'schedule.id': function() {
  116. },
  117. 'dialysis_order.id': function() {
  118. this.form.nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.start_nurse
  119. this.form.puncture_nurse_id = this.dialysis_order.id == 0 ? this.$store.getters.xt_user.user.id : this.dialysis_order.puncture_nurse
  120. var nowDate = new Date()
  121. var nowYear = nowDate.getFullYear()
  122. var nowMonth = nowDate.getMonth() + 1
  123. var nowDay = nowDate.getDate()
  124. var nowHours = nowDate.getHours()
  125. var nowMinutes = nowDate.getMinutes()
  126. var nowSeconds = nowDate.getSeconds()
  127. var time =
  128. nowYear +
  129. '-' +
  130. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  131. '-' +
  132. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
  133. this.form.start_time = this.dialysis_order.id == 0 ? time : this.getTime(this.dialysis_order.start_time, '{y}-{m}-{d} {h}:{i}')
  134. }
  135. },
  136. computed: {},
  137. methods: {
  138. changeSchedualType: function(schedual_type) {
  139. let ParamsQuery = {}
  140. ParamsQuery['schedual_type'] = schedual_type
  141. GetSchedualNumber(ParamsQuery).then(response => {
  142. if (response.data.state == 0) {
  143. return false
  144. } else {
  145. this.temp_device_numbers = response.data.data.number
  146. for (let index = 0; index < this.temp_device_numbers.length; index++) {
  147. const device_number = this.temp_device_numbers[index]
  148. this.temp_device_numbers[index]['number'] = device_number['zone_name'] + '-' + device_number['number']
  149. }
  150. this.zone_beds = this.temp_device_numbers
  151. this.form.bed_id = this.zone_beds[0].id
  152. }
  153. })
  154. },
  155. GetSchedualNumber: function() {
  156. let ParamsQuery = {}
  157. ParamsQuery['schedual_type'] = this.schedual_type
  158. GetSchedualNumber(ParamsQuery).then(response => {
  159. if (response.data.state == 0) {
  160. this.$message.error(response.data.msg)
  161. return false
  162. } else {
  163. this.temp_device_numbers = response.data.data.number
  164. for (let index = 0; index < this.temp_device_numbers.length; index++) {
  165. const device_number = this.temp_device_numbers[index]
  166. this.temp_device_numbers[index]['number'] = device_number['zone_name'] + '-' + device_number['number']
  167. }
  168. this.zone_beds = this.temp_device_numbers
  169. this.form.bed_id = this.dialysis_order.id == 0 ? this.schedule.bed_id : this.dialysis_order.bed_id
  170. if (this.dialysis_order.id == 0) {
  171. let isFilter = true
  172. for (let i = 0; i < this.zone_beds.length; i++) {
  173. if (this.zone_beds[i].id == this.schedule.bed_id) {
  174. isFilter = false
  175. }
  176. }
  177. if (isFilter) {
  178. this.form.bed_id = this.zone_beds[0].id
  179. }
  180. } else {
  181. for (let i = 0; i < this.device_numbers.length; i++) {
  182. if (this.device_numbers[i].id == this.dialysis_order.bed_id) {
  183. let obj = {}
  184. obj = this.device_numbers[i]
  185. if (obj['number'].indexOf(this.device_numbers[i]['zone_name']) == -1) {
  186. obj['number'] = this.device_numbers[i]['zone_name'] + '-' + this.device_numbers[i]['number']
  187. }
  188. this.zone_beds.unshift(obj)
  189. this.zone_beds.sort((a, b) => a.id - b.id)
  190. }
  191. }
  192. }
  193. }
  194. })
  195. },
  196. getTime(value, temp) {
  197. if (value != undefined) {
  198. return parseTime(value, temp)
  199. }
  200. return ''
  201. },
  202. show: function(dialysis) {
  203. this.record = dialysis
  204. console.log("上机",dialysis)
  205. this.getPermission()
  206. this.visible = true
  207. var nowDate = new Date()
  208. var nowYear = nowDate.getFullYear()
  209. var nowMonth = nowDate.getMonth() + 1
  210. var nowDay = nowDate.getDate()
  211. var nowHours = nowDate.getHours()
  212. var nowMinutes = nowDate.getMinutes()
  213. var nowSeconds = nowDate.getSeconds()
  214. if (this.dialysis_order.id != 0) {
  215. this.form.start_time = this.getTime(this.dialysis_order.start_time, '{y}-{m}-{d} {h}:{i}')
  216. } else {
  217. this.form.start_time =
  218. nowYear +
  219. '-' +
  220. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  221. '-' +
  222. (nowDay < 10 ? '0' + nowDay : nowDay) + ' ' + (nowHours < 10 ? '0' + nowHours : nowHours) + ':' + (nowMinutes < 10 ? '0' + nowMinutes : nowMinutes)
  223. }
  224. if (this.dialysis_order.id == 0) {
  225. let now = new Date()
  226. let hour = now.getHours()
  227. if (hour >= 6 && hour < 12) {
  228. this.schedual_type = 1
  229. } else if (hour >= 12 && hour < 18) {
  230. this.schedual_type = 2
  231. } else if (hour >= 18) {
  232. this.schedual_type = 3
  233. }
  234. } else {
  235. this.schedual_type = this.dialysis_order.schedual_type
  236. }
  237. if (this.dialysis_order.id > 0) {
  238. if (this.dialysis_order.creator == 0) {
  239. this.creator = this.dialysis_order.start_nurse
  240. } else {
  241. this.creator = this.dialysis_order.creator
  242. }
  243. }
  244. this.GetSchedualNumber()
  245. },
  246. hide: function() {
  247. this.visible = false
  248. },
  249. submit: function() {
  250. if (this.form.start_time == '' || this.form.start_time == null) {
  251. this.$message.error('开始时间不能为空')
  252. return
  253. }
  254. console.log(this.dialysis_order)
  255. this.loading = true
  256. let mode = '1'
  257. startDialysis(this.patient_id, parseTime(this.schedule_date, '{y}-{m}-{d}'), this.form.nurse_id, this.form.bed_id, this.form.lood_drawing, this.form.puncture_nurse_id, this.form.start_time, this.schedual_type, mode).then(rs => {
  258. this.loading = false
  259. var resp = rs.data
  260. if (resp.state == 1) {
  261. var resp_dialysis_order = resp.data.dialysis_order
  262. var this_order = this.dialysis_order
  263. for (const key in resp_dialysis_order) {
  264. this.$set(this_order, key, resp_dialysis_order[key])
  265. }
  266. this.hide()
  267. this.$emit('monitor', resp.data.monitor)
  268. this.$message.success('上机成功')
  269. } else {
  270. this.$message.error(resp.msg)
  271. }
  272. })
  273. }, editOrder() {
  274. let ParamsQuery = {}
  275. ParamsQuery['schedual_type'] = this.schedual_type
  276. ParamsQuery['id'] = this.dialysis_order.id
  277. ParamsQuery['nurse'] = this.form.nurse_id
  278. ParamsQuery['bed'] = this.form.bed_id
  279. ParamsQuery['start_time'] = this.form.start_time
  280. ParamsQuery['puncture_nurse'] = this.form.puncture_nurse_id
  281. ParamsQuery['mode'] = "2"
  282. if (this.dialysis_order.creator != this.$store.getters.xt_user.user.id) {
  283. ParamsQuery['mode'] = "3"
  284. }
  285. PostModifyStartDialysis(ParamsQuery).then(rs => {
  286. var resp = rs.data
  287. if (resp.state == 1) {
  288. this.$message.success('修改成功')
  289. var resp_dialysis_order = resp.data.dialysis_order
  290. var this_order = this.dialysis_order
  291. for (const key in resp_dialysis_order) {
  292. this.$set(this_order, key, resp_dialysis_order[key])
  293. this.$emit('assessmentAfterDislysis', resp.data.after)
  294. }
  295. } else {
  296. this.$message.error(resp.msg)
  297. }
  298. })
  299. },
  300. getPermission(){
  301. request.get("/api/func_per/get",{
  302. params:{
  303. create_url:"/api/dialysis/start_record?mode=1",
  304. modify_url:"/api/start_dialysis/modify?mode=2",
  305. modify_other_url:"/api/start_dialysis/modify?mode=3",
  306. module:0
  307. }
  308. }).then(res => {
  309. console.log(res)
  310. console.log("上机",this.record)
  311. if(res.data.state == 0){
  312. this.hasPermission = false
  313. }else if(res.data.state == 1){
  314. if(this.record.id != "" && this.record.creater != 0){//有数据
  315. if(this.record.creater == this.$store.getters.xt_user.user.id){//创建人是自己
  316. if(res.data.data.is_has_modify == false){
  317. this.hasPermission = false
  318. this.showTxt = "你没有修改执行上机权限"
  319. }
  320. }else{//创建人不是自己
  321. if(res.data.data.is_has_modify_other == false){
  322. this.hasPermission = false
  323. this.showTxt = "你没有修改他人执行上机权限"
  324. }
  325. }
  326. }else if(this.record.id == "" || this.record.creater == 0){
  327. if(res.data.data.is_has_create == false){
  328. this.hasPermission = false
  329. this.showTxt = "你没有执行上机权限"
  330. }
  331. }
  332. }
  333. })
  334. }
  335. }
  336. }
  337. </script>
  338. <style scoped>
  339. .txsj {
  340. text-align: center;
  341. margin-bottom: 20px;
  342. }
  343. .warnTxt{
  344. text-align: center;
  345. margin: 0 auto;
  346. background: #faa331;
  347. max-width: 240px;
  348. padding: 10px 20px;
  349. border-radius: 4px;
  350. margin-bottom: 10px;
  351. color:#fff;
  352. }
  353. </style>
  354. <style lang="scss">
  355. .newDialog{
  356. .el-dialog__body{
  357. padding: 10px 20px 30px;
  358. }
  359. }
  360. </style>