Kaynağa Gözat

Web Setup Validation and formatting

master
Brian Conway 2 yıl önce
ebeveyn
işleme
fdc35a9092

+ 28
- 23
src/components/admin/fees/feesPage.vue Dosyayı Görüntüle

@@ -1,21 +1,26 @@
1 1
 <template>
2
-  <main id="main" style=" padding-bottom:100px">
2
+  <main id="main" style="padding-bottom: 100px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>Fees</h2>
4
+      <div class="form">
5
+        <div class="row">
6
+          <div class="col">
7
+            <div class="section-header">
8
+              <h2>Fees</h2>
9
+            </div>
8 10
           </div>
9 11
         </div>
10
-      </div>
11
-      <div v-if="checkAccess" class="row">
12
-        <div class="col">
13
-          <listingFee />
12
+        <div v-if="checkAccess" class="row">
13
+          <div class="col">
14
+            <listingFee />
15
+          </div>
14 16
         </div>
15
-      </div>
16
-      <div v-else class="row">
17
-        <div class="col">
18
-          <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
17
+        <div v-else class="row">
18
+          <div class="col">
19
+            <alert
20
+              :text="'You don\'t have permission to view this page'"
21
+              :type="'ERROR'"
22
+            />
23
+          </div>
19 24
         </div>
20 25
       </div>
21 26
     </div>
@@ -24,25 +29,25 @@
24 29
 
25 30
 <script>
26 31
 /* eslint-disable */
27
-import Log from "../../../assets/Log";
28
-import alert from "../../shared/alert";
29
-import listingFee from "./listingFee";
32
+import Log from '../../../assets/Log'
33
+import alert from '../../shared/alert'
34
+import listingFee from './listingFee'
30 35
 
31 36
 export default {
32 37
   components: {
33 38
     listingFee,
34
-    alert
39
+    alert,
35 40
   },
36 41
   computed: {
37 42
     checkAccess() {
38
-      if (Log.getUser().role === "Super Admin") {
39
-        return true;
43
+      if (Log.getUser().role === 'Super Admin') {
44
+        return true
40 45
       } else {
41
-        return false;
46
+        return false
42 47
       }
43
-    }
44
-  }
45
-};
48
+    },
49
+  },
50
+}
46 51
 </script>
47 52
 
48 53
 <style lang="scss" scoped></style>

+ 43
- 32
src/components/admin/fees/listingFee.vue Dosyayı Görüntüle

@@ -3,61 +3,72 @@
3 3
     <div v-if="updated">
4 4
       <alert :text="'The listing fee has been updated!!'" :type="'SUCCESS'" />
5 5
     </div>
6
-
7
-    <label for="fee" class="uniLabel">LISTING FEE</label>
8
-
9
-    <currency-input
10
-      onClick="this.setSelectionRange(0, this.value.length)"
11
-      name="fee"
12
-      :value="value"
13
-      @input="value = $event"
14
-      v-model="fee"
15
-      id="price"
16
-      class="form-control uniInput"
17
-    />
18
-    <button @click="saveListingFee" class="btn-solid-blue mt-4">Save</button>
6
+    <float-label label="Listing Fee" style="width: 100%;">
7
+      <currency-input
8
+        onClick="this.setSelectionRange(0, this.value.length)"
9
+        name="fee"
10
+        :value="value"
11
+        @input="value = $event"
12
+        v-model="fee"
13
+        id="price"
14
+        class="form-control uniInput"
15
+        placeholder="Listing Fee"
16
+        v-bind:class="{
17
+          'is-valid': fee,
18
+          'is-invalid': !requiredField(fee),
19
+        }"
20
+      />
21
+    </float-label>
22
+    <button @click="saveListingFee" class="btn-white-border mt-4">Save</button>
19 23
   </section>
20 24
 </template>
21 25
 
22 26
 <script>
23 27
 /* eslint-disable */
24
-import { mapActions, mapGetters, mapState } from "vuex";
25
-import alert from "../../shared/alert";
28
+import { mapActions, mapGetters, mapState } from 'vuex'
29
+import alert from '../../shared/alert'
26 30
 export default {
27 31
   components: {
28
-    alert
32
+    alert,
29 33
   },
30 34
   data() {
31 35
     return {
32 36
       fee: 0.0,
33
-      updated: false
34
-    };
37
+      updated: false,
38
+    }
35 39
   },
36 40
   mounted() {
37
-    this.pullListingFee();
41
+    this.pullListingFee()
38 42
   },
39 43
   methods: {
40
-    ...mapActions("fees", ["retrieveListingFee", "setListingFee"]),
44
+    ...mapActions('fees', ['retrieveListingFee', 'setListingFee']),
41 45
     saveListingFee() {
42 46
       var feeObj = {
43 47
         amount: parseFloat(this.fee),
44
-        name: "Listing Fee"
45
-      };
46
-      this.setListingFee(feeObj);
48
+        name: 'Listing Fee',
49
+      }
50
+      this.setListingFee(feeObj)
47 51
       setTimeout(() => {
48
-        this.updated = true;
49
-      }, 200);
52
+        this.updated = true
53
+      }, 200)
50 54
     },
51 55
     async pullListingFee() {
52
-      await this.retrieveListingFee();
53
-      this.fee = this.getListingFee.amount;
54
-    }
56
+      await this.retrieveListingFee()
57
+      this.fee = this.getListingFee.amount
58
+    },
59
+    requiredField: function (tfield) {
60
+      if (tfield) {
61
+        return true
62
+      } else {
63
+        return false
64
+      }
65
+    },
55 66
   },
56 67
   computed: {
57
-    ...mapGetters("fees", ["getListingFee"]),
58
-    ...mapState("fees", ["listingFee"])
59
-  }
60
-};
68
+    ...mapGetters('fees', ['getListingFee']),
69
+    ...mapState('fees', ['listingFee']),
70
+  },
71
+}
61 72
 </script>
62 73
 
63 74
 <style lang="scss" scoped></style>

+ 113
- 52
src/components/admin/property/propertyTypeEdit.vue Dosyayı Görüntüle

@@ -1,57 +1,80 @@
1 1
 <template>
2 2
   <main id="main" style="margin-top: 200px; padding-bottom: 50px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>Property Type</h2>
4
+      <div class="form">
5
+        <div class="row">
6
+          <div class="col">
7
+            <div class="section-header">
8
+              <h2>Property Type</h2>
9
+            </div>
8 10
           </div>
9 11
         </div>
10
-      </div>
11
-      <div v-if="checkAccess" class="row mb-3">
12
-        <div class="col-md-12">
13
-          <form id="mainForm">
14
-            <div class="form-group row">
15
-              <div class="col-md-4">
16
-                <label>Description</label>
17
-                <input
18
-                  class="form-control"
19
-                  type="text"
20
-                  name="description"
21
-                  id="description"
22
-                  v-model="propertyType.description"
23
-                />
24
-              </div>
25
-              <div class="col-md-4">
26
-                <label>Property Usage Type</label>
27
-                <select
28
-                  class="form-control"
29
-                  name="UsageType"
30
-                  id="UsageType"
31
-                  v-model="propertyType.usageType"
32
-                >
33
-                  <option value="0">Residential</option>
34
-                  <option value="1">Commercial</option>
35
-                </select>
12
+        <div v-if="checkAccess" class="row mb-3">
13
+          <div class="col-md-12">
14
+            <form id="mainForm">
15
+              <div class="form-group row">
16
+                <div class="col-md-4">
17
+                  <float-label label="Description" style="width: 100%;">
18
+                    <input
19
+                      class="form-control uniInput"
20
+                      type="text"
21
+                      name="description"
22
+                      id="description"
23
+                      v-model="propertyType.description"
24
+                      v-bind:class="{
25
+                        'is-valid': propertyType.description,
26
+                        'is-invalid':
27
+                          !requiredField(propertyType.description) &&
28
+                          descriptionLoad,
29
+                      }"
30
+                      v-on:keyup="descriptionLoad = true"
31
+                      v-on:blur="descriptionLoad = true"
32
+                    />
33
+                    <div class="invalid-feedback">Description is required!</div>
34
+                  </float-label>
35
+                </div>
36
+                <div class="col-md-4">
37
+                  <float-label label="Property Usage Type" style="width: 100%;">
38
+                    <select
39
+                      class="form-control uniSelect"
40
+                      name="UsageType"
41
+                      id="UsageType"
42
+                      v-model="propertyType.usageType"
43
+                      v-bind:class="{
44
+                        'is-valid': propertyType.usageType,
45
+                      }"
46
+                      v-on:keyup="usageTypeLoad = true"
47
+                      v-on:blur="usageTypeLoad = true"
48
+                    >
49
+                      <option value="0">Residential</option>
50
+                      <option value="1">Commercial</option>
51
+                    </select>
52
+                    <div class="invalid-feedback">Usage Type is required!</div>
53
+                  </float-label>
54
+                </div>
36 55
               </div>
37
-            </div>
38
-          </form>
39
-        </div>
40
-        <div class="col-md-12">
41
-          <button type="button" @click="SubmitData()" class="btn-solid-blue">
42
-            Save
43
-          </button>
44
-          <button type="button" @click="Close()" class="btn-solid-blue">
45
-            Close
46
-          </button>
56
+            </form>
57
+          </div>
58
+          <div class="col-md-12">
59
+            <button
60
+              type="button"
61
+              @click="SubmitData()"
62
+              class="btn-white-border"
63
+            >
64
+              Save
65
+            </button>
66
+            <button type="button" @click="Close()" class="btn-white-border">
67
+              Close
68
+            </button>
69
+          </div>
47 70
         </div>
48
-      </div>
49
-      <div v-else class="row">
50
-        <div class="col">
51
-          <alert
52
-            :text="'You don\'t have permission to view this page'"
53
-            :type="'ERROR'"
54
-          />
71
+        <div v-else class="row">
72
+          <div class="col">
73
+            <alert
74
+              :text="'You don\'t have permission to view this page'"
75
+              :type="'ERROR'"
76
+            />
77
+          </div>
55 78
         </div>
56 79
       </div>
57 80
     </div>
@@ -70,6 +93,16 @@ export default {
70 93
   components: {
71 94
     alert,
72 95
   },
96
+  data() {
97
+    return {
98
+      boolSent: false,
99
+      errorOccurred: '',
100
+      errorMessage: '',
101
+      boolValidationError: false,
102
+      descriptionLoad: false,
103
+      usageTypeLoad: false,
104
+    }
105
+  },
73 106
   mounted() {
74 107
     this.clearPropertyType()
75 108
     if (this.$route.params.id > 0) {
@@ -94,16 +127,44 @@ export default {
94 127
       'clearPropertyType',
95 128
     ]),
96 129
     SubmitData() {
97
-      if (this.propertyType.id > 0) {
98
-        this.updatePropertyType(this.propertyType)
99
-      } else {
100
-        this.savePropertyType(this.propertyType)
130
+      if (this.validatePage()) {
131
+        console.log('SubmitData')
132
+        if (this.propertyType.id > 0) {
133
+          this.updatePropertyType(this.propertyType)
134
+        } else {
135
+          console.log('savePropertyType')
136
+          console.log(this.propertyType)
137
+          this.savePropertyType(this.propertyType)
138
+        }
139
+        this.$router.push('/propertyTypes/list')
101 140
       }
102
-      this.$router.push('/propertyTypes/list')
103 141
     },
104 142
     Close() {
105 143
       this.$router.push('/propertyTypes/list')
106 144
     },
145
+    validatePage: function () {
146
+      if (this.propertyType.description) {
147
+        this.errorOccurred = ''
148
+        this.errorMessage = ''
149
+        this.boolValidationError = false
150
+        return true
151
+      } else {
152
+        this.boolValidationError = true
153
+        this.nameLoad = true
154
+        this.descriptionLoad = true
155
+        this.usageTypeLoad = true
156
+        this.errorOccurred = 'ERROR'
157
+        this.errorMessage = 'Please check form and correct all input fields!'
158
+        return false
159
+      }
160
+    },
161
+    requiredField: function (tfield) {
162
+      if (tfield) {
163
+        return true
164
+      } else {
165
+        return false
166
+      }
167
+    },
107 168
   },
108 169
 }
109 170
 </script>

+ 27
- 25
src/components/admin/property/propertyTypeList.vue Dosyayı Görüntüle

@@ -2,34 +2,36 @@
2 2
   <!-- eslint-disable max-len -->
3 3
   <main id="main" style="margin-top: -20px; padding-bottom: 50px;">
4 4
     <div class="container">
5
-      <div class="row">
6
-        <div class="col-md-12 col-lg-8">
7
-          <div class="section-header">
8
-            <h2>Property Types</h2>
5
+      <div class="form">
6
+        <div class="row">
7
+          <div class="col-md-12 col-lg-8">
8
+            <div class="section-header">
9
+              <h2>Property Types</h2>
10
+            </div>
9 11
           </div>
10 12
         </div>
11
-      </div>
12
-      <div v-if="checkAccess" class="row">
13
-        <div class="col">
14
-          <listView
15
-            :items="propertyTypes"
16
-            :showNew="true"
17
-            :editable="true"
18
-            :deleteable="true"
19
-            :displayColumns="columns"
20
-            :sortKey="'description'"
21
-            @onEdit="Edit"
22
-            @onDelete="Delete"
23
-            @onNew="New"
24
-          />
13
+        <div v-if="checkAccess" class="row">
14
+          <div class="col">
15
+            <listView
16
+              :items="propertyTypes"
17
+              :showNew="true"
18
+              :editable="true"
19
+              :deleteable="true"
20
+              :displayColumns="columns"
21
+              :sortKey="'description'"
22
+              @onEdit="Edit"
23
+              @onDelete="Delete"
24
+              @onNew="New"
25
+            />
26
+          </div>
25 27
         </div>
26
-      </div>
27
-      <div v-else class="row">
28
-        <div class="col">
29
-          <alert
30
-            :text="'You don\'t have permission to view this page'"
31
-            :type="'ERROR'"
32
-          />
28
+        <div v-else class="row">
29
+          <div class="col">
30
+            <alert
31
+              :text="'You don\'t have permission to view this page'"
32
+              :type="'ERROR'"
33
+            />
34
+          </div>
33 35
         </div>
34 36
       </div>
35 37
     </div>

+ 252
- 172
src/components/admin/property/userDefinedGroupPage.vue Dosyayı Görüntüle

@@ -1,10 +1,12 @@
1 1
 <template>
2
-  <main id="main" style="margin-top:200px; padding-bottom:50px">
2
+  <main id="main" style="margin-top: 200px; padding-bottom: 50px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>Property User Defined Group</h2>
4
+      <div class="form">
5
+        <div class="row">
6
+          <div class="col">
7
+            <div class="section-header">
8
+              <h2>Property User Defined Group</h2>
9
+            </div>
8 10
           </div>
9 11
         </div>
10 12
       </div>
@@ -12,105 +14,144 @@
12 14
     <div v-if="checkAccess">
13 15
       <div v-if="showField === false">
14 16
         <div class="container">
15
-          <div class="row mb-3">
16
-            <div class="col-md-12">
17
-              <form id="mainForm">
18
-                <div v-if="userDefinedGroup" class="form-group row">
19
-                  <div class="col-md-4">
20
-                    <label>Description</label>
21
-                    <input
22
-                      class="form-control"
23
-                      type="text"
24
-                      name="description"
25
-                      id="description"
26
-                      v-model="userDefinedGroup.description"
27
-                    />
28
-                  </div>
29
-                  <div class="col-md-4">
30
-                    <label>Property Usage Type</label>
31
-                    <select
32
-                      class="form-control"
33
-                      name="UsageType"
34
-                      id="UsageType"
35
-                      v-model="userDefinedGroup.usageType"
36
-                    >
37
-                      <option value="0">Residential</option>
38
-                      <option value="1">Commercial</option>
39
-                      <option value="2">Both</option>
40
-                    </select>
41
-                  </div>
42
-                  <div class="col-md-4">
43
-                    <label>Order</label>
44
-                    <input
45
-                      class="form-control"
46
-                      type="number"
47
-                      name="rank"
48
-                      id="rank"
49
-                      v-model="userDefinedGroup.rank"
50
-                    />
51
-                  </div>
52
-                </div>
53
-                <div v-if="!userDefinedGroup" class="form-group row">
54
-                  <div class="col-md-4">
55
-                    <label>Description</label>
56
-                    <input
57
-                      class="form-control"
58
-                      type="text"
59
-                      name="description"
60
-                      id="description"
61
-                      v-model="group.description"
62
-                    />
63
-                  </div>
64
-                  <div class="col-md-4">
65
-                    <label>Property Usage Type</label>
66
-                    <select
67
-                      class="form-control"
68
-                      name="UsageType"
69
-                      id="UsageType"
70
-                      v-model="group.usageType"
71
-                    >
72
-                      <option value="0">Residential</option>
73
-                      <option value="1">Commercial</option>
74
-                      <option value="2">Both</option>
75
-                    </select>
17
+          <div class="form">
18
+            <div class="row mb-3">
19
+              <div class="col-md-12">
20
+                <form id="mainForm">
21
+                  <div v-if="userDefinedGroup" class="form-group row">
22
+                    <div class="form-group col-md-4">
23
+                      <float-label fixed label="Description">
24
+                        <input
25
+                          class="form-control uniInput"
26
+                          type="text"
27
+                          name="description"
28
+                          id="description"
29
+                          v-model="userDefinedGroup.description"
30
+                          placeholder="Description"
31
+                          v-bind:class="{
32
+                            'is-valid': userDefinedGroup.description,
33
+                            'is-invalid':
34
+                              !requiredField(userDefinedGroup.description) &&
35
+                              descriptionLoad,
36
+                          }"
37
+                          v-on:keyup="descriptionLoad = true"
38
+                          v-on:blur="descriptionLoad = true"
39
+                        />
40
+                        <div class="invalid-feedback">
41
+                          Description is Required!
42
+                        </div>
43
+                      </float-label>
44
+                    </div>
45
+
46
+                    <div class="form-group col-md-4">
47
+                      <float-label fixed label="Property Usage Type">
48
+                        <select
49
+                          class="form-control uniSelect"
50
+                          name="UsageType"
51
+                          id="UsageType"
52
+                          v-model="userDefinedGroup.usageType"
53
+                          placeholder="Property Usage Type"
54
+                          v-bind:class="{
55
+                            'is-valid': userDefinedGroup.usageType,
56
+                          }"
57
+                        >
58
+                          <option value="0">Residential</option>
59
+                          <option value="1">Commercial</option>
60
+                          <option value="2">Both</option>
61
+                        </select>
62
+                      </float-label>
63
+                    </div>
64
+                    <div class="col-md-4">
65
+                      <float-label fixed label="Order">
66
+                        <input
67
+                          class="form-control uniInput"
68
+                          type="number"
69
+                          name="rank"
70
+                          id="rank"
71
+                          v-model="userDefinedGroup.rank"
72
+                          placeholder="Order"
73
+                          v-bind:class="{
74
+                            'is-valid': userDefinedGroup.rank,
75
+                          }"
76
+                        />
77
+                      </float-label>
78
+                    </div>
76 79
                   </div>
77
-                  <div class="col-md-4">
78
-                    <label>Order</label>
79
-                    <input
80
-                      class="form-control"
81
-                      type="number"
82
-                      name="rank"
83
-                      id="rank"
84
-                      v-model="group.rank"
85
-                    />
80
+                  <div v-if="!userDefinedGroup" class="form-group row">
81
+                    <div class="form-group col-md-4">
82
+                      <label>Description</label>
83
+                      <input
84
+                        class="form-control"
85
+                        type="text"
86
+                        name="description"
87
+                        id="description"
88
+                        v-model="group.description"
89
+                      />
90
+                    </div>
91
+                    <div class="col-md-4">
92
+                      <label>Property Usage Type</label>
93
+                      <select
94
+                        class="form-control"
95
+                        name="UsageType"
96
+                        id="UsageType"
97
+                        v-model="group.usageType"
98
+                      >
99
+                        <option value="0">Residential</option>
100
+                        <option value="1">Commercial</option>
101
+                        <option value="2">Both</option>
102
+                      </select>
103
+                    </div>
104
+                    <div class="col-md-4">
105
+                      <label>Order</label>
106
+                      <input
107
+                        class="form-control"
108
+                        type="number"
109
+                        name="rank"
110
+                        id="rank"
111
+                        v-model="group.rank"
112
+                        v-bind:class="{
113
+                          'is-valid': group.rank,
114
+                        }"
115
+                      />
116
+                    </div>
86 117
                   </div>
87
-                </div>
88
-              </form>
118
+                </form>
119
+              </div>
89 120
             </div>
90
-          </div>
91
-          <div class="row">
92
-            <div class="col">
93
-              <listView
94
-                :items="userFields"
95
-                :showNew="true"
96
-                :editable="true"
97
-                :deleteable="true"
98
-                :displayColumns="columns"
99
-                :sortKey="'rank'"
100
-                @onEdit="Edit"
101
-                @onDelete="Delete"
102
-                @onNew="newItem"
103
-              />
121
+            <!--            <div class="row">
122
+              <div class="col">
123
+                <listView
124
+                  :items="userFields"
125
+                  :showNew="true"
126
+                  :editable="true"
127
+                  :deleteable="true"
128
+                  :displayColumns="columns"
129
+                  :sortKey="'rank'"
130
+                  @onEdit="Edit"
131
+                  @onDelete="Delete"
132
+                  @onNew="newItem"
133
+                />
134
+              </div>
104 135
             </div>
105
-          </div>
106
-          <div class="row">
107
-            <div class="col">
108
-              <button type="button" @click="SubmitData()" class="btn-solid-blue mb-5">
109
-                Save
110
-              </button>
111
-              <button type="button" @click="Close()" class="btn-solid-blue">
112
-                Close
113
-              </button>
136
+            -->
137
+            <div v-if="boolValidationError" class="row">
138
+              <div class="col">
139
+                <alert :text="errorMessage" :type="errorOccurred" />
140
+              </div>
141
+            </div>
142
+            <div class="row">
143
+              <div class="col">
144
+                <button
145
+                  type="button"
146
+                  @click="SubmitData()"
147
+                  class="btn-white-border mb-5"
148
+                >
149
+                  Save
150
+                </button>
151
+                <button type="button" @click="Close()" class="btn-white-border">
152
+                  Close
153
+                </button>
154
+              </div>
114 155
             </div>
115 156
           </div>
116 157
         </div>
@@ -120,124 +161,163 @@
120 161
       </div>
121 162
     </div>
122 163
     <div v-else>
123
-      <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
164
+      <alert
165
+        :text="'You don\'t have permission to view this page'"
166
+        :type="'ERROR'"
167
+      />
124 168
     </div>
125 169
   </main>
126 170
 </template>
127 171
 
128 172
 <script>
129 173
 /* eslint-disable */
130
-import { mapState, mapActions } from "vuex";
174
+import { mapState, mapActions } from 'vuex'
131 175
 
132
-import Log from "../../../assets/Log";
133
-import alert from "../../shared/alert";
134
-import userFields from "./userDefinedField.vue";
135
-import listView from "../../shared/listView.vue";
176
+import Log from '../../../assets/Log'
177
+import alert from '../../shared/alert'
178
+import userFields from './userDefinedField.vue'
179
+import listView from '../../shared/listView.vue'
136 180
 
137 181
 export default {
138
-  name: "UserDefinedGroup",
182
+  name: 'UserDefinedGroup',
139 183
   components: {
140 184
     userFields,
141 185
     listView,
142
-    alert
186
+    alert,
143 187
   },
144 188
   data() {
145 189
     return {
146 190
       item: {},
147 191
       showField: false,
148
-      columns: ["fieldName", "fieldType", "rank"]
149
-    };
192
+      errorOccurred: '',
193
+      errorMessage: '',
194
+      boolMessage: false,
195
+      boolValidationError: false,
196
+      descriptionLoad: false,
197
+      columns: ['fieldName', 'fieldType', 'rank'],
198
+    }
150 199
   },
151 200
   mounted() {
152
-    this.clearUserFields();
153
-    this.clearUserGroup();
201
+    this.clearUserFields()
202
+    this.clearUserGroup()
154 203
 
155 204
     if (this.$route.params.id > 0) {
156
-      this.getUserDefinedGroup(this.$route.params.id);
157
-      this.getUserFields(this.$route.params.id);
205
+      this.getUserDefinedGroup(this.$route.params.id)
206
+      this.getUserFields(this.$route.params.id)
158 207
     }
159 208
   },
160 209
   computed: {
161
-    ...mapState("propertyAdmin", ["userDefinedGroup", "userFields", "userField"]),
210
+    ...mapState('propertyAdmin', [
211
+      'userDefinedGroup',
212
+      'userFields',
213
+      'userField',
214
+    ]),
162 215
     checkAccess() {
163
-      if (Log.getUser().role === "Super Admin") {
164
-        return true;
216
+      if (Log.getUser().role === 'Super Admin') {
217
+        return true
165 218
       } else {
166
-        return false;
219
+        return false
167 220
       }
168
-    }
221
+    },
169 222
   },
170 223
   methods: {
171
-    ...mapActions("propertyAdmin", [
172
-      "getUserDefinedGroup",
173
-      "getUserFields",
174
-      "saveUserDefinedGroup",
175
-      "updateUserDefinedGroup",
176
-      "clearUserGroup",
177
-      "clearUserFields",
178
-      "clearUserField",
179
-      "saveUserField",
180
-      "updateUserField",
181
-      "deleteUserField"
224
+    ...mapActions('propertyAdmin', [
225
+      'getUserDefinedGroup',
226
+      'getUserFields',
227
+      'saveUserDefinedGroup',
228
+      'updateUserDefinedGroup',
229
+      'clearUserGroup',
230
+      'clearUserFields',
231
+      'clearUserField',
232
+      'saveUserField',
233
+      'updateUserField',
234
+      'deleteUserField',
182 235
     ]),
183 236
     SubmitData() {
184
-      this.userDefinedGroup.fields = [];
185
-      let reload = false;
186
-      if (this.$route.params.id > 0) {
187
-        this.updateUserDefinedGroup(this.userDefinedGroup);
188
-        this.userFields.forEach(fieldData => {
189
-          if (fieldData.id === 0) {
190
-            fieldData.groupId = this.userDefinedGroup.id;
191
-            this.saveUserField(fieldData);
192
-          } else {
193
-            this.updateUserField(fieldData);
194
-          }
195
-        });
196
-      } else {
197
-        reload = true;
198
-        this.userFields.forEach(fieldData => {
199
-          this.userDefinedGroup.fields.push({
200
-            fieldName: fieldData.fieldName,
201
-            fieldType: fieldData.fieldType,
202
-            rank: fieldData.rank
203
-          });
204
-        });
205
-        this.saveUserDefinedGroup(this.userDefinedGroup);
237
+      if (this.validatePage()) {
238
+        console.log('SubmitData')
239
+        this.userDefinedGroup.fields = []
240
+        let reload = false
241
+        if (this.$route.params.id > 0) {
242
+          this.updateUserDefinedGroup(this.userDefinedGroup)
243
+          this.userFields.forEach((fieldData) => {
244
+            if (fieldData.id === 0) {
245
+              fieldData.groupId = this.userDefinedGroup.id
246
+              this.saveUserField(fieldData)
247
+            } else {
248
+              this.updateUserField(fieldData)
249
+            }
250
+          })
251
+        } else {
252
+          reload = true
253
+          this.userFields.forEach((fieldData) => {
254
+            this.userDefinedGroup.fields.push({
255
+              fieldName: fieldData.fieldName,
256
+              fieldType: fieldData.fieldType,
257
+              rank: fieldData.rank,
258
+            })
259
+          })
260
+          this.saveUserDefinedGroup(this.userDefinedGroup)
261
+        }
262
+        this.$router.push('/userDefinedGroups/list')
263
+        // this.$router.push({
264
+        //   path: '/userDefinedGroups/list',
265
+        //   query: { reload },
266
+        // });
206 267
       }
207
-      this.$router.push("/userDefinedGroups/list");
208
-      // this.$router.push({
209
-      //   path: '/userDefinedGroups/list',
210
-      //   query: { reload },
211
-      // });
212 268
     },
213 269
     newItem() {
214
-      this.clearUserField();
215
-      this.item = this.userField;
216
-      this.item.groupId = this.userDefinedGroup.id;
217
-      this.showField = true;
270
+      this.clearUserField()
271
+      this.item = this.userField
272
+      this.item.groupId = this.userDefinedGroup.id
273
+      this.showField = true
218 274
     },
219 275
     Edit(item) {
220
-      this.item = item;
221
-      this.showField = true;
276
+      this.item = item
277
+      this.showField = true
222 278
     },
223 279
     Close() {
224
-      this.$router.push("/userDefinedGroups/list");
280
+      this.$router.push('/userDefinedGroups/list')
225 281
     },
226 282
     UpdateUserField(item) {
227 283
       if (item.id === 0) {
228
-        this.userFields.push(item);
284
+        this.userFields.push(item)
229 285
       }
230
-      this.showField = false;
286
+      this.showField = false
231 287
     },
232 288
     Delete(item) {
233
-      console.log(item);
289
+      console.log(item)
234 290
 
235 291
       if (item.id === 0) {
236
-        this.userFields.pop(this.userFields.find(p => p.id === item.id));
292
+        this.userFields.pop(this.userFields.find((p) => p.id === item.id))
237 293
       } else {
238
-        this.deleteUserField(item.id);
294
+        this.deleteUserField(item.id)
239 295
       }
240
-    }
241
-  }
242
-};
296
+    },
297
+    requiredField: function (tfield) {
298
+      if (tfield) {
299
+        return true
300
+      } else {
301
+        return false
302
+      }
303
+    },
304
+    validatePage: function () {
305
+      console.log('validatePage')
306
+      if (this.userDefinedGroup.description) {
307
+        console.log('passed')
308
+        this.errorOccurred = ''
309
+        this.errorMessage = ''
310
+        this.boolValidationError = false
311
+        return true
312
+      } else {
313
+        console.log('failed')
314
+        this.descriptionLoad = true
315
+        this.boolValidationError = true
316
+        this.errorOccurred = 'ERROR'
317
+        this.errorMessage = 'Please check form and correct all input fields!'
318
+        return false
319
+      }
320
+    },
321
+  },
322
+}
243 323
 </script>

+ 53
- 45
src/components/admin/property/userDefinedGroupsPage.vue Dosyayı Görüntüle

@@ -1,31 +1,36 @@
1 1
 <template>
2
-  <main id="main" style="margin-top:-80px; padding-bottom:50px">
2
+  <main id="main" style="margin-top: -80px; padding-bottom: 50px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>Property User Defined Groups</h2>
4
+      <div class="form">
5
+        <div class="row">
6
+          <div class="col">
7
+            <div class="section-header">
8
+              <h2>Property User Defined Groups</h2>
9
+            </div>
8 10
           </div>
9 11
         </div>
10
-      </div>
11
-      <div v-if="checkAccess" class="row">
12
-        <div class="col">
13
-          <listView
14
-            :items="userDefinedGroups"
15
-            :showNew="true"
16
-            :editable="true"
17
-            :deleteable="true"
18
-            :displayColumns="columns"
19
-            :sortKey="'rank'"
20
-            @onEdit="Edit"
21
-            @onDelete="Delete"
22
-            @onNew="New"
23
-          />
12
+        <div v-if="checkAccess" class="row">
13
+          <div class="col">
14
+            <listView
15
+              :items="userDefinedGroups"
16
+              :showNew="true"
17
+              :editable="true"
18
+              :deleteable="true"
19
+              :displayColumns="columns"
20
+              :sortKey="'rank'"
21
+              @onEdit="Edit"
22
+              @onDelete="Delete"
23
+              @onNew="New"
24
+            />
25
+          </div>
24 26
         </div>
25
-      </div>
26
-      <div v-else class="row">
27
-        <div class="col">
28
-          <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
27
+        <div v-else class="row">
28
+          <div class="col">
29
+            <alert
30
+              :text="'You don\'t have permission to view this page'"
31
+              :type="'ERROR'"
32
+            />
33
+          </div>
29 34
         </div>
30 35
       </div>
31 36
     </div>
@@ -34,50 +39,53 @@
34 39
 
35 40
 <script>
36 41
 /* eslint-disable */
37
-import { mapState, mapActions } from "vuex";
42
+import { mapState, mapActions } from 'vuex'
38 43
 
39
-import Log from "../../../assets/Log";
40
-import alert from "../../shared/alert";
41
-import listView from "../../shared/listView.vue";
44
+import Log from '../../../assets/Log'
45
+import alert from '../../shared/alert'
46
+import listView from '../../shared/listView.vue'
42 47
 
43 48
 export default {
44
-  name: "UserDefinedGroup",
49
+  name: 'UserDefinedGroup',
45 50
   components: {
46 51
     listView,
47
-    alert
52
+    alert,
48 53
   },
49 54
   data() {
50 55
     return {
51
-      columns: ["description", "propertyUsageType", "rank"]
52
-    };
56
+      columns: ['description', 'propertyUsageType', 'rank'],
57
+    }
53 58
   },
54 59
   mounted() {
55
-    this.getUserDefinedGroups();
60
+    this.getUserDefinedGroups()
56 61
   },
57 62
   computed: {
58
-    ...mapState("propertyAdmin", ["userDefinedGroups"]),
63
+    ...mapState('propertyAdmin', ['userDefinedGroups']),
59 64
     checkAccess() {
60
-      if (Log.getUser().role === "Super Admin") {
61
-        return true;
65
+      if (Log.getUser().role === 'Super Admin') {
66
+        return true
62 67
       } else {
63
-        return false;
68
+        return false
64 69
       }
65
-    }
70
+    },
66 71
   },
67 72
   methods: {
68
-    ...mapActions("propertyAdmin", ["getUserDefinedGroups", "deleteUserDefinedGroup"]),
73
+    ...mapActions('propertyAdmin', [
74
+      'getUserDefinedGroups',
75
+      'deleteUserDefinedGroup',
76
+    ]),
69 77
     New() {
70
-      this.$router.push("/userDefinedGroups/userDefinedGroup");
78
+      this.$router.push('/userDefinedGroups/userDefinedGroup')
71 79
     },
72 80
     Edit(item) {
73
-      this.$router.push(`/userDefinedGroups/userDefinedGroup/${item.id}`);
81
+      this.$router.push(`/userDefinedGroups/userDefinedGroup/${item.id}`)
74 82
     },
75 83
     Delete(item) {
76 84
       if (item.id === 0) {
77
-        this.userDefinedGroups.pop(item);
85
+        this.userDefinedGroups.pop(item)
78 86
       }
79
-      this.deleteUserDefinedGroup(item.id);
80
-    }
81
-  }
82
-};
87
+      this.deleteUserDefinedGroup(item.id)
88
+    },
89
+  },
90
+}
83 91
 </script>

+ 76
- 69
src/components/admin/status/agencyUserManagementPage.vue Dosyayı Görüntüle

@@ -2,23 +2,24 @@
2 2
   <!-- eslint-disable max-len -->
3 3
   <main id="main">
4 4
     <div class="container">
5
-      <div class="row">
6
-        <div class="col-md-12 col-lg-8">
7
-          <div class="section-header">
8
-            <h2>Agency Management</h2>
5
+      <div class="form">
6
+        <div class="row">
7
+          <div class="col-md-12 col-lg-8">
8
+            <div class="section-header">
9
+              <h2>Agency Management</h2>
10
+            </div>
9 11
           </div>
10 12
         </div>
11
-      </div>
12
-      <div class="row">
13
-        <div class="col-md-1 offset-1">
14
-          <button
15
-            @click="routerGoTo('/status/userManagementPage')"
16
-            type="button"
17
-            class="btn-white-border"
18
-          >
19
-            USERS
20
-          </button>
21
-        </div>
13
+        <div class="row">
14
+          <div class="col-md-1 offset-1">
15
+            <button
16
+              @click="routerGoTo('/status/userManagementPage')"
17
+              type="button"
18
+              class="btn-white-border"
19
+            >
20
+              USERS
21
+            </button>
22
+          </div>
22 23
           <div class="col-md-1 offset-1">
23 24
             <button
24 25
               @click="routerGoTo('/status/agentUserManagementPage')"
@@ -28,43 +29,46 @@
28 29
               AGENTS
29 30
             </button>
30 31
           </div>
31
-        <div class="col-md-1 offset-1">
32
+          <div class="col-md-1 offset-1">
32 33
             <button type="button" class="btn-solid-blue">AGENCIES</button>
33 34
           </div>
34
-        <div class="col-md-3 offset-3">
35
-          <button
36
-            type="button"
37
-            class="btn-white-border"
38
-            data-toggle="modal"
39
-            :data-target="'#myModalAgency'"
40
-          >
41
-            NEW AGENCY
42
-          </button>
43
-          <div :id="'myModalAgency'" class="modal fade" role="dialog">
44
-            <div class="modal-dialog modal-lg">
45
-              <div class="modal-content">
46
-                <div class="modal-header">
47
-                  <button type="button" class="close" data-dismiss="modal">&times;</button>
35
+          <div class="col-md-3 offset-3">
36
+            <button
37
+              type="button"
38
+              class="btn-white-border"
39
+              data-toggle="modal"
40
+              :data-target="'#myModalAgency'"
41
+            >
42
+              NEW AGENCY
43
+            </button>
44
+            <div :id="'myModalAgency'" class="modal fade" role="dialog">
45
+              <div class="modal-dialog modal-lg">
46
+                <div class="modal-content">
47
+                  <div class="modal-header">
48
+                    <button type="button" class="close" data-dismiss="modal">
49
+                      &times;
50
+                    </button>
51
+                  </div>
52
+                  <Agency name="Agency" :isAddAgent="false" :item="item" />
48 53
                 </div>
49
-                <Agency name="Agency" :isAddAgent="false" :item="item" />
50 54
               </div>
51 55
             </div>
52 56
           </div>
53 57
         </div>
54
-      </div>
55
-      <div class="container">
56
-        <ListView
57
-          :items="agencies"
58
-          :showNew="false"
59
-          :editable="false"
60
-          :deleteable="false"
61
-          :showCustomAction="true"
62
-          :showColumnChooser="false"
63
-          :displayColumns="columns"
64
-          :displayHeaders="headers"
65
-          @onEdit="Edit"
66
-          @onDelete="Delete"
67
-        />
58
+        <div class="container">
59
+          <ListView
60
+            :items="agencies"
61
+            :showNew="false"
62
+            :editable="false"
63
+            :deleteable="false"
64
+            :showCustomAction="true"
65
+            :showColumnChooser="false"
66
+            :displayColumns="columns"
67
+            :displayHeaders="headers"
68
+            @onEdit="Edit"
69
+            @onDelete="Delete"
70
+          />
71
+        </div>
68 72
       </div>
69 73
     </div>
70 74
   </main>
@@ -72,55 +76,58 @@
72 76
 
73 77
 <script>
74 78
 /* eslint-disable */
75
-import { mapState, mapActions } from "vuex";
76
-import axios from "axios";
77
-import Agency from "../../user/registerAgencySection.vue";
79
+import { mapState, mapActions } from 'vuex'
80
+import axios from 'axios'
81
+import Agency from '../../user/registerAgencySection.vue'
78 82
 // import alert from '../../shared/alert.vue';
79
-import ListView from "../../shared/listView.vue";
83
+import ListView from '../../shared/listView.vue'
80 84
 
81 85
 export default {
82
-  name: "agencyManagementPage",
86
+  name: 'agencyManagementPage',
83 87
   components: {
84 88
     ListView,
85
-    Agency
89
+    Agency,
86 90
     // alert,
87 91
   },
88 92
   props: {
89
-    delete: Boolean
93
+    delete: Boolean,
90 94
   },
91 95
   data() {
92 96
     return {
93
-      columns: ["id", "agencyName", "eaabeffcNumber", "companyRegNumber"],
94
-      headers: ["", "", "", ""],
95
-      item: {}
96
-    };
97
+      columns: ['id', 'agencyName', 'eaabeffcNumber', 'companyRegNumber'],
98
+      headers: ['', '', '', ''],
99
+      item: {},
100
+    }
97 101
   },
98 102
   methods: {
99
-    ...mapActions("register", ["getAgencies", "deleteAgency"]),
103
+    ...mapActions('register', ['getAgencies', 'deleteAgency']),
100 104
     addNewAgency({ commit }) {
101 105
       axios
102
-        .post("/api/agency")
103
-        .then(result => commit("saveAgency", result.data))
104
-        .catch(console.error);
106
+        .post('/api/agency')
107
+        .then((result) => commit('saveAgency', result.data))
108
+        .catch(console.error)
105 109
     },
106 110
     routerGoTo(goTo) {
107
-      this.$router.push(goTo);
111
+      this.$router.push(goTo)
108 112
     },
109 113
     Edit(item) {
110
-      this.$router.push({ name: "UpdateAgencyProfile", params: { agency: item } });
114
+      this.$router.push({
115
+        name: 'UpdateAgencyProfile',
116
+        params: { agency: item },
117
+      })
111 118
     },
112 119
     Delete(item) {
113
-      console.log(item.id);
114
-      this.deleteAgency(item.id);
115
-    }
120
+      console.log(item.id)
121
+      this.deleteAgency(item.id)
122
+    },
116 123
   },
117 124
   mounted() {
118
-    this.getAgencies();
125
+    this.getAgencies()
119 126
   },
120 127
   computed: {
121
-    ...mapState("register", ["agencies", "removeAgency"])
122
-  }
123
-};
128
+    ...mapState('register', ['agencies', 'removeAgency']),
129
+  },
130
+}
124 131
 </script>
125 132
 
126 133
 <style></style>

+ 76
- 86
src/components/admin/status/agentUserManagementPage.vue Dosyayı Görüntüle

@@ -2,26 +2,27 @@
2 2
   <!-- eslint-disable max-len -->
3 3
   <main id="main">
4 4
     <div class="container">
5
-      <div class="row">
6
-        <div class="col-md-12 col-lg-8">
7
-          <div class="section-header">
8
-            <h2>Agent Management</h2>
5
+      <div class="form">
6
+        <div class="row">
7
+          <div class="col-md-12 col-lg-8">
8
+            <div class="section-header">
9
+              <h2>Agent Management</h2>
10
+            </div>
9 11
           </div>
10 12
         </div>
11
-      </div>
12
-      <div class="row">
13
-        <div class="col-md-1 offset-1">
14
-          <button
15
-            @click="routerGoTo('/status/userManagementPage')"
16
-            type="button"
17
-            class="btn-white-border"
18
-          >
19
-            USERS
20
-          </button>
21
-        </div>
22
-        <div class="col-md-1 offset-1">
23
-          <button type="button" class="btn-solid-blue">AGENTS</button>
24
-        </div>
13
+        <div class="row">
14
+          <div class="col-md-1 offset-1">
15
+            <button
16
+              @click="routerGoTo('/status/userManagementPage')"
17
+              type="button"
18
+              class="btn-white-border"
19
+            >
20
+              USERS
21
+            </button>
22
+          </div>
23
+          <div class="col-md-1 offset-1">
24
+            <button type="button" class="btn-solid-blue">AGENTS</button>
25
+          </div>
25 26
           <div class="col-md-1 offset-1">
26 27
             <button
27 28
               @click="routerGoTo('/status/agencyUserManagementPage')"
@@ -31,54 +32,43 @@
31 32
               AGENCIES
32 33
             </button>
33 34
           </div>
34
-        <div class="col-md-2 offset-3">
35
-          <button
36
-            type="button"
37
-            class="btn-white-border"
38
-            data-toggle="modal"
39
-            :data-target="'#myModalAgent'"
40
-          >
41
-            NEW AGENT
42
-          </button>
43
-          <div :id="'myModalAgent'" class="modal fade" role="dialog">
44
-            <div class="modal-dialog modal-lg">
45
-              <div class="modal-content">
46
-                <div class="modal-header">
47
-                  <button type="button" class="close" data-dismiss="modal">&times;</button>
35
+          <div class="col-md-2 offset-3">
36
+            <button
37
+              type="button"
38
+              class="btn-white-border"
39
+              data-toggle="modal"
40
+              :data-target="'#myModalAgent'"
41
+            >
42
+              NEW AGENT
43
+            </button>
44
+            <div :id="'myModalAgent'" class="modal fade" role="dialog">
45
+              <div class="modal-dialog modal-lg">
46
+                <div class="modal-content">
47
+                  <div class="modal-header">
48
+                    <button type="button" class="close" data-dismiss="modal">
49
+                      &times;
50
+                    </button>
51
+                  </div>
52
+                  <Agent name="Agent" :isAddAgent="false" :item="item" />
48 53
                 </div>
49
-                <Agent name="Agent" :isAddAgent="false" :item="item" />
50 54
               </div>
51 55
             </div>
52 56
           </div>
53 57
         </div>
54
-      </div>
55
-      <div class="container">
56
-        <ListView
57
-          :items="agents"
58
-          :showNew="false"
59
-          :editable="true"
60
-          :deleteable="true"
61
-          :showCustomAction="true"
62
-          :showColumnChooser="false"
63
-          :displayColumns="columns"
64
-          :displayHeaders="headers"
65
-          @onEdit="Edit"
66
-          @onDelete="Delete"
67
-        />
68
-        <!-- <ListView
69
-          :items="agents"
70
-          :showNew="false"
71
-          :editable="true"
72
-          :deleteable="true"
73
-          :showCustomAction="true"
74
-          :showColumnChooser="false"
75
-          :CustomActionHeading="'Reset Password'"
76
-          :displayColumns="columns"
77
-          :displayHeaders="headers"
78
-          @onEdit="Edit"
79
-          @onDelete="Delete"
80
-          @onResetPassword="PasswordReset"
81
-        /> -->
58
+        <div class="container">
59
+          <ListView
60
+            :items="agents"
61
+            :showNew="false"
62
+            :editable="true"
63
+            :deleteable="true"
64
+            :showCustomAction="true"
65
+            :showColumnChooser="false"
66
+            :displayColumns="columns"
67
+            :displayHeaders="headers"
68
+            @onEdit="Edit"
69
+            @onDelete="Delete"
70
+          />
71
+        </div>
82 72
       </div>
83 73
     </div>
84 74
   </main>
@@ -86,56 +76,56 @@
86 76
 
87 77
 <script>
88 78
 /* eslint-disable */
89
-import { mapState, mapActions } from "vuex";
90
-import axios from "axios";
91
-import Agent from "../../user/registerAgentSection.vue";
79
+import { mapState, mapActions } from 'vuex'
80
+import axios from 'axios'
81
+import Agent from '../../user/registerAgentSection.vue'
92 82
 // import alert from '../../shared/alert.vue';
93
-import ListView from "../../shared/listView.vue";
83
+import ListView from '../../shared/listView.vue'
94 84
 
95 85
 export default {
96
-  name: "agentManagementPage",
86
+  name: 'agentManagementPage',
97 87
   components: {
98 88
     ListView,
99
-    Agent
89
+    Agent,
100 90
     // alert,
101 91
   },
102 92
   props: {
103
-    delete: Boolean
93
+    delete: Boolean,
104 94
   },
105 95
   data() {
106 96
     return {
107
-      columns: ["id", "name", "surname", "cellNumber", "telephone", "email"],
108
-      headers: ["", "", "", "", "", "", ""],
109
-      item: {}
110
-    };
97
+      columns: ['id', 'name', 'surname', 'cellNumber', 'telephone', 'email'],
98
+      headers: ['', '', '', '', '', '', ''],
99
+      item: {},
100
+    }
111 101
   },
112 102
   methods: {
113
-    ...mapActions("register", ["getAgencies", "getAgents", "deleteAgent"]),
103
+    ...mapActions('register', ['getAgencies', 'getAgents', 'deleteAgent']),
114 104
     addNewAgent({ commit }) {
115 105
       axios
116
-        .post("/api/agent")
117
-        .then(result => commit("saveAgent", result.data))
118
-        .catch(console.error);
106
+        .post('/api/agent')
107
+        .then((result) => commit('saveAgent', result.data))
108
+        .catch(console.error)
119 109
     },
120 110
     routerGoTo(goTo) {
121
-      this.$router.push(goTo);
111
+      this.$router.push(goTo)
122 112
     },
123 113
     Edit(item) {
124
-      this.$router.push({ name: "UpdateAgentProfile", params: { agent: item } });
114
+      this.$router.push({ name: 'UpdateAgentProfile', params: { agent: item } })
125 115
     },
126 116
     Delete(item) {
127
-      console.log(item.id);
128
-      this.deleteAgent(item.id);
129
-    }
117
+      console.log(item.id)
118
+      this.deleteAgent(item.id)
119
+    },
130 120
   },
131 121
   mounted() {
132
-    this.getAgents();
133
-    this.getAgencies();
122
+    this.getAgents()
123
+    this.getAgencies()
134 124
   },
135 125
   computed: {
136
-    ...mapState("register", ["agents", "removeAgent"])
137
-  }
138
-};
126
+    ...mapState('register', ['agents', 'removeAgent']),
127
+  },
128
+}
139 129
 </script>
140 130
 
141 131
 <style></style>

+ 0
- 70
src/components/admin/status/statusEdit.vue Dosyayı Görüntüle

@@ -1,70 +0,0 @@
1
-<template>
2
-  <main id="main" style="margin-top:200px; padding-bottom:50px">
3
-    <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>New Status</h2>
8
-          </div>
9
-        </div>
10
-      </div>
11
-      <div class="row">
12
-        <div class="col">
13
-          <float-label>
14
-            <input
15
-              type="text"
16
-              placeholder="CODE"
17
-              v-model="singleStatus.code"
18
-              class="form-control uniInput"
19
-            />
20
-          </float-label>
21
-        </div>
22
-        <div class="col">
23
-          <float-label>
24
-            <input
25
-              type="text"
26
-              placeholder="DESCRIPTION"
27
-              v-model="singleStatus.description"
28
-              class="form-control uniInput"
29
-            />
30
-          </float-label>
31
-        </div>
32
-      </div>
33
-      <div class="row mt-4">
34
-        <div class="col">
35
-          <button class="btn-solid-blue" @click="pushToApi()">EDIT</button>
36
-        </div>
37
-        <div class="col">
38
-          <router-link class="btn-solid-blue" to="/status/list">BACK</router-link>
39
-        </div>
40
-      </div>
41
-    </div>
42
-  </main>
43
-</template>
44
-
45
-<script>
46
-/* eslint-disable */
47
-import { mapActions, mapState } from "vuex";
48
-
49
-export default {
50
-  data() {
51
-    return {
52
-      status: {}
53
-    };
54
-  },
55
-  created() {
56
-    this.getSingleStatus(this.$route.params.id);
57
-  },
58
-  computed: {
59
-    ...mapState("status", ["singleStatus"])
60
-  },
61
-  methods: {
62
-    ...mapActions("status", ["updateStatus", "getSingleStatus"]),
63
-    pushToApi() {
64
-      this.updateStatus(this.singleStatus).then(this.$router.push("/status/list"));
65
-    }
66
-  }
67
-};
68
-</script>
69
-
70
-<style lang="scss" scoped></style>

+ 133
- 40
src/components/admin/status/statusNew.vue Dosyayı Görüntüle

@@ -1,41 +1,73 @@
1 1
 <template>
2
-  <main id="main" style="margin-top:200px; padding-bottom:50px">
2
+  <main id="main" style="margin-top: 200px; padding-bottom: 50px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>New Status</h2>
4
+      <div class="form">
5
+        <div class="row">
6
+          <div class="col">
7
+            <div class="section-header">
8
+              <h2>Status</h2>
9
+            </div>
8 10
           </div>
9 11
         </div>
10
-      </div>
11
-      <div class="row">
12
-        <div class="col">
13
-          <float-label>
14
-            <input
15
-              type="text"
16
-              placeholder="CODE"
17
-              v-model="status.code"
18
-              class="form-control uniInput"
19
-            />
20
-          </float-label>
21
-        </div>
22
-        <div class="col">
23
-          <float-label>
24
-            <input
25
-              type="text"
26
-              placeholder="DESCRIPTION"
27
-              v-model="status.description"
28
-              class="form-control uniInput"
29
-            />
30
-          </float-label>
12
+        <div class="row">
13
+          <div class="col-md-4">
14
+            <div class="form-group">
15
+              <float-label label="Code" style="width: 100%;">
16
+                <input
17
+                  type="text"
18
+                  id="Code"
19
+                  name="Code"
20
+                  v-model="status.code"
21
+                  class="form-control uniInput"
22
+                  placeholder="Code"
23
+                  v-bind:class="{
24
+                    'is-valid': status.code,
25
+                    'is-invalid': !requiredField(status.code) && statusLoad,
26
+                  }"
27
+                  v-on:keyup="statusLoad = true"
28
+                  v-on:blur="statusLoad = true"
29
+                />
30
+                <div class="invalid-feedback">Code is required!</div>
31
+              </float-label>
32
+            </div>
33
+          </div>
34
+          <div class="col-md-4">
35
+            <div class="form-group">
36
+              <float-label label="Description" style="width: 100%;">
37
+                <input
38
+                  type="text"
39
+                  id="Description"
40
+                  name="Description"
41
+                  v-model="status.description"
42
+                  class="form-control uniInput"
43
+                  placeholder="Description"
44
+                  v-bind:class="{
45
+                    'is-valid': status.description,
46
+                    'is-invalid':
47
+                      !requiredField(status.description) && descriptionLoad,
48
+                  }"
49
+                  v-on:keyup="descriptionLoad = true"
50
+                  v-on:blur="descriptionLoad = true"
51
+                />
52
+                <div class="invalid-feedback">Description is required!</div>
53
+              </float-label>
54
+            </div>
55
+          </div>
31 56
         </div>
32
-      </div>
33
-      <div class="row mt-4">
34
-        <div class="col">
35
-          <button class="btn-solid-blue" @click="pushToApi()">SAVE</button>
57
+        <div v-if="boolValidationError" class="row">
58
+          <div class="col">
59
+            <alert :text="errorMessage" :type="errorOccurred" />
60
+          </div>
36 61
         </div>
37
-        <div class="col">
38
-          <router-link class="btn-solid-blue" to="/status/list">BACK</router-link>
62
+        <div class="row">
63
+          <div class="col-md-12">
64
+            <button class="btn-white-border" @click="SubmitData()">
65
+              Submit
66
+            </button>
67
+            <router-link class="btn-white-border" to="/status/list">
68
+              Close
69
+            </router-link>
70
+          </div>
39 71
         </div>
40 72
       </div>
41 73
     </div>
@@ -43,21 +75,82 @@
43 75
 </template>
44 76
 
45 77
 <script>
46
-import { mapActions } from "vuex";
47 78
 /* eslint-disable */
79
+import { mapState, mapActions } from 'vuex'
80
+import alert from '../../shared/alert'
48 81
 export default {
82
+  name: 'StatusNew',
49 83
   data() {
50 84
     return {
51
-      status: {}
52
-    };
85
+      boolMessage: false,
86
+      boolValidationError: false,
87
+      showPassword: false,
88
+      statusLoad: false,
89
+      descriptionLoad: false,
90
+    }
91
+  },
92
+  components: {
93
+    alert,
94
+  },
95
+  mounted() {
96
+    this.clearStatus()
97
+    if (this.$route.params.id > 0) {
98
+      console.log(this.$route.params.id)
99
+      this.getSingleStatus(this.$route.params.id)
100
+      console.log(this.status.description)
101
+    }
102
+  },
103
+  computed: {
104
+    ...mapState('status', ['status']),
53 105
   },
54 106
   methods: {
55
-    ...mapActions("status", ["createNewStatus"]),
107
+    ...mapActions('status', [
108
+      'createNewStatus',
109
+      'getSingleStatus',
110
+      'updateStatus',
111
+      'clearStatus',
112
+    ]),
56 113
     pushToApi() {
57
-      this.createNewStatus(this.status).then(this.$router.push("/status/list"));
58
-    }
59
-  }
60
-};
114
+      this.createNewStatus(this.status).then(this.$router.push('/status/list'))
115
+    },
116
+    SubmitData() {
117
+      if (this.validatePage()) {
118
+        console.log('SubmitData')
119
+        if (this.status.id > 0) {
120
+          this.updateStatus(this.status)
121
+        } else {
122
+          this.createNewStatus(this.status)
123
+        }
124
+        this.$router.push('/status/list')
125
+      }
126
+    },
127
+    requiredField: function (tfield) {
128
+      if (tfield) {
129
+        return true
130
+      } else {
131
+        return false
132
+      }
133
+    },
134
+    validatePage: function () {
135
+      console.log('validatePage')
136
+      if (this.status.code && this.status.description) {
137
+        console.log('passed')
138
+        this.errorOccurred = ''
139
+        this.errorMessage = ''
140
+        this.boolValidationError = false
141
+        return true
142
+      } else {
143
+        console.log('failed')
144
+        this.statusLoad = true
145
+        this.descriptionLoad = true
146
+        this.boolValidationError = true
147
+        this.errorOccurred = 'ERROR'
148
+        this.errorMessage = 'Please check form and correct all input fields!'
149
+        return false
150
+      }
151
+    },
152
+  },
153
+}
61 154
 </script>
62 155
 
63 156
 <style lang="scss" scoped></style>

+ 54
- 44
src/components/admin/status/statusPage.vue Dosyayı Görüntüle

@@ -1,77 +1,87 @@
1 1
 <template>
2
-  <main id="main" style="margin-top:-20px; padding-bottom:50px">
2
+  <main id="main" style="margin-top: -20px; padding-bottom: 50px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col-md-12 col-lg-8">
6
-          <div class="section-header">
7
-            <h2>Status List</h2>
4
+      <div class="form">
5
+        <div class="row">
6
+          <div class="col-md-12 col-lg-8">
7
+            <div class="section-header">
8
+              <h2>Status List</h2>
9
+            </div>
8 10
           </div>
9
-          <br />
11
+        </div>
12
+        <div v-if="checkAccess" class="row">
13
+          <div class="col">
14
+            <ListView
15
+              :items="statusList"
16
+              :showColumnChooser="false"
17
+              :displayColumns="columns"
18
+              :sortkey="'description'"
19
+              :showNew="true"
20
+              :editable="true"
21
+              :deleteable="true"
22
+              @onEdit="Edit"
23
+              @onDelete="Delete"
24
+              @onNew="New"
25
+            />
26
+          </div>
27
+        </div>
28
+        <div v-else>
29
+          <alert
30
+            :text="'You don\'t have permission to view this page'"
31
+            :type="'ERROR'"
32
+          />
10 33
         </div>
11 34
       </div>
12 35
     </div>
13
-    <div v-if="checkAccess" class="container">
14
-      <ListView
15
-        :items="statusList"
16
-        :showColumnChooser="false"
17
-        :columnCount="4"
18
-        :hideSearch="true"
19
-        :compact="false"
20
-        :showNew="true"
21
-        :editable="true"
22
-        :deleteable="true"
23
-        @onEdit="Edit"
24
-        @onDelete="Delete"
25
-        @onNew="New"
26
-      />
27
-    </div>
28
-    <div v-else>
29
-      <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
30
-    </div>
31 36
   </main>
32 37
 </template>
33 38
 
34 39
 <script>
35 40
 /* eslint-disable */
36
-import { mapState, mapActions } from "vuex";
41
+import { mapState, mapActions } from 'vuex'
37 42
 
38
-import Log from "../../../assets/Log";
39
-import alert from "../../shared/alert";
40
-import ListView from "../../shared/listView.vue";
43
+import Log from '../../../assets/Log'
44
+import alert from '../../shared/alert'
45
+import ListView from '../../shared/listView.vue'
41 46
 
42 47
 export default {
43
-  name: "StatusList",
48
+  name: 'StatusList',
44 49
   components: {
45 50
     ListView,
46
-    alert
51
+    alert,
52
+  },
53
+  data() {
54
+    return {
55
+      columns: ['code', 'description', 'display'],
56
+    }
47 57
   },
48 58
   created() {
49
-    this.getStatusList();
59
+    this.getStatusList()
50 60
   },
51 61
   computed: {
52
-    ...mapState("status", ["statusList"]),
62
+    ...mapState('status', ['statusList']),
53 63
     checkAccess() {
54
-      if (Log.getUser().role === "Super Admin") {
55
-        return true;
64
+      if (Log.getUser().role === 'Super Admin') {
65
+        return true
56 66
       } else {
57
-        return false;
67
+        return false
58 68
       }
59
-    }
69
+    },
60 70
   },
61 71
   methods: {
62
-    ...mapActions("status", ["getStatusList", "deleteStatus"]),
72
+    ...mapActions('status', ['getStatusList', 'deleteStatus']),
63 73
     New() {
64
-      this.$router.push("/status/new");
74
+      this.$router.push('/status/new')
65 75
     },
66 76
     Edit(item) {
67 77
       this.$router.push({
68
-        path: `/status/Edit/${item.id}`
69
-      });
78
+        path: `/status/Edit/${item.id}`,
79
+      })
70 80
     },
71 81
     Delete(item) {
72
-      this.deleteStatus(item.id);
73
-    }
74
-  }
75
-};
82
+      this.deleteStatus(item.id)
83
+    },
84
+  },
85
+}
76 86
 </script>
77 87
 <style></style>

+ 97
- 92
src/components/admin/status/userManagementPage.vue Dosyayı Görüntüle

@@ -1,71 +1,74 @@
1 1
 <template>
2
-  <main id="main" style="margin-top:-20px; padding-bottom:50px">
2
+  <main id="main" style="margin-top: -20px; padding-bottom: 50px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>User Management</h2>
8
-          </div>
9
-        </div>
10
-      </div>
11
-      <div v-if="checkAccess">
4
+      <div class="form">
12 5
         <div class="row">
13
-          <div class="col-md-1 offset-1">
14
-            <button type="button" class="btn-solid-blue">USERS</button>
15
-          </div>
16
-          <div class="col-md-1 offset-1">
17
-            <button
18
-              @click="routerGoTo('/status/agentUserManagementPage')"
19
-              type="button"
20
-              class="btn-white-border"
21
-            >
22
-              AGENTS
23
-            </button>
24
-          </div>
25
-          <div class="col-md-1 offset-1">
26
-            <button
27
-              @click="routerGoTo('/status/agencyUserManagementPage')"
28
-              type="button"
29
-              class="btn-white-border"
30
-            >
31
-              AGENCIES
32
-            </button>
6
+          <div class="col">
7
+            <div class="section-header">
8
+              <h2>User Management</h2>
9
+            </div>
33 10
           </div>
34
-          <div class="col-md-2 offset-3">
35
-            <button
36
-              type="button"
37
-              class="btn-white-border"
38
-              data-toggle="modal"
39
-              :data-target="'#myNewUserModal'"
40
-            >
41
-              NEW USER
42
-            </button>
43
-            <div :id="'myNewUserModal'" class="modal fade" role="dialog">
44
-              <div class="modal-dialog modal-lg">
45
-                <div class="modal-content">
46
-                  <div class="modal-header">
47
-                    <button type="button" class="close" data-dismiss="modal">&times;</button>
11
+        </div>
12
+        <div v-if="checkAccess">
13
+          <div class="row">
14
+            <div class="col-md-1 offset-1">
15
+              <button type="button" class="btn-solid-blue">USERS</button>
16
+            </div>
17
+            <div class="col-md-1 offset-1">
18
+              <button
19
+                @click="routerGoTo('/status/agentUserManagementPage')"
20
+                type="button"
21
+                class="btn-white-border"
22
+              >
23
+                AGENTS
24
+              </button>
25
+            </div>
26
+            <div class="col-md-1 offset-1">
27
+              <button
28
+                @click="routerGoTo('/status/agencyUserManagementPage')"
29
+                type="button"
30
+                class="btn-white-border"
31
+              >
32
+                AGENCIES
33
+              </button>
34
+            </div>
35
+            <div class="col-md-2 offset-3">
36
+              <button
37
+                type="button"
38
+                class="btn-white-border"
39
+                data-toggle="modal"
40
+                :data-target="'#myNewUserModal'"
41
+              >
42
+                NEW USER
43
+              </button>
44
+              <div :id="'myNewUserModal'" class="modal fade" role="dialog">
45
+                <div class="modal-dialog modal-lg">
46
+                  <div class="modal-content">
47
+                    <div class="modal-header">
48
+                      <button type="button" class="close" data-dismiss="modal">
49
+                        &times;
50
+                      </button>
51
+                    </div>
52
+                    <Register />
48 53
                   </div>
49
-                  <Register />
50 54
                 </div>
51 55
               </div>
52 56
             </div>
53 57
           </div>
54
-        </div>
55
-        <div class="container">
56
-          <ListView
57
-            :items="individuals"
58
-            :showNew="false"
59
-            :editable="true"
60
-            :deleteable="true"
61
-            :showCustomAction="true"
62
-            :showColumnChooser="false"
63
-            :displayColumns="columns"
64
-            :displayHeaders="headers"
65
-            @onEdit="Edit"
66
-            @onDelete="Delete"
67
-          />
68
-          <!-- <ListView
58
+          <div class="container">
59
+            <ListView
60
+              :items="individuals"
61
+              :showNew="false"
62
+              :editable="true"
63
+              :deleteable="true"
64
+              :showCustomAction="true"
65
+              :showColumnChooser="false"
66
+              :displayColumns="columns"
67
+              :displayHeaders="headers"
68
+              @onEdit="Edit"
69
+              @onDelete="Delete"
70
+            />
71
+            <!-- <ListView
69 72
             :items="individuals"
70 73
             :showNew="false"
71 74
             :editable="true"
@@ -79,10 +82,14 @@
79 82
             @onDelete="Delete"
80 83
             @onResetPassword="PasswordReset"
81 84
           /> -->
85
+          </div>
86
+        </div>
87
+        <div v-else>
88
+          <alert
89
+            :text="'You don\'t have permission to view this page'"
90
+            :type="'ERROR'"
91
+          />
82 92
         </div>
83
-      </div>
84
-      <div v-else>
85
-        <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
86 93
       </div>
87 94
     </div>
88 95
   </main>
@@ -90,59 +97,57 @@
90 97
 
91 98
 <script>
92 99
 /* eslint-disable */
93
-import { mapState, mapActions, mapGetters } from "vuex";
100
+import { mapState, mapActions, mapGetters } from 'vuex'
94 101
 
95
-import Log from "../../../assets/Log";
96
-import alert from "../../shared/alert.vue";
97
-import Register from "../../user/registerIndividual";
98
-import ListView from "../../shared/listView.vue";
102
+import Log from '../../../assets/Log'
103
+import alert from '../../shared/alert.vue'
104
+import Register from '../../user/registerIndividual'
105
+import ListView from '../../shared/listView.vue'
99 106
 
100 107
 export default {
101
-  name: "userManagementPage",
108
+  name: 'userManagementPage',
102 109
   components: {
103 110
     ListView,
104 111
     alert,
105
-    Register
112
+    Register,
106 113
   },
107 114
   data() {
108 115
     return {
109
-      columns: ["id", "name", "surname", "cellNumber", "telephone", "email"],
110
-      headers: ["", "", "", "", "", "", ""],
111
-      item: {}
112
-    };
116
+      columns: ['id', 'name', 'surname', 'cellNumber', 'telephone', 'email'],
117
+      headers: ['', '', '', '', '', '', ''],
118
+      item: {},
119
+    }
113 120
   },
114 121
   props: {},
115 122
   methods: {
116
-    ...mapActions("register", ["getIndividuals", "deleteIndividual"]),
117
-    ...mapActions("role", ["retrieveRoles"]),
123
+    ...mapActions('register', ['getIndividuals', 'deleteIndividual']),
124
+    ...mapActions('role', ['retrieveRoles']),
118 125
     routerGoTo(goTo) {
119
-      this.$router.push(goTo);
126
+      this.$router.push(goTo)
120 127
     },
121 128
     Edit(item) {
122
-      this.$router.push({ name: "UpdateInfo", params: { indivParam: item } });
129
+      this.$router.push({ name: 'UpdateInfo', params: { indivParam: item } })
123 130
     },
124 131
     Delete(item) {
125
-      console.log(item);
126
-      this.deleteIndividual(item.id);
127
-    }
132
+      console.log(item)
133
+      this.deleteIndividual(item.id)
134
+    },
128 135
   },
129 136
   mounted() {
130
-    this.getIndividuals();
137
+    this.getIndividuals()
131 138
   },
132 139
   computed: {
133
-    ...mapState("register", ["individuals", "removeIndividual"]),
134
-    ...mapGetters("role", ["getRoles"]),
140
+    ...mapState('register', ['individuals', 'removeIndividual']),
141
+    ...mapGetters('role', ['getRoles']),
135 142
     checkAccess() {
136
-      if (Log.getUser().role === "Super Admin") {
137
-        return true;
143
+      if (Log.getUser().role === 'Super Admin') {
144
+        return true
138 145
       } else {
139
-        return false;
146
+        return false
140 147
       }
141
-    }
142
-  }
143
-};
148
+    },
149
+  },
150
+}
144 151
 </script>
145 152
 
146
-<style lang="scss" scoped>
147
-</style>
148
-
153
+<style lang="scss" scoped></style>

+ 0
- 0
src/components/admin/test.html Dosyayı Görüntüle


+ 31
- 26
src/components/admin/unitConfiguration/unitConfigurationPage.vue Dosyayı Görüntüle

@@ -1,53 +1,58 @@
1 1
 <template>
2
-  <main id="main" style="margin-top:-20px; padding-bottom:50px">
2
+  <main id="main" style="margin-top: -20px; padding-bottom: 50px;">
3 3
     <div class="container">
4
-      <div class="row">
5
-        <div class="col">
6
-          <div class="section-header">
7
-            <h2>Unit Configuration List</h2>
4
+      <div class="form">
5
+        <div class="row">
6
+          <div class="col">
7
+            <div class="section-header">
8
+              <h2>Unit Configuration List</h2>
9
+            </div>
8 10
           </div>
9 11
         </div>
12
+        <div v-if="checkAccess" class="container">
13
+          <ListView :items="unitConfigurationList" :showNew="false" />
14
+        </div>
15
+        <div v-else>
16
+          <alert
17
+            :text="'You don\'t have permission to view this page'"
18
+            :type="'ERROR'"
19
+          />
20
+        </div>
10 21
       </div>
11 22
     </div>
12
-    <div v-if="checkAccess" class="container">
13
-      <ListView :items="unitConfigurationList" />
14
-    </div>
15
-    <div v-else>
16
-      <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
17
-    </div>
18 23
   </main>
19 24
 </template>
20 25
 
21 26
 <script>
22 27
 /* eslint-disable */
23
-import { mapState, mapActions } from "vuex";
28
+import { mapState, mapActions } from 'vuex'
24 29
 
25
-import Log from "../../../assets/Log";
26
-import alert from "../../shared/alert";
27
-import ListView from "../../shared/listView.vue";
30
+import Log from '../../../assets/Log'
31
+import alert from '../../shared/alert'
32
+import ListView from '../../shared/listView.vue'
28 33
 
29 34
 export default {
30
-  name: "UnitConfiguration",
35
+  name: 'UnitConfiguration',
31 36
   components: {
32 37
     ListView,
33
-    alert
38
+    alert,
34 39
   },
35 40
   created() {
36
-    this.getUnitConfigurationList();
41
+    this.getUnitConfigurationList()
37 42
   },
38 43
   computed: {
39
-    ...mapState("unitConfiguration", ["unitConfigurationList"]),
44
+    ...mapState('unitConfiguration', ['unitConfigurationList']),
40 45
     checkAccess() {
41
-      if (Log.getUser().role === "Super Admin") {
42
-        return true;
46
+      if (Log.getUser().role === 'Super Admin') {
47
+        return true
43 48
       } else {
44
-        return false;
49
+        return false
45 50
       }
46
-    }
51
+    },
47 52
   },
48 53
   methods: {
49
-    ...mapActions("unitConfiguration", ["getUnitConfigurationList"])
50
-  }
51
-};
54
+    ...mapActions('unitConfiguration', ['getUnitConfigurationList']),
55
+  },
56
+}
52 57
 </script>
53 58
 <style></style>

+ 57
- 52
src/components/communication/enquireNowLog.vue Dosyayı Görüntüle

@@ -1,34 +1,39 @@
1 1
 <template>
2 2
   <div v-if="!boolLoaded" id="preloader"></div>
3
-  <main v-else id="main" style="margin-top:-20px; padding-bottom:50px">
3
+  <main v-else id="main" style="margin-top: -20px; padding-bottom: 50px;">
4 4
     <div class="container">
5
-      <div class="row">
6
-        <div class="col">
7
-          <div class="section-header">
8
-            <h2>Enquire Now Log</h2>
5
+      <div class="form">
6
+        <div class="row">
7
+          <div class="col">
8
+            <div class="section-header">
9
+              <h2>Enquire Now Log</h2>
10
+            </div>
9 11
           </div>
10 12
         </div>
11
-      </div>
12
-      <div v-if="checkAccess">
13
-        <div class="container">
14
-          <div class="row">
15
-            <div class="col-md-12">
16
-              <ListView
17
-                :items="enquireNowLog"
18
-                :showColumnChooser="false"
19
-                :hideSearch="false"
20
-                :compact="false"
21
-                :showNew="false"
22
-                :editable="false"
23
-                :deleteable="false"
24
-                :displayColumns="columns"
25
-              />
13
+        <div v-if="checkAccess">
14
+          <div class="container">
15
+            <div class="row">
16
+              <div class="col-md-12">
17
+                <ListView
18
+                  :items="enquireNowLog"
19
+                  :showColumnChooser="false"
20
+                  :hideSearch="false"
21
+                  :compact="false"
22
+                  :showNew="false"
23
+                  :editable="false"
24
+                  :deleteable="false"
25
+                  :displayColumns="columns"
26
+                />
27
+              </div>
26 28
             </div>
27 29
           </div>
28 30
         </div>
29
-      </div>
30
-      <div v-else>
31
-        <alert :text="'You don\'t have permission to view this page'" :type="'ERROR'" />
31
+        <div v-else>
32
+          <alert
33
+            :text="'You don\'t have permission to view this page'"
34
+            :type="'ERROR'"
35
+          />
36
+        </div>
32 37
       </div>
33 38
     </div>
34 39
   </main>
@@ -36,55 +41,55 @@
36 41
 
37 42
 <script>
38 43
 /* eslint-disable */
39
-import { mapActions, mapState } from "vuex";
40
-import Log from "../../assets/Log";
41
-import alert from "../shared/alert.vue";
42
-import ListView from "../shared/listView";
44
+import { mapActions, mapState } from 'vuex'
45
+import Log from '../../assets/Log'
46
+import alert from '../shared/alert.vue'
47
+import ListView from '../shared/listView'
43 48
 export default {
44 49
   components: {
45 50
     ListView,
46
-    alert
51
+    alert,
47 52
   },
48 53
   data() {
49 54
     return {
50 55
       boolLoaded: false,
51 56
       columns: [
52
-        "id",
53
-        "property",
54
-        "created",
55
-        "name",
56
-        "email",
57
-        "phone",
58
-        "message",
59
-        "heardFrom",
60
-        "error"
61
-      ]
62
-    };
57
+        'id',
58
+        'property',
59
+        'created',
60
+        'name',
61
+        'email',
62
+        'phone',
63
+        'message',
64
+        'heardFrom',
65
+        'error',
66
+      ],
67
+    }
63 68
   },
64 69
   methods: {
65
-    ...mapActions("template", ["getEnquireNowLog"]),
70
+    ...mapActions('template', ['getEnquireNowLog']),
66 71
     async loadData() {
67
-      await this.getEnquireNowLog();
68
-    }
72
+      await this.getEnquireNowLog()
73
+    },
69 74
   },
70 75
   mounted() {
71 76
     this.loadData().then(() => {
72 77
       setTimeout(() => {
73
-        this.boolLoaded = true;
74
-      }, 100);
75
-    });
78
+        this.boolLoaded = true
79
+      }, 100)
80
+    })
76 81
   },
77 82
   computed: {
78
-    ...mapState("template", ["enquireNowLog"]),
83
+    ...mapState('template', ['enquireNowLog']),
79 84
     checkAccess() {
80
-      if (Log.getUser().role === "Super Admin") {
81
-        return true;
85
+      if (Log.getUser().role === 'Super Admin') {
86
+        return true
82 87
       } else {
83
-        return false;
88
+        return false
84 89
       }
85
-    }
86
-  }
87
-};
90
+    },
91
+  },
92
+}
88 93
 </script>
89 94
 
90 95
 <style lang="scss" scoped></style>

+ 1
- 19
src/components/shared/contactUsSection.vue Dosyayı Görüntüle

@@ -100,25 +100,7 @@
100 100
         </float-label>
101 101
       </div>
102 102
 
103
-      <div class="form-group">
104
-        <float-label label="Message" style="width: 100%;">
105
-          <textarea
106
-            type="text"
107
-            id="message"
108
-            rows="5"
109
-            class="form-control uniInput my-2"
110
-            v-model="message"
111
-            v-bind:class="{
112
-              'is-valid': message,
113
-              'is-invalid': !requiredField(message) && messageLoad,
114
-            }"
115
-            v-on:keyup="messageLoad = true"
116
-            v-on:blur="messageLoad = true"
117
-            placeholder="Message"
118
-          ></textarea>
119
-          <div class="invalid-feedback">Message is required!</div>
120
-        </float-label>
121
-      </div>
103
+      <div class="form-group"></div>
122 104
       <div class="text-center">
123 105
         <button class="btn-white-border" @click="sendMail()">Send</button>
124 106
       </div>

+ 10
- 10
src/components/shared/listView.vue Dosyayı Görüntüle

@@ -333,7 +333,7 @@ export default {
333 333
       default: true,
334 334
     },
335 335
     showColumnChooser: {
336
-      default: true,
336
+      default: false,
337 337
     },
338 338
     displayColumns: {
339 339
       type: Array,
@@ -450,15 +450,15 @@ export default {
450 450
     },
451 451
     onRowClick(item, i) {
452 452
       const ind = this.getActualIndex(i)
453
-      if (_.some(this.selectedItems, (x) => x === ind)) {
454
-        this.selectedItems = this.selectedItems.filter((x) => x !== ind)
455
-      } else {
456
-        if (!this.allowMultipleSelect) {
457
-          this.selectedItems = []
458
-        }
459
-        this.selectedItems.push(item)
460
-      }
461
-      this.$emit('onRowClick', this.selectedItems)
453
+      //if (_.some(this.selectedItems, (x) => x === ind)) {
454
+      //  this.selectedItems = this.selectedItems.filter((x) => x !== ind)
455
+      //} else {
456
+      //  if (!this.allowMultipleSelect) {
457
+      //    this.selectedItems = []
458
+      //  }
459
+      //  this.selectedItems.push(item)
460
+      //}
461
+      //this.$emit('onRowClick', this.selectedItems)
462 462
     },
463 463
     getActualIndex(index) {
464 464
       return (this.currentPage - 1) * this.visibleItemsPerPageCount + index

+ 1
- 1
src/components/user/registerAgentSection.vue Dosyayı Görüntüle

@@ -238,7 +238,7 @@
238 238
         v-on:click="SubmitData()"
239 239
         type="submit"
240 240
       >
241
-        SUBMIT
241
+        Submit
242 242
       </button>
243 243
       <button
244 244
         :data-target="'#myModalAgent'"

+ 1
- 2
src/router/index.js Dosyayı Görüntüle

@@ -46,7 +46,6 @@ import Contact from '../components/shared/contact.vue'
46 46
 
47 47
 import Status from '../components/admin/status/statusPage.vue'
48 48
 import StatusNew from '../components/admin/status/statusNew.vue'
49
-import StatusEdit from '../components/admin/status/statusEdit.vue'
50 49
 
51 50
 import timeshareAdminPage from '../components/admin/status/timeshareAdminPage.vue'
52 51
 import tenderWeekAdminPage from '../components/admin/status/tenderWeekAdminPage.vue'
@@ -621,7 +620,7 @@ export default new Router({
621 620
         {
622 621
             path: '/status/Edit/:id',
623 622
             name: 'statusEdit',
624
-            component: StatusEdit,
623
+            component: StatusNew,
625 624
         },
626 625
         {
627 626
             path: '/financial/eftPage',

+ 8
- 4
src/store/modules/communication/contactUsSources.js Dosyayı Görüntüle

@@ -14,8 +14,6 @@ export default {
14 14
         },
15 15
         setContactUsSource(state, source) {
16 16
             state.contactUsSource = source
17
-            console.log('here')
18
-            console.log(this.contactUsSource)
19 17
         },
20 18
         addToContactUsSources(state, source) {
21 19
             state.contactUsSources.push(source)
@@ -56,13 +54,19 @@ export default {
56 54
         saveContactUsSource({ commit }, item) {
57 55
             axios
58 56
                 .post('/api/MailSource', item)
59
-                .then((result) => commit('addToContactUsSources', result.data))
57
+                .then((result) => {
58
+                    commit('addToContactUsSources', result.data)
59
+                })
60 60
                 .catch(console.error)
61 61
         },
62 62
         updateContactUsSource({ commit }, item) {
63 63
             axios
64 64
                 .put('/api/MailSource', item)
65
-                .then((result) => commit('updateContactUsSources', item))
65
+                .then((result) => {
66
+                    console.log('updateContactUsSources')
67
+                    console.log(item)
68
+                    commit('updateContactUsSources', item)
69
+                })
66 70
                 .catch(console.error)
67 71
         },
68 72
         clearContactUsSource({ commit }) {

+ 72
- 67
src/store/modules/property/propertyTypes.js Dosyayı Görüntüle

@@ -1,72 +1,77 @@
1
-import axios from 'axios';
1
+import axios from 'axios'
2 2
 
3 3
 export default {
4
-  namespaced: true,
5
-  state: {
6
-    propertyTypes: [],
7
-    propertyType: {
8
-      description: '',
9
-      usageType: 0,
4
+    namespaced: true,
5
+    state: {
6
+        propertyTypes: [],
7
+        propertyType: {
8
+            description: '',
9
+            usageType: 0,
10
+        },
10 11
     },
11
-  },
12
-  mutations: {
13
-    setPropertyTypes(state, types) {
14
-      state.propertyTypes = types;
12
+    mutations: {
13
+        setPropertyTypes(state, types) {
14
+            state.propertyTypes = types
15
+        },
16
+        setPropertyType(state, type) {
17
+            state.propertyType = type
18
+        },
19
+        addToPropertyTypes(state, type) {
20
+            state.propertyTypes.push(type)
21
+        },
22
+        updatePropertyTypes(state, type) {
23
+            state.propertyTypes.find((item) => item.id === type.id).description =
24
+                type.description
25
+            state.propertyTypes.find((item) => item.id === type.id).usageType =
26
+                type.usageType
27
+        },
28
+        clearPropertyType(state) {
29
+            state.propertyType = {
30
+                description: '',
31
+                usageType: 0,
32
+            }
33
+        },
34
+        removePropertyType(state, id) {
35
+            state.propertyTypes.pop(state.propertyTypes.find((p) => p.id === id))
36
+        },
15 37
     },
16
-    setPropertyType(state, type) {
17
-      state.propertyType = type;
38
+    getters: {},
39
+    actions: {
40
+        getPropertyTypes({ commit }) {
41
+            axios
42
+                .get('/api/PropertyType')
43
+                .then((result) => commit('setPropertyTypes', result.data))
44
+                .catch(console.error)
45
+        },
46
+        getPropertyType({ commit }, id) {
47
+            axios
48
+                .get(`/api/PropertyType/${id}`)
49
+                .then((result) => commit('setPropertyType', result.data))
50
+                .catch(console.error)
51
+        },
52
+        savePropertyType({ commit }, item) {
53
+            axios
54
+                .post('/api/PropertyType', item)
55
+                .then((result) => {
56
+                    console.log('save')
57
+                    commit('addToPropertyTypes', result.data)
58
+                })
59
+                .catch(console.error)
60
+        },
61
+        updatePropertyType({ commit }, item) {
62
+            axios
63
+                .put('/api/PropertyType', item)
64
+                .then((result) => commit('updatePropertyTypes', item))
65
+                .catch(console.error)
66
+        },
67
+        clearPropertyType({ commit }) {
68
+            commit('clearPropertyType')
69
+        },
70
+        deletePropertyType({ commit }, id) {
71
+            axios
72
+                .delete(`/api/PropertyType/${id}`)
73
+                .then((result) => commit('removePropertyType', id))
74
+                .catch(console.error)
75
+        },
18 76
     },
19
-    addToPropertyTypes(state, type) {
20
-      state.propertyTypes.push(type);
21
-    },
22
-    updatePropertyTypes(state, type) {
23
-      state.propertyTypes.find(item => item.id === type.id).description = type.description;
24
-      state.propertyTypes.find(item => item.id === type.id).usageType = type.usageType;
25
-    },
26
-    clearPropertyType(state) {
27
-      state.propertyType = {
28
-        description: '',
29
-        usageType: 0,
30
-      };
31
-    },
32
-    removePropertyType(state, id) {
33
-      state.propertyTypes.pop(state.propertyTypes.find(p => p.id === id));
34
-    },
35
-  },
36
-  getters: {},
37
-  actions: {
38
-    getPropertyTypes({ commit }) {
39
-      axios
40
-        .get('/api/PropertyType')
41
-        .then(result => commit('setPropertyTypes', result.data))
42
-        .catch(console.error);
43
-    },
44
-    getPropertyType({ commit }, id) {
45
-      axios
46
-        .get(`/api/PropertyType/${id}`)
47
-        .then(result => commit('setPropertyType', result.data))
48
-        .catch(console.error);
49
-    },
50
-    savePropertyType({ commit }, item) {
51
-      axios
52
-        .post('/api/PropertyType', item)
53
-        .then(result => commit('addToPropertyTypes', result.data))
54
-        .catch(console.error);
55
-    },
56
-    updatePropertyType({ commit }, item) {
57
-      axios
58
-        .put('/api/PropertyType', item)
59
-        .then(result => commit('updatePropertyTypes', item))
60
-        .catch(console.error);
61
-    },
62
-    clearPropertyType({ commit }) {
63
-      commit('clearPropertyType');
64
-    },
65
-    deletePropertyType({ commit }, id) {
66
-      axios
67
-        .delete(`/api/PropertyType/${id}`)
68
-        .then(result => commit('removePropertyType', id))
69
-        .catch(console.error);
70
-    },
71
-  },
72
-};
77
+}

Loading…
İptal
Kaydet