Reassign.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div v-if="permission">
  3. <div class="med-container">
  4. <label class="med-item">Assigned</label>
  5. <span class="med-item">
  6. <span class="med-state">{{ assignTo }}</span>
  7. <button class="btn btn-primary btn-xs" @click="toggleForm()">
  8. Reassign ✔
  9. </button>
  10. </span>
  11. </div>
  12. <div v-if="show" class="med-container">
  13. <form class="med-row">
  14. <select class="form-control" required>
  15. <option value="">---Choose---</option>
  16. <option value="1">&#40;None&#41;</option>
  17. </select>
  18. <button class="btn btn-lg btn-primary btn-block">
  19. Click to confirm
  20. </button>
  21. </form>
  22. </div>
  23. </div>
  24. <div v-else>
  25. <p>Assigned: {{ assignTo }}</p>
  26. </div>
  27. </template>
  28. <script>
  29. export default {
  30. name: "Reassign",
  31. props: ["assignTo", "permission"],
  32. data() {
  33. return {
  34. show: false
  35. };
  36. },
  37. methods: {
  38. toggleForm: function() {
  39. if (this.show) {
  40. this.show = false;
  41. } else {
  42. this.show = true;
  43. }
  44. }
  45. }
  46. };
  47. </script>
  48. <style scoped>
  49. .med-container {
  50. display: flex;
  51. flex-wrap: wrap;
  52. justify-content: space-between;
  53. background-color: #eeeeee;
  54. }
  55. .med-item {
  56. width: 40%;
  57. margin-bottom: 2%;
  58. }
  59. .med-item + .med-item,
  60. .med-state + button {
  61. margin-left: 2%;
  62. }
  63. select {
  64. margin-bottom: 2%;
  65. }
  66. .med-row {
  67. width: 100%;
  68. margin-bottom: 2%;
  69. }
  70. </style>