ztxkui 4.2.18-111 → 4.2.18-113

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.
Files changed (32) hide show
  1. package/dist/components/Table/hooks/useColumns.js +26 -2
  2. package/dist/components/electron-signatures/content.js +360 -340
  3. package/dist/components/electron-signatures/demoComponents/coUseDetail.d.ts +8 -0
  4. package/dist/components/electron-signatures/demoComponents/coUseDetail.js +255 -0
  5. package/dist/components/electron-signatures/demoComponents/index.js +4 -1
  6. package/dist/components/electron-signatures/demoComponents/makingData.d.ts +12 -0
  7. package/dist/components/electron-signatures/demoComponents/makingData.js +14 -0
  8. package/dist/components/electron-signatures/electron-signatures-fragment.js +74 -26
  9. package/dist/components/electron-signatures/electronComponents/electron-seal-personal-sign.d.ts +35 -0
  10. package/dist/components/electron-signatures/electronComponents/electron-seal-personal-sign.js +39 -0
  11. package/dist/components/electron-signatures/electronComponents/useElectronColumns.js +20 -2
  12. package/dist/components/electron-signatures/electronComponents/useFetchElectronData.d.ts +4 -0
  13. package/dist/components/electron-signatures/electronComponents/useFetchElectronData.js +103 -16
  14. package/dist/components/electron-signatures/hooks/useParseElectronSetting.d.ts +13 -4
  15. package/dist/components/electron-signatures/hooks/useParseElectronSetting.js +238 -165
  16. package/dist/components/electron-signatures/index.d.ts +2 -0
  17. package/dist/components/electron-signatures/index.js +14 -5
  18. package/dist/components/electron-signatures/interface.d.ts +16 -0
  19. package/dist/components/electron-signatures/qunjComponents/qunj-list.js +14 -5
  20. package/dist/components/electron-signatures/qunjComponents/useFetchQunjData.js +5 -0
  21. package/dist/components/electron-signatures/qunjComponents/useQunjColumns.js +2 -2
  22. package/dist/components/utils/ZtxkContext.d.ts +10 -0
  23. package/dist/components/utils/ZtxkContext.js +2 -0
  24. package/dist/components/utils/checkSealCoUse.d.ts +16 -0
  25. package/dist/components/utils/checkSealCoUse.js +83 -0
  26. package/dist/components/utils/useBaseContext.d.ts +2 -0
  27. package/dist/constants.d.ts +1 -1
  28. package/dist/constants.js +1 -1
  29. package/dist/index.css +52 -13
  30. package/dist/index.css.map +1 -1
  31. package/dist/index.js +10 -0
  32. package/package.json +1 -1
@@ -9,17 +9,55 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (_) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
12
48
  import i18next from 'ztxkutils/dist/i18next';
13
49
  import { useEffect, useMemo, useState } from 'react';
14
50
  import { unstable_batchedUpdates } from 'react-dom';
15
51
  import { message } from '../../../index';
16
52
  import useMemoizedFn from '../../utils/useMemoizedFn';
53
+ import checkSealCoUse from '../../utils/checkSealCoUse';
17
54
  import { isFlowCompleted } from '../utils';
18
55
  /**
19
56
  * 电子印章设置相关操作
20
57
  */
21
58
  export default function useParseElectronSetting(options) {
22
- var isUnControlled = options.isUnControlled, onValueChange = options.onValueChange, dataType = options.dataType, request = options.request, setLoading = options.setLoading, records = options.records, deptId = options.deptId, secondDepId = options.secondDepId, contractId = options.contractId, docAttachMap = options.docAttachMap, documentIdList = options.documentIdList, electronicSealIdList = options.electronicSealIdList, isCheckedEconomic = options.isCheckedEconomic, setCurrentIsCheckedEconomic = options.setCurrentIsCheckedEconomic, canEdit = options.canEdit, flowStatus = options.flowStatus, onElectronicSealIdChange = options.onElectronicSealIdChange, electronList = options.electronList;
59
+ var _this = this;
60
+ var isUnControlled = options.isUnControlled, onValueChange = options.onValueChange, dataType = options.dataType, request = options.request, setLoading = options.setLoading, records = options.records, deptId = options.deptId, secondDepId = options.secondDepId, contractId = options.contractId, docAttachMap = options.docAttachMap, documentIdList = options.documentIdList, electronicSealIdList = options.electronicSealIdList, isCheckedEconomic = options.isCheckedEconomic, setCurrentIsCheckedEconomic = options.setCurrentIsCheckedEconomic, personalSignUserIds = options.personalSignUserIds, setPersonalSignUserIds = options.setPersonalSignUserIds, canEdit = options.canEdit, flowStatus = options.flowStatus, onElectronicSealIdChange = options.onElectronicSealIdChange, qunjSeal = options.qunjSeal, fileFieldsNameRef = options.fileFieldsNameRef;
23
61
  // 点击签署位置 实时记录点击时的印章列表
24
62
  var _a = useState(), clickElectronicSealIdList = _a[0], setClickElectronicSealIdList = _a[1];
25
63
  // 当前合同id数据
@@ -53,179 +91,187 @@ export default function useParseElectronSetting(options) {
53
91
  };
54
92
  });
55
93
  // 指定签署位置
56
- var appointSignLocation = useMemoizedFn(function (options) {
57
- var _a = options || {}, callback = _a.callback, _b = _a.otherParams, otherParams = _b === void 0 ? {} : _b, isCheckUnStampedSeal = _a.isCheckUnStampedSeal, _c = _a.spinningTip, spinningTip = _c === void 0 ? i18next.t('指定签署位置中...') : _c;
58
- // 选出选了盖电子印章的附件数据
59
- if (!Array.isArray(records)) {
60
- console.log(i18next.t('没有选中需要盖电子印章的数据!'));
61
- return;
62
- }
63
- // 没有选择印章
64
- if (!Array.isArray(electronicSealIdList) ||
65
- (electronicSealIdList === null || electronicSealIdList === void 0 ? void 0 : electronicSealIdList.length) <= 0) {
66
- console.log(i18next.t('没有选择电子印章!'));
67
- message.error(i18next.t('没有选择需要盖章的电子印章!'));
68
- return;
69
- }
70
- // 校验带有"必须共同使用"标识的印章(mustUseWithOthers + useWithSealIds)
71
- if (Array.isArray(electronList) && electronicSealIdList.length > 0) {
72
- var selectedSealIds_1 = new Set(electronicSealIdList.map(function (id) { return id + ''; }));
73
- for (var _i = 0, electronList_1 = electronList; _i < electronList_1.length; _i++) {
74
- var seal = electronList_1[_i];
75
- if (selectedSealIds_1.has(seal.sealId + '') &&
76
- seal.mustUseWithOthers &&
77
- seal.useWithSealIds) {
78
- var requiredIds = seal.useWithSealIds
79
- .split(',')
80
- .map(function (id) { return id.trim(); })
81
- .filter(Boolean);
82
- var hasMatch = requiredIds.some(function (id) { return selectedSealIds_1.has(id); });
83
- if (!hasMatch) {
84
- var msg = i18next.t('当前所选的{{sealName}},要求必须和{{requiredSealNames}}其中之一一起使用,请重新勾选印章。', {
85
- sealName: seal.sealName,
86
- requiredSealNames: seal.useWithSealNames,
87
- });
88
- message.warning(msg);
89
- return;
94
+ var appointSignLocation = useMemoizedFn(function (options) { return __awaiter(_this, void 0, void 0, function () {
95
+ var _a, callback, _b, otherParams, isCheckUnStampedSeal, _c, spinningTip, isCoUsePass, currentCheckedElectronAttachIds, isError, params, newSealIdList, stampedAttachIdList;
96
+ return __generator(this, function (_d) {
97
+ switch (_d.label) {
98
+ case 0:
99
+ _a = options || {}, callback = _a.callback, _b = _a.otherParams, otherParams = _b === void 0 ? {} : _b, isCheckUnStampedSeal = _a.isCheckUnStampedSeal, _c = _a.spinningTip, spinningTip = _c === void 0 ? i18next.t('指定签署位置中...') : _c;
100
+ // 选出选了盖电子印章的附件数据
101
+ if (!Array.isArray(records)) {
102
+ console.log(i18next.t('没有选中需要盖电子印章的数据!'));
103
+ return [2 /*return*/];
90
104
  }
91
- }
92
- }
93
- }
94
- // 找到需要盖章的附件
95
- var currentCheckedElectronAttachIds = [];
96
- // 处理一些异常情况。有附件数据 但是没有附件id
97
- var isError = false;
98
- records.forEach(function (record, index) {
99
- if (!record.isElectronicSeal) {
100
- return;
101
- }
102
- if (!record.attachId && !isError) {
103
- message.error(i18next.t('第{{slot0}}行附件没有附件id,无法盖章!', {
104
- slot0: index + 1,
105
- }));
106
- isError = true;
107
- }
108
- else {
109
- currentCheckedElectronAttachIds.push(record.attachId);
110
- }
111
- });
112
- if (isError) {
113
- return;
114
- }
115
- setLoading === null || setLoading === void 0 ? void 0 : setLoading({
116
- spinning: true,
117
- tip: spinningTip,
118
- });
119
- var params = __assign({ attachIdList: [], sealIdList: electronicSealIdList, deleteAttachIdList: [], docAttachMap: currentDocAttachMap, deptId: deptId,
120
- secondDepId: secondDepId, needYjzrr: isCheckedEconomic }, otherParams);
121
- // 更新最新的电子印章选中列表
122
- var newSealIdList = params.sealIdList;
123
- setClickElectronicSealIdList(newSealIdList);
124
- // 盖过章的附件列表
125
- var stampedAttachIdList = getStampedAttachIdListByMap(currentDocAttachMap);
126
- // 这里参考之前的逻辑处理(不知道为什么这里没有处理印章逻辑 如果前后的印章不一致 应该也要重新勾选才是)
127
- // (前后印章不同的逻辑 是在提交的时候处理的,会弹出一个模态框)
128
- // 如果有合同id 传入合同id
129
- // 有合同id 表明之前已经签署过位置了
130
- // 需要处理下签署前后的附件数据
131
- if (currentContractId) {
132
- params.contractId = currentContractId;
133
- // 找出此次新增加的附件
134
- if (stampedAttachIdList.length === 0) {
135
- params.attachIdList = currentCheckedElectronAttachIds;
136
- }
137
- else {
138
- params.attachIdList = currentCheckedElectronAttachIds.filter(function (attachId) { return !stampedAttachIdList.includes(attachId); });
139
- }
140
- }
141
- else {
142
- params.attachIdList = currentCheckedElectronAttachIds;
143
- }
144
- // 找到需要删除的附件(之前已经盖了章的附件,但是本次没有选中盖电子印章的按钮)
145
- // 已盖章的附件id列表中筛选出要删除的附件id列表
146
- if (Array.isArray(stampedAttachIdList)) {
147
- stampedAttachIdList.forEach(function (n) {
148
- if (currentCheckedElectronAttachIds.length !== 0 &&
149
- !currentCheckedElectronAttachIds.includes(n)) {
150
- params.deleteAttachIdList.push(n);
151
- }
152
- });
153
- }
154
- request({
155
- url: '/api/zmdms-resource/seal/confirm-seal-info',
156
- method: 'POST',
157
- timeout: 90000,
158
- data: params,
159
- })
160
- .then(function (res) {
161
- unstable_batchedUpdates(function () {
162
- var _a;
163
- setLoading === null || setLoading === void 0 ? void 0 : setLoading({
164
- spinning: false,
165
- });
166
- if (res.status === 200 &&
167
- res.data.code === 200 &&
168
- res.data.data.preSignUrl) {
169
- // 更新一些数据
170
- var newContractId = res.data.data.contractId; // 新合同id
171
- var newDocAttachMap = res.data.data.docAttachMap; // 新文档对应关系(附件:合同id)
172
- var newDocumentIdList = getDocumentIdListByMap(newDocAttachMap); // 新文档id列表
173
- // 非受控模式 设置下内部数据
174
- // 受控模式 会在effect中进行处理
175
- // if (isUnControlled) {
176
- setCurrentContractId(newContractId);
177
- setCurrentDocAttachMap(newDocAttachMap);
178
- setCurrentDocumentIdList(newDocumentIdList);
179
- onElectronicSealIdChange(newSealIdList, false);
180
- // }
181
- if (otherParams.needYjzrr !== undefined) {
182
- setCurrentIsCheckedEconomic(otherParams.needYjzrr);
105
+ // 没有选择印章
106
+ if (!Array.isArray(electronicSealIdList) ||
107
+ (electronicSealIdList === null || electronicSealIdList === void 0 ? void 0 : electronicSealIdList.length) <= 0) {
108
+ console.log(i18next.t('没有选择电子印章!'));
109
+ message.error(i18next.t('没有选择需要盖章的电子印章!'));
110
+ return [2 /*return*/];
183
111
  }
184
- callback === null || callback === void 0 ? void 0 : callback({
185
- checkAttachIdList: currentCheckedElectronAttachIds,
186
- contractId: newContractId,
187
- docAttachMap: newDocAttachMap,
188
- documentIdList: newDocumentIdList,
112
+ // 校验印章"必须共同使用"的约束(后端接口统一校验)
113
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading({
114
+ spinning: true,
115
+ tip: spinningTip,
189
116
  });
190
- // 更改当前数据
191
- if (dataType) {
192
- onValueChange &&
193
- onValueChange((_a = {},
194
- _a[dataType] = {
195
- checkAttachIdList: currentCheckedElectronAttachIds,
196
- contractId: newContractId,
197
- docAttachMap: newDocAttachMap,
198
- documentIdList: newDocumentIdList,
199
- // 在这里更改下是否加盖一级责任人数据
200
- isCheckedEconomic: params.needYjzrr,
201
- electronicSealIdList: newSealIdList,
202
- },
203
- _a));
117
+ return [4 /*yield*/, checkSealCoUse({
118
+ request: request,
119
+ qysSealIds: electronicSealIdList,
120
+ qjSealNos: collectQjSealNos(qunjSeal, records, fileFieldsNameRef),
121
+ })];
122
+ case 1:
123
+ isCoUsePass = _d.sent();
124
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading({
125
+ spinning: false,
126
+ });
127
+ if (!isCoUsePass) {
128
+ return [2 /*return*/];
204
129
  }
205
- // 需要跳转到契约锁重新指定签署位置
206
- // 如果需要检测是否还有 未确认盖章位置的印章信息列表
207
- if (isCheckUnStampedSeal) {
208
- if (unElectronicSealList.length > 0) {
209
- window.open(res.data.data.preSignUrl);
130
+ currentCheckedElectronAttachIds = [];
131
+ isError = false;
132
+ records.forEach(function (record, index) {
133
+ if (!record.isElectronicSeal) {
134
+ return;
135
+ }
136
+ if (!record.attachId && !isError) {
137
+ message.error(i18next.t('第{{slot0}}行附件没有附件id,无法盖章!', {
138
+ slot0: index + 1,
139
+ }));
140
+ isError = true;
141
+ }
142
+ else {
143
+ currentCheckedElectronAttachIds.push(record.attachId);
144
+ }
145
+ });
146
+ if (isError) {
147
+ return [2 /*return*/];
148
+ }
149
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading({
150
+ spinning: true,
151
+ tip: spinningTip,
152
+ });
153
+ params = __assign({ attachIdList: [], sealIdList: electronicSealIdList, deleteAttachIdList: [], docAttachMap: currentDocAttachMap, deptId: deptId,
154
+ secondDepId: secondDepId, needYjzrr: isCheckedEconomic,
155
+ // 个人签署(手签章)用户 编辑合同全量更新 漏传会把已添加的手签用户从契约锁合同移除
156
+ personalSignUserIds: Array.isArray(personalSignUserIds)
157
+ ? personalSignUserIds
158
+ : [] }, otherParams);
159
+ newSealIdList = params.sealIdList;
160
+ setClickElectronicSealIdList(newSealIdList);
161
+ stampedAttachIdList = getStampedAttachIdListByMap(currentDocAttachMap);
162
+ // 这里参考之前的逻辑处理(不知道为什么这里没有处理印章逻辑 如果前后的印章不一致 应该也要重新勾选才是)
163
+ // (前后印章不同的逻辑 是在提交的时候处理的,会弹出一个模态框)
164
+ // 如果有合同id 传入合同id
165
+ // 有合同id 表明之前已经签署过位置了
166
+ // 需要处理下签署前后的附件数据
167
+ if (currentContractId) {
168
+ params.contractId = currentContractId;
169
+ // 找出此次新增加的附件
170
+ if (stampedAttachIdList.length === 0) {
171
+ params.attachIdList = currentCheckedElectronAttachIds;
172
+ }
173
+ else {
174
+ params.attachIdList = currentCheckedElectronAttachIds.filter(function (attachId) { return !stampedAttachIdList.includes(attachId); });
210
175
  }
211
176
  }
212
177
  else {
213
- window.open(res.data.data.preSignUrl);
178
+ params.attachIdList = currentCheckedElectronAttachIds;
214
179
  }
215
- }
216
- else {
217
- message.error(res.data.msg || i18next.t('出错了'));
218
- }
219
- });
220
- })
221
- .catch(function (error) {
222
- var _a, _b;
223
- setLoading === null || setLoading === void 0 ? void 0 : setLoading({
224
- spinning: false,
225
- });
226
- message.error(((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('请求失败!'));
180
+ // 找到需要删除的附件(之前已经盖了章的附件,但是本次没有选中盖电子印章的按钮)
181
+ // 已盖章的附件id列表中筛选出要删除的附件id列表
182
+ if (Array.isArray(stampedAttachIdList)) {
183
+ stampedAttachIdList.forEach(function (n) {
184
+ if (currentCheckedElectronAttachIds.length !== 0 &&
185
+ !currentCheckedElectronAttachIds.includes(n)) {
186
+ params.deleteAttachIdList.push(n);
187
+ }
188
+ });
189
+ }
190
+ request({
191
+ url: '/api/zmdms-resource/seal/confirm-seal-info',
192
+ method: 'POST',
193
+ timeout: 90000,
194
+ data: params,
195
+ })
196
+ .then(function (res) {
197
+ unstable_batchedUpdates(function () {
198
+ var _a;
199
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading({
200
+ spinning: false,
201
+ });
202
+ if (res.status === 200 &&
203
+ res.data.code === 200 &&
204
+ res.data.data.preSignUrl) {
205
+ // 更新一些数据
206
+ var newContractId = res.data.data.contractId; // 新合同id
207
+ var newDocAttachMap = res.data.data.docAttachMap; // 新文档对应关系(附件:合同id)
208
+ var newDocumentIdList = getDocumentIdListByMap(newDocAttachMap); // 新文档id列表
209
+ // 非受控模式 设置下内部数据
210
+ // 受控模式 会在effect中进行处理
211
+ // if (isUnControlled) {
212
+ setCurrentContractId(newContractId);
213
+ setCurrentDocAttachMap(newDocAttachMap);
214
+ setCurrentDocumentIdList(newDocumentIdList);
215
+ onElectronicSealIdChange(newSealIdList, false);
216
+ // }
217
+ if (otherParams.needYjzrr !== undefined) {
218
+ setCurrentIsCheckedEconomic(otherParams.needYjzrr);
219
+ }
220
+ // 回写接口返回的最新手签用户列表(编辑全量更新语义下的服务端数据为准)
221
+ if (setPersonalSignUserIds &&
222
+ Array.isArray(res.data.data.personalSignUserIds)) {
223
+ setPersonalSignUserIds(res.data.data.personalSignUserIds);
224
+ }
225
+ callback === null || callback === void 0 ? void 0 : callback({
226
+ checkAttachIdList: currentCheckedElectronAttachIds,
227
+ contractId: newContractId,
228
+ docAttachMap: newDocAttachMap,
229
+ documentIdList: newDocumentIdList,
230
+ });
231
+ // 更改当前数据
232
+ if (dataType) {
233
+ onValueChange &&
234
+ onValueChange((_a = {},
235
+ _a[dataType] = {
236
+ checkAttachIdList: currentCheckedElectronAttachIds,
237
+ contractId: newContractId,
238
+ docAttachMap: newDocAttachMap,
239
+ documentIdList: newDocumentIdList,
240
+ // 在这里更改下是否加盖一级责任人数据
241
+ isCheckedEconomic: params.needYjzrr,
242
+ // 手签用户列表 供业务系统保存 供 final-seal 使用
243
+ personalSignUserIds: params.personalSignUserIds,
244
+ electronicSealIdList: newSealIdList,
245
+ },
246
+ _a));
247
+ }
248
+ // 需要跳转到契约锁重新指定签署位置
249
+ // 如果需要检测是否还有 未确认盖章位置的印章信息列表
250
+ if (isCheckUnStampedSeal) {
251
+ if (unElectronicSealList.length > 0) {
252
+ window.open(res.data.data.preSignUrl);
253
+ }
254
+ }
255
+ else {
256
+ window.open(res.data.data.preSignUrl);
257
+ }
258
+ }
259
+ else {
260
+ message.error(res.data.msg || i18next.t('出错了'));
261
+ }
262
+ });
263
+ })
264
+ .catch(function (error) {
265
+ var _a, _b;
266
+ setLoading === null || setLoading === void 0 ? void 0 : setLoading({
267
+ spinning: false,
268
+ });
269
+ message.error(((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || i18next.t('请求失败!'));
270
+ });
271
+ return [2 /*return*/];
272
+ }
227
273
  });
228
- });
274
+ }); });
229
275
  // 预览盖章签署效果
230
276
  var viewSignPage = useMemoizedFn(function () {
231
277
  if (!currentContractId) {
@@ -333,6 +379,33 @@ export default function useParseElectronSetting(options) {
333
379
  unElectronicSealIdList: unElectronicSealIdList,
334
380
  };
335
381
  }
382
+ /**
383
+ * 收集当前已选的群杰印章编号
384
+ * 包含整体选择的群杰印章 和 单附件模式下各附件选择的群杰印章
385
+ */
386
+ function collectQjSealNos(qunjSeal, records, fileFieldsNameRef) {
387
+ var _a;
388
+ var sealNos = new Set();
389
+ // 整体选择的群杰印章
390
+ ((qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) || []).forEach(function (item) {
391
+ if (item === null || item === void 0 ? void 0 : item.sealNo) {
392
+ sealNos.add(item.sealNo + '');
393
+ }
394
+ });
395
+ // 单附件模式下 各附件选择的群杰印章
396
+ var qunjSealKey = ((_a = fileFieldsNameRef === null || fileFieldsNameRef === void 0 ? void 0 : fileFieldsNameRef.current) === null || _a === void 0 ? void 0 : _a.qunjSeal) || 'qunjSeal';
397
+ (records || []).forEach(function (record) {
398
+ var _a, _b;
399
+ var details = (_b = (_a = record) === null || _a === void 0 ? void 0 : _a[qunjSealKey]) === null || _b === void 0 ? void 0 : _b.details;
400
+ (Array.isArray(details) ? details : []).forEach(function (item) {
401
+ if (item === null || item === void 0 ? void 0 : item.sealNo) {
402
+ sealNos.add(item.sealNo + '');
403
+ }
404
+ });
405
+ });
406
+ // 注意:不能用 [...set] 展开符,低版本target编译后对Set会得到空数组
407
+ return Array.from(sealNos);
408
+ }
336
409
  /** 根据文档 附件对应关系 获取已盖章的附件id列表 */
337
410
  function getStampedAttachIdListByMap(currentDocAttachMap) {
338
411
  if (currentDocAttachMap) {
@@ -7,6 +7,8 @@ interface IElectronSignaturesContext {
7
7
  isNewElectronSealStyle?: boolean;
8
8
  /** 群杰印章是否使用新版展示样式 */
9
9
  isNewQunjSealStyle?: boolean;
10
+ /** 是否启用流程印章过滤(legalsealflow/getSeal) */
11
+ isFilterLegalSeal?: boolean;
10
12
  }
11
13
  export declare const ElectronSignaturesContext: React.Context<IElectronSignaturesContext>;
12
14
  declare const _default: React.NamedExoticComponent<IElectronSignaturesProps>;
@@ -28,27 +28,36 @@ export var ElectronSignaturesContext = createContext({
28
28
  isQjVerifyCode: true,
29
29
  isNewElectronSealStyle: false,
30
30
  isNewQunjSealStyle: false,
31
+ isFilterLegalSeal: false,
31
32
  });
32
33
  /**
33
34
  * 容器组件,为了将context传递给组件,方便组件能快速访问到一些信息
34
35
  */
35
36
  var ElectronSignaturesWrap = function (props) {
36
- var _a, _b, _c, _d;
37
+ var _a, _b, _c, _d, _e, _f;
37
38
  // 这里未上线之前,都使用默认为false。不采用最新版本的修改
38
- var _e = props.isQjVerifyCode, isQjVerifyCode = _e === void 0 ? false : _e, _f = props.isNewQys, isNewQys = _f === void 0 ? false : _f, resetProps = __rest(props, ["isQjVerifyCode", "isNewQys"]);
39
+ var _g = props.isQjVerifyCode, isQjVerifyCode = _g === void 0 ? false : _g, _h = props.isNewQys, isNewQys = _h === void 0 ? false : _h, resetProps = __rest(props, ["isQjVerifyCode", "isNewQys"]);
39
40
  // 全局配置:组件 props 优先,未传时取全局 ZtxkContext 配置
40
- var _g = useBaseContext(), globalElectronSealStyle = _g.isNewElectronSealStyle, globalQunjSealStyle = _g.isNewQunjSealStyle;
41
+ var _j = useBaseContext(), globalElectronSealStyle = _j.isNewElectronSealStyle, globalQunjSealStyle = _j.isNewQunjSealStyle, globalFilterLegalSeal = _j.isFilterLegalSeal;
41
42
  var isNewElectronSealStyle = (_b = (_a = props.isNewElectronSealStyle) !== null && _a !== void 0 ? _a : globalElectronSealStyle) !== null && _b !== void 0 ? _b : false;
42
43
  var isNewQunjSealStyle = (_d = (_c = props.isNewQunjSealStyle) !== null && _c !== void 0 ? _c : globalQunjSealStyle) !== null && _d !== void 0 ? _d : false;
44
+ var isFilterLegalSeal = (_f = (_e = props.isFilterLegalSeal) !== null && _e !== void 0 ? _e : globalFilterLegalSeal) !== null && _f !== void 0 ? _f : false;
43
45
  var defaultContext = useMemo(function () {
44
46
  return {
45
47
  isNewQys: isNewQys,
46
48
  isQjVerifyCode: isQjVerifyCode,
47
49
  isNewElectronSealStyle: isNewElectronSealStyle,
48
50
  isNewQunjSealStyle: isNewQunjSealStyle,
51
+ isFilterLegalSeal: isFilterLegalSeal,
49
52
  };
50
- }, [isNewQys, isQjVerifyCode, isNewElectronSealStyle, isNewQunjSealStyle]);
53
+ }, [
54
+ isNewQys,
55
+ isQjVerifyCode,
56
+ isNewElectronSealStyle,
57
+ isNewQunjSealStyle,
58
+ isFilterLegalSeal,
59
+ ]);
51
60
  return (React.createElement(ElectronSignaturesContext.Provider, { value: defaultContext },
52
- React.createElement(ElectronSignatures, __assign({ isQjVerifyCode: isQjVerifyCode, isNewQys: isNewQys, isNewElectronSealStyle: isNewElectronSealStyle, isNewQunjSealStyle: isNewQunjSealStyle }, resetProps))));
61
+ React.createElement(ElectronSignatures, __assign({ isQjVerifyCode: isQjVerifyCode, isNewQys: isNewQys, isNewElectronSealStyle: isNewElectronSealStyle, isNewQunjSealStyle: isNewQunjSealStyle, isFilterLegalSeal: isFilterLegalSeal }, resetProps))));
53
62
  };
54
63
  export default memo(ElectronSignaturesWrap);
@@ -195,6 +195,12 @@ export interface IElectronSignaturesItem {
195
195
  * 是否默认勾选经济责任人 1为默认勾选 0为不勾选
196
196
  */
197
197
  isCheckedEconomic?: number;
198
+ /**
199
+ * 个人签署(手签章)已勾选的用户id列表
200
+ * 回显时使用 组件返回这个参数 需要保存 下次调用组件时传入
201
+ * 最终盖章(final-seal)时也需原样传给后端
202
+ */
203
+ personalSignUserIds?: Array<number | string>;
198
204
  /** 合同id */
199
205
  contractId?: string;
200
206
  /**
@@ -209,6 +215,11 @@ export interface IElectronSignaturesItem {
209
215
  * 流程状态 15 审批中 50 审批完成
210
216
  */
211
217
  flowStatus?: any;
218
+ /**
219
+ * 个人签署配置的组织机构类型 1=业务组织机构(默认) 2=行政组织机构 4=人事范围
220
+ * 用于查询个人签署(手签章)配置 不传则后端按默认处理
221
+ */
222
+ organizationType?: number | string;
212
223
  /**
213
224
  * 部门ID
214
225
  */
@@ -455,6 +466,11 @@ export interface IElectronSignaturesItemPublic {
455
466
  * 未传时取全局 ZtxkContext 中的 isNewQunjSealStyle
456
467
  */
457
468
  isNewQunjSealStyle?: boolean;
469
+ /**
470
+ * 是否启用流程印章过滤(调用 legalsealflow/getSeal 过滤电子印章列表)
471
+ * 未传时取全局 ZtxkContext 中的 isFilterLegalSeal,默认 false 不过滤
472
+ */
473
+ isFilterLegalSeal?: boolean;
458
474
  /**
459
475
  * 户用合同章显示的逻辑的控制
460
476
  */
@@ -100,8 +100,17 @@ var QunjList = function (props) {
100
100
  });
101
101
  return countMap;
102
102
  }, [companyMap, details]);
103
- // 新版:已选印章完整列表
104
- var selectedDetails = details || [];
103
+ // 新版:已选印章完整列表(详情回显的 details 只有 sealNo 等基础字段 需要用列表数据匹配补全印章名称等信息)
104
+ var selectedDetails = useMemo(function () {
105
+ if (!Array.isArray(details)) {
106
+ return [];
107
+ }
108
+ var listMap = new Map((Array.isArray(qunjList) ? qunjList : []).map(function (item) { return [
109
+ item.sealNo,
110
+ item,
111
+ ]; }));
112
+ return details.map(function (detail) { return (__assign(__assign({}, (listMap.get(detail.sealNo) || {})), detail)); });
113
+ }, [details, qunjList]);
105
114
  // 旧版:按 useType 分组
106
115
  var qunjListTypeMemo = useMemo(function () {
107
116
  var _a;
@@ -136,7 +145,7 @@ var QunjList = function (props) {
136
145
  } },
137
146
  React.createElement(Radio, { value: 0 }, i18next.t('内部用印')),
138
147
  React.createElement(Radio, { value: 1 }, i18next.t('外部用印'))),
139
- isQunjAddress && isTakeOut + '' === '1' ? (React.createElement(EnhanceSelect, { style: { width: 70 }, list: qunjAddressList, size: "small", value: currentQunjAddress === null || currentQunjAddress === void 0 ? void 0 : currentQunjAddress.id, onChange: function (value, option, completeData) {
148
+ isQunjAddress && isTakeOut + '' === '1' ? (React.createElement(EnhanceSelect, { style: { width: 68 }, list: qunjAddressList, size: "small", value: currentQunjAddress === null || currentQunjAddress === void 0 ? void 0 : currentQunjAddress.id, onChange: function (value, option, completeData) {
140
149
  var _a, _b;
141
150
  // 切换盖章地点时,清理非当前地点的已选印章
142
151
  var copyDetails = ((_b = (_a = details === null || details === void 0 ? void 0 : details.slice()) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, function (d) { return (__assign({}, d)); })) || [];
@@ -194,7 +203,6 @@ var QunjList = function (props) {
194
203
  } },
195
204
  React.createElement("span", { title: qunjItem.sealName }, getSealShortName(qunjItem))),
196
205
  React.createElement("div", { className: "qunj-list-new--seal-count" },
197
- i18next.t('次数'),
198
206
  React.createElement(InputNumber, { size: "small", value: findItem === null || findItem === void 0 ? void 0 : findItem.sealCount, min: 1, onChange: function (e) {
199
207
  var index = copyDetails.findIndex(function (d) { return d.sealNo === sealNo; });
200
208
  if (index === -1) {
@@ -207,7 +215,8 @@ var QunjList = function (props) {
207
215
  details: copyDetails,
208
216
  contranctNum: contranctNum ? contranctNum : 1,
209
217
  });
210
- } }))));
218
+ } }),
219
+ i18next.t('次'))));
211
220
  })),
212
221
  React.createElement("div", { className: "seal-selected-summary" },
213
222
  React.createElement("div", { className: "seal-selected-title" }, i18next.t('已选印章')),
@@ -21,11 +21,16 @@ export default function useFetchQunjData(options) {
21
21
  companyType: item.companyType,
22
22
  companyTypeName: item.companyTypeName,
23
23
  sealName: item.sealName,
24
+ sealShortName: item.sealShortName,
24
25
  sealNo: item.sealNo,
25
26
  areaType: item.areaType,
26
27
  areaTypeName: item.areaTypeName,
27
28
  useType: item.useType,
28
29
  useTypeName: item.useTypeName,
30
+ useWithQjIds: item.useWithQjIds,
31
+ useWithQjNames: item.useWithQjNames,
32
+ useWithQysIds: item.useWithQysIds,
33
+ useWithQysNames: item.useWithQysNames,
29
34
  }); })) || []);
30
35
  }
31
36
  else {
@@ -140,11 +140,11 @@ export default function useQunjColumns(options) {
140
140
  title: i18next.t('选择群杰印章'),
141
141
  dataIndex: 'qunjDetail',
142
142
  key: 'qunjDetail',
143
- width: 326,
143
+ width: 344,
144
144
  align: 'center',
145
145
  // 固定列宽(scroll.x=max-content 时 width 会被内容撑开)
146
146
  onHeaderCell: function () { return ({
147
- style: { width: 326, minWidth: 326, maxWidth: 326 },
147
+ style: { width: 344, minWidth: 344, maxWidth: 344 },
148
148
  }); },
149
149
  onCell: function () { return ({
150
150
  // 内容从顶部往下排,避免切换公司时因印章数量不同导致内容垂直居中抖动
@@ -29,6 +29,16 @@ export interface IZtxkConfig {
29
29
  * 表格是否默认开启前端过滤
30
30
  */
31
31
  isTableFilterEnabled?: boolean;
32
+ /**
33
+ * 带排序的列在配置宽度基础上默认追加的宽度(px),
34
+ * 用于避免排序图标挤压表头文字;0 或不配置则不追加
35
+ */
36
+ sortColumnExtraWidth?: number;
37
+ /**
38
+ * 带过滤的列在配置宽度基础上默认追加的宽度(px),
39
+ * 用于避免过滤图标挤压表头文字;0 或不配置则不追加
40
+ */
41
+ filterColumnExtraWidth?: number;
32
42
  /**
33
43
  * 列表表单是否添加常用搜索
34
44
  */
@@ -8,6 +8,8 @@ var ztxkConfig = {
8
8
  customDecimalFieldRender: undefined,
9
9
  isTableSortEnabled: false,
10
10
  isTableFilterEnabled: false,
11
+ sortColumnExtraWidth: 0,
12
+ filterColumnExtraWidth: 0,
11
13
  isRecordCommonSearch: false,
12
14
  isUIWeeklyReview: false,
13
15
  };