zmdms-webui 3.1.8 → 3.2.0
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/dist/es/applayoutsider/menu/MainMenu.js +1 -1
- package/dist/es/applayoutsider/menu/SubMenu.js +8 -1
- package/dist/es/canvastable/canvasTable.js +1 -0
- package/dist/es/config/MyStorage.js +11 -5
- package/dist/es/config/ZtxkContext.d.ts +10 -0
- package/dist/es/config/ZtxkContext.js +2 -0
- package/dist/es/config/index.js +1 -0
- package/dist/es/config/utils.js +58 -1
- package/dist/es/dynamicsetting/dynamicDrawer.js +61 -19
- package/dist/es/dynamicsetting/dynamicSetting.js +4 -4
- package/dist/es/dynamicsetting/hooks.js +4 -4
- package/dist/es/dynamicsetting/index.css +1 -1
- package/dist/es/dynamicsetting/index.js +1 -0
- package/dist/es/dynamicsetting/interface.d.ts +5 -0
- package/dist/es/dynamicsetting/useDynamic.js +5 -1
- package/dist/es/dynamicsetting/useSearch.js +26 -6
- package/dist/es/dynamicsetting/useTemplate.d.ts +4 -0
- package/dist/es/dynamicsetting/useTemplate.js +428 -0
- package/dist/es/electronsignatures/content.js +974 -0
- package/dist/es/electronsignatures/dgcomponents/contract-comparison.js +2 -2
- package/dist/es/electronsignatures/dgcomponents/file-comparison-btn.js +136 -0
- package/dist/es/electronsignatures/dgcomponents/new-contract-comparison.js +54 -0
- package/dist/es/electronsignatures/dgcomponents/useContractColumns.js +110 -39
- package/dist/es/electronsignatures/electron-signatures-fragment.js +11 -3
- package/dist/es/electronsignatures/electroncomponents/electron-seal-batch-download.js +179 -67
- package/dist/es/electronsignatures/electroncomponents/electron-seal-detail.js +5 -5
- package/dist/es/electronsignatures/electroncomponents/electron-seal-item-detail.js +15 -0
- package/dist/es/electronsignatures/electroncomponents/electron-seal-item.js +9 -6
- package/dist/es/electronsignatures/electroncomponents/useElectronColumns.js +330 -154
- package/dist/es/electronsignatures/electroncomponents/useFetchElectronData.js +60 -10
- package/dist/es/electronsignatures/electroncomponents/utils.js +119 -28
- package/dist/es/electronsignatures/filecomponents/file-operation.js +6 -4
- package/dist/es/electronsignatures/filecomponents/new-file-operation.js +56 -0
- package/dist/es/electronsignatures/filecomponents/useFileColumns.js +179 -102
- package/dist/es/electronsignatures/hooks/useGetQjVerifyCode.js +134 -0
- package/dist/es/electronsignatures/hooks/useMergeRecords.js +4 -3
- package/dist/es/electronsignatures/hooks/useParseElectronSetting.js +5 -3
- package/dist/es/electronsignatures/hooks/useParseIsNeedElectronData.js +21 -2
- package/dist/es/electronsignatures/hooks/useParseQunjSingleData.js +6 -1
- package/dist/es/electronsignatures/hooks/useParseRecords.js +41 -34
- package/dist/es/electronsignatures/index.css +1 -1
- package/dist/es/electronsignatures/index.js +18 -833
- package/dist/es/electronsignatures/interface.d.ts +129 -5
- package/dist/es/electronsignatures/interface.js +9 -4
- package/dist/es/electronsignatures/qunjcomponents/qunj-check.js +2 -2
- package/dist/es/electronsignatures/qunjcomponents/qunj-detail.js +135 -14
- package/dist/es/electronsignatures/qunjcomponents/qunj-list.js +33 -13
- package/dist/es/electronsignatures/qunjcomponents/useFetchQunjData.js +8 -3
- package/dist/es/electronsignatures/qunjcomponents/useQunjColumns.js +202 -202
- package/dist/es/electronsignatures/translatecomponents/TranslateButton.js +27 -0
- package/dist/es/electronsignatures/translatecomponents/useTranslateCom.js +35 -0
- package/dist/es/form/common-search-list.js +28 -9
- package/dist/es/form/form.js +13 -11
- package/dist/es/form/useCommonSearch.js +3 -4
- package/dist/es/table/components/EnhanceBodyBasicCell.js +9 -0
- package/dist/es/table/components/useDragRef.js +6 -0
- package/dist/es/table/constant.js +4 -1
- package/dist/es/table/hooks/useCtrl.js +44 -0
- package/dist/es/table/hooks/useSelectSubtotal.js +376 -0
- package/dist/es/table/index.css +1 -1
- package/dist/es/table/interface.d.ts +2 -0
- package/dist/es/table/table.js +14 -2
- package/dist/index.build.d.ts +1 -0
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/dist/index.es.js +1 -0
- package/dist/less/components/DynamicSetting/style/index.less +38 -0
- package/dist/less/components/ElectronSignatures/style/index.less +37 -5
- package/dist/less/components/Table/style/index.less +32 -0
- package/package.json +2 -2
- package/dist/es/electronsignatures/electroncomponents/electron-seal-download.js +0 -74
|
@@ -1,838 +1,23 @@
|
|
|
1
|
-
import { __rest, __assign
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import '../config/ZtxkContext.js';
|
|
6
|
-
import useBaseContext from '../config/useBaseContext.js';
|
|
7
|
-
import '../config/MyStorage.js';
|
|
8
|
-
import ElectronSignaturesFragment from './electron-signatures-fragment.js';
|
|
9
|
-
import { useMemoizedFn } from 'ahooks';
|
|
10
|
-
import useMergeRecords from './hooks/useMergeRecords.js';
|
|
11
|
-
import useFileTypeColumns from './filecomponents/useFileTypeColumns.js';
|
|
12
|
-
import useFileColumns from './filecomponents/useFileColumns.js';
|
|
13
|
-
import useElectronColumns from './electroncomponents/useElectronColumns.js';
|
|
14
|
-
import ElectronSealBatchDownload from './electroncomponents/electron-seal-batch-download.js';
|
|
15
|
-
import useCheckedSealInfoList from './electroncomponents/useCheckedSealInfoList.js';
|
|
16
|
-
import LastQysModal from './electroncomponents/last-qys-modal.js';
|
|
17
|
-
import useQunjColumns from './qunjcomponents/useQunjColumns.js';
|
|
18
|
-
import useContractColumns from './dgcomponents/useContractColumns.js';
|
|
19
|
-
import useDg from './dgcomponents/useDg.js';
|
|
20
|
-
import { currentRecordIsOnlyQunj, FLOW_IDS } from './utils.js';
|
|
21
|
-
import { countIsValidate } from './hooks/useParseQunjListData.js';
|
|
22
|
-
import FileUpload from './filecomponents/file-upload.js';
|
|
23
|
-
import { DATA_TYPE_KEY } from './hooks/useParseRecords.js';
|
|
24
|
-
import useCheckedSealInfoList$1 from './electroncomponents/useGetDeptInfo.js';
|
|
25
|
-
import dayjs from 'dayjs';
|
|
26
|
-
import isEqual from 'lodash/isEqual';
|
|
27
|
-
import myMessage from '../message/index.js';
|
|
28
|
-
import ModalComponent from '../modal/modal.js';
|
|
1
|
+
import { __rest, __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { createContext, memo, useMemo } from 'react';
|
|
4
|
+
import ElectronSignatures from './content.js';
|
|
29
5
|
|
|
6
|
+
var ElectronSignaturesContext = createContext({
|
|
7
|
+
isNewQys: true,
|
|
8
|
+
isQjVerifyCode: true,
|
|
9
|
+
});
|
|
30
10
|
/**
|
|
31
|
-
*
|
|
32
|
-
* 不同的数据类型 共享一个表头 那么其实这样就做不到隐藏某些表头的效果
|
|
11
|
+
* 容器组件,为了将context传递给组件,方便组件能快速访问到一些信息
|
|
33
12
|
*/
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
// fmsIsElectronicSealPushLabel = '推送银行',
|
|
42
|
-
_j = props.fmsIsElectronicSealPushLabel,
|
|
43
|
-
// fmsIsElectronicSealPushLabel = '推送银行',
|
|
44
|
-
fmsIsElectronicSealPushLabel = _j === void 0 ? "加盖银行签章" : _j, isSingleQj = props.isSingleQj, _k = props.isQjUseModal, isQjUseModal = _k === void 0 ? true : _k, defaultJustNeedQj = props.defaultJustNeedQj, isDeleteAllFileWhenJustUseQj = props.isDeleteAllFileWhenJustUseQj, _l = props.isShowQysWhenNeedNotQys, isShowQysWhenNeedNotQys = _l === void 0 ? true : _l, _m = props.isControlNeedQys, isControlNeedQys = _m === void 0 ? true : _m, isDeletePlaceholderFileData = props.isDeletePlaceholderFileData, caseId = props.caseId, _o = props.needOrganizationId, needOrganizationId = _o === void 0 ? true : _o, resetProps = __rest(props, ["request", "isUnControlled", "contractNumFlowIds", "fileUploadProps", "isShowFileUpload", "otherOptions", "fileBaseUrl", "apiBaseUrl", "electronHandleRef", "onValueChange", "isValidateSuccess", "refreshCode", "onCheckedComparison", "onFileTypeChangeGetItem", "tableScroll", "getCreateTimeHand", "isShowElectronBatchBtn", "isShowDownloadBatchBtn", "isShowBatchDeleteBtn", "batchDownloadZipName", "isShowDoubleSignedBatchBtn", "isShowFileType", "isShowFileTypeMerge", "fmsIsElectronicSealLabel", "fmsIsElectronicSealPushLabel", "isSingleQj", "isQjUseModal", "defaultJustNeedQj", "isDeleteAllFileWhenJustUseQj", "isShowQysWhenNeedNotQys", "isControlNeedQys", "isDeletePlaceholderFileData", "caseId", "needOrganizationId"]);
|
|
45
|
-
var selectRows = useRef(null);
|
|
46
|
-
var onValueChange = useMemoizedFn(function (info) {
|
|
47
|
-
_onValueChange && _onValueChange(info);
|
|
48
|
-
});
|
|
49
|
-
var onFileTypeChangeGetItem = useMemoizedFn(function (info) {
|
|
50
|
-
if (_onFileTypeChangeGetItem) {
|
|
51
|
-
return _onFileTypeChangeGetItem(info);
|
|
52
|
-
}
|
|
53
|
-
return __assign(__assign({}, info), { templateAttachId: undefined, templateAttachName: undefined, taskId: undefined });
|
|
54
|
-
});
|
|
55
|
-
var getCreateTimeHand = useMemoizedFn(function (record) {
|
|
56
|
-
// 这里方法有点问题做了下替换。后续看是否有问题
|
|
57
|
-
if (_getCreateTimeHand) {
|
|
58
|
-
return _getCreateTimeHand(record);
|
|
59
|
-
}
|
|
60
|
-
return record.createTime;
|
|
61
|
-
});
|
|
62
|
-
// 验证契约锁是否全部盖章
|
|
63
|
-
var getNoSealInfoList = useCheckedSealInfoList(request).getNoSealInfoList;
|
|
64
|
-
// 获得部门信息
|
|
65
|
-
var getDeptInfo = useCheckedSealInfoList$1(request).getDeptInfo;
|
|
66
|
-
// 达观操作
|
|
67
|
-
var _p = useDg(request), compareHandle = _p.compareHandle, lookCompareHandle = _p.lookCompareHandle;
|
|
68
|
-
// 存储当前点击的选择比对模板的一些参数
|
|
69
|
-
var dgInfoRef = useRef({});
|
|
70
|
-
var myCompareHandle = useMemoizedFn(function (templateId) {
|
|
71
|
-
return new Promise(function (resolve, reject) {
|
|
72
|
-
var _a = dgInfoRef.current, realIndex = _a.realIndex, attachId = _a.attachId, setRecords = _a.setRecords;
|
|
73
|
-
if (templateId && attachId) {
|
|
74
|
-
compareHandle(templateId, attachId)
|
|
75
|
-
.then(function (res) {
|
|
76
|
-
var _a, _b, _c;
|
|
77
|
-
if ((_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.taskId) {
|
|
78
|
-
setRecords(function (preRecords) {
|
|
79
|
-
var _a;
|
|
80
|
-
var copyRecords = preRecords.slice();
|
|
81
|
-
var item = copyRecords[realIndex];
|
|
82
|
-
copyRecords.splice(realIndex, 1, __assign(__assign({}, item), { taskId: (_a = res.data.data) === null || _a === void 0 ? void 0 : _a.taskId }));
|
|
83
|
-
return copyRecords;
|
|
84
|
-
});
|
|
85
|
-
resolve((_c = res.data.data) === null || _c === void 0 ? void 0 : _c.taskId);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
reject("调用合同比对接口失败");
|
|
89
|
-
}
|
|
90
|
-
})
|
|
91
|
-
.catch(function (err) {
|
|
92
|
-
reject(err || "调用合同比对接口失败");
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
// 基础地址
|
|
98
|
-
var _q = useBaseContext(), API_BASE_URL = _q.apiBaseUrl, FILE_BASE_URL = _q.fileBaseUrl;
|
|
99
|
-
var apiBaseUrl = _apiBaseUrl || API_BASE_URL;
|
|
100
|
-
var fileBaseUrl = _fileBaseUrl || FILE_BASE_URL;
|
|
101
|
-
// 将配置分级处理
|
|
102
|
-
var allOptions = [];
|
|
103
|
-
// 对于那些没有传入部门数据和流程数据的参数统统干掉
|
|
104
|
-
// 这样会导致一个bug。那就是首次加载的时候,可能没有数据。但是后续又通过接口拿到了数据。
|
|
105
|
-
// 这里之前是不会有部门、流程的限制的。是因为用印流程他实际也是用了多个类型的附件,但是实际上
|
|
106
|
-
// 他不会有多个类型的附件。会导致多一个空行出来
|
|
107
|
-
if (Array.isArray(otherOptions)) {
|
|
108
|
-
var newOtherOptions = otherOptions.filter(function (item) {
|
|
109
|
-
return item.deptId && item.flowId ? true : false;
|
|
110
|
-
});
|
|
111
|
-
allOptions = __spreadArray([resetProps], newOtherOptions, true);
|
|
112
|
-
}
|
|
113
|
-
else if (otherOptions && (otherOptions === null || otherOptions === void 0 ? void 0 : otherOptions.deptId) && (otherOptions === null || otherOptions === void 0 ? void 0 : otherOptions.flowId)) {
|
|
114
|
-
allOptions = [resetProps, otherOptions];
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
allOptions = [resetProps];
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* 当前是否是编辑状态
|
|
121
|
-
*/
|
|
122
|
-
var currentIsEditMemo = useMemo(function () {
|
|
123
|
-
return ((resetProps === null || resetProps === void 0 ? void 0 : resetProps.canEdit) + "" === "1" || (resetProps === null || resetProps === void 0 ? void 0 : resetProps.canEdit) === true);
|
|
124
|
-
}, [resetProps.canEdit]);
|
|
125
|
-
// 表格是否处于loading中
|
|
126
|
-
var _r = useState(), loading = _r[0], setLoading = _r[1];
|
|
127
|
-
// 当前是否处于仅需要群杰印章的状态
|
|
128
|
-
var _s = useState(defaultJustNeedQj || false), justNeedQj = _s[0], setJustNeedQj = _s[1];
|
|
129
|
-
var _t = useState(""), organizationId = _t[0], setOrganizationId = _t[1];
|
|
130
|
-
/**
|
|
131
|
-
* 通过部门Id获得公司id
|
|
132
|
-
*/
|
|
133
|
-
useEffect(function () {
|
|
134
|
-
var _deptId = resetProps.deptId;
|
|
135
|
-
if (_deptId && needOrganizationId) {
|
|
136
|
-
// 调用接口
|
|
137
|
-
getDeptInfo({
|
|
138
|
-
id: _deptId,
|
|
139
|
-
}).then(function (res) {
|
|
140
|
-
setOrganizationId((res === null || res === void 0 ? void 0 : res.companyId) || "");
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
144
|
-
}, [resetProps.deptId]);
|
|
145
|
-
useEffect(function () {
|
|
146
|
-
setJustNeedQj(defaultJustNeedQj || false);
|
|
147
|
-
}, [defaultJustNeedQj]);
|
|
148
|
-
// 记录下传入配置的顺序
|
|
149
|
-
// 这里做一下改造,将dataTypeSort作为一个动态变化的值来控制
|
|
150
|
-
var dataTypeString = (_c = (_b = (_a = allOptions === null || allOptions === void 0 ? void 0 : allOptions.map) === null || _a === void 0 ? void 0 : _a.call(allOptions, function (option, index) {
|
|
151
|
-
var dataType = option.dataType;
|
|
152
|
-
return dataType || "".concat(index);
|
|
153
|
-
})) === null || _b === void 0 ? void 0 : _b.join) === null || _c === void 0 ? void 0 : _c.call(_b, ",");
|
|
154
|
-
var dataTypeSort = useMemo(function () {
|
|
155
|
-
return allOptions.map(function (option, index) {
|
|
156
|
-
var dataType = option.dataType;
|
|
157
|
-
return dataType || "".concat(index);
|
|
158
|
-
});
|
|
159
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
160
|
-
}, [dataTypeString]);
|
|
161
|
-
// const [dataTypeSort] = useState<string[]>(() => {
|
|
162
|
-
// return allOptions.map((option, index) => {
|
|
163
|
-
// const { dataType } = option;
|
|
164
|
-
// return dataType || `${index}`;
|
|
165
|
-
// });
|
|
166
|
-
// });
|
|
167
|
-
// 第一份数据的数据类型
|
|
168
|
-
var firstDataType = resetProps.dataType || dataTypeSort[0];
|
|
169
|
-
// 记录下需要处理的所有数据
|
|
170
|
-
// TODO: 定义allData 类型
|
|
171
|
-
var _u = useState({}), allData = _u[0], setAllData = _u[1];
|
|
172
|
-
// 收集修改数据
|
|
173
|
-
var onTrackChange = useMemoizedFn(function (dataType, data) {
|
|
174
|
-
setAllData(function (preAllData) {
|
|
175
|
-
var _a, _b;
|
|
176
|
-
if (preAllData[dataType]) {
|
|
177
|
-
var changeData = preAllData[dataType];
|
|
178
|
-
return __assign(__assign({}, preAllData), (_a = {}, _a[dataType] = __assign(__assign({}, changeData), data), _a));
|
|
179
|
-
}
|
|
180
|
-
return __assign(__assign({}, preAllData), (_b = {}, _b[dataType] = data, _b));
|
|
181
|
-
});
|
|
182
|
-
});
|
|
183
|
-
// 合并数据(数据最终还是要在一个表格中显示)
|
|
184
|
-
var _v = useMergeRecords({
|
|
185
|
-
allData: allData,
|
|
186
|
-
dataTypeSort: dataTypeSort,
|
|
187
|
-
isDeleteAllFileWhenJustUseQj: isDeleteAllFileWhenJustUseQj,
|
|
188
|
-
isDeletePlaceholderFileData: isDeletePlaceholderFileData,
|
|
189
|
-
}), mergeRecords = _v.mergeRecords, isHiddenColumns = _v.isHiddenColumns;
|
|
190
|
-
// 附件归属
|
|
191
|
-
var fileTypeColumns = useFileTypeColumns({
|
|
192
|
-
records: mergeRecords,
|
|
193
|
-
dataTypeSort: dataTypeSort,
|
|
194
|
-
allData: allData,
|
|
195
|
-
fileUploadProps: fileUploadProps,
|
|
196
|
-
isShowFileUpload: isShowFileUpload,
|
|
197
|
-
apiBaseUrl: apiBaseUrl,
|
|
198
|
-
}).fileTypeColumns;
|
|
199
|
-
// 附件相关
|
|
200
|
-
var fileColumns = useFileColumns({
|
|
201
|
-
records: mergeRecords,
|
|
202
|
-
dataTypeSort: dataTypeSort,
|
|
203
|
-
allData: allData,
|
|
204
|
-
fileUploadProps: fileUploadProps,
|
|
205
|
-
isShowFileUpload: isShowFileUpload,
|
|
206
|
-
apiBaseUrl: apiBaseUrl,
|
|
207
|
-
fileBaseUrl: fileBaseUrl,
|
|
208
|
-
firstDataType: firstDataType,
|
|
209
|
-
onValueChange: onValueChange,
|
|
210
|
-
onFileTypeChangeGetItem: onFileTypeChangeGetItem,
|
|
211
|
-
getCreateTimeHand: getCreateTimeHand,
|
|
212
|
-
isSingleQj: isSingleQj,
|
|
213
|
-
justNeedQj: justNeedQj,
|
|
214
|
-
setJustNeedQj: setJustNeedQj,
|
|
215
|
-
isShowFileType: isShowFileType,
|
|
216
|
-
currentIsEditMemo: currentIsEditMemo,
|
|
217
|
-
isDeleteAllFileWhenJustUseQj: isDeleteAllFileWhenJustUseQj,
|
|
218
|
-
isControlNeedQys: isControlNeedQys,
|
|
219
|
-
organizationId: organizationId,
|
|
220
|
-
onFileReplace: onFileReplace,
|
|
221
|
-
}).fileColumns;
|
|
222
|
-
// 智能合同比对
|
|
223
|
-
var contractColumns = useContractColumns({
|
|
224
|
-
records: mergeRecords,
|
|
225
|
-
dataTypeSort: dataTypeSort,
|
|
226
|
-
allData: allData,
|
|
227
|
-
lookCompareHandle: lookCompareHandle,
|
|
228
|
-
dgInfoRef: dgInfoRef,
|
|
229
|
-
myCompareHandle: myCompareHandle,
|
|
230
|
-
onCheckedComparison: onCheckedComparison,
|
|
231
|
-
}).contractColumns;
|
|
232
|
-
// 生成电子印章列数据
|
|
233
|
-
var electronColumns = useElectronColumns({
|
|
234
|
-
request: request,
|
|
235
|
-
records: mergeRecords,
|
|
236
|
-
dataTypeSort: dataTypeSort,
|
|
237
|
-
allData: allData,
|
|
238
|
-
setLoading: setLoading,
|
|
239
|
-
fmsIsElectronicSealLabel: fmsIsElectronicSealLabel,
|
|
240
|
-
fmsIsElectronicSealPushLabel: fmsIsElectronicSealPushLabel,
|
|
241
|
-
isDeleteAllFileWhenJustUseQj: isDeleteAllFileWhenJustUseQj,
|
|
242
|
-
}).electronColumns;
|
|
243
|
-
// 生成群杰物理章列数据
|
|
244
|
-
var qunjColumns = useQunjColumns({
|
|
245
|
-
request: request,
|
|
246
|
-
records: mergeRecords,
|
|
247
|
-
dataTypeSort: dataTypeSort,
|
|
248
|
-
allData: allData,
|
|
249
|
-
setLoading: setLoading,
|
|
250
|
-
contractNumFlowIds: contractNumFlowIds,
|
|
251
|
-
refreshCode: refreshCode,
|
|
252
|
-
isSingleQj: isSingleQj,
|
|
253
|
-
isQjUseModal: isQjUseModal,
|
|
254
|
-
apiBaseUrl: apiBaseUrl,
|
|
255
|
-
caseId: caseId,
|
|
256
|
-
}).qunjColumns;
|
|
257
|
-
// 组装columns
|
|
258
|
-
var columns = [
|
|
259
|
-
{
|
|
260
|
-
title: "序号",
|
|
261
|
-
dataIndex: "index",
|
|
262
|
-
key: "index",
|
|
263
|
-
width: 50,
|
|
264
|
-
align: "center",
|
|
265
|
-
render: function (text, record, index) { return "".concat(index + 1); },
|
|
266
|
-
},
|
|
267
|
-
];
|
|
268
|
-
// 附件归属类型
|
|
269
|
-
if (isShowFileTypeMerge) {
|
|
270
|
-
columns.push.apply(columns, fileTypeColumns);
|
|
271
|
-
}
|
|
272
|
-
// 附件相关操作
|
|
273
|
-
columns.push.apply(columns, fileColumns);
|
|
274
|
-
// 是否需要显示达观配置
|
|
275
|
-
var isNeedDg = allOptions === null || allOptions === void 0 ? void 0 : allOptions.find(function (item) { return item.needDg + "" === "1"; });
|
|
276
|
-
// 智能合同比对 如果不需要达观 那么肯定不显示
|
|
277
|
-
// 如果设置了 仅需要群杰印章 并且另外一个没有附件
|
|
278
|
-
if (isNeedDg && !isHiddenColumns) {
|
|
279
|
-
columns.push.apply(columns, contractColumns);
|
|
280
|
-
}
|
|
281
|
-
// 是否需要电子印章配置
|
|
282
|
-
var isNeedQys = allOptions === null || allOptions === void 0 ? void 0 : allOptions.find(function (item) { return item.needQys + "" === "1"; });
|
|
283
|
-
// 是否有选盖章的附件
|
|
284
|
-
var isShowQys = allOptions === null || allOptions === void 0 ? void 0 : allOptions.find(function (item) { var _a, _b; return (_b = (_a = item.fileList) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, function (file) { return (file === null || file === void 0 ? void 0 : file.isElectronicSeal) + "" === "1"; }); });
|
|
285
|
-
// 电子印章
|
|
286
|
-
if ((isNeedQys && !isHiddenColumns) || isShowQysWhenNeedNotQys) {
|
|
287
|
-
// 非编辑状态 并且没有印章
|
|
288
|
-
if (allOptions[0].canEdit + "" === "1") {
|
|
289
|
-
columns.push.apply(columns, electronColumns);
|
|
290
|
-
}
|
|
291
|
-
else if (isShowQys) {
|
|
292
|
-
columns.push.apply(columns, electronColumns);
|
|
293
|
-
}
|
|
294
|
-
else if (isShowQysWhenNeedNotQys) {
|
|
295
|
-
columns.push.apply(columns, electronColumns);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
// 是否需要群杰印章配置
|
|
299
|
-
var isNeedQj = allOptions === null || allOptions === void 0 ? void 0 : allOptions.find(function (item) { return item.needQj + "" === "1"; });
|
|
300
|
-
// 群杰印章
|
|
301
|
-
if (isNeedQj) {
|
|
302
|
-
columns.push.apply(columns, qunjColumns);
|
|
303
|
-
}
|
|
304
|
-
var getAllData = useMemoizedFn(function () {
|
|
305
|
-
var resultData = {};
|
|
306
|
-
Object.keys(allData).forEach(function (key) {
|
|
307
|
-
var _a, _b, _c, _d;
|
|
308
|
-
var data = allData[key];
|
|
309
|
-
var records = data.records || [];
|
|
310
|
-
// 是否 过滤掉无用的附件数据 20241014
|
|
311
|
-
var newRecords = isDeletePlaceholderFileData
|
|
312
|
-
? records.filter(function (record) { return !currentRecordIsOnlyQunj(record); })
|
|
313
|
-
: records.slice();
|
|
314
|
-
resultData[key] = {
|
|
315
|
-
fileList: newRecords,
|
|
316
|
-
qunjSeal: data.currentQunjSeal,
|
|
317
|
-
electronicSealIdList: data.currentCheckedElectronicSealIdList,
|
|
318
|
-
docAttachMap: data.currentDocAttachMap,
|
|
319
|
-
documentIdList: data.currentDocumentIdList,
|
|
320
|
-
contractId: data.currentContractId,
|
|
321
|
-
/** 用印次数是否合理 */
|
|
322
|
-
isTotalSealNumTooMore: countIsValidate(data.currentQunjSeal, false),
|
|
323
|
-
/** 群杰盖章地点 */
|
|
324
|
-
qunjAddress:
|
|
325
|
-
// 选了章子
|
|
326
|
-
((_a = data.currentQunjSeal) === null || _a === void 0 ? void 0 : _a.details) &&
|
|
327
|
-
((_c = (_b = data.currentQunjSeal) === null || _b === void 0 ? void 0 : _b.details) === null || _c === void 0 ? void 0 : _c.length) > 0 &&
|
|
328
|
-
// 并且是外部用印
|
|
329
|
-
((_d = data.currentQunjSeal) === null || _d === void 0 ? void 0 : _d.isTakeOut) + "" === "1"
|
|
330
|
-
? data.currentQunjAddress
|
|
331
|
-
: null,
|
|
332
|
-
needQys: data.needQys ? 1 : 0,
|
|
333
|
-
};
|
|
334
|
-
});
|
|
335
|
-
return resultData;
|
|
336
|
-
});
|
|
337
|
-
var modalHandleRef = useRef({});
|
|
338
|
-
// 当前未盖章的印章
|
|
339
|
-
var currentUnSealListRef = useRef({});
|
|
340
|
-
var isClickElectronSureRef = useRef(false);
|
|
341
|
-
useImperativeHandle(electronHandleRef, function () {
|
|
342
|
-
return {
|
|
343
|
-
/** 外部调用此方法时,需要传入合同模板ID */
|
|
344
|
-
compareHandle: myCompareHandle,
|
|
345
|
-
/** 获取所有数据 */
|
|
346
|
-
getAllData: function () {
|
|
347
|
-
return getAllData();
|
|
348
|
-
},
|
|
349
|
-
/** 验证组件是否通过校验 */
|
|
350
|
-
validateElectronTable: function (validateInfo) { return __awaiter(void 0, void 0, void 0, function () {
|
|
351
|
-
var validateAttachType, resultData, submitData, currentData, _a, _b, isQunjKey, _c, qunjSealKey, fileList, hasElectronicSeal, electronicSealFileList, hasQunj, electronicSealIdList, docAttachMap, qunjSeal, contractId, isContranctNum, isEdit, needDg, needQys, needQj, preElectronicSealIdList, qunjChecked, isOnlyQj, isValidateAttachTypeIndex, msg, isValidateDgIndex, msg, isValidateAttachType, msg, msg, electronicSealedFileList_1, isMoreQunjCountIndex, msg, isMoreQunjCount, msg, isCheckTakeOutNoAddress, isCheckTakeOutNoAddressIndex, msg, msg, msg, hasNoWritContranctNum, msg, hasNoCheckedQjSeal, msg, noNumSealName_1, hasNoNumCheckedQjSeal, msg, msg;
|
|
352
|
-
var _d, _e, _f, _g, _h;
|
|
353
|
-
return __generator(this, function (_j) {
|
|
354
|
-
validateAttachType = (validateInfo || {}).validateAttachType;
|
|
355
|
-
resultData = getAllData();
|
|
356
|
-
submitData = resultData[firstDataType];
|
|
357
|
-
currentData = allData[firstDataType];
|
|
358
|
-
_a = ((_d = currentData.fileFieldsNameRef) === null || _d === void 0 ? void 0 : _d.current) || {}, _b = _a.isQunj, isQunjKey = _b === void 0 ? "isQunj" : _b, _c = _a.qunjSeal, qunjSealKey = _c === void 0 ? "qunjSeal" : _c;
|
|
359
|
-
fileList = submitData.fileList;
|
|
360
|
-
hasElectronicSeal = fileList === null || fileList === void 0 ? void 0 : fileList.some(function (item) { return !!item.isElectronicSeal; });
|
|
361
|
-
electronicSealFileList = (_g = (_f = (_e = fileList === null || fileList === void 0 ? void 0 : fileList.filter) === null || _e === void 0 ? void 0 : _e.call(fileList, function (item) { return !!item.isElectronicSeal; })) === null || _f === void 0 ? void 0 : _f.map) === null || _g === void 0 ? void 0 : _g.call(_f, function (item) { return item.attachId; });
|
|
362
|
-
hasQunj = fileList === null || fileList === void 0 ? void 0 : fileList.some(function (item) { return !!(item === null || item === void 0 ? void 0 : item[isQunjKey]); });
|
|
363
|
-
electronicSealIdList = submitData.electronicSealIdList || [];
|
|
364
|
-
docAttachMap = {};
|
|
365
|
-
try {
|
|
366
|
-
docAttachMap = submitData.docAttachMap
|
|
367
|
-
? JSON.parse(submitData.docAttachMap)
|
|
368
|
-
: {};
|
|
369
|
-
}
|
|
370
|
-
catch (err) {
|
|
371
|
-
console.log("解析数据失败!!!!!");
|
|
372
|
-
}
|
|
373
|
-
qunjSeal = submitData.qunjSeal;
|
|
374
|
-
contractId = submitData.contractId;
|
|
375
|
-
isContranctNum = currentData.isContranctNum;
|
|
376
|
-
isEdit = currentData.isEdit;
|
|
377
|
-
needDg = currentData.needDg;
|
|
378
|
-
needQys = currentData.needQys;
|
|
379
|
-
needQj = currentData.needQj;
|
|
380
|
-
preElectronicSealIdList = currentData === null || currentData === void 0 ? void 0 : currentData.clickElectronicSealIdList;
|
|
381
|
-
qunjChecked = currentData.qunjChecked;
|
|
382
|
-
isOnlyQj = fileList.length === 0;
|
|
383
|
-
// 0. 智能合同比对相关验证
|
|
384
|
-
if (isEdit && needDg) {
|
|
385
|
-
isValidateAttachTypeIndex = fileList.findIndex(function (item) {
|
|
386
|
-
return (item.attachId &&
|
|
387
|
-
!item.templateAttachId &&
|
|
388
|
-
(validateAttachType
|
|
389
|
-
? validateAttachType(item)
|
|
390
|
-
: item.attachType === "001"));
|
|
391
|
-
});
|
|
392
|
-
if (isValidateAttachTypeIndex !== -1) {
|
|
393
|
-
msg = "\u7B2C ".concat(isValidateAttachTypeIndex + 1, " \u884C\u6570\u636E\uFF0C\u9644\u4EF6\u7C7B\u578B\u4E3A\u5408\u540C\u672C\u8EAB\uFF0C\u9700\u8981\u6311\u9009\u6BD4\u5BF9\u6A21\u677F\uFF01");
|
|
394
|
-
myMessage.warning(msg);
|
|
395
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
396
|
-
}
|
|
397
|
-
isValidateDgIndex = fileList.findIndex(function (item) {
|
|
398
|
-
return (item.attachId &&
|
|
399
|
-
item.templateAttachId &&
|
|
400
|
-
!item.taskId &&
|
|
401
|
-
(validateAttachType
|
|
402
|
-
? validateAttachType(item)
|
|
403
|
-
: item.attachType === "001"));
|
|
404
|
-
});
|
|
405
|
-
if (isValidateDgIndex !== -1) {
|
|
406
|
-
msg = "\u7B2C ".concat(isValidateDgIndex + 1, " \u884C\u6570\u636E\uFF0C\u6CA1\u6709\u751F\u6210\u4EFB\u52A1id\uFF0C\u8BF7\u70B9\u51FB\u5F00\u59CB\u6BD4\u5BF9\u6309\u94AE\uFF01");
|
|
407
|
-
myMessage.warning(msg);
|
|
408
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
409
|
-
}
|
|
410
|
-
isValidateAttachType = fileList.findIndex(function (item) {
|
|
411
|
-
return !item.attachType;
|
|
412
|
-
});
|
|
413
|
-
if (resetProps.isAllowedPatchFileType &&
|
|
414
|
-
isValidateAttachType !== -1) {
|
|
415
|
-
msg = "\u7B2C ".concat(isValidateAttachType + 1, " \u884C\u6570\u636E\uFF0C\u6CA1\u6709\u9009\u62E9\u9644\u4EF6\u7C7B\u578B\uFF0C\u8BF7\u9009\u62E9\uFF01");
|
|
416
|
-
myMessage.warning(msg);
|
|
417
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
// 1. 指定盖章位置后,又修改了选中印章信息 并且本次一定手动指定了签署位置
|
|
421
|
-
if (isEdit &&
|
|
422
|
-
needQys &&
|
|
423
|
-
!isClickElectronSureRef.current &&
|
|
424
|
-
!isOnlyQj &&
|
|
425
|
-
preElectronicSealIdList &&
|
|
426
|
-
electronicSealIdList.length !== (preElectronicSealIdList === null || preElectronicSealIdList === void 0 ? void 0 : preElectronicSealIdList.length)) {
|
|
427
|
-
ModalComponent.confirm({
|
|
428
|
-
title: "当前所勾选的电子印章信息与上一次盖章时有差异,请确认是否继续?",
|
|
429
|
-
okText: "是",
|
|
430
|
-
okType: "danger",
|
|
431
|
-
cancelText: "否",
|
|
432
|
-
onOk: function () {
|
|
433
|
-
isClickElectronSureRef.current = true;
|
|
434
|
-
},
|
|
435
|
-
onCancel: function () {
|
|
436
|
-
isClickElectronSureRef.current = false;
|
|
437
|
-
},
|
|
438
|
-
});
|
|
439
|
-
return [2 /*return*/, Promise.reject("当前所勾选的电子印章信息与上一次盖章时有差异,请确认是否继续?")];
|
|
440
|
-
}
|
|
441
|
-
// 2. 给附件勾选了加盖电子印章 但是未选择电子印章列表
|
|
442
|
-
if (isEdit &&
|
|
443
|
-
needQys &&
|
|
444
|
-
electronicSealIdList.length === 0 &&
|
|
445
|
-
hasElectronicSeal &&
|
|
446
|
-
!isOnlyQj) {
|
|
447
|
-
msg = "请勾选加盖电子印章所需要的印章列表!";
|
|
448
|
-
myMessage.warning(msg);
|
|
449
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
450
|
-
}
|
|
451
|
-
// 2.1 一开始选了附件和印章,指定了盖章位置。得到了contractId和docAttachMap数据。
|
|
452
|
-
// 后续又选了新的附件或者删掉了之前的附件
|
|
453
|
-
if (isEdit &&
|
|
454
|
-
needQys &&
|
|
455
|
-
contractId &&
|
|
456
|
-
docAttachMap &&
|
|
457
|
-
electronicSealFileList) {
|
|
458
|
-
electronicSealedFileList_1 = [];
|
|
459
|
-
Object.keys(docAttachMap).forEach(function (key) {
|
|
460
|
-
// const value = docAttachMap[key];
|
|
461
|
-
if (electronicSealFileList.find(function (attachId) { return attachId === key; }) ||
|
|
462
|
-
key !== "needYjzrr") {
|
|
463
|
-
// 将当前合同下已经盖章的附件 添加到 已盖章附件列表中
|
|
464
|
-
electronicSealedFileList_1.push(key);
|
|
465
|
-
}
|
|
466
|
-
});
|
|
467
|
-
if (!isEqual(electronicSealFileList.sort(), electronicSealedFileList_1.sort())) {
|
|
468
|
-
myMessage.warning("附件盖章信息有变动,请重新确认盖章信息");
|
|
469
|
-
return [2 /*return*/, Promise.reject("附件盖章信息有变动,请重新确认盖章信息")];
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
// 3. 群杰超过4倍 禁止提交审批
|
|
473
|
-
if (isEdit && needQj && isContranctNum) {
|
|
474
|
-
// 单附件都需要选群杰章 校验逻辑
|
|
475
|
-
if (isSingleQj && hasQunj) {
|
|
476
|
-
isMoreQunjCountIndex = fileList.findIndex(function (file) {
|
|
477
|
-
var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
|
|
478
|
-
// 如果没有勾选,不需要验证
|
|
479
|
-
if (!isQunj) {
|
|
480
|
-
return false;
|
|
481
|
-
}
|
|
482
|
-
var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
|
|
483
|
-
var isMoreQunjCount = countIsValidate(qunjSeal, false);
|
|
484
|
-
if (!isMoreQunjCount) {
|
|
485
|
-
return true;
|
|
486
|
-
}
|
|
487
|
-
return false;
|
|
488
|
-
});
|
|
489
|
-
if (isMoreQunjCountIndex !== -1) {
|
|
490
|
-
msg = "\u7B2C".concat(isMoreQunjCountIndex + 1, "\u884C\u6570\u636E\uFF0C\u60A8\u7684\u7FA4\u6770\u7AE0\u7528\u5370\u6B21\u6570\u8FDC\u8FDC\u8D85\u8FC7\u5408\u7406\u6B21\u6570\u8303\u56F4\uFF0C\u8BF7\u4FEE\u6539\u3002");
|
|
491
|
-
myMessage.warning(msg);
|
|
492
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
// 整体盖群杰章校验逻辑
|
|
496
|
-
if (!isSingleQj) {
|
|
497
|
-
isMoreQunjCount = countIsValidate(qunjSeal, false);
|
|
498
|
-
if (!isMoreQunjCount) {
|
|
499
|
-
msg = "您的群杰章用印次数远远超过合理次数范围,请修改。";
|
|
500
|
-
myMessage.warning(msg);
|
|
501
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
isCheckTakeOutNoAddress = function (data) {
|
|
506
|
-
if (data &&
|
|
507
|
-
data.qunjSeal &&
|
|
508
|
-
data.qunjSeal.isTakeOut + "" === "1" &&
|
|
509
|
-
(!data.qunjAddress || data.qunjAddress.length === 0)) {
|
|
510
|
-
return true;
|
|
511
|
-
}
|
|
512
|
-
return false;
|
|
513
|
-
};
|
|
514
|
-
if (isEdit && needQj) {
|
|
515
|
-
// 对于那种每个附件都需要选择群杰用印的逻辑
|
|
516
|
-
if (isSingleQj) {
|
|
517
|
-
isCheckTakeOutNoAddressIndex = fileList.findIndex(function (file) {
|
|
518
|
-
var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
|
|
519
|
-
// 如果没有勾选,不需要验证
|
|
520
|
-
if (!isQunj) {
|
|
521
|
-
return false;
|
|
522
|
-
}
|
|
523
|
-
var isCheckTakeOutNoAddressResult = isCheckTakeOutNoAddress(file);
|
|
524
|
-
if (isCheckTakeOutNoAddressResult) {
|
|
525
|
-
return true;
|
|
526
|
-
}
|
|
527
|
-
return false;
|
|
528
|
-
});
|
|
529
|
-
if (isCheckTakeOutNoAddressIndex !== -1) {
|
|
530
|
-
msg = "\u7B2C".concat(isCheckTakeOutNoAddressIndex + 1, "\u884C\u6570\u636E\uFF0C\u60A8\u7684\u7FA4\u6770\u7AE0\u7528\u9009\u4E86\u5916\u90E8\u7528\u5370\uFF0C\u4F46\u662F\u6CA1\u6709\u9009\u62E9\u5916\u90E8\u7528\u5370\u7684\u5730\u5740\uFF01");
|
|
531
|
-
myMessage.warning(msg);
|
|
532
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
else if (isCheckTakeOutNoAddress(submitData)) {
|
|
536
|
-
msg = "您的群杰印章选了外部用印,但是没有选择外部用印的地址!";
|
|
537
|
-
myMessage.warning(msg);
|
|
538
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
// 4. 没有确认盖章
|
|
542
|
-
if (isEdit &&
|
|
543
|
-
needQys &&
|
|
544
|
-
hasElectronicSeal &&
|
|
545
|
-
!contractId &&
|
|
546
|
-
!isOnlyQj) {
|
|
547
|
-
msg = "请点击指定签署位置按钮,指定签署位置后方可提交!";
|
|
548
|
-
myMessage.warning(msg);
|
|
549
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
550
|
-
}
|
|
551
|
-
// 5. 合同份数验证
|
|
552
|
-
if (isEdit && needQj) {
|
|
553
|
-
// 单附件都需要选群杰章 校验逻辑
|
|
554
|
-
if (isSingleQj && hasQunj) {
|
|
555
|
-
// 合同份数校验
|
|
556
|
-
if (isContranctNum) {
|
|
557
|
-
hasNoWritContranctNum = fileList.findIndex(function (file) {
|
|
558
|
-
var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
|
|
559
|
-
// 如果没有勾选,不需要验证
|
|
560
|
-
if (!isQunj) {
|
|
561
|
-
return false;
|
|
562
|
-
}
|
|
563
|
-
var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
|
|
564
|
-
if (!qunjSeal.contranctNum) {
|
|
565
|
-
return true;
|
|
566
|
-
}
|
|
567
|
-
return false;
|
|
568
|
-
});
|
|
569
|
-
if (hasNoWritContranctNum !== -1) {
|
|
570
|
-
msg = "\u7B2C".concat(hasNoWritContranctNum + 1, "\u884C\u6570\u636E\uFF0C\u6CA1\u6709\u586B\u5199\u7FA4\u6770\u7AE0\u5408\u540C\u4EFD\u6570\u3002");
|
|
571
|
-
myMessage.warning(msg);
|
|
572
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
hasNoCheckedQjSeal = fileList.findIndex(function (file) {
|
|
576
|
-
var _a, _b;
|
|
577
|
-
var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
|
|
578
|
-
// 如果没有勾选,不需要验证
|
|
579
|
-
if (!isQunj) {
|
|
580
|
-
return false;
|
|
581
|
-
}
|
|
582
|
-
var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
|
|
583
|
-
if (!((_a = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) ||
|
|
584
|
-
((_b = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _b === void 0 ? void 0 : _b.length) === 0) {
|
|
585
|
-
return true;
|
|
586
|
-
}
|
|
587
|
-
return false;
|
|
588
|
-
});
|
|
589
|
-
if (hasNoCheckedQjSeal !== -1) {
|
|
590
|
-
msg = "\u7B2C".concat(hasNoCheckedQjSeal + 1, "\u884C\u6570\u636E\uFF0C\u52FE\u9009\u4E86\u76D6\u7FA4\u6770\u7AE0\uFF0C\u4F46\u662F\u6CA1\u6709\u9009\u62E9\u7FA4\u6770\u5370\u7AE0");
|
|
591
|
-
myMessage.warning(msg);
|
|
592
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
593
|
-
}
|
|
594
|
-
noNumSealName_1 = "";
|
|
595
|
-
hasNoNumCheckedQjSeal = fileList.findIndex(function (file) {
|
|
596
|
-
var _a;
|
|
597
|
-
var isQunj = file === null || file === void 0 ? void 0 : file[isQunjKey];
|
|
598
|
-
// 如果没有勾选,不需要验证
|
|
599
|
-
if (!isQunj) {
|
|
600
|
-
return false;
|
|
601
|
-
}
|
|
602
|
-
var qunjSeal = file === null || file === void 0 ? void 0 : file[qunjSealKey];
|
|
603
|
-
if (Array.isArray(qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) &&
|
|
604
|
-
((_a = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
605
|
-
var noNumItem = qunjSeal.details.find(function (item) { return !item.sealCount; });
|
|
606
|
-
if (noNumItem) {
|
|
607
|
-
noNumSealName_1 = noNumItem.sealName;
|
|
608
|
-
return true;
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
return false;
|
|
612
|
-
});
|
|
613
|
-
if (hasNoNumCheckedQjSeal !== -1) {
|
|
614
|
-
msg = "\u7B2C".concat(hasNoNumCheckedQjSeal + 1, "\u884C\u6570\u636E\uFF0C\u8BF7\u68C0\u67E5\u662F\u5426\u9009\u4E86\u5370\u7AE0\uFF0C\u4F46\u662F\u6CA1\u586B\u7528\u5370\u6B21\u6570\u7684\u5370\u7AE0\u3002\u5982\uFF1A").concat(noNumSealName_1);
|
|
615
|
-
myMessage.warning(msg);
|
|
616
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
// 整体盖群杰章校验逻辑
|
|
620
|
-
if (!isSingleQj && qunjChecked) {
|
|
621
|
-
// 合同份数为空
|
|
622
|
-
if (isContranctNum && !qunjSeal.contranctNum) {
|
|
623
|
-
myMessage.warning("请填写合同份数!");
|
|
624
|
-
return [2 /*return*/, Promise.reject("请填写合同份数!")];
|
|
625
|
-
}
|
|
626
|
-
// 勾选了群杰印章 没有填用印次数
|
|
627
|
-
if (((_h = qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) === null || _h === void 0 ? void 0 : _h.length) > 0) {
|
|
628
|
-
qunjSeal.details.forEach(function (item) {
|
|
629
|
-
if (!item.sealCount) {
|
|
630
|
-
myMessage.warning("\u8BF7\u586B\u5199".concat(item.sealName, " \u7684\u7528\u5370\u6B21\u6570\uFF01"));
|
|
631
|
-
}
|
|
632
|
-
});
|
|
633
|
-
if (qunjSeal.details.filter(function (item) { return !item.sealCount; }).length >
|
|
634
|
-
0) {
|
|
635
|
-
return [2 /*return*/, Promise.reject("请填写用印次数!")];
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
else {
|
|
639
|
-
msg = "请选择群杰用印!";
|
|
640
|
-
myMessage.warning(msg);
|
|
641
|
-
return [2 /*return*/, Promise.reject(msg)];
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
// 6. 调接口检测 是否存在未确认盖章位置的印章
|
|
646
|
-
if (needQys &&
|
|
647
|
-
isEdit &&
|
|
648
|
-
hasElectronicSeal &&
|
|
649
|
-
electronicSealIdList.length > 0) {
|
|
650
|
-
setLoading({
|
|
651
|
-
spinning: true,
|
|
652
|
-
tip: "服务器验证中...",
|
|
653
|
-
});
|
|
654
|
-
// 调用接口
|
|
655
|
-
return [2 /*return*/, getNoSealInfoList({
|
|
656
|
-
contractId: contractId,
|
|
657
|
-
sealIdList: electronicSealIdList,
|
|
658
|
-
deptId: resetProps.deptId,
|
|
659
|
-
needYjzrr: docAttachMap.needYjzrr === "true" ||
|
|
660
|
-
docAttachMap.needYjzrr === true
|
|
661
|
-
? true
|
|
662
|
-
: false,
|
|
663
|
-
})
|
|
664
|
-
.then(function (res) {
|
|
665
|
-
setLoading({
|
|
666
|
-
spinning: false,
|
|
667
|
-
});
|
|
668
|
-
if (res.length > 0) {
|
|
669
|
-
currentUnSealListRef.current = res;
|
|
670
|
-
modalHandleRef.current.setInfo(true, {
|
|
671
|
-
unSealList: res,
|
|
672
|
-
});
|
|
673
|
-
return Promise.reject("还有印章未通过校验");
|
|
674
|
-
}
|
|
675
|
-
else {
|
|
676
|
-
return Promise.resolve(true);
|
|
677
|
-
}
|
|
678
|
-
})
|
|
679
|
-
.catch(function (err) {
|
|
680
|
-
setLoading({
|
|
681
|
-
spinning: false,
|
|
682
|
-
});
|
|
683
|
-
return Promise.reject(err);
|
|
684
|
-
})];
|
|
685
|
-
}
|
|
686
|
-
return [2 /*return*/, Promise.resolve(true)];
|
|
687
|
-
});
|
|
688
|
-
}); },
|
|
689
|
-
/** 切换部门时,应该清空电子印章相关数据 */
|
|
690
|
-
changeDeptIdClearQysDataHandler: function (dataType) {
|
|
691
|
-
var clearAllElectronDataHandler = allData[firstDataType].clearAllElectronDataHandler;
|
|
692
|
-
clearAllElectronDataHandler && clearAllElectronDataHandler(dataType);
|
|
693
|
-
},
|
|
694
|
-
};
|
|
695
|
-
});
|
|
696
|
-
var myRowSelection = useMemo(function () { return ({
|
|
697
|
-
type: "checkbox",
|
|
698
|
-
onChange: function (selectedRowKeys, selectedRows) {
|
|
699
|
-
selectRows.current = selectedRows.map(function (item) {
|
|
700
|
-
var newItem = __assign({}, item);
|
|
701
|
-
return newItem;
|
|
702
|
-
});
|
|
703
|
-
},
|
|
704
|
-
}); }, []);
|
|
705
|
-
var _w = allData[firstDataType] || {}, sameTypeRecords = _w.records, setSameTypeRecords = _w.setRecords, parseCurrentUploadFile = _w.parseCurrentUploadFile;
|
|
706
|
-
function addFile(info, callback) {
|
|
707
|
-
var _a;
|
|
708
|
-
var file = info.file;
|
|
709
|
-
if (file.status === "done") {
|
|
710
|
-
var currentData = allData[firstDataType];
|
|
711
|
-
// 附件类型字段对应表
|
|
712
|
-
var _b = ((_a = currentData.fileFieldsNameRef) === null || _a === void 0 ? void 0 : _a.current) || {}, _c = _b.isQunj, isQunjKey_1 = _c === void 0 ? "isQunj" : _c, _d = _b.qunjSeal, qunjSealKey_1 = _d === void 0 ? "qunjSeal" : _d;
|
|
713
|
-
setSameTypeRecords(function (preRecords) {
|
|
714
|
-
var copyRecords = (preRecords === null || preRecords === void 0 ? void 0 : preRecords.slice()) || [];
|
|
715
|
-
copyRecords = copyRecords.filter(function (record) { return !currentRecordIsOnlyQunj(record); });
|
|
716
|
-
// 插入一个给开发操作附件的机会
|
|
717
|
-
var newFile = callback(file);
|
|
718
|
-
newFile.createTime = dayjs().format("YYYY-MM-DD HH:mm:ss");
|
|
719
|
-
// 每个附件都可以添加群杰时控制
|
|
720
|
-
if (isSingleQj) {
|
|
721
|
-
newFile[isQunjKey_1] = 1;
|
|
722
|
-
newFile[qunjSealKey_1] = { isTakeOut: 0 };
|
|
723
|
-
}
|
|
724
|
-
if (parseCurrentUploadFile) {
|
|
725
|
-
newFile = parseCurrentUploadFile(newFile);
|
|
726
|
-
}
|
|
727
|
-
copyRecords.push(newFile);
|
|
728
|
-
return copyRecords;
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
function onFileChange(info) {
|
|
733
|
-
addFile(info, function (file) {
|
|
734
|
-
var _a;
|
|
735
|
-
var _b, _c, _d, _e;
|
|
736
|
-
return _a = {
|
|
737
|
-
attachId: (_c = (_b = file === null || file === void 0 ? void 0 : file.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.attachId,
|
|
738
|
-
attachName: (_e = (_d = file === null || file === void 0 ? void 0 : file.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.originalName
|
|
739
|
-
},
|
|
740
|
-
_a[DATA_TYPE_KEY] = firstDataType,
|
|
741
|
-
_a;
|
|
742
|
-
});
|
|
743
|
-
}
|
|
744
|
-
function onFileReplace(info, oldVersionId) {
|
|
745
|
-
addFile(info, function (file) {
|
|
746
|
-
var _a;
|
|
747
|
-
var _b, _c, _d, _e;
|
|
748
|
-
return _a = {
|
|
749
|
-
attachId: (_c = (_b = file === null || file === void 0 ? void 0 : file.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.attachId,
|
|
750
|
-
attachName: (_e = (_d = file === null || file === void 0 ? void 0 : file.response) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.originalName,
|
|
751
|
-
oldVersionId: oldVersionId
|
|
752
|
-
},
|
|
753
|
-
_a[DATA_TYPE_KEY] = firstDataType,
|
|
754
|
-
_a;
|
|
755
|
-
});
|
|
756
|
-
}
|
|
757
|
-
function onBatchDeleteHandle() {
|
|
758
|
-
var _a;
|
|
759
|
-
if (!selectRows.current || selectRows.current.length === 0) {
|
|
760
|
-
myMessage.warning("请选择要删除的附件!");
|
|
761
|
-
return;
|
|
762
|
-
}
|
|
763
|
-
var deleteInfo = {};
|
|
764
|
-
for (var _i = 0, _b = selectRows.current; _i < _b.length; _i++) {
|
|
765
|
-
var item = _b[_i];
|
|
766
|
-
var currentDataType = item === null || item === void 0 ? void 0 : item[DATA_TYPE_KEY];
|
|
767
|
-
var _c = allData[currentDataType] || {}, isEdit = _c.isEdit, records = _c.records, setRecords = _c.setRecords;
|
|
768
|
-
if (!isEdit) {
|
|
769
|
-
myMessage.warning("存在不能删除的附件!");
|
|
770
|
-
return;
|
|
771
|
-
}
|
|
772
|
-
if (deleteInfo[currentDataType]) {
|
|
773
|
-
(_a = deleteInfo[currentDataType].deleteList) === null || _a === void 0 ? void 0 : _a.push(item);
|
|
774
|
-
}
|
|
775
|
-
else {
|
|
776
|
-
deleteInfo[currentDataType] = {
|
|
777
|
-
records: records,
|
|
778
|
-
setRecords: setRecords,
|
|
779
|
-
deleteList: [item],
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
Object.values(deleteInfo).forEach(function (_a) {
|
|
784
|
-
var records = _a.records, setRecords = _a.setRecords, deleteList = _a.deleteList;
|
|
785
|
-
setRecords(function () {
|
|
786
|
-
return records === null || records === void 0 ? void 0 : records.filter(function (record) {
|
|
787
|
-
return !(deleteList === null || deleteList === void 0 ? void 0 : deleteList.some(function (item) {
|
|
788
|
-
return item.id
|
|
789
|
-
? item.id === record.id
|
|
790
|
-
: item.attachId === record.attachId;
|
|
791
|
-
}));
|
|
792
|
-
});
|
|
793
|
-
});
|
|
794
|
-
});
|
|
795
|
-
}
|
|
796
|
-
return (jsxs(Fragment, { children: [allOptions.map(function (options, index) {
|
|
797
|
-
var mergeOptions = index === 0
|
|
798
|
-
? __assign(__assign({}, options), { onValueChange: onValueChange }) : __assign(__assign({ deptId: resetProps.deptId, flowId: resetProps.flowId }, options), { onValueChange: onValueChange });
|
|
799
|
-
return (jsx(ElectronSignaturesFragment, __assign({ dataType: "".concat(index), onTrackChange: onTrackChange, request: request, isUnControlled: isUnControlled, setLoading: setLoading, apiBaseUrl: apiBaseUrl, fileBaseUrl: fileBaseUrl, isSingleQj: isSingleQj }, mergeOptions, { deptId: resetProps.deptId }), index));
|
|
800
|
-
}), jsxs(ElectronSealBatchDownload, __assign({ request: request, apiBaseUrl: apiBaseUrl, selectRows: selectRows, allData: allData, isShowElectronBatchBtn: isShowElectronBatchBtn, isShowDownloadBatchBtn: isShowDownloadBatchBtn, isShowDoubleSignedBatchBtn: isShowDoubleSignedBatchBtn, batchDownloadZipName: batchDownloadZipName, firstDataType: firstDataType }, { children: [isShowBatchDeleteBtn ? (jsx(Button, __assign({ type: "primary", onClick: onBatchDeleteHandle, style: { marginRight: "10px" } }, { children: "\u6279\u91CF\u5220\u9664" }))) : null, isShowFileUpload && currentIsEditMemo ? (jsx(FileUpload, __assign({ fileList: sameTypeRecords, apiBaseUrl: apiBaseUrl, onFileChange: onFileChange, multiple: true }, fileUploadProps, { children: "\u6DFB\u52A0\u9644\u4EF6" }))) : null] })), jsx(Table, { dataSource: mergeRecords, columns: columns, rowKey: function (record) { return record.id || record.attachId; }, className: "ztxk-table electron-table", bordered: true, pagination: false, loading: loading, rowSelection: myRowSelection, scroll: __assign({ x: "max-content", y: 500 }, tableScroll) }), jsx(LastQysModal, { modalHandleRef: modalHandleRef, appointSignLocation: function (info) {
|
|
801
|
-
// 未盖章的印章id列表
|
|
802
|
-
var needReSealList = info.needReSealList;
|
|
803
|
-
var currentData = allData[firstDataType];
|
|
804
|
-
var currentCheckedElectronicSealIdList = currentData.currentCheckedElectronicSealIdList;
|
|
805
|
-
/** 最开始的未盖章的印章列表 (不是id列表) */
|
|
806
|
-
var currentUnSealListRefValue = currentUnSealListRef.current;
|
|
807
|
-
var currentUnSealIdListValue = currentUnSealListRefValue.map(function (item) { return item.sealId; });
|
|
808
|
-
var appointSignLocation = currentData.appointSignLocation;
|
|
809
|
-
var onElectronicSealIdChange = currentData.onElectronicSealIdChange;
|
|
810
|
-
if (!Array.isArray(needReSealList)) {
|
|
811
|
-
modalHandleRef.current.clear();
|
|
812
|
-
return;
|
|
813
|
-
}
|
|
814
|
-
if (needReSealList.length === 0) {
|
|
815
|
-
var newSealIdList_1 = currentCheckedElectronicSealIdList.filter(function (item) { return !currentUnSealIdListValue.includes(item); });
|
|
816
|
-
onElectronicSealIdChange(newSealIdList_1);
|
|
817
|
-
modalHandleRef.current.clear();
|
|
818
|
-
// 如果所有未盖章的都取消了 那么可以认为校验直接通过了
|
|
819
|
-
isValidateSuccess && isValidateSuccess();
|
|
820
|
-
return;
|
|
821
|
-
}
|
|
822
|
-
// 计算出最终选中了的印章
|
|
823
|
-
var deleteSealItemList = currentUnSealListRefValue.filter(function (item) { return !needReSealList.includes(item.sealId); });
|
|
824
|
-
var deleteSealIdList = deleteSealItemList.map(function (item) { return item.sealId; });
|
|
825
|
-
var newSealIdList = currentCheckedElectronicSealIdList.filter(function (item) { return !deleteSealIdList.includes(item); });
|
|
826
|
-
appointSignLocation === null || appointSignLocation === void 0 ? void 0 : appointSignLocation({
|
|
827
|
-
callback: function (info) {
|
|
828
|
-
modalHandleRef.current.clear();
|
|
829
|
-
},
|
|
830
|
-
otherParams: {
|
|
831
|
-
sealIdList: newSealIdList,
|
|
832
|
-
},
|
|
833
|
-
});
|
|
834
|
-
} })] }));
|
|
13
|
+
var ElectronSignaturesWrap = function (props) {
|
|
14
|
+
// 这里未上线之前,都使用默认为false。不采用最新版本的修改
|
|
15
|
+
var _a = props.isQjVerifyCode, isQjVerifyCode = _a === void 0 ? false : _a, _b = props.isNewQys, isNewQys = _b === void 0 ? false : _b, resetProps = __rest(props, ["isQjVerifyCode", "isNewQys"]);
|
|
16
|
+
var defaultContext = useMemo(function () {
|
|
17
|
+
return { isNewQys: isNewQys, isQjVerifyCode: isQjVerifyCode };
|
|
18
|
+
}, [isNewQys, isQjVerifyCode]);
|
|
19
|
+
return (jsx(ElectronSignaturesContext.Provider, __assign({ value: defaultContext }, { children: jsx(ElectronSignatures, __assign({ isQjVerifyCode: isQjVerifyCode, isNewQys: isNewQys }, resetProps)) })));
|
|
835
20
|
};
|
|
836
|
-
var index = memo(
|
|
21
|
+
var index = memo(ElectronSignaturesWrap);
|
|
837
22
|
|
|
838
|
-
export { index as default };
|
|
23
|
+
export { ElectronSignaturesContext, index as default };
|