LLEdit.vue 3.58 KB
Newer Older
Andrzej Obracaj's avatar
Andrzej Obracaj committed
1
<template>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
2
3
4
5
6
7
8
  <l-modal
    :showing="showing"
    text="Responsible Authorities"
    icon="edit"
    color="bg-orange-500"
    @close="close"
  >
Andrzej Obracaj's avatar
Andrzej Obracaj committed
9
10
    <div class="w-full text-xs" v-if="editObj.id">
      <div class="w-full flex mb-4">
Andrzej Obracaj's avatar
Andrzej Obracaj committed
11
        <div class="w-1/2 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
12
13
14
          <b>Id</b>
          <br />
          <l-input
15
            placeholder="Enter unique Id"
Andrzej Obracaj's avatar
bug    
Andrzej Obracaj committed
16
            v-model="editObj.id"
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
17
18
19
            inputClass="text-2xs"
            :disabled="true"
          ></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
20
        </div>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
21
        <div class="w-1/2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
22
23
          <b>Name</b>
          <br />
24
          <l-input placeholder="Enter 'Name' (text)" v-model="editObj.name" inputClass="text-2xs"></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
25
26
        </div>
      </div>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
27
      <div class="w-full flex mb-4">
Andrzej Obracaj's avatar
Andrzej Obracaj committed
28
        <div class="w-1/2 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
29
30
31
          <b>Locator</b>
          <br />
          <l-input
32
            placeholder="Enter 'Locator' (text)"
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
33
34
35
            v-model="editObj.locator"
            inputClass="text-2xs"
          ></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
36
37
        </div>
        <div class="w-1/2 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
38
39
40
          <b>Address</b>
          <br />
          <l-input
41
            placeholder="Enter 'Address' (text)"
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
42
43
44
            v-model="editObj.address"
            inputClass="text-2xs"
          ></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
45
46
        </div>
      </div>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
47
      <div class="w-full flex mb-4">
Andrzej Obracaj's avatar
Andrzej Obracaj committed
48
        <div class="w-1/2 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
49
50
51
          <b>Postcode</b>
          <br />
          <l-input
52
            placeholder="Enter 'Postcode'"
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
53
54
55
            v-model="editObj.postcode"
            inputClass="text-2xs"
          ></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
56
57
        </div>
        <div class="w-1/2 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
58
59
60
          <b>Organisation</b>
          <br />
          <l-input
61
            placeholder="Enter 'Organisation' (text)"
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
62
63
64
            v-model="editObj.organisation"
            inputClass="text-2xs"
          ></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
65
66
        </div>
      </div>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
67
      <div class="w-full flex mb-4">
Andrzej Obracaj's avatar
Andrzej Obracaj committed
68
        <div class="w-1/2 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
69
70
71
          <b>Website</b>
          <br />
          <l-input
72
            placeholder="Enter 'Website' (text)"
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
73
74
75
            v-model="editObj.website"
            inputClass="text-2xs"
          ></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
76
77
        </div>
        <div class="w-1/2 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
78
79
          <b>Email</b>
          <br />
80
          <l-input placeholder="Enter 'Email' (text)" v-model="editObj.email" inputClass="text-2xs"></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
81
82
        </div>
      </div>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
83
      <div class="w-full flex mb-4">
Andrzej Obracaj's avatar
Andrzej Obracaj committed
84
        <div class="w-1/2 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
85
86
          <b>Phone</b>
          <br />
87
          <l-input placeholder="Enter 'Phone' (text)" v-model="editObj.phone" inputClass="text-2xs"></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
88
89
        </div>
        <div class="w-1/2 mr-2">
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
90
91
92
          <b>Is Responsible Reporter</b>
          <br />
          <l-input
93
            placeholder="Enter 'Is Responsible Reporter' ('true' or 'false')"
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
94
95
96
            v-model="editObj.is_responsible_reporter"
            inputClass="text-2xs"
          ></l-input>
Andrzej Obracaj's avatar
Andrzej Obracaj committed
97
98
        </div>
      </div>
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
99

Andrzej Obracaj's avatar
Andrzej Obracaj committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
      <div class="flex w-full justify-between">
        <l-button type="success" @click="onSave">Save changes</l-button>
        <l-button type="danger" @click="close">Cancel</l-button>
      </div>
    </div>
  </l-modal>
</template>

<script>
import LModal from "@/components/LModal";
import { LInput, LButton, LSelect, LOption } from "@/components/forms";

export default {
  name: "LLEdit",
  props: ["showing", "stations", "selected"],
  components: {
    LModal,
    LInput,
    LButton,
    LSelect,
    LOption
  },
  computed: {
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
123
    editObj: function() {
Andrzej Obracaj's avatar
Andrzej Obracaj committed
124
125
126
      return Object.assign({}, this.selected);
    }
  },
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
127
  methods: {
Andrzej Obracaj's avatar
Andrzej Obracaj committed
128
129
130
    close() {
      this.$emit("close");
    },
Rune Åvar Ødegård's avatar
Rune Åvar Ødegård committed
131
    onSave() {
Andrzej Obracaj's avatar
Andrzej Obracaj committed
132
133
134
135
136
137
      this.$emit("save", this.editObj);
      this.close();
    }
  }
};
</script>