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

index.vue 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <el-dialog title="设置" :visible.sync="visibility" :close-on-click-modal="isClose"
  3. :close-on-press-escape="isClose">
  4. <div style="text-align: center;">
  5. <div>
  6. <el-button type="primary" v-if="!is_open" @click="changeOpen(1)">启用自动扣减</el-button>
  7. <el-button type="danger" v-if="is_open" @click="changeOpen(2)">关闭自动扣减</el-button>
  8. <div style="margin-top: 40px;"><p style="color:#909399;text-align: center;">
  9. 启用“药品管理”后,在开透析医嘱时,医生可以选择药品后将自动产生出库单</p></div>
  10. </div>
  11. </div>
  12. <span slot="footer" class="dialog-footer">
  13. <el-button @click="hide()">取 消</el-button>
  14. </span>
  15. </el-dialog>
  16. </template>
  17. <script>
  18. import { createDrugStockAutomaticReduceConfig, getDrugStockAutomaticReduceConfig } from '@/api/drug/drug_stock'
  19. export default {
  20. name: 'settingDialog',
  21. data() {
  22. return {
  23. is_open: false,
  24. visibility: false,
  25. isClose: false
  26. }
  27. },
  28. props: {
  29. propForm: {
  30. type: Object
  31. }
  32. },
  33. methods: {
  34. hide: function() {
  35. this.visibility = false
  36. },
  37. show: function() {
  38. this.getConfig()
  39. this.visibility = true
  40. }, changeOpen(val) {
  41. var message = ''
  42. if (val == 1) {
  43. message = '启用药品自动扣减功能'
  44. } else {
  45. message = '关闭药品自动扣减功能'
  46. }
  47. this.$confirm(message, '提示', {
  48. confirmButtonText: '确定',
  49. cancelButtonText: '取消',
  50. type: 'info'
  51. }).then(() => {
  52. createDrugStockAutomaticReduceConfig(val).then(response => {
  53. if (response.data.state == 0) {
  54. this.$message.error(response.data.msg)
  55. return false
  56. } else {
  57. if (response.data.data.is_open == 1) {
  58. this.is_open = true
  59. this.$message({
  60. type: 'success',
  61. message: '已启用'
  62. })
  63. } else {
  64. this.is_open = false
  65. this.$message({
  66. type: 'success',
  67. message: '已关闭'
  68. })
  69. }
  70. }
  71. })
  72. }).catch(() => {
  73. })
  74. },
  75. getConfig() {
  76. getDrugStockAutomaticReduceConfig().then(response => {
  77. if (response.data.state == 0) {
  78. this.$message.error(response.data.msg)
  79. return false
  80. } else {
  81. var config = response.data.data.config
  82. if (config.is_open == 1) {
  83. this.is_open = true
  84. } else {
  85. this.is_open = false
  86. }
  87. }
  88. })
  89. }
  90. }
  91. }
  92. </script>
  93. <style scoped>
  94. </style>