eztech-core-components 1.0.21 → 1.0.22

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.
@@ -325,9 +325,10 @@ export default {
325
325
  methods: {
326
326
  ...mapActions('settings', ['set_pdf_url']),
327
327
  handleChangeDescription (image) {
328
- const doRequest = () => this.$axios.post('7/log_files', {
328
+ const doRequest = () => this.$axios.post('file/description', {
329
329
  _id: image._id,
330
- description: image.description
330
+ description: image.description,
331
+ tid: image.tid
331
332
  }).catch((err) => {
332
333
  this.$showError(err)
333
334
  })
@@ -224,6 +224,7 @@
224
224
  :no-search="true"
225
225
  :plain-button="true"
226
226
  :parent-level="level"
227
+ :serviceName="serviceName"
227
228
  />
228
229
  </div>
229
230
  </fieldset>
@@ -40,6 +40,7 @@
40
40
  :hide-excel="true"
41
41
  :no-search="true"
42
42
  :plain-button="true"
43
+ :service-name="serviceName"
43
44
  />
44
45
  </div>
45
46
  <div
@@ -122,8 +123,8 @@
122
123
  <training-hrm-material v-else-if="group.name === 'TRAINING_MATERIALS'" :parent-row="temp" :level="level" />
123
124
  <training-hrm-material v-else-if="group.name === 'TRAINING_MATERIALS1'" :parent-row="temp" :level="level" />
124
125
  <hrm-employee-inquiries v-else-if="group.name === 'HRM_EMPLOYEE_INQUIRIES'" :parent-row="temp" :level="level" />
125
- <archive-document-pages v-else-if="group.name === 'ARCHIVE_DOCUMENT_PAGES'" :parent-temp="temp" :parent-root-api-id="rootApiId" :temp-id="temp && temp._id" :level="level" :group="group" :ref-column="refColumns.find(c => c.tableName === group.col_fields)" />
126
- <archive-classification-item-pages v-else-if="group.name === 'CLASSIFICATION_ITEM_PAGES'" :parent-temp="temp" :temp-id="temp && temp._id" :level="level" :group="group" :ref-column="refColumns.find(c => c.tableName === group.col_fields)" />
126
+ <archive-document-pages v-else-if="group.name === 'ARCHIVE_DOCUMENT_PAGES'" :parent-temp="temp" :parent-root-api-id="rootApiId" :temp-id="temp && temp._id" :level="level" :group="group" :ref-column="refColumns.find(c => c.tableName === group.col_fields)" :service-name="serviceName" />
127
+ <archive-classification-item-pages v-else-if="group.name === 'CLASSIFICATION_ITEM_PAGES'" :parent-temp="temp" :temp-id="temp && temp._id" :level="level" :group="group" :ref-column="refColumns.find(c => c.tableName === group.col_fields)" :service-name="serviceName" />
127
128
  </div>
128
129
  <template v-else>
129
130
  <template
@@ -48,7 +48,8 @@ export default {
48
48
  noSearch: { type: Boolean, default: false },
49
49
  plainButton: { type: Boolean, default: false },
50
50
  apiName: { type: String, default: null },
51
- showPkid: { type: Boolean, default: false }
51
+ showPkid: { type: Boolean, default: false },
52
+ serviceName: { type: String, default: null }
52
53
  },
53
54
  data () {
54
55
  return {
@@ -77,6 +78,9 @@ export default {
77
78
  ...tableComputed,
78
79
  tableName () {
79
80
  return this.table?.name
81
+ },
82
+ subUrl () {
83
+ return `sub/${this.serviceName}/${this.tempId}/`
80
84
  }
81
85
  },
82
86
  watch: {
@@ -190,22 +190,12 @@ export default {
190
190
  this.result_message = null
191
191
  this.id = null
192
192
  this.xypServiceDetails = []
193
- const { data: xypService } = await this.$axios.get('one/7/xyp_services', {
194
- params: {
195
- search: JSON.stringify({
196
- name: { val: this.serviceName, t: 'string', op: 'eq' }
197
- })
198
- }
199
- })
200
- if (!xypService._id) {
201
- this.$customError('Сервис олдсонгүй')
193
+ const params = {}
194
+ if (this.xypLogId) {
195
+ params.xypLogId = this.xypLogId
202
196
  }
203
- const { data: xypServiceDetails } = await this.$axios.get('list/7/xyp_service_details', {
204
- params: {
205
- search: JSON.stringify({
206
- service_id: { val: xypService._id, t: 'number', op: 'eq' }
207
- })
208
- }
197
+ const { data: { xypService, xypServiceDetails, xypLog } } = await this.$axios.get(`xypservice/service/log/${this.serviceName}`, {
198
+ params
209
199
  })
210
200
  const requestData = {}
211
201
  for (const itemInput of xypServiceDetails.filter(c => c.is_input)) {
@@ -214,13 +204,12 @@ export default {
214
204
  this.request = { ...requestData, ...this.defaultRequest }
215
205
  this.xypService = xypService
216
206
  this.xypServiceDetails = xypServiceDetails
217
- if (this.xypLogId) {
218
- const { data } = await this.$axios.get(`7/xyp_logs/${this.xypLogId}`)
219
- this.request = data.request
220
- this.response = data.response
221
- this.id = data._id
222
- this.created_at = data.created_at
223
- this.result_message = data.result_message
207
+ if (xypLog) {
208
+ this.request = xypLog.request
209
+ this.response = xypLog.response
210
+ this.id = xypLog._id
211
+ this.created_at = xypLog.created_at
212
+ this.result_message = xypLog.result_message
224
213
  }
225
214
  } catch (err) {
226
215
  this.$showError(err)
@@ -176,7 +176,7 @@ export default {
176
176
  if (!this.$attrs.value) {
177
177
  return null
178
178
  }
179
- const { data } = await this.$axios.get('list/5/reg_resolutions', {
179
+ const { data } = await this.$axios.get('list/5/service_search_reg_resolutions', {
180
180
  params: {
181
181
  search: JSON.stringify({
182
182
  crime_description: { val: this.$attrs.value, t: 'string', op: 'start' },
@@ -74,7 +74,7 @@ export default {
74
74
  if (this.timeout[type?._id]) {
75
75
  clearTimeout(this.timeout[type?._id])
76
76
  }
77
- this.timeout[type?._id] = setTimeout(() => this.$axios.post('5/hrm_employee_national_lang_skills', { ...changedItem }).catch(this.$showError), 2000)
77
+ this.timeout[type?._id] = setTimeout(() => this.$axios.post('5/service_hrm_employee_national_lang_skills', { ...changedItem }).catch(this.$showError), 2000)
78
78
  } catch (err) {
79
79
  this.$showError(err)
80
80
  }
@@ -95,7 +95,7 @@ export default {
95
95
  changedItem = { employee_id: this.temp._id, skill_id: type, rate_id: rate }
96
96
  this.list.push({ ...changedItem })
97
97
  }
98
- await this.$axios.post('5/hrm_employee_national_lang_skills', { ...changedItem })
98
+ await this.$axios.post('5/service_hrm_employee_national_lang_skills', { ...changedItem })
99
99
  } catch (err) {
100
100
  this.$showError(err)
101
101
  } finally {
@@ -114,18 +114,12 @@ export default {
114
114
  return
115
115
  }
116
116
  this.loading = true
117
- const { data } = await this.$axios.get('list/5/hrm_employee_national_lang_skills', {
118
- params: {
119
- search: JSON.stringify({
120
- employee_id: { op: 'eq', val: this.temp._id, t: 'number' }
121
- })
122
- }
117
+ const { data } = await this.$axios.get(`hrm/user/national/lang/skills/${this.temp._id}`, {
118
+ params: { tid: this.temp.tid }
123
119
  })
124
- const { data: skillTypes } = await this.$axios.get('list/5/ref_hrm_national_lang_skills')
125
- const { data: skillRates } = await this.$axios.get('list/5/ref_hrm_national_lang_rates')
126
- this.skillTypes = skillTypes
127
- this.skillRates = skillRates
128
- this.list = data
120
+ this.skillTypes = data.skillTypes
121
+ this.skillRates = data.skillRates
122
+ this.list = data.list
129
123
  } catch (err) {
130
124
  this.$showError(err)
131
125
  } finally {
@@ -216,7 +216,7 @@
216
216
  :title="title"
217
217
  width="950px"
218
218
  v-el-drag-dialog
219
- append-to-body="appendToBody"
219
+ append-to-body
220
220
  :close-on-click-modal="false"
221
221
  >
222
222
  <div v-if="visible" class="flex flex-col gap-2">
@@ -426,52 +426,18 @@ export default {
426
426
  return
427
427
  }
428
428
  this.loading = true
429
- const { data: clotheRegs } = await this.$axios.get('list/5/ref_clothe_regs', {
429
+ const { data } = await this.$axios.get(`hrm/user/clothes/${this.temp._id}`, {
430
430
  params: {
431
- extraFields: 'type_general_id.clothe_sizes,type_general_id.sort_order'
431
+ tid: this.temp.tid
432
432
  }
433
433
  })
434
- const { data: list } = await this.$axios.get('list/5/hrm_employee_clothe_sizes', {
435
- params: {
436
- search: JSON.stringify({
437
- employee_id: { op: 'eq', val: this.temp._id, t: 'number' }
438
- })
439
- }
440
- })
441
- const { data: types } = await this.$axios.get('list/5/ref_clothe_general_types', {
442
- params: {
443
- search: JSON.stringify({
444
- clothe_sizes: { op: 'eq', val: 'notnull', t: 'string' }
445
- })
446
- }
447
- })
448
- const { data: clothes } = await this.$axios.get('list/5/service_clothe_tamachis', {
449
- params: {
450
- search: JSON.stringify({
451
- employee_id: { op: 'eq', val: this.temp._id, t: 'number' }
452
- }),
453
- sorts: JSON.stringify([
454
- { prop: 'clothe_reg_id.type_general_id.sort_order', order: 'ascending' },
455
- { prop: 'clothe_reg_id.sort_order', order: 'ascending' }
456
- ]),
457
- extraFields: 'clothe_reg_id.type_general_id.sort_order,clothe_reg_id.sort_order,clothe_reg_id.type_general_id.name'
458
- }
459
- })
460
- const { data: expiredClothes } = await this.$axios.get('list/5/service_clothe_tamachis', {
461
- params: {
462
- search: JSON.stringify({
463
- employee_id: { op: 'eq', val: this.temp._id, t: 'number' },
464
- next_receive_date: { op: 'gt', val: new Date(), t: 'date' }
465
- })
466
- }
467
- })
468
- this.expiredClothes = expiredClothes
469
- this.types = types
470
- this.list = list
434
+ this.expiredClothes = data.expiredClothes
435
+ this.types = data.types
436
+ this.list = data.list
471
437
  // каракуль малгай зөвхөн хурандаа нарт олгоно
472
438
  const isCarakulCat = this.temp?.employee_degree_text?.toLowerCase()?.includes('цагдаагийн хурандаа')
473
- this.clotheRegs = clotheRegs.filter(c => isCarakulCat || (!isCarakulCat && c.name?.toLowerCase() !== 'каракуль малгай'))
474
- this.clothes = clothes
439
+ this.clotheRegs = data.clotheRegs.filter(c => isCarakulCat || (!isCarakulCat && c.name?.toLowerCase() !== 'каракуль малгай'))
440
+ this.clothes = data.clothes
475
441
  } catch (err) {
476
442
  this.$showError(err)
477
443
  } finally {
@@ -108,7 +108,7 @@ export default {
108
108
  if (checkItem) {
109
109
  const item = { employee_id: this.temp._id, user_id: { _id: userId }, role_group_id: checkItem }
110
110
  this.roles.push(item)
111
- const { data } = await this.$axios.post('5/hrm_user_role_groups', item)
111
+ const { data } = await this.$axios.post('5/service_hrm_user_role_groups', item)
112
112
  item._id = data._id
113
113
  item.tid = data.tid
114
114
  } else {
@@ -117,7 +117,7 @@ export default {
117
117
  const itemId = this.roles[removeIndex]._id
118
118
  const itemTid = this.roles[removeIndex].tid
119
119
  this.roles.splice(removeIndex, 1)
120
- await this.$axios.delete(`5/hrm_user_role_groups/${itemId}`, {
120
+ await this.$axios.delete(`5/service_hrm_user_role_groups/${itemId}`, {
121
121
  data: { tid: itemTid }
122
122
  })
123
123
  }
@@ -139,25 +139,13 @@ export default {
139
139
  return
140
140
  }
141
141
  this.loading = true
142
- const { data } = await this.$axios.get('list/5/hrm_users', {
142
+ const { data } = await this.$axios.get(`hrm/users/${this.temp._id}`, {
143
143
  params: {
144
- search: JSON.stringify({
145
- employee_id: { op: 'eq', val: this.temp._id, t: 'number' },
146
- end_date: { op: 'eq', val: 'null', t: 'date' }
147
- })
144
+ tid: this.temp.tid
148
145
  }
149
146
  })
150
- if (data.length > 0) {
151
- const { data: roles } = await this.$axios.get('list/5/hrm_user_role_groups', {
152
- params: {
153
- search: JSON.stringify({
154
- user_id: { op: 'in', val: data.map(c => c._id).join(','), t: 'number' }
155
- })
156
- }
157
- })
158
- this.roles = roles
159
- this.list = data
160
- }
147
+ this.roles = data.roles
148
+ this.list = data.list
161
149
  } catch (err) {
162
150
  this.$showError(err)
163
151
  } finally {
@@ -59,7 +59,7 @@ export default {
59
59
  changedItem = { employee_id: this.temp._id, skill_type_id: item, rate_value: $event }
60
60
  this.list.push({ ...changedItem })
61
61
  }
62
- await this.$axios.post('5/hrm_employee_skill_types', { ...changedItem })
62
+ await this.$axios.post('5/service_hrm_employee_skill_types', { ...changedItem })
63
63
  } catch (err) {
64
64
  this.$showError(err)
65
65
  } finally {
@@ -77,16 +77,11 @@ export default {
77
77
  return
78
78
  }
79
79
  this.loading = true
80
- const { data } = await this.$axios.get('list/5/hrm_employee_skill_types', {
81
- params: {
82
- search: JSON.stringify({
83
- employee_id: { op: 'eq', val: this.temp._id, t: 'number' }
84
- })
85
- }
80
+ const { data } = await this.$axios.get(`hrm/user/skill/types/${this.temp._id}`, {
81
+ params: { tid: this.temp.tid }
86
82
  })
87
- const { data: skillTypes } = await this.$axios.get('list/5/ref_hrm_skill_types')
88
- this.skillTypes = skillTypes
89
- this.list = data
83
+ this.skillTypes = data.skillTypes
84
+ this.list = data.list
90
85
  } catch (err) {
91
86
  this.$showError(err)
92
87
  } finally {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eztech-core-components",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,7 +39,7 @@ export const getFormComponent = ({
39
39
  props = { ...props, type: 'textarea', maxlength: col_length || 255, showWordLimit: true, style: 'font-family: Mongolian Baiti; font-size: 20px; writing-mode: vertical-lr; line-height: 1.15' }
40
40
  } else if (['doc_controls', 'doc_requests', 'doc_request_receives'].includes(table_name) && col_field === 'reg_num') {
41
41
  name = 'DocRegNum'
42
- props.table_type = table_name
42
+ props.tableType = table_name
43
43
  } else if (table_name === 'doc_controls' && col_field === 'doc_num') {
44
44
  name = 'DocIndexNum'
45
45
  } else if (col_type === 'json') {
@@ -46,9 +46,12 @@ export const tableComputed = {
46
46
  url () {
47
47
  return this.customUrl || `${this.subUrl || ''}${this.projectId}/${this.tableName}`
48
48
  },
49
- urlOne () {
49
+ urlGet () {
50
50
  return this.customUrl || `${this.subUrl || ''}${this.projectId}/${this.tableName}`
51
51
  },
52
+ urlOne () {
53
+ return this.customOneUrl || `${this.subUrl || ''}one/${this.projectId}/${this.tableName}`
54
+ },
52
55
  urlTable () {
53
56
  return `${this.subUrl || ''}${this.projectId}/${this.table?.name}`
54
57
  },
@@ -679,7 +682,7 @@ export const tableMethods = {
679
682
  if (this.customExtraFields) {
680
683
  extraFields.push(...this.customExtraFields?.split(','))
681
684
  }
682
- const { data } = await this.$axios.get(`${this.urlOne}/${id}`, {
685
+ const { data } = await this.$axios.get(`${this.urlGet}/${id}`, {
683
686
  params: {
684
687
  locale_id,
685
688
  extraFields: extraFields.join(','),
@@ -731,7 +734,7 @@ export const tableMethods = {
731
734
  }
732
735
  }
733
736
  // const select = this.columns.filter(c => c.col_field).map((c) => { return c.col_field })
734
- const { data } = await this.$axios.get(`one/${this.urlOne}`, {
737
+ const { data } = await this.$axios.get(`${this.urlOne}`, {
735
738
  params: {
736
739
  // reApi: this.reApi,
737
740
  // select,
@@ -1368,6 +1371,7 @@ export const getAsyncData = async ({
1368
1371
  columnUsers,
1369
1372
  statuses
1370
1373
  } = data
1374
+ // console.log('data', data)
1371
1375
  if (!level && checkPermission) {
1372
1376
  error({ statusCode: 402 })
1373
1377
  }