@nixweb/nixloc-ui 0.0.264 → 0.0.266

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nixweb/nixloc-ui",
3
- "version": "0.0.264",
3
+ "version": "0.0.266",
4
4
  "description": "Componentes UI",
5
5
  "author": "Fábio Ávila <fabio@nixweb.com.br>",
6
6
  "private": false,
@@ -17,6 +17,25 @@ export default {
17
17
  d: Object,
18
18
  },
19
19
  methods: {
20
+ periodo(grupo, campo) {
21
+ var item = this.d.itensLocacao.find(item => item.grupo == grupo);
22
+ const campoMap = {
23
+ "dataEntrega": item.dataEntrega,
24
+ "horaEntrega": item.horaEntrega,
25
+ "dataInicio": item.dataInicio,
26
+ "horaInicio": item.horaInicio,
27
+ "dataFim": item.dataFim,
28
+ "horaFim": item.horaFim,
29
+ "dataRetirada": item.dataRetirada,
30
+ "horaRetirada": item.horaRetirada,
31
+ "ano": item.ano,
32
+ "mes": item.mes,
33
+ "dia": item.dia,
34
+ "hora": item.hora,
35
+ "minuto": item.minuto
36
+ };
37
+ return campoMap[campo];
38
+ },
20
39
  somaGrupo(grupo) {
21
40
  let sum = [];
22
41
  this.d.itensLocacao.forEach((item) => {
@@ -36,6 +55,7 @@ export default {
36
55
  var group = this.groupBy({ array: this.d.itensLocacao, key: "grupo" });
37
56
  return group;
38
57
  },
58
+
39
59
  },
40
60
  };
41
61
  </script>
@@ -29,6 +29,5 @@ export default {
29
29
  .content {
30
30
  width: 1024px;
31
31
  margin: auto;
32
- padding: 10px;
33
32
  }
34
33
  </style>
@@ -2,23 +2,52 @@
2
2
  <div>
3
3
  <hr class="hr-report" />
4
4
  <div class="text-right">
5
- <span class="title-report-header"> Total de Registro(s) </span>
6
- <span class="title-report-header value-report-header"> {{ totalRecords }} </span>
5
+ <b-row>
6
+ <b-col sm="10">
7
+ <span class="title-report-header"> Total de Registros .................. </span>
8
+ </b-col>
9
+ <b-col sm="2">
10
+ <span class="title-report-header value-report-header"> {{ totalRecords }} </span>
11
+ </b-col>
12
+ </b-row>
7
13
  </div>
8
14
  <div class="text-right" v-for="item in totalization" :key="item.title">
9
- <span :class="convertName(item[0]).classCss">
15
+ <b-row>
16
+ <b-col sm="10">
17
+ <span v-if="convertName(item[0]).type == 'currency'">
18
+ <span class="title-report-header">
19
+ {{ convertName(item[0]).title }} ..................
20
+ </span>
21
+ </span>
22
+ </b-col>
23
+ <b-col sm="2">
24
+ <span v-if="convertName(item[0]).type == 'currency'">
25
+ {{ item[1] | currency }}
26
+ </span>
27
+ <span v-if="convertName(item[0]).type == 'numeric'">
28
+ {{ Math.round(item[1]) }}
29
+ </span>
30
+ </b-col>
31
+ </b-row>
32
+
33
+
34
+ <!-- <span :class="convertName(item[0]).classCss">
10
35
  <span class="title-report-header">
11
36
  {{ convertName(item[0]).title }}
12
37
  <span class="title-report-header value-report-header">
13
- <span v-if="convertName(item[0]).type == 'currency'">
14
- {{ item[1] | currency }}
15
- </span>
16
- <span v-if="convertName(item[0]).type == 'numeric'">
17
- {{ Math.round(item[1]) }}
18
- </span>
38
+ <div class="side-by-side div-title">
39
+ <span v-if="convertName(item[0]).type == 'currency'">
40
+ {{ item[1] | currency }}
41
+ </span>
42
+ </div>
43
+ <div class="side-by-side div-value">
44
+ <span v-if="convertName(item[0]).type == 'numeric'">
45
+ {{ Math.round(item[1]) }}
46
+ </span>
47
+ </div>
19
48
  </span>
20
49
  </span>
21
- </span>
50
+ </span> -->
22
51
  </div>
23
52
  </div>
24
53
  </template>
@@ -60,4 +89,8 @@ export default {
60
89
  .receipt {
61
90
  color: darkblue;
62
91
  }
92
+
93
+ .div-title {
94
+ margin-right: 0px;
95
+ }
63
96
  </style>
@@ -46,7 +46,11 @@ export default class ConvertToOdata {
46
46
  if (seq + 1 != size) query += ` or `;
47
47
  }
48
48
  if (type == "totalization") {
49
- query += `${name} with ${value} as ${value}${name.charAt(0).toUpperCase() + name.slice(1)}`;
49
+
50
+ let field = value.split('_').pop();
51
+ field = field.charAt(0).toLowerCase() + field.slice(1);
52
+
53
+ query += `${field} with ${value.split('_')[0]} as ${value.replace(/_/g, '')}`;
50
54
  if (seq + 1 != size) query += `,`;
51
55
  }
52
56
  seq++;
@@ -153,6 +153,8 @@ export default {
153
153
  rules: this.templateReport.rules,
154
154
  });
155
155
 
156
+ this.clearTotalization();
157
+
156
158
  if (this.id) this.getById();
157
159
 
158
160
  if (!this.id) this.removeLoadingWithTime();
@@ -166,6 +168,7 @@ export default {
166
168
  "addReport",
167
169
  "addInitialReportCustom",
168
170
  "removeInitialReportCustom",
171
+
169
172
  ]),
170
173
  ...mapMutations("generic", [
171
174
  "addEvent",
@@ -173,6 +176,9 @@ export default {
173
176
  "hideModal",
174
177
  "removeLoading",
175
178
  ]),
179
+ ...mapMutations("report", [
180
+ "clearTotalization"
181
+ ]),
176
182
  getById() {
177
183
  let params = { url: this.urlGetById, obj: { id: this.id } };
178
184
  this.getApi(params).then((response) => {
@@ -448,6 +448,7 @@ export default {
448
448
  context.commit('removeNotificarions');
449
449
  return response.data;
450
450
  } else {
451
+
451
452
  context.commit('addNotifications', response.data.notifications)
452
453
  context.commit('addToast', 'falhaGenerica');
453
454
  return response.data;
@@ -254,6 +254,9 @@ export default {
254
254
  }
255
255
  });
256
256
  },
257
+ clearTotalization: (state) => {
258
+ state.finalQueryFormatOData.totalization = [];
259
+ }
257
260
  },
258
261
  actions: {
259
262
  addReport: async function (context, report) {