ztxkui 3.4.4 → 3.4.5

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.
@@ -10,50 +10,6 @@ var CompareResult = function (_a) {
10
10
  var record = _a.record, index = _a.index, request = _a.request, isEdit = _a.isEdit, getTaskId = _a.getTaskId;
11
11
  // 设置查看比对结果按钮的loading状态
12
12
  var _b = useState(false), resultLoading = _b[0], setResultLoading = _b[1];
13
- // 设置合同比对按钮的loading状态
14
- var _c = useState(false), loading = _c[0], setLoading = _c[1];
15
- // 设置查看结果按钮是否显示
16
- var _d = useState(false), isShow = _d[0], setIsShow = _d[1];
17
- var onClickHandle = function () {
18
- console.log('合同比对', index, record);
19
- setLoading(true);
20
- try {
21
- if (!record.templateAttachId) {
22
- message.info('请选择客户样板');
23
- return;
24
- }
25
- var params = {
26
- leftAttachId: record.attachId,
27
- rightAttachId: record.templateAttachId,
28
- };
29
- // 发起比对任务
30
- request({
31
- url: "/api/zmdms-resource/seal/create-compare-task/" + params.leftAttachId + "/" + params.rightAttachId,
32
- method: 'GET',
33
- })
34
- .then(function (res) {
35
- var _a;
36
- if (res.status === 200 && res.data.code === 200) {
37
- getTaskId((_a = res.data.data) === null || _a === void 0 ? void 0 : _a.taskId, index);
38
- setIsShow(true);
39
- message.success('操作成功');
40
- }
41
- else {
42
- message.error(res.data.msg || '出错了');
43
- }
44
- })
45
- .catch(function (error) {
46
- var _a, _b;
47
- 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) || '请求失败!');
48
- });
49
- }
50
- catch (err) {
51
- //
52
- }
53
- finally {
54
- setLoading(false);
55
- }
56
- };
57
13
  var viewCompareResult = function () {
58
14
  console.log('查看比对结果', index, record);
59
15
  setResultLoading(true);
@@ -97,7 +53,6 @@ var CompareResult = function (_a) {
97
53
  }
98
54
  };
99
55
  return (React.createElement(React.Fragment, null,
100
- React.createElement(Button, { type: "primary", size: "small", disabled: !isEdit, onClick: onClickHandle, loading: loading }, "\u5408\u540C\u6BD4\u5BF9"),
101
- React.createElement("div", null, isShow || record.taskId ? (React.createElement(Button, { type: "link", onClick: viewCompareResult, loading: resultLoading }, "\u67E5\u770B\u6BD4\u5BF9\u7ED3\u679C")) : (''))));
56
+ React.createElement("div", null, record.taskId ? (React.createElement(Button, { type: "link", onClick: viewCompareResult, loading: resultLoading }, "\u67E5\u770B\u6BD4\u5BF9\u7ED3\u679C")) : (React.createElement(React.Fragment, null)))));
102
57
  };
103
58
  export default CompareResult;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @author zyh
3
+ * @description 审批中审批后详情展示
4
+ */
5
+ import React from 'react';
6
+ interface IProps {
7
+ /** 接口api */
8
+ ZT_API_BASEURL: string;
9
+ /** 附件api */
10
+ ZT_FILE_BASEURL: string;
11
+ /** token */
12
+ token?: any;
13
+ /** 合同id */
14
+ contractId: string;
15
+ electronicList: any;
16
+ sealList: any;
17
+ querySealStatus?: () => void;
18
+ flow_status: string;
19
+ needQj: number;
20
+ needQys: number;
21
+ records: any;
22
+ /** 已选中的电子印章列表 */
23
+ electronicSealIdList: any;
24
+ /** 已选中群杰印章列表 */
25
+ qunjSeal: any;
26
+ /** 查看盖章页面 */
27
+ viewSealPageFn: any;
28
+ }
29
+ declare const _default: React.NamedExoticComponent<IProps>;
30
+ export default _default;
@@ -0,0 +1,184 @@
1
+ /**
2
+ * @author zyh
3
+ * @description 审批中审批后详情展示
4
+ */
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ import React, { memo } from 'react';
17
+ import { Table, Button } from '../../../../index';
18
+ // 自定义组件
19
+ import AttachOperation from './AttachOperation';
20
+ var DetailTable = function (_a) {
21
+ var needQj = _a.needQj, needQys = _a.needQys, records = _a.records, qunjSeal = _a.qunjSeal, electronicSeal = _a.electronicSealIdList, ZT_API_BASEURL = _a.ZT_API_BASEURL, ZT_FILE_BASEURL = _a.ZT_FILE_BASEURL, token = _a.token, viewSealPageFn = _a.viewSealPageFn, contractId = _a.contractId, electronicList = _a.electronicList, sealList = _a.sealList, querySealStatus = _a.querySealStatus, flow_status = _a.flow_status;
22
+ var authToken = token || '';
23
+ /** 下载水印附件 */
24
+ var downFileFn = function (_record) {
25
+ try {
26
+ var xhr_1 = new XMLHttpRequest();
27
+ xhr_1.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);
28
+ xhr_1.responseType = 'blob';
29
+ xhr_1.onload = function () {
30
+ var _a;
31
+ if (xhr_1.status === 200 || xhr_1.status === 201) {
32
+ var link = document.createElement('a');
33
+ link.href = window.URL.createObjectURL(xhr_1.response);
34
+ link.download = ((_a = _record === null || _record === void 0 ? void 0 : _record.attachName) === null || _a === void 0 ? void 0 : _a.split('.')[0]) + ".pdf";
35
+ // fix Firefox
36
+ link.style.display = 'none';
37
+ document.body.appendChild(link);
38
+ link.click();
39
+ document.body.removeChild(link);
40
+ window.URL.revokeObjectURL(link.href);
41
+ }
42
+ };
43
+ xhr_1.send();
44
+ }
45
+ catch (err) {
46
+ //
47
+ }
48
+ };
49
+ var columns = [
50
+ {
51
+ title: '序号',
52
+ key: 'orderNum',
53
+ dataIndex: 'orderNum',
54
+ width: 62,
55
+ fixed: 'left',
56
+ render: function (text, record, index) { return "" + (index + 1); },
57
+ },
58
+ {
59
+ title: '附件类型',
60
+ key: 'attachTypeName',
61
+ dataIndex: 'attachTypeName',
62
+ width: 100,
63
+ },
64
+ {
65
+ title: '附件名称',
66
+ key: 'attachId',
67
+ dataIndex: 'attachId',
68
+ width: 240,
69
+ render: function (text, record, index) {
70
+ return (React.createElement(React.Fragment, null,
71
+ 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 })));
72
+ },
73
+ },
74
+ {
75
+ title: '水印',
76
+ key: 'isWatermark',
77
+ dataIndex: 'isWatermark',
78
+ width: 60,
79
+ render: function (text, record, index) {
80
+ return (React.createElement(Button, { type: "link", onClick: function () { return downFileFn(record); } }, "\u4E0B\u8F7D\u6C34\u5370\u7248"));
81
+ },
82
+ },
83
+ {
84
+ title: '电子印章',
85
+ key: 'electronicSeal',
86
+ dataIndex: 'electronicSeal',
87
+ width: '20%',
88
+ render: function (value, row, index) {
89
+ var obj = {
90
+ children: (React.createElement("div", { style: { height: '100%', padding: '10px 0' } },
91
+ React.createElement(Button, { type: "link", style: __assign({}, (contractId ? {} : { display: 'none' })), size: "small", onClick: function () {
92
+ viewSealPageFn && viewSealPageFn();
93
+ } }, "\u9884\u89C8\u76D6\u7AE0\u6548\u679C"),
94
+ (electronicList || [])
95
+ .filter(function (item) { return electronicSeal.includes(item.sealId); })
96
+ .map(function (n) { return (React.createElement("div", { style: { padding: '3px 0' }, key: n.sealId }, n.sealName || '')); }))),
97
+ props: {},
98
+ };
99
+ obj.props['rowSpan'] = index === 0 ? records.length : 0;
100
+ return obj;
101
+ },
102
+ },
103
+ {
104
+ title: '群杰印章-用印申请',
105
+ key: 'qunjSeal',
106
+ dataIndex: 'qunjSeal',
107
+ width: 240,
108
+ render: function (value, row, index) {
109
+ var obj = {
110
+ children: (React.createElement("div", { style: { height: '100%', padding: '10px 0' } },
111
+ React.createElement("div", { style: {
112
+ display: 'flex',
113
+ justifyContent: 'space-between',
114
+ height: '50px',
115
+ borderBottom: '1px solid #EBEBEB',
116
+ } },
117
+ React.createElement("div", { style: {
118
+ width: '160px',
119
+ height: '38px',
120
+ background: '#FCECC8',
121
+ borderRadius: '4px',
122
+ padding: '0 10px',
123
+ lineHeight: '38px',
124
+ } },
125
+ "\u7FA4\u6770\u9A8C\u8BC1\u7801",
126
+ ' ',
127
+ React.createElement("span", { style: { color: '#FF6666', fontSize: '16px' } }, (qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.vertifyCode) || '')),
128
+ !!flow_status && (React.createElement("div", { style: {
129
+ height: '38px',
130
+ background: '#FCECC8',
131
+ borderRadius: '4px',
132
+ padding: '0 10px',
133
+ lineHeight: '38px',
134
+ } }, flow_status))),
135
+ React.createElement("div", { style: {
136
+ borderBottom: '1px solid #EBEBEB',
137
+ } },
138
+ React.createElement("div", { style: __assign({}, (!!(qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.vertifyCode) ? {} : { display: 'none' })) },
139
+ React.createElement(Button, { type: "link", size: "small", onClick: querySealStatus }, "\u67E5\u8BE2\u7528\u5370\u72B6\u6001")),
140
+ React.createElement("div", null,
141
+ React.createElement("span", { style: {
142
+ color: '#888888',
143
+ } }, "\u5408\u540C\u4EFD\u6570\uFF1A"),
144
+ (qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.contranctNum) || '',
145
+ " \u4EFD"),
146
+ React.createElement("div", null,
147
+ React.createElement("span", { style: {
148
+ color: '#888888',
149
+ } }, "\u7528\u5370\u7C7B\u578B\uFF1A"),
150
+ "" + (qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.isTakeOut) === '1' ? '外部用印' : '内部用印')),
151
+ React.createElement("div", null, (sealList || [])
152
+ .filter(function (item) {
153
+ return ((qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) || [])
154
+ .map(function (n) { return n.sealNo; })
155
+ .includes(item.sealNo);
156
+ })
157
+ .map(function (m) {
158
+ var ele = ((qunjSeal === null || qunjSeal === void 0 ? void 0 : qunjSeal.details) || []).find(function (element) { return element.sealNo === m.sealNo; });
159
+ return (React.createElement("div", { style: { padding: '5px 0' }, key: m.sealNo },
160
+ m.sealName,
161
+ ' ',
162
+ "\u7528\u5370",
163
+ ele.sealCount || '',
164
+ "\u6B21"));
165
+ })))),
166
+ props: {},
167
+ };
168
+ obj.props['rowSpan'] = index === 0 ? records.length : 0;
169
+ return obj;
170
+ },
171
+ },
172
+ ];
173
+ // 由外部传入needQj needQys参数过滤出需展示的列
174
+ var columnsLast = columns;
175
+ if (!needQj) {
176
+ columnsLast = columnsLast.filter(function (item) { return item.key !== 'qunjSeal'; });
177
+ }
178
+ if (!needQys) {
179
+ columnsLast = columnsLast.filter(function (item) { return !['electronicSeal'].includes(item.key); });
180
+ }
181
+ return (React.createElement(React.Fragment, null,
182
+ React.createElement(Table, { columns: columnsLast, rowKey: "attachId", dataSource: records, scroll: { x: 'max-content' } })));
183
+ };
184
+ export default memo(DetailTable);
@@ -4,12 +4,10 @@
4
4
  */
5
5
  import React from 'react';
6
6
  interface IProps {
7
+ electronicList: any;
7
8
  value?: any;
8
9
  onChange?: any;
9
- request?: any;
10
- flowId: number;
11
- deptId: any;
12
10
  isEdit: boolean;
13
11
  }
14
- declare const ElectronicSeal: React.FC<IProps>;
15
- export default ElectronicSeal;
12
+ declare const _default: React.NamedExoticComponent<IProps>;
13
+ export default _default;
@@ -2,67 +2,20 @@
2
2
  * @author 陈亚雄
3
3
  * @description
4
4
  */
5
- import React, { useEffect, useState } from 'react';
5
+ import React, { memo } from 'react';
6
6
  // redux
7
7
  // ztxkui公共组件
8
- import { Checkbox, message } from '../../../../index';
8
+ import { Checkbox } from '../../../../index';
9
9
  var ElectronicSeal = function (_a) {
10
- var value = _a.value, onChange = _a.onChange, request = _a.request, flowId = _a.flowId, deptId = _a.deptId, isEdit = _a.isEdit;
11
- var _b = useState([]), electronicList = _b[0], setElectronicList = _b[1];
12
- useEffect(function () {
13
- var params = {
14
- deptId: deptId,
15
- size: 200,
16
- };
17
- if (flowId) {
18
- params.flowId = flowId;
19
- }
20
- request({
21
- url: '/api/zmdms-resource/flowdeptseal/page',
22
- params: params,
23
- method: 'GET',
24
- })
25
- .then(function (res) {
26
- var _a, _b, _c;
27
- if (res.status === 200 && res.data.code === 200) {
28
- // 当前部门和流程没查到数据时 调下面接口查所有的印章
29
- if (((_a = res.data.data) === null || _a === void 0 ? void 0 : _a.records.length) === 0) {
30
- request({
31
- url: '/api/zmdms-resource/qyssealinfo/list',
32
- method: 'GET',
33
- })
34
- .then(function (res) {
35
- var _a, _b;
36
- if ((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[0]) {
37
- var list = res.data.data.map(function (item) { return ({
38
- sealId: item.id,
39
- sealName: item.sealName,
40
- }); });
41
- setElectronicList(list);
42
- }
43
- else {
44
- message.error(res.data.msg || '出错了');
45
- }
46
- })
47
- .catch(function (error) {
48
- var _a, _b;
49
- 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) || '请求失败!');
50
- });
51
- }
52
- setElectronicList((_c = (_b = res.data.data) === null || _b === void 0 ? void 0 : _b.records[0]) === null || _c === void 0 ? void 0 : _c.sealInfoList);
53
- }
54
- else {
55
- message.error(res.data.msg || '出错了');
56
- }
57
- })
58
- .catch(function (error) {
59
- var _a, _b;
60
- 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) || '请求失败!');
61
- });
62
- }, [request, flowId, deptId]);
63
- return (React.createElement(Checkbox.Group, { defaultValue: value, onChange: onChange, className: "flex-checkbox-group", disabled: !isEdit }, Array.isArray(electronicList) &&
64
- electronicList.map(function (item) {
65
- return (React.createElement(Checkbox, { key: item.sealId, value: item.sealId }, item.sealName));
66
- })));
10
+ var electronicList = _a.electronicList, value = _a.value, onChange = _a.onChange, isEdit = _a.isEdit;
11
+ return (React.createElement("div", { style: {
12
+ height: '100%',
13
+ overflowY: 'auto',
14
+ overflowX: 'hidden',
15
+ } },
16
+ React.createElement(Checkbox.Group, { defaultValue: value, onChange: onChange, className: "flex-checkbox-group", disabled: !isEdit }, Array.isArray(electronicList) &&
17
+ electronicList.map(function (item) {
18
+ return (React.createElement(Checkbox, { key: item.sealId, value: item.sealId }, item.sealName));
19
+ }))));
67
20
  };
68
- export default ElectronicSeal;
21
+ export default memo(ElectronicSeal);
@@ -6,14 +6,12 @@ import React from 'react';
6
6
  interface IProps {
7
7
  value?: any;
8
8
  onChange?: any;
9
- request?: any;
10
- flowId: number;
11
- caseId: string;
12
9
  ZT_API_BASEURL: string;
13
10
  isEdit: boolean;
14
- isOnlyQunj: boolean;
15
11
  showContranctNum: boolean;
12
+ sealList: any;
16
13
  handleRef?: any;
14
+ querySealStatus?: () => void;
17
15
  }
18
16
  declare const QunjSeal: React.FC<IProps>;
19
17
  export default QunjSeal;
@@ -16,41 +16,17 @@ var __assign = (this && this.__assign) || function () {
16
16
  import React, { useEffect, useState } from 'react';
17
17
  // redux
18
18
  // ztxkui公共组件
19
- import { Form, Input, InputNumber, SearchContainer, Radio, Button, message, Checkbox, } from '../../../../index';
19
+ import { Form, InputNumber, SearchContainer, Radio, Checkbox, } from '../../../../index';
20
20
  // 路由配置
21
21
  // store
22
22
  // 自定义组件
23
23
  import { SealCheckboxGroup } from './SealCheckbox';
24
- // 其他文件
25
- var SearchLeft = SearchContainer.SearchLeft, Item = SearchContainer.SearchItem;
24
+ var Item = SearchContainer.SearchItem;
26
25
  var QunjSeal = function (_a) {
27
- var value = _a.value, onChange = _a.onChange, request = _a.request, flowId = _a.flowId, caseId = _a.caseId, ZT_API_BASEURL = _a.ZT_API_BASEURL, isEdit = _a.isEdit, isOnlyQunj = _a.isOnlyQunj, showContranctNum = _a.showContranctNum, handleRef = _a.handleRef;
26
+ var value = _a.value, onChange = _a.onChange, ZT_API_BASEURL = _a.ZT_API_BASEURL, isEdit = _a.isEdit, showContranctNum = _a.showContranctNum, sealList = _a.sealList, handleRef = _a.handleRef, querySealStatus = _a.querySealStatus;
28
27
  var form = Form.useForm()[0];
29
28
  // 是否加盖群杰印章
30
- var _b = useState(false), checked = _b[0], setChecked = _b[1];
31
- var _c = useState([]), sealList = _c[0], setSealList = _c[1];
32
- useEffect(function () {
33
- request({
34
- url: "/api/zmdms-resource/flowqjuse/query-qj-seal-list/" + flowId,
35
- method: 'GET',
36
- })
37
- .then(function (res) {
38
- var _a;
39
- if (res.status === 200 && res.data.code === 200) {
40
- setSealList((_a = res.data.data) === null || _a === void 0 ? void 0 : _a.map(function (item, index) { return ({
41
- sealName: item.sealName,
42
- sealNo: item.sealNo,
43
- }); }));
44
- }
45
- else {
46
- message.error(res.data.msg || '出错了');
47
- }
48
- })
49
- .catch(function (error) {
50
- var _a, _b;
51
- 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) || '请求失败!');
52
- });
53
- }, [request, flowId]);
29
+ var _b = useState(true), checked = _b[0], setChecked = _b[1];
54
30
  useEffect(function () {
55
31
  var _a;
56
32
  if (value) {
@@ -64,26 +40,34 @@ var QunjSeal = function (_a) {
64
40
  }
65
41
  }
66
42
  }, [value, form]);
67
- /** 查询用印状态 */
68
- var querySealStatus = function () {
69
- var url = ZT_API_BASEURL + "/api/zmdms-esb-outer/outer/qj/view-stamp?caseId=" + caseId + "&systemId=1493475945847648257";
70
- window.open(url);
71
- };
72
43
  /** 是否加盖群杰印章 */
73
44
  var needQjSealFn = function (e) {
74
45
  if (!e.target.checked) {
75
- form.resetFields();
46
+ form.setFieldsValue({
47
+ isTakeOut: 0,
48
+ details: [],
49
+ });
50
+ onChange && onChange({});
76
51
  }
77
52
  setChecked(e.target.checked);
78
53
  };
79
- var onSealCheckboxHandle = function (sealList) {
54
+ var onSealCheckboxHandle = function (values) {
80
55
  form.setFieldsValue({
81
- sealList: sealList,
56
+ values: values,
82
57
  });
83
58
  };
84
59
  var onValuesChangeHandle = function (value, allValues) {
85
- onChange && onChange(allValues);
86
- form.setFieldsValue(allValues);
60
+ var _a;
61
+ var result = allValues;
62
+ if (result &&
63
+ Object.keys(result).length === 1 &&
64
+ Object.keys(result)[0] === 'needQj' &&
65
+ Object.keys(result)[0]) {
66
+ result = __assign(__assign({}, result), { isTakeOut: 0, details: [], contranctNum: 1 });
67
+ (_a = handleRef === null || handleRef === void 0 ? void 0 : handleRef.current) === null || _a === void 0 ? void 0 : _a.getData('enable');
68
+ }
69
+ onChange && onChange(result);
70
+ form.setFieldsValue(result);
87
71
  };
88
72
  /** 渲染SealCheckboxGroup组件 */
89
73
  var getSealCheckboxGroupRender = function () {
@@ -92,42 +76,27 @@ var QunjSeal = function (_a) {
92
76
  overflowY: 'auto',
93
77
  overflowX: 'hidden',
94
78
  } },
95
- React.createElement(SealCheckboxGroup, { sealList: sealList, onChange: onSealCheckboxHandle, handleRef: handleRef, isEdit: isEdit, isOnlyQunj: isOnlyQunj, showContranctNum: showContranctNum })));
79
+ React.createElement(SealCheckboxGroup, { sealList: sealList, onChange: onSealCheckboxHandle, handleRef: handleRef, isEdit: isEdit, showContranctNum: showContranctNum })));
96
80
  };
97
- return isOnlyQunj ? (React.createElement(Form, { form: form, onValuesChange: onValuesChangeHandle },
98
- React.createElement(SearchContainer, null,
99
- React.createElement(SearchLeft, null,
100
- React.createElement("div", { style: {
101
- display: 'flex',
102
- justifyContent: 'space-between',
103
- width: '100%',
104
- } },
105
- React.createElement(Item, { name: "needQj", label: "", valuePropName: "checked", noBorder: true, width: "half" },
106
- React.createElement(Checkbox, { checked: checked, disabled: !isEdit, style: { marginTop: '8px' }, onChange: function (e) { return needQjSealFn(e); } }, "\u662F\u5426\u52A0\u76D6\u7FA4\u6770\u5370\u7AE0")),
107
- checked ? (React.createElement(React.Fragment, null,
108
- React.createElement(Item, { name: "isTakeOut", label: "", noBorder: true, width: "half" },
109
- React.createElement(Radio.Group, { style: { padding: '5px 6px' }, disabled: !isEdit },
110
- React.createElement(Radio, { value: 0 }, "\u5185\u90E8\u7528\u5370"),
111
- React.createElement(Radio, { value: 1 }, "\u5916\u90E8\u7528\u5370"))),
112
- React.createElement(Item, { name: "vertifyCode", label: "\u7FA4\u6770\u9A8C\u8BC1\u7801", width: "half" },
113
- React.createElement(Input, { disabled: true })),
114
- !!value.vertifyCode ? (React.createElement(Button, { type: "primary", size: "small", style: { margin: '8px 10px auto 0px' }, onClick: querySealStatus }, "\u67E5\u8BE2\u7528\u5370\u72B6\u6001")) : (''))) : (React.createElement(React.Fragment, null))),
115
- checked ? (React.createElement(React.Fragment, null,
116
- showContranctNum ? (React.createElement(Item, { name: "contranctNum", label: "\u5408\u540C\u4EFD\u6570", width: "all" },
117
- React.createElement(InputNumber, { disabled: !isEdit, min: 0 }))) : (''),
118
- getSealCheckboxGroupRender())) : (React.createElement(React.Fragment, null)))))) : (React.createElement(Form, { form: form, onValuesChange: onValuesChangeHandle },
119
- React.createElement(Item, { name: "needQj", label: "", valuePropName: "checked", noBorder: true, width: "all" },
120
- React.createElement(Checkbox, { checked: checked, disabled: !isEdit, style: { marginTop: '8px' }, onChange: function (e) { return needQjSealFn(e); } }, "\u662F\u5426\u52A0\u76D6\u7FA4\u6770\u5370\u7AE0")),
121
- React.createElement(SearchContainer, null, checked ? (React.createElement(SearchLeft, null,
122
- React.createElement(Item, { name: "vertifyCode", label: "\u7FA4\u6770\u9A8C\u8BC1\u7801", width: "all" },
123
- React.createElement(Input, { disabled: true })),
124
- showContranctNum ? (React.createElement(Item, { name: "contranctNum", label: "\u5408\u540C\u4EFD\u6570", width: "all" },
125
- React.createElement(InputNumber, { disabled: !isEdit, min: 0 }))) : (''),
126
- !!value.vertifyCode ? (React.createElement(Button, { type: "primary", size: "small", style: { marginLeft: '6px' }, onClick: querySealStatus }, "\u67E5\u8BE2\u7528\u5370\u72B6\u6001")) : (''),
127
- React.createElement(Item, { name: "isTakeOut", label: "", noBorder: true, width: "all" },
128
- React.createElement(Radio.Group, { style: { padding: '0 6px' }, disabled: !isEdit },
129
- React.createElement(Radio, { value: 0 }, "\u5185\u90E8\u7528\u5370"),
130
- React.createElement(Radio, { value: 1 }, "\u5916\u90E8\u7528\u5370"))),
131
- getSealCheckboxGroupRender())) : (React.createElement(React.Fragment, null)))));
81
+ return (React.createElement(Form, { form: form, onValuesChange: onValuesChangeHandle },
82
+ React.createElement(Item, { name: "needQj", valuePropName: "checked", noBorder: true, width: "all" },
83
+ React.createElement(Checkbox, { checked: checked, disabled: !isEdit, style: { marginTop: '8px' }, onChange: function (e) { return needQjSealFn(e); } }, "\u7FA4\u6770\u5370\u7AE0-\u7528\u5370\u7533\u8BF7")),
84
+ checked ? (React.createElement(React.Fragment, null,
85
+ React.createElement("div", { style: {
86
+ display: 'flex',
87
+ justifyContent: 'space-between',
88
+ height: '36px',
89
+ borderBottom: '1px solid #EBEBEB',
90
+ marginBottom: '5px',
91
+ } },
92
+ React.createElement(Item, { name: "isTakeOut", label: "", noBorder: true, width: "halfAll" },
93
+ React.createElement(Radio.Group, { style: { width: '40%' }, disabled: !isEdit },
94
+ React.createElement(Radio, { value: 0 }, "\u5185\u90E8\u7528\u5370"),
95
+ React.createElement(Radio, { value: 1 }, "\u5916\u90E8\u7528\u5370"))),
96
+ showContranctNum ? (React.createElement("div", { style: { display: 'flex', lineHeight: '32px' } },
97
+ React.createElement(Item, { name: "contranctNum", label: "\u5408\u540C\u4EFD\u6570", width: "all", colon: false },
98
+ React.createElement(InputNumber, { disabled: !isEdit, size: "small", min: 0, style: { width: '60px' } })),
99
+ React.createElement("div", { style: { margin: 'auto 42px auto 16px' } }, "\u4EFD"))) : ('')),
100
+ getSealCheckboxGroupRender())) : (React.createElement(React.Fragment, null))));
132
101
  };
133
102
  export default QunjSeal;
@@ -10,7 +10,6 @@ interface IProps {
10
10
  showContranctNum: boolean;
11
11
  value?: any;
12
12
  onChange?: any;
13
- isOnlyQunj?: boolean;
14
13
  handleRef?: any;
15
14
  }
16
15
  declare const SealCheckbox: React.FC<IProps>;
@@ -26,7 +25,6 @@ interface ISealProps {
26
25
  handleRef?: any;
27
26
  isEdit: boolean;
28
27
  showContranctNum: boolean;
29
- isOnlyQunj?: boolean;
30
28
  }
31
29
  declare const SealCheckboxGroup: React.FC<ISealProps>;
32
30
  export { SealCheckboxGroup };
@@ -22,10 +22,11 @@ import React from 'react';
22
22
  import sumBy from 'lodash/sumBy';
23
23
  // redux
24
24
  // ztxkui公共组件
25
- import { Checkbox, InputNumber } from '../../../../index';
25
+ import { Checkbox, InputNumber, SearchContainer } from '../../../../index';
26
26
  import { message } from 'antd';
27
+ var Item = SearchContainer.SearchItem;
27
28
  var SealCheckbox = function (_a) {
28
- var name = _a.name, id = _a.id, value = _a.value, onChange = _a.onChange, isEdit = _a.isEdit, showContranctNum = _a.showContranctNum, isOnlyQunj = _a.isOnlyQunj, handleRef = _a.handleRef;
29
+ var name = _a.name, id = _a.id, value = _a.value, onChange = _a.onChange, isEdit = _a.isEdit, showContranctNum = _a.showContranctNum, handleRef = _a.handleRef;
29
30
  var onCheckboxChange = function (e) {
30
31
  onChange &&
31
32
  onChange(__assign(__assign({}, (value || {})), { sealName: e.target.checked ? name : null, sealNo: e.target.checked ? id : null }));
@@ -34,14 +35,14 @@ var SealCheckbox = function (_a) {
34
35
  var _a, _b;
35
36
  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;
36
37
  var num = count;
37
- if (count < 0) {
38
- num = 0;
38
+ if (count < 1) {
39
+ num = 1;
39
40
  }
40
- if (!contractNum && showContranctNum) {
41
+ if (typeof contractNum !== 'number' && showContranctNum && onChange) {
41
42
  message.info('请输入合同份数!');
42
43
  num = null;
43
44
  }
44
- if (typeof num !== 'number') {
45
+ if (typeof num !== 'number' && value) {
45
46
  Reflect.deleteProperty(value, 'sealCount');
46
47
  }
47
48
  var info = __assign(__assign({}, (value || {})), (typeof num === 'number' ? { sealCount: num } : {}));
@@ -50,14 +51,22 @@ var SealCheckbox = function (_a) {
50
51
  }
51
52
  onChange && onChange(info, 'sealCount');
52
53
  };
53
- return (React.createElement("div", { style: __assign({ padding: '6px' }, (isOnlyQunj ? { display: 'flex' } : {})) },
54
+ return (React.createElement("div", { style: {
55
+ display: 'flex',
56
+ justifyContent: 'space-between',
57
+ height: '32px',
58
+ } },
54
59
  React.createElement(Checkbox, { onChange: onCheckboxChange, checked: value && value.sealNo ? true : false, disabled: !isEdit, style: { width: '40%' } }, name),
55
- React.createElement("div", null,
56
- React.createElement("span", null, "\u7528\u5370\u6B21\u6570\uFF1A"),
57
- React.createElement(InputNumber, { bordered: false, disabled: !isEdit, min: 0, size: "small", value: typeof (value === null || value === void 0 ? void 0 : value.sealCount) === 'number' ? value === null || value === void 0 ? void 0 : value.sealCount : undefined, onChange: onNumberChange, style: { borderBottom: '1px solid #e9ecf3' } }))));
60
+ React.createElement("div", { style: { display: 'flex', lineHeight: '32px' } },
61
+ React.createElement("div", { style: { marginRight: '5px' } }, "\u7528\u5370"),
62
+ React.createElement(Item, { noLabel: true, width: "half" },
63
+ React.createElement(InputNumber, { disabled: !isEdit, min: 1, size: "small", value: typeof (value === null || value === void 0 ? void 0 : value.sealCount) === 'number'
64
+ ? value === null || value === void 0 ? void 0 : value.sealCount
65
+ : undefined, onChange: onNumberChange, style: { width: '60px' } })),
66
+ React.createElement("div", { style: { marginLeft: '50px' } }, "\u6B21"))));
58
67
  };
59
68
  var SealCheckboxGroup = function (_a) {
60
- var value = _a.value, onChange = _a.onChange, sealList = _a.sealList, handleRef = _a.handleRef, isEdit = _a.isEdit, showContranctNum = _a.showContranctNum, isOnlyQunj = _a.isOnlyQunj;
69
+ var value = _a.value, onChange = _a.onChange, sealList = _a.sealList, handleRef = _a.handleRef, isEdit = _a.isEdit, showContranctNum = _a.showContranctNum;
61
70
  var onChangeHandle = function (_value, index, sealNo, type) {
62
71
  var _a, _b, _c, _d;
63
72
  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;
@@ -81,7 +90,7 @@ var SealCheckboxGroup = function (_a) {
81
90
  }
82
91
  var totalSealNum = sumBy(valueArr, 'sealCount');
83
92
  onChange && onChange(valueArr);
84
- if (contractNum) {
93
+ if (typeof contractNum === 'number') {
85
94
  if (totalSealNum > contractNum * 4) {
86
95
  (_c = handleRef === null || handleRef === void 0 ? void 0 : handleRef.current) === null || _c === void 0 ? void 0 : _c.getData('4');
87
96
  message.warning('您的用印次数远超超过合理次数范围,请修改。');
@@ -106,7 +115,7 @@ var SealCheckboxGroup = function (_a) {
106
115
  if (Array.isArray(value)) {
107
116
  itemValue = value.find(function (valueItem) { return valueItem.sealNo === item.sealNo; });
108
117
  }
109
- 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, isEdit: isEdit, isOnlyQunj: isOnlyQunj, showContranctNum: showContranctNum, handleRef: handleRef, onChange: function (value, type) {
118
+ 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, isEdit: isEdit, showContranctNum: showContranctNum, handleRef: handleRef, onChange: function (value, type) {
110
119
  onChangeHandle(value, index, item.sealNo, type);
111
120
  } }));
112
121
  })));
@@ -13,6 +13,6 @@ var TemplateAttach = function (_a) {
13
13
  React.createElement("div", null,
14
14
  React.createElement(Button, { type: "link", disabled: !isEdit, onClick: function () {
15
15
  openCustomerModalHandle && openCustomerModalHandle(index);
16
- } }, "\u9009\u62E9\u5BA2\u6237\u6837\u677F"))));
16
+ } }, "\u9009\u62E9\u6BD4\u5BF9\u6A21\u7248"))));
17
17
  };
18
18
  export default TemplateAttach;
@@ -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, Checkbox, Button } from '../../../index';
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 needQj = _a.needQj, needDg = _a.needDg, needQys = _a.needQys, isUpload = _a.isUpload, fileList = _a.fileList, qunjSeal = _a.qunjSeal, qunjSealChange = _a.qunjSealChange, electronicSeal = _a.electronicSealIdList, 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, flowId = _a.flowId, deptId = _a.deptId, canEdit = _a.canEdit, flowStatus = _a.flowStatus, caseId = _a.caseId, contract_id = _a.contractId, docAttachMap = _a.docAttachMap, checkAttachIdList = _a.checkAttachIdList, // 已盖章附件id
54
- documentIdList = _a.documentIdList;
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,6 +246,7 @@ 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',
@@ -214,98 +313,141 @@ var Sinatures = function (_a) {
214
313
  render: function (text, record, index) { return "" + (index + 1); },
215
314
  },
216
315
  {
217
- title: '附件类型',
218
- key: 'attachTypeName',
219
- dataIndex: 'attachTypeName',
316
+ title: '附件',
317
+ children: [
318
+ {
319
+ title: '类型',
320
+ key: 'attachTypeName',
321
+ dataIndex: 'attachTypeName',
322
+ width: 100,
323
+ },
324
+ {
325
+ title: function () {
326
+ return (React.createElement("div", { className: "seal-file-upload" },
327
+ React.createElement("span", null, "\u540D\u79F0"),
328
+ React.createElement("span", null, isUpload && (React.createElement(Upload, { apiBaseUrl: ZT_API_BASEURL, method: "post", showTable: false, showTip: false, headers: {
329
+ 'Zmdms-Auth': authToken,
330
+ }, data: uploadData, authToken: authToken, callback: uploadCallbackFn, originFileList: originFileList, style: { margin: 0 } },
331
+ React.createElement(Button, { type: "link" }, "\u6DFB\u52A0\u9644\u4EF6"))))));
332
+ },
333
+ key: 'attachId',
334
+ dataIndex: 'attachId',
335
+ width: 240,
336
+ render: function (text, record, index) {
337
+ return (React.createElement(React.Fragment, null,
338
+ 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 })));
339
+ },
340
+ },
341
+ ],
220
342
  },
221
343
  {
222
- title: function () {
223
- return (React.createElement("div", { className: "seal-file-upload" },
224
- React.createElement("span", null, "\u9644\u4EF6"),
225
- React.createElement("span", null, isUpload && (React.createElement(Upload, { apiBaseUrl: ZT_API_BASEURL, method: "post", showTable: false, showTip: false, headers: {
226
- 'Zmdms-Auth': authToken,
227
- }, data: uploadData, authToken: authToken, callback: uploadCallbackFn, originFileList: originFileList, style: { margin: 0 } },
228
- React.createElement(Button, { type: "link" }, "\u6DFB\u52A0\u9644\u4EF6"))))));
229
- },
230
- key: 'attachId',
231
- dataIndex: 'attachId',
232
- render: function (text, record, index) {
233
- return (React.createElement(React.Fragment, null,
234
- 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 }),
235
- NEED_SAVE_TEMPLATE.includes("" + flowId) ? (React.createElement(Checkbox, { checked: record.isCustomerReference, disabled: !isEdit, onChange: function (e) {
236
- return onCheckboxChangeHandle(e, 'isCustomerReference', index);
237
- } }, "\u5B58\u6837\u677F")) : ('')));
238
- },
344
+ title: '合同',
345
+ key: 'needDg',
346
+ dataIndex: 'needDg',
347
+ children: [
348
+ {
349
+ title: '合同比对模板',
350
+ key: 'templateAttachId',
351
+ dataIndex: 'templateAttachId',
352
+ width: 160,
353
+ render: function (text, record, index) {
354
+ return record.attachTypeName === '合同本身' ? (React.createElement(TemplateAttach, { record: record, index: index, openCustomerModalHandle: openCustomerModalHandle, isEdit: isEdit })) : ('');
355
+ },
356
+ },
357
+ {
358
+ title: '合同比对结果',
359
+ key: 'compareAttachId',
360
+ dataIndex: 'compareAttachId',
361
+ width: 100,
362
+ render: function (text, record, index) {
363
+ return record.attachTypeName === '合同本身' ? (React.createElement(CompareResult, { record: record, index: index, request: request, getTaskId: getTaskId, isEdit: isEdit })) : ('');
364
+ },
365
+ },
366
+ {
367
+ title: '保存为模版',
368
+ key: 'templateAttachId',
369
+ dataIndex: 'templateAttachId',
370
+ width: 80,
371
+ render: function (text, record, index) {
372
+ return NEED_SAVE_TEMPLATE.includes("" + flowId) ? (React.createElement(Switch, { checked: record.isCustomerReference, disabled: !isEdit, onChange: function (value) {
373
+ return onSwitchChangeHandle(value, 'isCustomerReference', index);
374
+ } })) : ('');
375
+ },
376
+ },
377
+ ],
239
378
  },
240
379
  {
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: '添加水印',
380
+ title: isEdit ? '添加水印' : '水印',
280
381
  key: 'isWatermark',
281
382
  dataIndex: 'isWatermark',
282
- width: 100,
383
+ width: 60,
283
384
  render: function (text, record, index) {
284
- return (React.createElement(React.Fragment, null,
285
- React.createElement(Checkbox, { checked: text, disabled: !isEdit, onChange: function (e) { return onCheckboxChangeHandle(e, 'isWatermark', index); } }, "\u662F"),
286
- !isEdit && (React.createElement(Button, { type: "link", onClick: function () { return downFileFn(record); } }, "\u4E0B\u8F7D\u6C34\u5370\u9644\u4EF6"))));
385
+ return (React.createElement(Switch, { checked: text, disabled: !isEdit, onChange: function (value) {
386
+ return onSwitchChangeHandle(value, 'isWatermark', index);
387
+ } }));
287
388
  },
288
389
  },
289
390
  {
290
391
  title: '电子印章',
291
- key: 'electronicSeal',
292
- dataIndex: 'electronicSeal',
293
- render: function (value, row, index) {
294
- var obj = {
295
- children: (React.createElement(ElectronicSeal, { value: electronicSeal, request: request, flowId: flowId, deptId: deptId, onChange: electronicSealChangeHandle, isEdit: isEdit })),
296
- props: {},
297
- };
298
- obj.props['rowSpan'] = index === 0 ? records.length : 0;
299
- return obj;
300
- },
392
+ key: 'needQys',
393
+ dataIndex: 'needQys',
394
+ children: [
395
+ {
396
+ title: '盖电子印章',
397
+ key: 'isElectronicSeal',
398
+ dataIndex: 'isElectronicSeal',
399
+ width: 80,
400
+ render: function (text, record, index) {
401
+ return (React.createElement(Switch, { checked: text, disabled: !isEdit, onChange: function (value) {
402
+ return onSwitchChangeHandle(value, 'isElectronicSeal', index);
403
+ } }));
404
+ },
405
+ },
406
+ {
407
+ title: '选择电子印章',
408
+ key: 'electronicSeal',
409
+ dataIndex: 'electronicSeal',
410
+ width: '20%',
411
+ render: function (value, row, index) {
412
+ var obj = {
413
+ children: (React.createElement(ElectronicSeal, { value: electronicSeal, onChange: electronicSealChangeHandle, isEdit: isEdit, electronicList: electronicList })),
414
+ props: {},
415
+ };
416
+ obj.props['rowSpan'] = index === 0 ? records.length : 0;
417
+ return obj;
418
+ },
419
+ },
420
+ {
421
+ title: '电子印章设置',
422
+ key: 'setElectronicSeal',
423
+ dataIndex: 'setElectronicSeal',
424
+ width: 95,
425
+ render: function (value, row, index) {
426
+ var Comp = function () {
427
+ return records.length !== 0 ? (React.createElement("div", { style: { height: '100%', paddingTop: '23px' } },
428
+ React.createElement(Button, { type: "link", style: __assign({}, (checkSealVisible && isEdit
429
+ ? {}
430
+ : { display: 'none' })), size: "small", onClick: checkSealFn }, "\u6307\u5B9A\u7B7E\u7F72\u4F4D\u7F6E"),
431
+ 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));
432
+ };
433
+ var obj = {
434
+ children: React.createElement(Comp, null),
435
+ props: {},
436
+ };
437
+ obj.props['rowSpan'] = index === 0 ? records.length : 0;
438
+ return obj;
439
+ },
440
+ },
441
+ ],
301
442
  },
302
443
  {
303
444
  title: '群杰印章',
304
445
  key: 'qunjSeal',
305
446
  dataIndex: 'qunjSeal',
447
+ width: 240,
306
448
  render: function (value, row, index) {
307
449
  var obj = {
308
- children: (React.createElement(QunjSeal, { value: qunjSeal, onChange: qunjSealChangeHandle, request: request, flowId: flowId, caseId: caseId, ZT_API_BASEURL: ZT_API_BASEURL, isEdit: isEdit, handleRef: handleRef, isOnlyQunj: isOnlyQunj, showContranctNum: showContranctNum })),
450
+ 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
451
  props: {},
310
452
  };
311
453
  obj.props['rowSpan'] = index === 0 ? records.length : 0;
@@ -322,52 +464,40 @@ var Sinatures = function (_a) {
322
464
  columnsLast = columnsLast.filter(function (item) { return !['attachTypeName'].includes(item.key); });
323
465
  }
324
466
  if (!needDg) {
325
- columnsLast = columnsLast.filter(function (item) {
326
- return !['attachTypeName', 'templateAttachId', 'compareAttachId'].includes(item.key);
327
- });
467
+ columnsLast = columnsLast.filter(function (item) { return !['needDg'].includes(item.key); });
328
468
  }
329
469
  if (!needQys) {
330
- columnsLast = columnsLast.filter(function (item) {
331
- return !['isWatermark', 'isElectronicSeal', 'electronicSeal'].includes(item.key);
332
- });
470
+ columnsLast = columnsLast.filter(function (item) { return !['isWatermark', 'needQys'].includes(item.key); });
333
471
  }
334
472
  // 上传组件的数据
335
- var _l = useState(), originFileList = _l[0], setOriginFileList = _l[1];
473
+ var _q = useState(), originFileList = _q[0], setOriginFileList = _q[1];
336
474
  /** 签章组件onChange事件 */
337
475
  var sigValuesChange = function (type, value) {
338
476
  var _a, _b;
339
477
  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
478
  Reflect.deleteProperty(info, type);
341
479
  info[type] = value;
342
- return info;
480
+ return __assign(__assign({}, otherParams), info);
343
481
  };
344
482
  // 是否存入样板 添加水印 电子印章发生改变触发事件
345
- function onCheckboxChangeHandle(e, type, index) {
483
+ function onSwitchChangeHandle(value, type, index) {
346
484
  if (type === 'isElectronicSeal') {
347
485
  var hasElecSeal = records.filter(function (item) { return item.isElectronicSeal; });
348
486
  // 勾选加盖电子印章后 显示确认盖章按钮
349
- setCheckSealVisible(e.target.checked ? true : hasElecSeal.length > 1 ? true : false);
487
+ setCheckSealVisible(value ? true : hasElecSeal.length > 1 ? true : false);
488
+ // 去除加盖电子印章勾选时 清除合同id 等之前的信息
489
+ if (!value) {
490
+ setSealedIds(__spreadArray([], sealedIds));
491
+ setContractId('');
492
+ setAttachMap(null);
493
+ setDocumentIds([]);
494
+ }
350
495
  }
351
496
  setRecords(function (preRecords) {
352
497
  var _a;
353
498
  var newRecords = preRecords.slice();
354
- // 勾选添加水印的前提 需要勾选加盖电子印章
355
- // if (type === 'isWatermark' && !newRecords[index].isElectronicSeal) {
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));
499
+ newRecords.splice(index, 1, __assign(__assign({}, newRecords[index]), (_a = {}, _a[type] = value ? 1 : 0, _a)));
500
+ onSigValuesChange(sigValuesChange('fileList', newRecords));
371
501
  return newRecords;
372
502
  });
373
503
  }
@@ -403,14 +533,14 @@ var Sinatures = function (_a) {
403
533
  function qunjSealChangeHandle(value) {
404
534
  qunjSealChange && qunjSealChange(value);
405
535
  setQunjSeal(value);
406
- onSigValuesChange && onSigValuesChange(sigValuesChange('qunjSeal', value));
536
+ onSigValuesChange(sigValuesChange('qunjSeal', value));
407
537
  }
408
538
  /** 电子印章修改 */
409
539
  function electronicSealChangeHandle(value) {
410
540
  electronicSealChange && electronicSealChange(value);
411
541
  setElectronicSeal(value);
412
- onSigValuesChange &&
413
- onSigValuesChange(sigValuesChange('electronicSealIdList', value));
542
+ onSigValuesChange(sigValuesChange('electronicSealIdList', value));
543
+ isSure && setIsSure(false);
414
544
  }
415
545
  /**
416
546
  * 暴露方法给外部调用
@@ -445,7 +575,24 @@ var Sinatures = function (_a) {
445
575
  },
446
576
  /** 签章组件相关校验 */
447
577
  validateSealFn: function () {
448
- var _a;
578
+ var _a, _b;
579
+ // 确认盖章后 勾选的信息有更改
580
+ if (((_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) &&
581
+ !isSure) {
582
+ Modal.confirm({
583
+ title: '当前所勾选的电子印章信息与上一次盖章时有差异,请确认是否继续?',
584
+ okText: '是',
585
+ okType: 'danger',
586
+ cancelText: '否',
587
+ onOk: function () {
588
+ setIsSure(true);
589
+ },
590
+ onCancel: function () {
591
+ setIsSure(false);
592
+ },
593
+ });
594
+ return false;
595
+ }
449
596
  // 是否有勾选加盖电子印章
450
597
  var hasElectronicSeal = records === null || records === void 0 ? void 0 : records.some(function (item) { return !!item.isElectronicSeal; });
451
598
  // 勾选加盖电子印章时未勾选电子印章
@@ -470,7 +617,7 @@ var Sinatures = function (_a) {
470
617
  return false;
471
618
  }
472
619
  // 勾选的群杰印章 没有填用印次数
473
- if (((_a = innerQunjSeal === null || innerQunjSeal === void 0 ? void 0 : innerQunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) > 0) {
620
+ if (((_b = innerQunjSeal === null || innerQunjSeal === void 0 ? void 0 : innerQunjSeal.details) === null || _b === void 0 ? void 0 : _b.length) > 0) {
474
621
  innerQunjSeal.details.forEach(function (item) {
475
622
  if (!item.sealCount) {
476
623
  message.warning("\u8BF7\u586B\u5199" + item.sealName + " \u7684\u7528\u5370\u6B21\u6570\uFF01");
@@ -488,7 +635,22 @@ var Sinatures = function (_a) {
488
635
  return true;
489
636
  },
490
637
  }); });
491
- return (React.createElement(React.Fragment, null,
492
- React.createElement(Table, { columns: columnsLast, rowKey: "attachId", dataSource: records, scroll: { x: true } })));
638
+ var detail = {
639
+ contractId: contract_id,
640
+ records: records,
641
+ electronicSealIdList: electronicSeal,
642
+ qunjSeal: qunjSeal,
643
+ ZT_API_BASEURL: ZT_API_BASEURL,
644
+ ZT_FILE_BASEURL: ZT_FILE_BASEURL,
645
+ token: token,
646
+ viewSealPageFn: viewSealPageFn,
647
+ electronicList: electronicList,
648
+ sealList: sealList,
649
+ querySealStatus: querySealStatus,
650
+ flow_status: FLOW_STATUS[flowStatus],
651
+ needQj: needQj,
652
+ needQys: needQys,
653
+ };
654
+ 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
655
  };
494
656
  export default Sinatures;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztxkui",
3
- "version": "3.4.4",
3
+ "version": "3.4.5",
4
4
  "private": false,
5
5
  "description": "React components library",
6
6
  "author": "zt-front-end",