ztxkui 3.4.3 → 3.4.6
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/components/EnhanceSelect/index.js +28 -16
- package/dist/components/Upload/upload.js +1 -0
- package/dist/components/business/Signatures/components/CompareResult.js +1 -46
- package/dist/components/business/Signatures/components/DetailTable.d.ts +30 -0
- package/dist/components/business/Signatures/components/DetailTable.js +184 -0
- package/dist/components/business/Signatures/components/ElectronicSeal.d.ts +3 -5
- package/dist/components/business/Signatures/components/ElectronicSeal.js +13 -60
- package/dist/components/business/Signatures/components/QunjSeal.d.ts +2 -4
- package/dist/components/business/Signatures/components/QunjSeal.js +43 -74
- package/dist/components/business/Signatures/components/SealCheckbox.d.ts +0 -2
- package/dist/components/business/Signatures/components/SealCheckbox.js +22 -13
- package/dist/components/business/Signatures/components/TemplateAttach.js +1 -1
- package/dist/components/business/Signatures/index.js +301 -135
- package/dist/components/utils/upload.js +1 -0
- package/dist/index.css +1 -0
- package/dist/index.css.map +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
12
23
|
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
13
24
|
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
14
25
|
to[j] = from[i];
|
|
@@ -21,7 +32,8 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
21
32
|
import React, { useImperativeHandle, useCallback, useState, useMemo, useEffect, } from 'react';
|
|
22
33
|
// redux
|
|
23
34
|
// ztxkui公共组件
|
|
24
|
-
import { Table, Upload, message,
|
|
35
|
+
import { Table, Upload, message, Button, Modal } from '../../../index';
|
|
36
|
+
import { Switch } from 'antd';
|
|
25
37
|
// 路由配置
|
|
26
38
|
// store
|
|
27
39
|
// 自定义组件
|
|
@@ -30,6 +42,7 @@ import TemplateAttach from './components/TemplateAttach';
|
|
|
30
42
|
import CompareResult from './components/CompareResult';
|
|
31
43
|
import QunjSeal from './components/QunjSeal';
|
|
32
44
|
import ElectronicSeal from './components/ElectronicSeal';
|
|
45
|
+
import DetailTable from './components/DetailTable';
|
|
33
46
|
import { useRecords, useQunjData, useElectronicData } from './hooks';
|
|
34
47
|
/** 需要存样板合同类型 采购合同 销售合同 双边合同 */
|
|
35
48
|
var NEED_SAVE_TEMPLATE = [
|
|
@@ -44,14 +57,26 @@ var FLOW_IDS = [
|
|
|
44
57
|
'scm_order_contract_sbht',
|
|
45
58
|
'scm_order_contract_bjjyht',
|
|
46
59
|
];
|
|
60
|
+
/** 流程状态 */
|
|
61
|
+
var FLOW_STATUS = {
|
|
62
|
+
10: '草稿',
|
|
63
|
+
15: '审批中',
|
|
64
|
+
20: '已驳回',
|
|
65
|
+
50: '已生效',
|
|
66
|
+
60: '收货完成',
|
|
67
|
+
70: '结算完成',
|
|
68
|
+
9: '已作废',
|
|
69
|
+
99: '同步失败', // APPROVE_FAIL
|
|
70
|
+
};
|
|
47
71
|
/**
|
|
48
72
|
* TodoList
|
|
49
73
|
* 实现可以上传文件,删除列
|
|
50
74
|
* 实现受控,接收一个附件列表
|
|
51
75
|
*/
|
|
52
76
|
var Sinatures = function (_a) {
|
|
53
|
-
var
|
|
54
|
-
|
|
77
|
+
var isUpload = _a.isUpload, qunjSealChange = _a.qunjSealChange, electronicSealChange = _a.electronicSealChange, onSigValuesChange = _a.onSigValuesChange, handleRef = _a.handleRef, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, systemCode = _a.systemCode, token = _a.token, openCustomerModalHandle = _a.openCustomerModalHandle, request = _a.request, otherParams = __rest(_a, ["isUpload", "qunjSealChange", "electronicSealChange", "onSigValuesChange", "handleRef", "ZT_API_BASEURL", "ZT_FILE_BASEURL", "systemCode", "token", "openCustomerModalHandle", "request"]);
|
|
78
|
+
var canEdit = otherParams.canEdit, needQj = otherParams.needQj, needDg = otherParams.needDg, needQys = otherParams.needQys, fileList = otherParams.fileList, qunjSeal = otherParams.qunjSeal, electronicSeal = otherParams.electronicSealIdList, flowId = otherParams.flowId, deptId = otherParams.deptId, flowStatus = otherParams.flowStatus, caseId = otherParams.caseId, contract_id = otherParams.contractId, docAttachMap = otherParams.docAttachMap, checkAttachIdList = otherParams.checkAttachIdList, // 已盖章附件id
|
|
79
|
+
documentIdList = otherParams.documentIdList;
|
|
55
80
|
var authToken = token || '';
|
|
56
81
|
// 是否可编辑 1可编辑 0不可编辑
|
|
57
82
|
var isEdit = canEdit === 1;
|
|
@@ -75,10 +100,96 @@ var Sinatures = function (_a) {
|
|
|
75
100
|
var _j = useState(documentIdList), documentIds = _j[0], setDocumentIds = _j[1];
|
|
76
101
|
// 总用印次数超过4倍
|
|
77
102
|
var _k = useState(false), isTotalSealNumTooMore = _k[0], setIsTotalSealNumTooMore = _k[1];
|
|
78
|
-
// 单独使用群杰章
|
|
79
|
-
var isOnlyQunj = !!needQj && !needDg && !needQys;
|
|
80
103
|
// 采购合同 销售合同 双边合同 部门间交易合同 需要展示合同份数 其他的不需要
|
|
81
104
|
var showContranctNum = FLOW_IDS.includes("" + flowId);
|
|
105
|
+
// 电子印章列表
|
|
106
|
+
var _l = useState([]), electronicList = _l[0], setElectronicList = _l[1];
|
|
107
|
+
// 群杰印章列表
|
|
108
|
+
var _m = useState([]), sealList = _m[0], setSealList = _m[1];
|
|
109
|
+
// 上一次盖章时的参数信息
|
|
110
|
+
var _o = useState({}), prevParam = _o[0], setPrevParam = _o[1];
|
|
111
|
+
// 请确认
|
|
112
|
+
var _p = useState(false), isSure = _p[0], setIsSure = _p[1];
|
|
113
|
+
/** 查询用印状态 */
|
|
114
|
+
var querySealStatus = function () {
|
|
115
|
+
var url = ZT_API_BASEURL + "/api/zmdms-esb-outer/outer/qj/view-stamp?caseId=" + caseId + "&systemId=1493475945847648257";
|
|
116
|
+
window.open(url);
|
|
117
|
+
};
|
|
118
|
+
/** 获取电子印章列表 */
|
|
119
|
+
var getElectronicList = useCallback(function () {
|
|
120
|
+
var params = {
|
|
121
|
+
deptId: deptId,
|
|
122
|
+
size: 200,
|
|
123
|
+
};
|
|
124
|
+
if (flowId) {
|
|
125
|
+
params.flowId = flowId;
|
|
126
|
+
}
|
|
127
|
+
request({
|
|
128
|
+
url: '/api/zmdms-resource/flowdeptseal/page',
|
|
129
|
+
params: params,
|
|
130
|
+
method: 'GET',
|
|
131
|
+
})
|
|
132
|
+
.then(function (res) {
|
|
133
|
+
var _a, _b, _c;
|
|
134
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
135
|
+
// 当前部门和流程没查到数据时 调下面接口查所有的印章
|
|
136
|
+
if (((_a = res.data.data) === null || _a === void 0 ? void 0 : _a.records.length) === 0) {
|
|
137
|
+
request({
|
|
138
|
+
url: '/api/zmdms-resource/qyssealinfo/list',
|
|
139
|
+
method: 'GET',
|
|
140
|
+
})
|
|
141
|
+
.then(function (res) {
|
|
142
|
+
var _a, _b;
|
|
143
|
+
if ((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[0]) {
|
|
144
|
+
var list = res.data.data.map(function (item) { return ({
|
|
145
|
+
sealId: item.id,
|
|
146
|
+
sealName: item.sealName,
|
|
147
|
+
}); });
|
|
148
|
+
setElectronicList(list);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
message.error(res.data.msg || '出错了');
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
.catch(function (error) {
|
|
155
|
+
var _a, _b;
|
|
156
|
+
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) || '请求失败!');
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
setElectronicList((_c = (_b = res.data.data) === null || _b === void 0 ? void 0 : _b.records[0]) === null || _c === void 0 ? void 0 : _c.sealInfoList);
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
message.error(res.data.msg || '出错了');
|
|
163
|
+
}
|
|
164
|
+
})
|
|
165
|
+
.catch(function (error) {
|
|
166
|
+
var _a, _b;
|
|
167
|
+
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) || '请求失败!');
|
|
168
|
+
});
|
|
169
|
+
}, [deptId, flowId, request]);
|
|
170
|
+
/** 获取群杰印章列表 */
|
|
171
|
+
var getQunjSealList = useCallback(function () {
|
|
172
|
+
request({
|
|
173
|
+
url: "/api/zmdms-resource/flowqjuse/query-qj-seal-list/" + flowId,
|
|
174
|
+
method: 'GET',
|
|
175
|
+
})
|
|
176
|
+
.then(function (res) {
|
|
177
|
+
var _a;
|
|
178
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
179
|
+
setSealList((_a = res.data.data) === null || _a === void 0 ? void 0 : _a.map(function (item, index) { return ({
|
|
180
|
+
sealName: item.sealName,
|
|
181
|
+
sealNo: item.sealNo,
|
|
182
|
+
}); }));
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
message.error(res.data.msg || '出错了');
|
|
186
|
+
}
|
|
187
|
+
})
|
|
188
|
+
.catch(function (error) {
|
|
189
|
+
var _a, _b;
|
|
190
|
+
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) || '请求失败!');
|
|
191
|
+
});
|
|
192
|
+
}, [flowId, request]);
|
|
82
193
|
useEffect(function () {
|
|
83
194
|
// 判断入参fileList中是否有已勾选电子印章的元素
|
|
84
195
|
if (Array.isArray(fileList) &&
|
|
@@ -86,34 +197,21 @@ var Sinatures = function (_a) {
|
|
|
86
197
|
setCheckSealVisible(true);
|
|
87
198
|
}
|
|
88
199
|
}, [fileList]);
|
|
200
|
+
useEffect(function () {
|
|
201
|
+
if (needQys) {
|
|
202
|
+
getElectronicList();
|
|
203
|
+
}
|
|
204
|
+
if (needQj) {
|
|
205
|
+
getQunjSealList();
|
|
206
|
+
}
|
|
207
|
+
}, [getElectronicList, getQunjSealList, needQj, needQys]);
|
|
89
208
|
/** 获取taskId */
|
|
90
209
|
var getTaskId = function (id, index) {
|
|
91
210
|
handleRef.current.setTemplateData({
|
|
92
211
|
taskId: id,
|
|
93
212
|
}, index);
|
|
94
213
|
};
|
|
95
|
-
/**
|
|
96
|
-
var downFileFn = function (_record) {
|
|
97
|
-
var xhr = new XMLHttpRequest();
|
|
98
|
-
xhr.open('GET', ZT_API_BASEURL + "/api/zmdms-resource/seal/download-watermark-attach/" + (_record === null || _record === void 0 ? void 0 : _record.attachId) + "?Zmdms-Auth=bearer " + token, true);
|
|
99
|
-
xhr.responseType = 'blob';
|
|
100
|
-
xhr.onload = function () {
|
|
101
|
-
var _a;
|
|
102
|
-
if (xhr.status === 200 || xhr.status === 201) {
|
|
103
|
-
var link = document.createElement('a');
|
|
104
|
-
link.href = window.URL.createObjectURL(xhr.response);
|
|
105
|
-
link.download = ((_a = _record === null || _record === void 0 ? void 0 : _record.attachName) === null || _a === void 0 ? void 0 : _a.split('.')[0]) + ".pdf";
|
|
106
|
-
// fix Firefox
|
|
107
|
-
link.style.display = 'none';
|
|
108
|
-
document.body.appendChild(link);
|
|
109
|
-
link.click();
|
|
110
|
-
document.body.removeChild(link);
|
|
111
|
-
window.URL.revokeObjectURL(link.href);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
xhr.send();
|
|
115
|
-
};
|
|
116
|
-
/** 确认盖章 */
|
|
214
|
+
/** 指定签署位置 */
|
|
117
215
|
var checkSealFn = function () {
|
|
118
216
|
// 已勾选的要加盖电子印章的附件id列表
|
|
119
217
|
var checkedElecSealIds = records
|
|
@@ -148,9 +246,11 @@ var Sinatures = function (_a) {
|
|
|
148
246
|
params.deleteAttachIdList.push(n);
|
|
149
247
|
}
|
|
150
248
|
});
|
|
249
|
+
setPrevParam(params);
|
|
151
250
|
request({
|
|
152
251
|
url: '/api/zmdms-resource/seal/confirm-seal-info',
|
|
153
252
|
method: 'POST',
|
|
253
|
+
timeout: 90000,
|
|
154
254
|
data: params,
|
|
155
255
|
})
|
|
156
256
|
.then(function (res) {
|
|
@@ -214,98 +314,143 @@ var Sinatures = function (_a) {
|
|
|
214
314
|
render: function (text, record, index) { return "" + (index + 1); },
|
|
215
315
|
},
|
|
216
316
|
{
|
|
217
|
-
title: '
|
|
218
|
-
|
|
219
|
-
|
|
317
|
+
title: '附件',
|
|
318
|
+
children: [
|
|
319
|
+
{
|
|
320
|
+
title: '类型',
|
|
321
|
+
key: 'attachTypeName',
|
|
322
|
+
dataIndex: 'attachTypeName',
|
|
323
|
+
width: 100,
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
title: function () {
|
|
327
|
+
return (React.createElement("div", { className: "seal-file-upload" },
|
|
328
|
+
React.createElement("span", null, "\u540D\u79F0"),
|
|
329
|
+
React.createElement("span", null, isUpload && (React.createElement(Upload, { apiBaseUrl: ZT_API_BASEURL, method: "post", showTable: false, showTip: false, headers: {
|
|
330
|
+
'Zmdms-Auth': authToken,
|
|
331
|
+
}, data: uploadData, authToken: authToken, callback: uploadCallbackFn, originFileList: originFileList, style: { margin: 0 } },
|
|
332
|
+
React.createElement(Button, { type: "link" }, "\u6DFB\u52A0\u9644\u4EF6"))))));
|
|
333
|
+
},
|
|
334
|
+
key: 'attachId',
|
|
335
|
+
dataIndex: 'attachId',
|
|
336
|
+
width: 240,
|
|
337
|
+
render: function (text, record, index) {
|
|
338
|
+
return (React.createElement(React.Fragment, null,
|
|
339
|
+
React.createElement(AttachOperation, { ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, token: authToken, attachId: record === null || record === void 0 ? void 0 : record.attachId, attachName: record === null || record === void 0 ? void 0 : record.attachName, attachSize: record === null || record === void 0 ? void 0 : record.attachSize })));
|
|
340
|
+
},
|
|
341
|
+
},
|
|
342
|
+
],
|
|
220
343
|
},
|
|
221
344
|
{
|
|
222
|
-
title:
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
345
|
+
title: '合同',
|
|
346
|
+
key: 'needDg',
|
|
347
|
+
dataIndex: 'needDg',
|
|
348
|
+
children: [
|
|
349
|
+
{
|
|
350
|
+
title: '合同比对模板',
|
|
351
|
+
key: 'templateAttachId',
|
|
352
|
+
dataIndex: 'templateAttachId',
|
|
353
|
+
width: 160,
|
|
354
|
+
render: function (text, record, index) {
|
|
355
|
+
return record.attachTypeName === '合同本身' ? (React.createElement(TemplateAttach, { record: record, index: index, openCustomerModalHandle: openCustomerModalHandle, isEdit: isEdit })) : ('');
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
title: '合同比对结果',
|
|
360
|
+
key: 'compareAttachId',
|
|
361
|
+
dataIndex: 'compareAttachId',
|
|
362
|
+
width: 100,
|
|
363
|
+
render: function (text, record, index) {
|
|
364
|
+
return record.attachTypeName === '合同本身' ? (React.createElement(CompareResult, { record: record, index: index, request: request, getTaskId: getTaskId, isEdit: isEdit })) : ('');
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
title: '保存为模版',
|
|
369
|
+
key: 'templateAttachId',
|
|
370
|
+
dataIndex: 'templateAttachId',
|
|
371
|
+
width: 80,
|
|
372
|
+
render: function (text, record, index) {
|
|
373
|
+
return NEED_SAVE_TEMPLATE.includes("" + flowId) ? (React.createElement(Switch, { checked: record.isCustomerReference, disabled: !isEdit, onChange: function (value) {
|
|
374
|
+
return onSwitchChangeHandle(value, 'isCustomerReference', index);
|
|
375
|
+
} })) : ('');
|
|
376
|
+
},
|
|
377
|
+
},
|
|
378
|
+
],
|
|
239
379
|
},
|
|
240
380
|
{
|
|
241
|
-
title: '
|
|
242
|
-
key: 'templateAttachId',
|
|
243
|
-
dataIndex: 'templateAttachId',
|
|
244
|
-
width: 220,
|
|
245
|
-
render: function (text, record, index) {
|
|
246
|
-
return record.attachTypeName === '合同本身' ? (React.createElement(TemplateAttach, { record: record, index: index, openCustomerModalHandle: openCustomerModalHandle, isEdit: isEdit })) : ('');
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
title: '合同比对结果',
|
|
251
|
-
key: 'compareAttachId',
|
|
252
|
-
dataIndex: 'compareAttachId',
|
|
253
|
-
width: 100,
|
|
254
|
-
render: function (text, record, index) {
|
|
255
|
-
return record.attachTypeName === '合同本身' ? (React.createElement(CompareResult, { record: record, index: index, request: request, getTaskId: getTaskId, isEdit: isEdit })) : ('');
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
title: function () {
|
|
260
|
-
return (React.createElement(React.Fragment, null,
|
|
261
|
-
React.createElement("div", null, "\u52A0\u76D6\u7535\u5B50\u5370\u7AE0"),
|
|
262
|
-
records.length !== 0 && (React.createElement("div", null,
|
|
263
|
-
React.createElement("div", null,
|
|
264
|
-
React.createElement(Button, { type: "link", style: __assign({}, (checkSealVisible && isEdit
|
|
265
|
-
? {}
|
|
266
|
-
: { display: 'none' })), size: "small", onClick: checkSealFn }, "\u786E\u8BA4\u76D6\u7AE0")),
|
|
267
|
-
React.createElement("div", null,
|
|
268
|
-
React.createElement(Button, { type: "link", style: __assign({}, (contractId || contract_id ? {} : { display: 'none' })), size: "small", onClick: viewSealPageFn }, "\u67E5\u770B\u76D6\u7AE0\u9875\u9762"))))));
|
|
269
|
-
},
|
|
270
|
-
key: 'isElectronicSeal',
|
|
271
|
-
dataIndex: 'isElectronicSeal',
|
|
272
|
-
render: function (text, record, index) {
|
|
273
|
-
return (React.createElement(Checkbox, { checked: text, disabled: !isEdit, onChange: function (e) {
|
|
274
|
-
return onCheckboxChangeHandle(e, 'isElectronicSeal', index);
|
|
275
|
-
} }, "\u662F"));
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
title: '添加水印',
|
|
381
|
+
title: isEdit ? '添加水印' : '水印',
|
|
280
382
|
key: 'isWatermark',
|
|
281
383
|
dataIndex: 'isWatermark',
|
|
282
|
-
width:
|
|
384
|
+
width: 60,
|
|
283
385
|
render: function (text, record, index) {
|
|
284
|
-
return (React.createElement(
|
|
285
|
-
|
|
286
|
-
|
|
386
|
+
return (React.createElement(Switch, { checked: text, disabled: !isEdit, onChange: function (value) {
|
|
387
|
+
return onSwitchChangeHandle(value, 'isWatermark', index);
|
|
388
|
+
} }));
|
|
287
389
|
},
|
|
288
390
|
},
|
|
289
391
|
{
|
|
290
392
|
title: '电子印章',
|
|
291
|
-
key: '
|
|
292
|
-
dataIndex: '
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
393
|
+
key: 'needQys',
|
|
394
|
+
dataIndex: 'needQys',
|
|
395
|
+
children: [
|
|
396
|
+
{
|
|
397
|
+
title: '盖电子印章',
|
|
398
|
+
key: 'isElectronicSeal',
|
|
399
|
+
dataIndex: 'isElectronicSeal',
|
|
400
|
+
width: 80,
|
|
401
|
+
render: function (text, record, index) {
|
|
402
|
+
return (React.createElement(Switch, { checked: text, disabled: !isEdit, onChange: function (value) {
|
|
403
|
+
return onSwitchChangeHandle(value, 'isElectronicSeal', index);
|
|
404
|
+
} }));
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
title: '选择电子印章',
|
|
409
|
+
key: 'electronicSeal',
|
|
410
|
+
dataIndex: 'electronicSeal',
|
|
411
|
+
width: '20%',
|
|
412
|
+
render: function (value, row, index) {
|
|
413
|
+
// 是否有勾选加盖电子印章
|
|
414
|
+
var hasElectronicSeal = records === null || records === void 0 ? void 0 : records.some(function (item) { return !!item.isElectronicSeal; });
|
|
415
|
+
var obj = {
|
|
416
|
+
children: (React.createElement(ElectronicSeal, { value: electronicSeal, onChange: electronicSealChangeHandle, isEdit: hasElectronicSeal && isEdit, electronicList: electronicList })),
|
|
417
|
+
props: {},
|
|
418
|
+
};
|
|
419
|
+
obj.props['rowSpan'] = index === 0 ? records.length : 0;
|
|
420
|
+
return obj;
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
title: '电子印章设置',
|
|
425
|
+
key: 'setElectronicSeal',
|
|
426
|
+
dataIndex: 'setElectronicSeal',
|
|
427
|
+
width: 95,
|
|
428
|
+
render: function (value, row, index) {
|
|
429
|
+
var Comp = function () {
|
|
430
|
+
return records.length !== 0 ? (React.createElement("div", { style: { height: '100%', paddingTop: '23px' } },
|
|
431
|
+
React.createElement(Button, { type: "link", style: __assign({}, (checkSealVisible && isEdit
|
|
432
|
+
? {}
|
|
433
|
+
: { display: 'none' })), size: "small", onClick: checkSealFn }, "\u6307\u5B9A\u7B7E\u7F72\u4F4D\u7F6E"),
|
|
434
|
+
React.createElement(Button, { type: "link", style: __assign({}, (contractId || contract_id ? {} : { display: 'none' })), size: "small", onClick: viewSealPageFn }, "\u9884\u89C8\u76D6\u7AE0\u6548\u679C"))) : (React.createElement(React.Fragment, null));
|
|
435
|
+
};
|
|
436
|
+
var obj = {
|
|
437
|
+
children: React.createElement(Comp, null),
|
|
438
|
+
props: {},
|
|
439
|
+
};
|
|
440
|
+
obj.props['rowSpan'] = index === 0 ? records.length : 0;
|
|
441
|
+
return obj;
|
|
442
|
+
},
|
|
443
|
+
},
|
|
444
|
+
],
|
|
301
445
|
},
|
|
302
446
|
{
|
|
303
447
|
title: '群杰印章',
|
|
304
448
|
key: 'qunjSeal',
|
|
305
449
|
dataIndex: 'qunjSeal',
|
|
450
|
+
width: 240,
|
|
306
451
|
render: function (value, row, index) {
|
|
307
452
|
var obj = {
|
|
308
|
-
children: (React.createElement(QunjSeal, { value: qunjSeal, onChange: qunjSealChangeHandle,
|
|
453
|
+
children: (React.createElement(QunjSeal, { value: qunjSeal, onChange: qunjSealChangeHandle, querySealStatus: querySealStatus, ZT_API_BASEURL: ZT_API_BASEURL, isEdit: isEdit, handleRef: handleRef, showContranctNum: showContranctNum, sealList: sealList })),
|
|
309
454
|
props: {},
|
|
310
455
|
};
|
|
311
456
|
obj.props['rowSpan'] = index === 0 ? records.length : 0;
|
|
@@ -322,52 +467,40 @@ var Sinatures = function (_a) {
|
|
|
322
467
|
columnsLast = columnsLast.filter(function (item) { return !['attachTypeName'].includes(item.key); });
|
|
323
468
|
}
|
|
324
469
|
if (!needDg) {
|
|
325
|
-
columnsLast = columnsLast.filter(function (item) {
|
|
326
|
-
return !['attachTypeName', 'templateAttachId', 'compareAttachId'].includes(item.key);
|
|
327
|
-
});
|
|
470
|
+
columnsLast = columnsLast.filter(function (item) { return !['needDg'].includes(item.key); });
|
|
328
471
|
}
|
|
329
472
|
if (!needQys) {
|
|
330
|
-
columnsLast = columnsLast.filter(function (item) {
|
|
331
|
-
return !['isWatermark', 'isElectronicSeal', 'electronicSeal'].includes(item.key);
|
|
332
|
-
});
|
|
473
|
+
columnsLast = columnsLast.filter(function (item) { return !['isWatermark', 'needQys'].includes(item.key); });
|
|
333
474
|
}
|
|
334
475
|
// 上传组件的数据
|
|
335
|
-
var
|
|
476
|
+
var _q = useState(), originFileList = _q[0], setOriginFileList = _q[1];
|
|
336
477
|
/** 签章组件onChange事件 */
|
|
337
478
|
var sigValuesChange = function (type, value) {
|
|
338
479
|
var _a, _b;
|
|
339
480
|
var info = (_b = (_a = handleRef === null || handleRef === void 0 ? void 0 : handleRef.current) === null || _a === void 0 ? void 0 : _a.getData) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
340
481
|
Reflect.deleteProperty(info, type);
|
|
341
482
|
info[type] = value;
|
|
342
|
-
return info;
|
|
483
|
+
return __assign(__assign({}, otherParams), info);
|
|
343
484
|
};
|
|
344
485
|
// 是否存入样板 添加水印 电子印章发生改变触发事件
|
|
345
|
-
function
|
|
486
|
+
function onSwitchChangeHandle(value, type, index) {
|
|
346
487
|
if (type === 'isElectronicSeal') {
|
|
347
488
|
var hasElecSeal = records.filter(function (item) { return item.isElectronicSeal; });
|
|
348
489
|
// 勾选加盖电子印章后 显示确认盖章按钮
|
|
349
|
-
setCheckSealVisible(
|
|
490
|
+
setCheckSealVisible(value ? true : hasElecSeal.length > 1 ? true : false);
|
|
491
|
+
// 去除加盖电子印章勾选时 清除合同id 等之前的信息
|
|
492
|
+
if (!value) {
|
|
493
|
+
setSealedIds(__spreadArray([], sealedIds));
|
|
494
|
+
setContractId('');
|
|
495
|
+
setAttachMap(null);
|
|
496
|
+
setDocumentIds([]);
|
|
497
|
+
}
|
|
350
498
|
}
|
|
351
499
|
setRecords(function (preRecords) {
|
|
352
500
|
var _a;
|
|
353
501
|
var newRecords = preRecords.slice();
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
// message.info('请先选择是否加盖电子印章!');
|
|
357
|
-
// return newRecords;
|
|
358
|
-
// }
|
|
359
|
-
// 取消勾选电子印章时 不可添加水印
|
|
360
|
-
// if (type === 'isElectronicSeal' && !e.target.checked) {
|
|
361
|
-
// newRecords.splice(index, 1, {
|
|
362
|
-
// ...newRecords[index],
|
|
363
|
-
// isWatermark: 0,
|
|
364
|
-
// [type]: 0,
|
|
365
|
-
// });
|
|
366
|
-
// return newRecords;
|
|
367
|
-
// }
|
|
368
|
-
newRecords.splice(index, 1, __assign(__assign({}, newRecords[index]), (_a = {}, _a[type] = e.target.checked ? 1 : 0, _a)));
|
|
369
|
-
onSigValuesChange &&
|
|
370
|
-
onSigValuesChange(sigValuesChange('fileList', newRecords));
|
|
502
|
+
newRecords.splice(index, 1, __assign(__assign({}, newRecords[index]), (_a = {}, _a[type] = value ? 1 : 0, _a)));
|
|
503
|
+
onSigValuesChange(sigValuesChange('fileList', newRecords));
|
|
371
504
|
return newRecords;
|
|
372
505
|
});
|
|
373
506
|
}
|
|
@@ -403,14 +536,14 @@ var Sinatures = function (_a) {
|
|
|
403
536
|
function qunjSealChangeHandle(value) {
|
|
404
537
|
qunjSealChange && qunjSealChange(value);
|
|
405
538
|
setQunjSeal(value);
|
|
406
|
-
onSigValuesChange
|
|
539
|
+
onSigValuesChange(sigValuesChange('qunjSeal', value));
|
|
407
540
|
}
|
|
408
541
|
/** 电子印章修改 */
|
|
409
542
|
function electronicSealChangeHandle(value) {
|
|
410
543
|
electronicSealChange && electronicSealChange(value);
|
|
411
544
|
setElectronicSeal(value);
|
|
412
|
-
onSigValuesChange
|
|
413
|
-
|
|
545
|
+
onSigValuesChange(sigValuesChange('electronicSealIdList', value));
|
|
546
|
+
isSure && setIsSure(false);
|
|
414
547
|
}
|
|
415
548
|
/**
|
|
416
549
|
* 暴露方法给外部调用
|
|
@@ -445,7 +578,25 @@ var Sinatures = function (_a) {
|
|
|
445
578
|
},
|
|
446
579
|
/** 签章组件相关校验 */
|
|
447
580
|
validateSealFn: function () {
|
|
448
|
-
var _a;
|
|
581
|
+
var _a, _b;
|
|
582
|
+
// 确认盖章后 勾选的信息有更改
|
|
583
|
+
if (needQys &&
|
|
584
|
+
((_a = prevParam === null || prevParam === void 0 ? void 0 : prevParam.sealIdList) === null || _a === void 0 ? void 0 : _a.length) !== (innerElectronicSeal === null || innerElectronicSeal === void 0 ? void 0 : innerElectronicSeal.length) &&
|
|
585
|
+
!isSure) {
|
|
586
|
+
Modal.confirm({
|
|
587
|
+
title: '当前所勾选的电子印章信息与上一次盖章时有差异,请确认是否继续?',
|
|
588
|
+
okText: '是',
|
|
589
|
+
okType: 'danger',
|
|
590
|
+
cancelText: '否',
|
|
591
|
+
onOk: function () {
|
|
592
|
+
setIsSure(true);
|
|
593
|
+
},
|
|
594
|
+
onCancel: function () {
|
|
595
|
+
setIsSure(false);
|
|
596
|
+
},
|
|
597
|
+
});
|
|
598
|
+
return false;
|
|
599
|
+
}
|
|
449
600
|
// 是否有勾选加盖电子印章
|
|
450
601
|
var hasElectronicSeal = records === null || records === void 0 ? void 0 : records.some(function (item) { return !!item.isElectronicSeal; });
|
|
451
602
|
// 勾选加盖电子印章时未勾选电子印章
|
|
@@ -470,7 +621,7 @@ var Sinatures = function (_a) {
|
|
|
470
621
|
return false;
|
|
471
622
|
}
|
|
472
623
|
// 勾选的群杰印章 没有填用印次数
|
|
473
|
-
if (((
|
|
624
|
+
if (((_b = innerQunjSeal === null || innerQunjSeal === void 0 ? void 0 : innerQunjSeal.details) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
474
625
|
innerQunjSeal.details.forEach(function (item) {
|
|
475
626
|
if (!item.sealCount) {
|
|
476
627
|
message.warning("\u8BF7\u586B\u5199" + item.sealName + " \u7684\u7528\u5370\u6B21\u6570\uFF01");
|
|
@@ -488,7 +639,22 @@ var Sinatures = function (_a) {
|
|
|
488
639
|
return true;
|
|
489
640
|
},
|
|
490
641
|
}); });
|
|
491
|
-
|
|
492
|
-
|
|
642
|
+
var detail = {
|
|
643
|
+
contractId: contract_id,
|
|
644
|
+
records: records,
|
|
645
|
+
electronicSealIdList: electronicSeal,
|
|
646
|
+
qunjSeal: qunjSeal,
|
|
647
|
+
ZT_API_BASEURL: ZT_API_BASEURL,
|
|
648
|
+
ZT_FILE_BASEURL: ZT_FILE_BASEURL,
|
|
649
|
+
token: token,
|
|
650
|
+
viewSealPageFn: viewSealPageFn,
|
|
651
|
+
electronicList: electronicList,
|
|
652
|
+
sealList: sealList,
|
|
653
|
+
querySealStatus: querySealStatus,
|
|
654
|
+
flow_status: FLOW_STATUS[flowStatus],
|
|
655
|
+
needQj: needQj,
|
|
656
|
+
needQys: needQys,
|
|
657
|
+
};
|
|
658
|
+
return (React.createElement(React.Fragment, null, isEdit ? (React.createElement(Table, { columns: columnsLast, rowKey: "attachId", dataSource: records, scroll: { x: 'max-content' } })) : (React.createElement(DetailTable, __assign({}, detail)))));
|
|
493
659
|
};
|
|
494
660
|
export default Sinatures;
|
package/dist/index.css
CHANGED
|
@@ -908,6 +908,7 @@ template {
|
|
|
908
908
|
}
|
|
909
909
|
.zt-search .zt-search__left .zt-search__left__item .ant-input-affix-wrapper .ant-input {
|
|
910
910
|
height: auto;
|
|
911
|
+
font-size: 13px;
|
|
911
912
|
}
|
|
912
913
|
.zt-search .zt-search__left .zt-search__left__item .ant-input-affix-wrapper:hover,
|
|
913
914
|
.zt-search .zt-search__left .zt-search__left__item .ant-input-number:hover {
|