ztxkui 3.1.13 → 3.1.16
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/Demo.js +16 -6
- package/dist/DemoCom/SinaturesDemo.js +55 -34
- package/dist/components/EnhanceSelect/index.d.ts +5 -1
- package/dist/components/EnhanceSelect/index.js +44 -9
- package/dist/components/business/Signatures/components/CompareResult.d.ts +0 -1
- package/dist/components/business/Signatures/components/CompareResult.js +33 -20
- package/dist/components/business/Signatures/components/ElectronicSeal.d.ts +4 -1
- package/dist/components/business/Signatures/components/ElectronicSeal.js +27 -5
- package/dist/components/business/Signatures/components/QunjSeal.d.ts +6 -1
- package/dist/components/business/Signatures/components/QunjSeal.js +37 -14
- package/dist/components/business/Signatures/components/SealCheckbox.d.ts +5 -1
- package/dist/components/business/Signatures/components/SealCheckbox.js +27 -10
- package/dist/components/business/Signatures/components/TemplateAttach.d.ts +1 -5
- package/dist/components/business/Signatures/components/TemplateAttach.js +38 -19
- package/dist/components/business/Signatures/hooks.js +1 -1
- package/dist/components/business/Signatures/index.js +154 -71
- package/dist/components/business/Signatures/props.d.ts +28 -17
- package/dist/{DemoCom/Template.d.ts → components/business/Template/index.d.ts} +3 -0
- package/dist/{DemoCom/Template.js → components/business/Template/index.js} +41 -33
- package/dist/index.css +13 -8
- package/dist/index.css.map +1 -1
- package/package.json +95 -95
|
@@ -19,38 +19,55 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
19
19
|
* @description
|
|
20
20
|
*/
|
|
21
21
|
import React from 'react';
|
|
22
|
+
import sumBy from 'lodash/sumBy';
|
|
22
23
|
// redux
|
|
23
24
|
// ztxkui公共组件
|
|
24
25
|
import { Checkbox, InputNumber } from '../../../../index';
|
|
26
|
+
import { message } from 'antd';
|
|
25
27
|
var SealCheckbox = function (_a) {
|
|
26
|
-
var name = _a.name, value = _a.value, onChange = _a.onChange;
|
|
28
|
+
var name = _a.name, id = _a.id, value = _a.value, onChange = _a.onChange;
|
|
27
29
|
var onCheckboxChange = function (e) {
|
|
28
30
|
onChange &&
|
|
29
|
-
onChange(__assign(__assign({}, (value || {})), {
|
|
31
|
+
onChange(__assign(__assign({}, (value || {})), { sealName: e.target.checked ? name : null, sealNo: e.target.checked ? id : null }));
|
|
30
32
|
};
|
|
31
|
-
var onNumberChange = function (
|
|
32
|
-
onChange && onChange(__assign(__assign({}, (value || {})), {
|
|
33
|
+
var onNumberChange = function (sealCount) {
|
|
34
|
+
onChange && onChange(__assign(__assign({}, (value || {})), { sealCount: sealCount }));
|
|
33
35
|
};
|
|
34
36
|
return (React.createElement("div", { style: { padding: '0 6px' } },
|
|
35
|
-
React.createElement(Checkbox, { onChange: onCheckboxChange, checked: value && value.
|
|
37
|
+
React.createElement(Checkbox, { onChange: onCheckboxChange, checked: value && value.sealName ? true : false }, name),
|
|
36
38
|
React.createElement("div", null,
|
|
37
|
-
React.createElement("span", null, "\u7528\u5370\u6B21\u6570"),
|
|
38
|
-
React.createElement(InputNumber, { bordered: false, size: "small", value: value && value.
|
|
39
|
+
React.createElement("span", null, "\u7528\u5370\u6B21\u6570\uFF1A"),
|
|
40
|
+
React.createElement(InputNumber, { bordered: false, size: "small", value: value && value.sealCount ? value.sealCount : undefined, onChange: onNumberChange, style: { borderBottom: '1px solid #e9ecf3' } }))));
|
|
39
41
|
};
|
|
40
42
|
var SealCheckboxGroup = function (_a) {
|
|
41
|
-
var value = _a.value, onChange = _a.onChange, sealList = _a.sealList;
|
|
43
|
+
var value = _a.value, onChange = _a.onChange, sealList = _a.sealList, handleRef = _a.handleRef;
|
|
42
44
|
var onChangeHandle = function (_value, index) {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
var contractNum = (_b = (_a = handleRef === null || handleRef === void 0 ? void 0 : handleRef.current) === null || _a === void 0 ? void 0 : _a.getData().qunjSeal) === null || _b === void 0 ? void 0 : _b.contranctNum;
|
|
43
47
|
var valueArr = Array.isArray(value) ? __spreadArray([], value) : [];
|
|
44
48
|
valueArr.splice(index, 1, _value);
|
|
49
|
+
var totalSealNum = sumBy(valueArr, 'sealCount');
|
|
45
50
|
onChange && onChange(valueArr);
|
|
51
|
+
if (totalSealNum > contractNum * 4) {
|
|
52
|
+
message.warning('您的用印次数远超超过合理次数范围,请修改。');
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (totalSealNum > contractNum * 3) {
|
|
56
|
+
message.warning('您的用印次数超过合理次数范围,请慎重确认!');
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (totalSealNum > contractNum * 2) {
|
|
60
|
+
message.warning('您的用印次数已超过2倍合同数量,请确认用印数量是否正确。');
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
46
63
|
};
|
|
47
64
|
return (React.createElement("div", null, Array.isArray(sealList) &&
|
|
48
65
|
sealList.map(function (item, index) {
|
|
49
66
|
var itemValue = {};
|
|
50
67
|
if (Array.isArray(value)) {
|
|
51
|
-
itemValue = value.find(function (valueItem) { return valueItem.
|
|
68
|
+
itemValue = value.find(function (valueItem) { return valueItem.sealName === item.sealName; });
|
|
52
69
|
}
|
|
53
|
-
return (React.createElement(SealCheckbox, { key: item === null || item === void 0 ? void 0 : item.
|
|
70
|
+
return (React.createElement(SealCheckbox, { key: item === null || item === void 0 ? void 0 : item.sealNo, name: item === null || item === void 0 ? void 0 : item.sealName, id: item === null || item === void 0 ? void 0 : item.sealNo, value: itemValue, onChange: function (value) {
|
|
54
71
|
onChangeHandle(value, index);
|
|
55
72
|
} }));
|
|
56
73
|
})));
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author 陈亚雄
|
|
3
|
-
* @description 合同模板
|
|
4
|
-
*/
|
|
5
1
|
import React from 'react';
|
|
6
2
|
interface IProps {
|
|
7
3
|
record: any;
|
|
@@ -11,9 +7,9 @@ interface IProps {
|
|
|
11
7
|
index: number;
|
|
12
8
|
/** 点击客户样板 */
|
|
13
9
|
openCustomerModalHandle?: any;
|
|
14
|
-
compareTaskUrl?: string;
|
|
15
10
|
getTaskId: (id: any, index: number) => void;
|
|
16
11
|
request?: any;
|
|
12
|
+
isEdit: boolean;
|
|
17
13
|
}
|
|
18
14
|
declare const TemplateAttach: React.FC<IProps>;
|
|
19
15
|
export default TemplateAttach;
|
|
@@ -2,35 +2,54 @@
|
|
|
2
2
|
* @author 陈亚雄
|
|
3
3
|
* @description 合同模板
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import { message } from 'antd';
|
|
6
|
+
import React, { useState } from 'react';
|
|
6
7
|
// redux
|
|
7
8
|
// ztxkui公共组件
|
|
8
9
|
import { Button } from '../../../../index';
|
|
9
|
-
// 路由配置
|
|
10
|
-
// store
|
|
11
|
-
// 自定义组件
|
|
12
|
-
import AttachOperation from './AttachOperation';
|
|
13
10
|
var TemplateAttach = function (_a) {
|
|
14
|
-
var record = _a.record, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, openCustomerModalHandle = _a.openCustomerModalHandle, index = _a.index,
|
|
11
|
+
var record = _a.record, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, openCustomerModalHandle = _a.openCustomerModalHandle, index = _a.index, request = _a.request, getTaskId = _a.getTaskId, isEdit = _a.isEdit;
|
|
12
|
+
// 设置合同比对按钮的loading状态
|
|
13
|
+
var _b = useState(false), loading = _b[0], setLoading = _b[1];
|
|
15
14
|
var onClickHandle = function () {
|
|
16
15
|
console.log('合同比对', index, record);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var _a;
|
|
23
|
-
if (res.code === 200) {
|
|
24
|
-
getTaskId((_a = res.data) === null || _a === void 0 ? void 0 : _a.taskId, index);
|
|
16
|
+
setLoading(true);
|
|
17
|
+
try {
|
|
18
|
+
if (!record.templateAttachId) {
|
|
19
|
+
message.info('请选择客户样板');
|
|
20
|
+
return;
|
|
25
21
|
}
|
|
26
|
-
|
|
22
|
+
var params = {
|
|
23
|
+
leftAttachId: record.attachId,
|
|
24
|
+
rightAttachId: record.templateAttachId,
|
|
25
|
+
};
|
|
26
|
+
// 发起比对任务
|
|
27
|
+
request({
|
|
28
|
+
url: "/api/zmdms-resource/seal/create-compare-task/" + params.leftAttachId + "/" + params.rightAttachId,
|
|
29
|
+
method: 'GET',
|
|
30
|
+
}).then(function (res) {
|
|
31
|
+
var _a;
|
|
32
|
+
if (res.status === 200 && res.data.code === 200) {
|
|
33
|
+
getTaskId((_a = res.data.data) === null || _a === void 0 ? void 0 : _a.taskId, index);
|
|
34
|
+
message.success('操作成功');
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
message.error(res.data.msg || '出错了');
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
//
|
|
43
|
+
}
|
|
44
|
+
finally {
|
|
45
|
+
setLoading(false);
|
|
46
|
+
}
|
|
27
47
|
};
|
|
28
48
|
return (React.createElement("div", null,
|
|
29
|
-
React.createElement("div",
|
|
49
|
+
React.createElement("div", null,
|
|
30
50
|
React.createElement(Button, { type: "link", onClick: function () {
|
|
31
51
|
openCustomerModalHandle && openCustomerModalHandle(index);
|
|
32
|
-
} }, "\u9009\u62E9\u5BA2\u6237\u6837\u677F"),
|
|
33
|
-
|
|
34
|
-
(record === null || record === void 0 ? void 0 : record.templateAttachId) && (React.createElement(AttachOperation, { ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, token: token, attachId: record === null || record === void 0 ? void 0 : record.templateAttachId, attachName: record === null || record === void 0 ? void 0 : record.templateAttachName, attachSize: record === null || record === void 0 ? void 0 : record.templateAttachSize }))));
|
|
52
|
+
} }, "\u9009\u62E9\u5BA2\u6237\u6837\u677F")),
|
|
53
|
+
React.createElement(Button, { type: "primary", size: "small", disabled: !isEdit, onClick: onClickHandle, loading: loading }, "\u5408\u540C\u6BD4\u5BF9")));
|
|
35
54
|
};
|
|
36
55
|
export default TemplateAttach;
|
|
@@ -15,7 +15,7 @@ export function useRecords(fileList) {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
export function useQunjData(data) {
|
|
18
|
-
var _a = useState(
|
|
18
|
+
var _a = useState({}), qunjSeal = _a[0], setQunjSeal = _a[1];
|
|
19
19
|
useEffect(function () {
|
|
20
20
|
if (typeof data === 'object') {
|
|
21
21
|
setQunjSeal(data);
|
|
@@ -21,7 +21,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
21
21
|
import React, { useImperativeHandle, useCallback, useState, useMemo, } from 'react';
|
|
22
22
|
// redux
|
|
23
23
|
// ztxkui公共组件
|
|
24
|
-
import { Table,
|
|
24
|
+
import { Table, Upload, message, Checkbox, Button } from '../../../index';
|
|
25
25
|
// 路由配置
|
|
26
26
|
// store
|
|
27
27
|
// 自定义组件
|
|
@@ -37,8 +37,11 @@ import { useRecords, useQunjData, useElectronicData } from './hooks';
|
|
|
37
37
|
* 实现受控,接收一个附件列表
|
|
38
38
|
*/
|
|
39
39
|
var Sinatures = function (_a) {
|
|
40
|
-
var
|
|
40
|
+
var needQj = _a.needQj, needDg = _a.needDg, needQys = _a.needQys, isUpload = _a.isUpload, fileList = _a.fileList, qunjSeal = _a.qunjSeal, qunjSealChange = _a.qunjSealChange, electronicSeal = _a.electronicSeal, electronicSealChange = _a.electronicSealChange, 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, flowId = _a.flowId, deptId = _a.deptId, canEdit = _a.canEdit, caseId = _a.caseId, contract_id = _a.contractId, docAttachMap = _a.docAttachMap, checkAttachIdList = _a.checkAttachIdList, // 已盖章附件id
|
|
41
|
+
documentIdList = _a.documentIdList;
|
|
41
42
|
var authToken = token || '';
|
|
43
|
+
// 是否可编辑 1可编辑 0不可编辑
|
|
44
|
+
var isEdit = canEdit === 1;
|
|
42
45
|
// 如果上传,需要传入系统的code
|
|
43
46
|
var uploadData = useMemo(function () { return (systemCode ? { system: systemCode } : {}); }, [systemCode]);
|
|
44
47
|
// 组件内部管理的数组
|
|
@@ -55,7 +58,13 @@ var Sinatures = function (_a) {
|
|
|
55
58
|
: false;
|
|
56
59
|
}), checkSealVisible = _e[0], setCheckSealVisible = _e[1];
|
|
57
60
|
// 合同id
|
|
58
|
-
var _f = useState(
|
|
61
|
+
var _f = useState(contract_id), contractId = _f[0], setContractId = _f[1];
|
|
62
|
+
// 已盖章附件id
|
|
63
|
+
var _g = useState(checkAttachIdList || []), sealedIds = _g[0], setSealedIds = _g[1];
|
|
64
|
+
// docAttachMap
|
|
65
|
+
var _h = useState(docAttachMap), attachMap = _h[0], setAttachMap = _h[1];
|
|
66
|
+
// 文档id列表
|
|
67
|
+
var _j = useState(documentIdList), documentIds = _j[0], setDocumentIds = _j[1];
|
|
59
68
|
/** 获取taskId */
|
|
60
69
|
var getTaskId = function (id, index) {
|
|
61
70
|
handleRef.current.setTemplateData({
|
|
@@ -64,27 +73,78 @@ var Sinatures = function (_a) {
|
|
|
64
73
|
};
|
|
65
74
|
/** 确认盖章 */
|
|
66
75
|
var checkSealFn = function () {
|
|
67
|
-
|
|
76
|
+
// 已勾选的要加盖电子印章的附件id列表
|
|
77
|
+
var checkedElecSealIds = records
|
|
78
|
+
.filter(function (item) { return item.isElectronicSeal; })
|
|
79
|
+
.map(function (item) { return item.attachId; });
|
|
80
|
+
if (innerElectronicSeal.length === 0) {
|
|
81
|
+
message.info('请勾选电子印章!');
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
68
84
|
var params = {
|
|
69
|
-
attachIdList:
|
|
70
|
-
sealIdList: innerElectronicSeal
|
|
85
|
+
attachIdList: [],
|
|
86
|
+
sealIdList: innerElectronicSeal,
|
|
87
|
+
deleteAttachIdList: [],
|
|
88
|
+
docAttachMap: attachMap,
|
|
71
89
|
};
|
|
72
|
-
if (contractId) {
|
|
90
|
+
if (!contractId) {
|
|
91
|
+
setDocumentIds([]);
|
|
92
|
+
setSealedIds([]);
|
|
93
|
+
params.attachIdList = checkedElecSealIds;
|
|
94
|
+
params.deleteAttachIdList = [];
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
73
97
|
params.contractId = contractId;
|
|
74
98
|
}
|
|
75
|
-
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
99
|
+
checkedElecSealIds.forEach(function (n) {
|
|
100
|
+
if (sealedIds.length !== 0 && !sealedIds.includes(n)) {
|
|
101
|
+
params.attachIdList.push(n);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
sealedIds.forEach(function (n) {
|
|
105
|
+
if (checkedElecSealIds.length !== 0 && !checkedElecSealIds.includes(n)) {
|
|
106
|
+
params.deleteAttachIdList.push(n);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
request({
|
|
110
|
+
url: '/api/zmdms-resource/seal/confirm-seal-info',
|
|
111
|
+
method: 'POST',
|
|
112
|
+
data: params,
|
|
113
|
+
}).then(function (res) {
|
|
114
|
+
if (res.status === 200 &&
|
|
115
|
+
res.data.code === 200 &&
|
|
116
|
+
res.data.data.preSignUrl) {
|
|
117
|
+
for (var i = sealedIds.length; i--; i >= 0) {
|
|
118
|
+
if (res.data.data.deleteAttachIdList.includes(sealedIds[i])) {
|
|
119
|
+
sealedIds.splice(i, 1);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
setSealedIds(__spreadArray(__spreadArray([], sealedIds), res.data.data.attachIdList));
|
|
123
|
+
setContractId(res.data.data.contractId);
|
|
124
|
+
setAttachMap(res.data.data.docAttachMap);
|
|
125
|
+
setDocumentIds(res.data.data.documentIdList);
|
|
126
|
+
window.open(res.data.data.preSignUrl);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
message.error(res.data.msg || '出错了');
|
|
79
130
|
}
|
|
80
131
|
});
|
|
81
132
|
};
|
|
82
133
|
/** 查看盖章页面 */
|
|
83
134
|
var viewSealPageFn = function () {
|
|
84
|
-
if (contractId) {
|
|
85
|
-
request(
|
|
86
|
-
|
|
87
|
-
|
|
135
|
+
if (contractId || contract_id) {
|
|
136
|
+
request({
|
|
137
|
+
url: '/api/zmdms-resource/seal/view-seal-state',
|
|
138
|
+
data: { contractId: contractId || contract_id },
|
|
139
|
+
method: 'POST',
|
|
140
|
+
}).then(function (res) {
|
|
141
|
+
if (res.status === 200 &&
|
|
142
|
+
res.data.code === 200 &&
|
|
143
|
+
res.data.data.viewUrl) {
|
|
144
|
+
window.open(res.data.data.viewUrl);
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
message.error(res.data.msg || '出错了');
|
|
88
148
|
}
|
|
89
149
|
});
|
|
90
150
|
}
|
|
@@ -94,32 +154,34 @@ var Sinatures = function (_a) {
|
|
|
94
154
|
};
|
|
95
155
|
var columns = [
|
|
96
156
|
{
|
|
97
|
-
title: '
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
render: function (text, record, index) { return
|
|
101
|
-
React.createElement(EnhanceSelect, { value: text, list: fileTypeList, titleKey: "dictValue", dataKey: "dictKey", dropdownMatchSelectWidth: 160, onChange: function (value, option, fullData) {
|
|
102
|
-
onFileTypeChange({ value: value, option: option, fullData: fullData }, index);
|
|
103
|
-
} }))); },
|
|
157
|
+
title: '序号',
|
|
158
|
+
width: 62,
|
|
159
|
+
fixed: 'left',
|
|
160
|
+
render: function (text, record, index) { return "" + (index + 1); },
|
|
104
161
|
},
|
|
105
162
|
{
|
|
106
|
-
title: '
|
|
107
|
-
key: '
|
|
108
|
-
dataIndex: '
|
|
109
|
-
width: 70,
|
|
110
|
-
render: function (text, record, index) {
|
|
111
|
-
return (React.createElement(Checkbox, { checked: text, onChange: function (e) {
|
|
112
|
-
return onCheckboxChangeHandle(e, 'isCustomerReference', index);
|
|
113
|
-
} }));
|
|
114
|
-
},
|
|
163
|
+
title: '附件类型',
|
|
164
|
+
key: 'attachTypeName',
|
|
165
|
+
dataIndex: 'attachTypeName',
|
|
115
166
|
},
|
|
116
167
|
{
|
|
117
|
-
title:
|
|
168
|
+
title: function () {
|
|
169
|
+
return (React.createElement("div", { className: "seal-file-upload" },
|
|
170
|
+
React.createElement("span", null, "\u9644\u4EF6"),
|
|
171
|
+
React.createElement("span", null, isUpload && (React.createElement(Upload, { apiBaseUrl: ZT_API_BASEURL, method: "post", showTable: false, showTip: false, headers: {
|
|
172
|
+
'Zmdms-Auth': authToken,
|
|
173
|
+
}, data: uploadData, authToken: authToken, callback: uploadCallbackFn, originFileList: originFileList, style: { margin: 0 } },
|
|
174
|
+
React.createElement(Button, { type: "link" }, "\u6DFB\u52A0\u9644\u4EF6"))))));
|
|
175
|
+
},
|
|
118
176
|
key: 'attachId',
|
|
119
177
|
dataIndex: 'attachId',
|
|
120
|
-
width: 220,
|
|
121
178
|
render: function (text, record, index) {
|
|
122
|
-
return (React.createElement(
|
|
179
|
+
return (React.createElement(React.Fragment, null,
|
|
180
|
+
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 }),
|
|
181
|
+
React.createElement(Checkbox, { checked: record.isCustomerReference, disabled: !isEdit, onChange: function (e) {
|
|
182
|
+
return onCheckboxChangeHandle(e, 'isCustomerReference', index);
|
|
183
|
+
} }),
|
|
184
|
+
React.createElement("span", null, "\u5B58\u6837\u677F")));
|
|
123
185
|
},
|
|
124
186
|
},
|
|
125
187
|
{
|
|
@@ -128,7 +190,7 @@ var Sinatures = function (_a) {
|
|
|
128
190
|
dataIndex: 'templateAttachId',
|
|
129
191
|
width: 220,
|
|
130
192
|
render: function (text, record, index) {
|
|
131
|
-
return (React.createElement(TemplateAttach, { record: record, request: request,
|
|
193
|
+
return record.attachTypeName === '合同本身' ? (React.createElement(TemplateAttach, { record: record, request: request, ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, token: authToken, index: index, openCustomerModalHandle: openCustomerModalHandle, getTaskId: getTaskId, isEdit: isEdit })) : ('');
|
|
132
194
|
},
|
|
133
195
|
},
|
|
134
196
|
{
|
|
@@ -137,42 +199,45 @@ var Sinatures = function (_a) {
|
|
|
137
199
|
dataIndex: 'compareAttachId',
|
|
138
200
|
width: 100,
|
|
139
201
|
render: function (text, record, index) {
|
|
140
|
-
return (React.createElement(CompareResult, { record: record, ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, token: authToken, index: index, request: request
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
title: '是否添加水印',
|
|
145
|
-
key: 'isWatermark',
|
|
146
|
-
dataIndex: 'isWatermark',
|
|
147
|
-
width: 100,
|
|
148
|
-
render: function (text, record, index) {
|
|
149
|
-
return (React.createElement(Checkbox, { checked: text, onChange: function (e) { return onCheckboxChangeHandle(e, 'isWatermark', index); } }, "\u662F"));
|
|
202
|
+
return record.attachTypeName === '合同本身' ? (React.createElement(CompareResult, { record: record, ZT_API_BASEURL: ZT_API_BASEURL, ZT_FILE_BASEURL: ZT_FILE_BASEURL, token: authToken, index: index, request: request })) : ('');
|
|
150
203
|
},
|
|
151
204
|
},
|
|
152
205
|
{
|
|
153
206
|
title: function () {
|
|
154
207
|
return (React.createElement(React.Fragment, null,
|
|
155
|
-
React.createElement("div", null, "\
|
|
156
|
-
React.createElement("div", null,
|
|
157
|
-
React.createElement(
|
|
158
|
-
|
|
159
|
-
|
|
208
|
+
React.createElement("div", null, "\u52A0\u76D6\u7535\u5B50\u5370\u7AE0"),
|
|
209
|
+
records.length !== 0 && (React.createElement("div", null,
|
|
210
|
+
React.createElement("div", null,
|
|
211
|
+
React.createElement(Button, { type: "link", style: __assign({}, (checkSealVisible && isEdit
|
|
212
|
+
? {}
|
|
213
|
+
: { display: 'none' })), size: "small", onClick: checkSealFn }, "\u786E\u8BA4\u76D6\u7AE0")),
|
|
214
|
+
React.createElement("div", null,
|
|
215
|
+
React.createElement(Button, { type: "link", style: __assign({}, (contractId || contract_id ? {} : { display: 'none' })), size: "small", onClick: viewSealPageFn }, "\u67E5\u770B\u76D6\u7AE0\u9875\u9762"))))));
|
|
160
216
|
},
|
|
161
217
|
key: 'isElectronicSeal',
|
|
162
218
|
dataIndex: 'isElectronicSeal',
|
|
163
219
|
render: function (text, record, index) {
|
|
164
|
-
return (React.createElement(Checkbox, { checked: text, onChange: function (e) {
|
|
220
|
+
return (React.createElement(Checkbox, { checked: text, disabled: !isEdit, onChange: function (e) {
|
|
165
221
|
return onCheckboxChangeHandle(e, 'isElectronicSeal', index);
|
|
166
222
|
} }, "\u662F"));
|
|
167
223
|
},
|
|
168
224
|
},
|
|
225
|
+
{
|
|
226
|
+
title: '添加水印',
|
|
227
|
+
key: 'isWatermark',
|
|
228
|
+
dataIndex: 'isWatermark',
|
|
229
|
+
width: 100,
|
|
230
|
+
render: function (text, record, index) {
|
|
231
|
+
return (React.createElement(Checkbox, { checked: text, disabled: !isEdit, onChange: function (e) { return onCheckboxChangeHandle(e, 'isWatermark', index); } }, "\u662F"));
|
|
232
|
+
},
|
|
233
|
+
},
|
|
169
234
|
{
|
|
170
235
|
title: '群杰印章',
|
|
171
236
|
key: 'qunjSeal',
|
|
172
237
|
dataIndex: 'qunjSeal',
|
|
173
238
|
render: function (value, row, index) {
|
|
174
239
|
var obj = {
|
|
175
|
-
children: (React.createElement(QunjSeal, {
|
|
240
|
+
children: (React.createElement(QunjSeal, { value: qunjSeal, onChange: qunjSealChangeHandle, request: request, flowId: flowId, caseId: caseId, ZT_API_BASEURL: ZT_API_BASEURL, isEdit: isEdit, handleRef: handleRef })),
|
|
176
241
|
props: {},
|
|
177
242
|
};
|
|
178
243
|
obj.props['rowSpan'] = index === 0 ? records.length : 0;
|
|
@@ -185,7 +250,7 @@ var Sinatures = function (_a) {
|
|
|
185
250
|
dataIndex: 'electronicSeal',
|
|
186
251
|
render: function (value, row, index) {
|
|
187
252
|
var obj = {
|
|
188
|
-
children: (React.createElement(ElectronicSeal, {
|
|
253
|
+
children: (React.createElement(ElectronicSeal, { value: electronicSeal, request: request, flowId: flowId, deptId: deptId, onChange: electronicSealChangeHandle, isEdit: isEdit })),
|
|
189
254
|
props: {},
|
|
190
255
|
};
|
|
191
256
|
obj.props['rowSpan'] = index === 0 ? records.length : 0;
|
|
@@ -193,27 +258,45 @@ var Sinatures = function (_a) {
|
|
|
193
258
|
},
|
|
194
259
|
},
|
|
195
260
|
];
|
|
261
|
+
// 由外部传入needQj needDg needQys参数过滤出需展示的列
|
|
262
|
+
var columnsLast = columns;
|
|
263
|
+
if (!needQj) {
|
|
264
|
+
columnsLast = columnsLast.filter(function (item) { return item.key !== 'qunjSeal'; });
|
|
265
|
+
}
|
|
266
|
+
if (!needDg && !needQys) {
|
|
267
|
+
columnsLast = columnsLast.filter(function (item) { return item.key !== 'attachId'; });
|
|
268
|
+
}
|
|
269
|
+
if (!needDg) {
|
|
270
|
+
columnsLast = columnsLast.filter(function (item) { return !['templateAttachId', 'compareAttachId'].includes(item.key); });
|
|
271
|
+
}
|
|
272
|
+
if (!needQys) {
|
|
273
|
+
columnsLast = columnsLast.filter(function (item) {
|
|
274
|
+
return !['isWatermark', 'isElectronicSeal', 'electronicSeal'].includes(item.key);
|
|
275
|
+
});
|
|
276
|
+
}
|
|
196
277
|
// 上传组件的数据
|
|
197
|
-
var
|
|
278
|
+
var _k = useState(), originFileList = _k[0], setOriginFileList = _k[1];
|
|
198
279
|
// 是否存入样板 添加水印 电子印章发生改变触发事件
|
|
199
280
|
function onCheckboxChangeHandle(e, type, index) {
|
|
200
281
|
if (type === 'isElectronicSeal') {
|
|
201
282
|
var hasElecSeal = records.filter(function (item) { return item.isElectronicSeal; });
|
|
283
|
+
// 勾选加盖电子印章后 显示确认盖章按钮
|
|
202
284
|
setCheckSealVisible(e.target.checked ? true : hasElecSeal.length > 1 ? true : false);
|
|
203
285
|
}
|
|
204
286
|
setRecords(function (preRecords) {
|
|
205
|
-
var _a;
|
|
287
|
+
var _a, _b;
|
|
206
288
|
var newRecords = preRecords.slice();
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
289
|
+
// 勾选添加水印的前提 需要勾选加盖电子印章
|
|
290
|
+
if (type === 'isWatermark' && !newRecords[index].isElectronicSeal) {
|
|
291
|
+
message.info('请先选择是否加盖电子印章!');
|
|
292
|
+
return newRecords;
|
|
293
|
+
}
|
|
294
|
+
// 取消勾选电子印章时 不可添加水印
|
|
295
|
+
if (type === 'isElectronicSeal' && !e.target.checked) {
|
|
296
|
+
newRecords.splice(index, 1, __assign(__assign({}, newRecords[index]), (_a = { isWatermark: 0 }, _a[type] = 0, _a)));
|
|
297
|
+
return newRecords;
|
|
298
|
+
}
|
|
299
|
+
newRecords.splice(index, 1, __assign(__assign({}, newRecords[index]), (_b = {}, _b[type] = e.target.checked ? 1 : 0, _b)));
|
|
217
300
|
return newRecords;
|
|
218
301
|
});
|
|
219
302
|
}
|
|
@@ -260,9 +343,12 @@ var Sinatures = function (_a) {
|
|
|
260
343
|
*/
|
|
261
344
|
useImperativeHandle(handleRef, function () { return ({
|
|
262
345
|
getData: function () { return ({
|
|
263
|
-
|
|
346
|
+
fileList: records,
|
|
264
347
|
qunjSeal: innerQunjSeal,
|
|
265
|
-
|
|
348
|
+
electronicSealIdList: innerElectronicSeal,
|
|
349
|
+
checkAttachIdList: sealedIds,
|
|
350
|
+
docAttachMap: attachMap,
|
|
351
|
+
documentIdList: documentIds,
|
|
266
352
|
}); },
|
|
267
353
|
/** 更新数据 */
|
|
268
354
|
setTemplateData: function (data, index) {
|
|
@@ -274,9 +360,6 @@ var Sinatures = function (_a) {
|
|
|
274
360
|
},
|
|
275
361
|
}); });
|
|
276
362
|
return (React.createElement(React.Fragment, null,
|
|
277
|
-
|
|
278
|
-
'Zmdms-Auth': authToken,
|
|
279
|
-
}, data: uploadData, authToken: authToken, callback: uploadCallbackFn, originFileList: originFileList })),
|
|
280
|
-
React.createElement(Table, { columns: columns, rowKey: "attachId", dataSource: records, scroll: { x: true } })));
|
|
363
|
+
React.createElement(Table, { columns: columnsLast, rowKey: "attachId", dataSource: records, scroll: { x: true } })));
|
|
281
364
|
};
|
|
282
365
|
export default Sinatures;
|
|
@@ -18,27 +18,24 @@ export interface IFileItem {
|
|
|
18
18
|
export interface IQunjProps {
|
|
19
19
|
code?: string;
|
|
20
20
|
contranctNum?: string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
isTakeOut?: string;
|
|
22
|
+
details?: {
|
|
23
|
+
sealName?: string;
|
|
24
|
+
sealNo: string;
|
|
25
|
+
sealCount?: number;
|
|
25
26
|
}[];
|
|
26
27
|
}
|
|
27
28
|
export interface IProps {
|
|
28
29
|
/** 是否显示上传按钮 */
|
|
29
|
-
|
|
30
|
+
isUpload?: boolean;
|
|
30
31
|
/** 附件列表 */
|
|
31
32
|
fileList?: IFileItem[];
|
|
32
33
|
/** 已选中群杰印章列表 */
|
|
33
34
|
qunjSeal?: IQunjProps;
|
|
34
|
-
/** 当前群杰所有印章列表 */
|
|
35
|
-
qunjSealList?: any[];
|
|
36
35
|
/** 群杰印章修改事件 */
|
|
37
36
|
qunjSealChange?: any;
|
|
38
37
|
/** 已选中的电子印章列表 */
|
|
39
38
|
electronicSeal?: any[];
|
|
40
|
-
/** 当前电子印章列表 */
|
|
41
|
-
electronicSealList?: any;
|
|
42
39
|
/** 电子印章修改事件 */
|
|
43
40
|
electronicSealChange?: any;
|
|
44
41
|
/** 组件暴露给外部得方法 */
|
|
@@ -53,14 +50,28 @@ export interface IProps {
|
|
|
53
50
|
token?: any;
|
|
54
51
|
/** 点击客户样板 */
|
|
55
52
|
openCustomerModalHandle?: any;
|
|
56
|
-
/** 附件类型 */
|
|
57
|
-
fileTypeList?: any;
|
|
58
53
|
/** 发送接口请求的方法 */
|
|
59
54
|
request?: any;
|
|
60
|
-
/**
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
|
|
55
|
+
/** 是否展示群杰 */
|
|
56
|
+
needQj: number;
|
|
57
|
+
/** 是否展示达观 */
|
|
58
|
+
needDg: number;
|
|
59
|
+
/** 是否展示契约锁 */
|
|
60
|
+
needQys: number;
|
|
61
|
+
/** 流程id */
|
|
62
|
+
flowId: number;
|
|
63
|
+
/** 部门id */
|
|
64
|
+
deptId: any;
|
|
65
|
+
/** 0 可编辑 1 为不可编辑 */
|
|
66
|
+
canEdit: number;
|
|
67
|
+
/** 当前办理事项id */
|
|
68
|
+
caseId: string;
|
|
69
|
+
/** 合同id */
|
|
70
|
+
contractId: string;
|
|
71
|
+
/** 后台用于维护当前合同id下附件id(key)与文档id(value)的关系map 后台解绑文档时使用 */
|
|
72
|
+
docAttachMap: any;
|
|
73
|
+
/** 用于校验上传的附件是新增还是删除,组件返回这个参数,需要保存,下次调用组件时传入 */
|
|
74
|
+
checkAttachIdList: any[];
|
|
75
|
+
/** 文档id列表 */
|
|
76
|
+
documentIdList: string[];
|
|
66
77
|
}
|