tnx-shared 5.1.606 → 5.1.607

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.
@@ -9939,18 +9939,41 @@
9939
9939
  });
9940
9940
  }); });
9941
9941
  };
9942
- TemplateInstanceService.prototype.fillWordByTemplateCodeMultiData = function (templateCode, data, onLoadingDataPdf, onEndLoadingDataPdf) {
9942
+ TemplateInstanceService.prototype.fillWordByTemplateCodeMultiData = function (templateCode, data, onLoadingDataPdf, onEndLoadingDataPdf, isPrint, fileName) {
9943
9943
  var _this = this;
9944
9944
  if (onLoadingDataPdf === void 0) { onLoadingDataPdf = null; }
9945
9945
  if (onEndLoadingDataPdf === void 0) { onEndLoadingDataPdf = null; }
9946
- var url = this.serviceUri + "/fillWordByTemplateCodeMultiData/" + templateCode + "?isPrint=true";
9947
- return this._httpClient
9948
- .post(url, data)
9949
- .toPromise().then(function (res) {
9950
- if (res.data) {
9951
- _this._printService.printBase64Pdf(res.data, onLoadingDataPdf, onEndLoadingDataPdf);
9952
- }
9953
- });
9946
+ if (isPrint === void 0) { isPrint = true; }
9947
+ if (fileName === void 0) { fileName = 'Export'; }
9948
+ var url = this.serviceUri + "/fillWordByTemplateCodeMultiData/" + templateCode + "?isPrint=" + (isPrint ? 'true' : 'false');
9949
+ if (isPrint) {
9950
+ return this._httpClient
9951
+ .post(url, data)
9952
+ .toPromise().then(function (res) {
9953
+ if (res.data) {
9954
+ _this._printService.printBase64Pdf(res.data, onLoadingDataPdf, onEndLoadingDataPdf);
9955
+ }
9956
+ });
9957
+ }
9958
+ else {
9959
+ return this._httpClient
9960
+ .post(url, data, { responseType: 'blob' })
9961
+ .toPromise()
9962
+ .then(function (res) {
9963
+ FileSaver__namespace.saveAs(res, _this.getFullFileName(fileName || 'Export', TemplateConstant.WORD_EXTENSION));
9964
+ }).catch(function (err) { return __awaiter(_this, void 0, void 0, function () {
9965
+ var errorText;
9966
+ return __generator(this, function (_a) {
9967
+ switch (_a.label) {
9968
+ case 0: return [4 /*yield*/, err.error.text()];
9969
+ case 1:
9970
+ errorText = _a.sent();
9971
+ this._crudService.processErrorResponse(JSON.parse(errorText || ''));
9972
+ return [2 /*return*/];
9973
+ }
9974
+ });
9975
+ }); });
9976
+ }
9954
9977
  };
9955
9978
  TemplateInstanceService.prototype.setFileInfo = function (model) {
9956
9979
  model.data = model.data ? model.data : JSON.stringify(model.dataObject);