tnx-shared 5.3.341 → 5.3.343

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.
@@ -1038,6 +1038,8 @@
1038
1038
  var ActionThuHoiBase = '__THU_HOI';
1039
1039
  var ActionChoYKienBase = '__CHO_Y_KIEN';
1040
1040
  var ActionUpdateModel = '__UPDATE_MODEL';
1041
+ var ActionChuyenXuLyBase = '__CHUYEN_XU_LY';
1042
+ var TextActionChuyenXuLyBase = 'Chuyển xử lý';
1041
1043
  var FieldDefineHasTask = '__idTask';
1042
1044
 
1043
1045
  function mapProperty(init, toMap) {
@@ -9184,6 +9186,17 @@
9184
9186
  }
9185
9187
  return this.defaultPost(this.serviceUri + "/ChangeStateBase", itemWorkflowHistory);
9186
9188
  };
9189
+ BaseService.prototype.chuyenXuLyBase = function (itemWorkflowHistory) {
9190
+ if (itemWorkflowHistory) {
9191
+ if (itemWorkflowHistory.departmentIds) {
9192
+ itemWorkflowHistory.donViIds = itemWorkflowHistory.departmentIds;
9193
+ }
9194
+ if (itemWorkflowHistory.departmentViewIds) {
9195
+ itemWorkflowHistory.donViViewIds = itemWorkflowHistory.departmentViewIds;
9196
+ }
9197
+ }
9198
+ return this.defaultPost(this.serviceUri + "/ChuyenXuLyBase", itemWorkflowHistory);
9199
+ };
9187
9200
  BaseService.prototype.choYKien = function (itemWorkflowHistory) {
9188
9201
  return this.defaultPost(this.serviceUri + "/ChoYKienBase", itemWorkflowHistory);
9189
9202
  };
@@ -20380,12 +20393,12 @@
20380
20393
  __extends(HoSoDoiTacService, _super);
20381
20394
  function HoSoDoiTacService(http, injector, _moduleConfigService) {
20382
20395
  var _this = _super.call(this, http, injector, _moduleConfigService.getConfig().environment.apiDomain
20383
- .doitacEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/HoSoDoiTac") || this;
20396
+ .canboEndpoint + "/" + _moduleConfigService.getConfig().environment.apiVersion + "/HoSoDoiTac") || this;
20384
20397
  _this._moduleConfigService = _moduleConfigService;
20385
20398
  _this.entityName = 'HoSoDoiTac';
20386
- _this.serviceCode = 'doitac';
20399
+ _this.serviceCode = 'canbo';
20387
20400
  _this.endPoint
20388
- = _moduleConfigService.getConfig().environment.apiDomain.doitacEndpoint;
20401
+ = _moduleConfigService.getConfig().environment.apiDomain.canboEndpoint;
20389
20402
  return _this;
20390
20403
  }
20391
20404
  HoSoDoiTacService.prototype.genDropDownSchema = function (required, multiple, field, label, mdWidth, funcModifySchema) {
@@ -22134,6 +22147,7 @@
22134
22147
  _this.serviceManagers = {};
22135
22148
  _this.entityName = 'WorkflowPermissionDetail';
22136
22149
  _this.tableName = '';
22150
+ _this.guidEmpty = '00000000-0000-0000-0000-000000000000';
22137
22151
  _this.endPoint = _moduleConfigService.getConfig().environment.apiDomain.workflowEndpoint;
22138
22152
  _this._moduleConfig = _moduleConfigService.getConfig();
22139
22153
  return _this;
@@ -22180,9 +22194,9 @@
22180
22194
  filters.push(this.newFilter('userId', exports.Operator.equal, userIdCurrent));
22181
22195
  }
22182
22196
  else {
22183
- sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }));
22197
+ sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }), new Sort({ field: 'isCOEdit', dir: -1 }));
22184
22198
  }
22185
- return [4 /*yield*/, this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission', sorts, 'ForCrudList')];
22199
+ return [4 /*yield*/, this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission,isCOEdit', sorts, 'ForCrudList')];
22186
22200
  case 1:
22187
22201
  dataStatus = (_a.sent()).data;
22188
22202
  if (dataStatus == null) {
@@ -22196,6 +22210,7 @@
22196
22210
  });
22197
22211
  };
22198
22212
  WorkflowPermissionDetailService.prototype.appendWorkflowInfoToItem = function (data, itemId, userIdCurrent, ignoreWorkflow, dataStatus, callBackWhenNotHaveStatus) {
22213
+ var _this = this;
22199
22214
  if (callBackWhenNotHaveStatus === void 0) { callBackWhenNotHaveStatus = null; }
22200
22215
  var itemStatus = {
22201
22216
  textTrangThai: 'Chưa chạy quy trình'
@@ -22219,6 +22234,7 @@
22219
22234
  if (!itemStatus.trangThai) {
22220
22235
  callBackWhenNotHaveStatus(itemStatus, data);
22221
22236
  }
22237
+ data.__isCoEdit = dataStatus.some(function (x) { return x.itemId === itemId && x.userId != _this.guidEmpty && x.isCOEdit; });
22222
22238
  data.__trangThai = itemStatus.trangThai;
22223
22239
  data.__textTrangThai = itemStatus.textTrangThai;
22224
22240
  if (itemStatus.workflowCode == DummyWorkflowCode) {
@@ -22280,8 +22296,8 @@
22280
22296
  // if (!ignoreWorkflow) {
22281
22297
  // filters.push(this.newFilter('userId', Operator.equal, userIdCurrent));
22282
22298
  // }
22283
- sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }));
22284
- return [4 /*yield*/, this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission', sorts, 'ForCrudList')];
22299
+ sorts.push(new Sort({ field: 'permission', dir: -1 }), new Sort({ field: 'inComing', dir: -1 }), new Sort({ field: 'isCOEdit', dir: -1 }));
22300
+ return [4 /*yield*/, this.getAll(filters, 'itemId,userId,trangThai,textTrangThai,workflowCode,permission,isCOEdit', sorts, 'ForCrudList')];
22285
22301
  case 1:
22286
22302
  dataStatus = (_a.sent()).data;
22287
22303
  if (dataStatus == null) {
@@ -25820,6 +25836,14 @@
25820
25836
  if (userId) {
25821
25837
  userIdStringUpper = userId.toUpperCase();
25822
25838
  }
25839
+ if (rowData.__isCoEdit) {
25840
+ buttonContexts.push({
25841
+ icon: 'pi pi-backward',
25842
+ label: TextActionChuyenXuLyBase,
25843
+ actionCode: ActionChuyenXuLyBase,
25844
+ command: function () { return _this.showFormChuyenXuLy(crudListSetting, itemWorkflowSetting_1, rowData); }
25845
+ });
25846
+ }
25823
25847
  return [4 /*yield*/, workflowHistoryService.changeEndpoint(crudListSetting.baseService).getLastByItemId(rowData.id)];
25824
25848
  case 3:
25825
25849
  itemWorkflowHistoryLast = (_h.sent()).data;
@@ -26011,6 +26035,51 @@
26011
26035
  });
26012
26036
  });
26013
26037
  };
26038
+ ListComponentBase.prototype.showFormChuyenXuLy = function (crudListSetting, itemWorkflowSetting, rowData) {
26039
+ return __awaiter(this, void 0, void 0, function () {
26040
+ var workflowHistoryService, itemWorkflowHistoryLast, currentState, compRef, action;
26041
+ var _this = this;
26042
+ return __generator(this, function (_h) {
26043
+ switch (_h.label) {
26044
+ case 0:
26045
+ workflowHistoryService = this._injector.get(WorkflowHistoryService);
26046
+ workflowHistoryService.changeEndpoint(this.setting.baseService);
26047
+ return [4 /*yield*/, workflowHistoryService.changeEndpoint(crudListSetting.baseService).getLastByItemId(rowData.id)];
26048
+ case 1:
26049
+ itemWorkflowHistoryLast = (_h.sent()).data;
26050
+ if (!itemWorkflowHistoryLast) {
26051
+ return [2 /*return*/, this._notifierService.showWarning('Không tìm thấy bước thực hiện gần nhất của bảng ghi!')];
26052
+ }
26053
+ currentState = itemWorkflowSetting.data.machines.find(function (x) { return x.code == rowData.__trangThai; });
26054
+ this.processWorkflowModel.showEditForm = true;
26055
+ this.processWorkflowModel.header = TextActionChuyenXuLyBase;
26056
+ return [4 /*yield*/, this._federationService.loadRemoteNewComponent('commonapp', 'ProcessWorkflowFormComponent', this.processWorkflowFormViewContainer)];
26057
+ case 2:
26058
+ compRef = _h.sent();
26059
+ if (this.dialogProcessWorkflowForm) {
26060
+ this.dialogProcessWorkflowForm.buttonTemplateInput = compRef.instance.buttonTemplate;
26061
+ }
26062
+ compRef.instance.item = this.currentItem;
26063
+ compRef.instance.businessSetting = crudListSetting;
26064
+ compRef.instance.workflow = itemWorkflowSetting;
26065
+ action = new WfAction();
26066
+ action.code = ActionChuyenXuLyBase;
26067
+ action.name = TextActionChuyenXuLyBase;
26068
+ action.data = {};
26069
+ action.openPopup = true;
26070
+ action.target = currentState.id || this.guidEmpty;
26071
+ action.source = currentState.id || this.guidEmpty;
26072
+ compRef.instance.action = action;
26073
+ compRef.instance.onSaved.subscribe(function (event) {
26074
+ _this.processWorkflowModel.showEditForm = false;
26075
+ _this.getData();
26076
+ });
26077
+ compRef.instance.onCancel.subscribe(function (event) { return _this.processWorkflowModel.showEditForm = false; });
26078
+ return [2 /*return*/];
26079
+ }
26080
+ });
26081
+ });
26082
+ };
26014
26083
  ListComponentBase.prototype.startWorkflow = function (rowData, workflow) {
26015
26084
  return __awaiter(this, void 0, void 0, function () {
26016
26085
  var _this = this;
@@ -44545,6 +44614,7 @@
44545
44614
  this.setting.hiddenSettingPermission = true;
44546
44615
  this.setting.fieldSearchText = this.control.fieldSearchText;
44547
44616
  this.setting.columnSetting.sortField = this.control.sortField;
44617
+ this.setting.columnSetting.sortDir = this.control.sortDir;
44548
44618
  this.control.columns.forEach(function (column) {
44549
44619
  if (column.isDisplay) {
44550
44620
  var col = new ColumnSchemaBase(Object.assign(Object.assign({}, column), { visible: true, field: column.code || column.field, label: _this._translateService.instant(column.label) }));
@@ -45389,7 +45459,7 @@
45389
45459
  }
45390
45460
  CoCauToChucPickerListComponent.prototype.ngOnInit = function () {
45391
45461
  this.control._component = this;
45392
- this.controlPicker = new AutoCompletePickerControlSchema(Object.assign(Object.assign({}, this.control), { field: 'arrIdNguoiDung', label: 'Đơn vị', title: 'Chọn đơn vị', baseService: this._coCauToChucService, multiple: this.control.multiple, valueField: this.control.valueField, defaultFilters: this.control.defaultFilters, sortField: 'idDuongDan', required: true, columns: [
45462
+ this.controlPicker = new AutoCompletePickerControlSchema(Object.assign(Object.assign({}, this.control), { field: 'arrIdNguoiDung', label: 'Đơn vị', title: 'Chọn đơn vị', baseService: this._coCauToChucService, multiple: this.control.multiple, valueField: this.control.valueField, defaultFilters: this.control.defaultFilters, sortField: 'idDuongDan', sortDir: 1, required: true, columns: [
45393
45463
  new EntityPickerColumn({
45394
45464
  label: 'Tên đơn vị',
45395
45465
  code: this.control.displayField,
@@ -56863,6 +56933,7 @@
56863
56933
  exports.AccessDeniedComponent = AccessDeniedComponent;
56864
56934
  exports.Action = Action;
56865
56935
  exports.ActionChoYKienBase = ActionChoYKienBase;
56936
+ exports.ActionChuyenXuLyBase = ActionChuyenXuLyBase;
56866
56937
  exports.ActionThuHoiBase = ActionThuHoiBase;
56867
56938
  exports.ActionUpdateModel = ActionUpdateModel;
56868
56939
  exports.AddressControlSchema = AddressControlSchema;
@@ -57185,6 +57256,7 @@
57185
57256
  exports.TemplateTextV4Service = TemplateTextV4Service;
57186
57257
  exports.TemplateV4Service = TemplateV4Service;
57187
57258
  exports.TenContainer = TenContainer;
57259
+ exports.TextActionChuyenXuLyBase = TextActionChuyenXuLyBase;
57188
57260
  exports.TextAreaControlSchema = TextAreaControlSchema;
57189
57261
  exports.TextControlSchema = TextControlSchema;
57190
57262
  exports.TextControlSchemaWithService = TextControlSchemaWithService;