ztxkui 3.9.9 → 3.9.11
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.
|
@@ -3,5 +3,19 @@
|
|
|
3
3
|
* @description 可编辑表格
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
|
+
declare type numType = number | string;
|
|
7
|
+
/**
|
|
8
|
+
* 精确加法
|
|
9
|
+
*/
|
|
10
|
+
export declare function plus(num1: numType, num2: numType, ...others: numType[]): number;
|
|
11
|
+
/**
|
|
12
|
+
* 精确减法
|
|
13
|
+
*/
|
|
14
|
+
export declare function minus(num1: numType, num2: numType, ...others: numType[]): number;
|
|
15
|
+
/**
|
|
16
|
+
* 精确乘法
|
|
17
|
+
*/
|
|
18
|
+
export declare function times(num1: numType, num2: numType, ...others: numType[]): number;
|
|
19
|
+
export declare function divide(num1: numType, num2: numType, ...others: numType[]): number;
|
|
6
20
|
declare const EditableTable: React.FC;
|
|
7
21
|
export default EditableTable;
|
|
@@ -45,6 +45,11 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
49
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
50
|
+
to[j] = from[i];
|
|
51
|
+
return to;
|
|
52
|
+
};
|
|
48
53
|
/**
|
|
49
54
|
* @author 陈亚雄
|
|
50
55
|
* @description 可编辑表格
|
|
@@ -57,8 +62,90 @@ import { Table, EnhanceSelect, Button, message } from '../index';
|
|
|
57
62
|
// store
|
|
58
63
|
// 自定义组件
|
|
59
64
|
// 其他文件
|
|
65
|
+
import { times as _times, exactRound, toThousand, plus as _plus, minus as _minus, divide as _divide, } from 'ztxkutils/dist/tools';
|
|
60
66
|
import update from 'immutability-helper';
|
|
61
67
|
import { dataSource, list1 } from './data';
|
|
68
|
+
/**
|
|
69
|
+
* 精确加法
|
|
70
|
+
*/
|
|
71
|
+
export function plus(num1, num2) {
|
|
72
|
+
var others = [];
|
|
73
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
74
|
+
others[_i - 2] = arguments[_i];
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
var _num1 = isNaN(Number(num1)) ? num1 : Number(num1);
|
|
78
|
+
var _num2 = isNaN(Number(num2)) ? num2 : Number(num2);
|
|
79
|
+
var _others = Array.isArray(others)
|
|
80
|
+
? others === null || others === void 0 ? void 0 : others.map(function (item) { return (isNaN(Number(item)) ? item : Number(item)); })
|
|
81
|
+
: [];
|
|
82
|
+
return _plus.apply(void 0, __spreadArray([_num1, _num2], _others));
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
console.log(err);
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* 精确减法
|
|
91
|
+
*/
|
|
92
|
+
export function minus(num1, num2) {
|
|
93
|
+
var others = [];
|
|
94
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
95
|
+
others[_i - 2] = arguments[_i];
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
var _num1 = isNaN(Number(num1)) ? num1 : Number(num1);
|
|
99
|
+
var _num2 = isNaN(Number(num2)) ? num2 : Number(num2);
|
|
100
|
+
var _others = Array.isArray(others)
|
|
101
|
+
? others === null || others === void 0 ? void 0 : others.map(function (item) { return (isNaN(Number(item)) ? item : Number(item)); })
|
|
102
|
+
: [];
|
|
103
|
+
return _minus.apply(void 0, __spreadArray([_num1, _num2], _others));
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
console.log(err);
|
|
107
|
+
return 0;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* 精确乘法
|
|
112
|
+
*/
|
|
113
|
+
export function times(num1, num2) {
|
|
114
|
+
var others = [];
|
|
115
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
116
|
+
others[_i - 2] = arguments[_i];
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
var _num1 = isNaN(Number(num1)) ? num1 : Number(num1);
|
|
120
|
+
var _num2 = isNaN(Number(num2)) ? num2 : Number(num2);
|
|
121
|
+
var _others = Array.isArray(others)
|
|
122
|
+
? others === null || others === void 0 ? void 0 : others.map(function (item) { return (isNaN(Number(item)) ? item : Number(item)); })
|
|
123
|
+
: [];
|
|
124
|
+
return _times.apply(void 0, __spreadArray([_num1, _num2], _others));
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
console.log(err);
|
|
128
|
+
return 0;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
export function divide(num1, num2) {
|
|
132
|
+
var others = [];
|
|
133
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
134
|
+
others[_i - 2] = arguments[_i];
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
var _num1 = isNaN(Number(num1)) ? num1 : Number(num1);
|
|
138
|
+
var _num2 = isNaN(Number(num2)) ? num2 : Number(num2);
|
|
139
|
+
var _others = Array.isArray(others)
|
|
140
|
+
? others === null || others === void 0 ? void 0 : others.map(function (item) { return (isNaN(Number(item)) ? item : Number(item)); })
|
|
141
|
+
: [];
|
|
142
|
+
return _divide.apply(void 0, __spreadArray([_num1, _num2], _others));
|
|
143
|
+
}
|
|
144
|
+
catch (err) {
|
|
145
|
+
console.log(err);
|
|
146
|
+
return 0;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
62
149
|
var EditableTable = function () {
|
|
63
150
|
var _a = useState(dataSource), records = _a[0], setRecords = _a[1];
|
|
64
151
|
var recordsRef = useRef([]);
|
|
@@ -122,6 +209,13 @@ var EditableTable = function () {
|
|
|
122
209
|
dataIndex: 'test111',
|
|
123
210
|
key: 'test111',
|
|
124
211
|
editable: true,
|
|
212
|
+
editableConfig: {
|
|
213
|
+
type: 'inputNumber',
|
|
214
|
+
placeholder: '输入',
|
|
215
|
+
min: 0,
|
|
216
|
+
precision: 2,
|
|
217
|
+
formatterType: 'currency',
|
|
218
|
+
},
|
|
125
219
|
validate: {},
|
|
126
220
|
shouldCellUpdate: function (record, preRecord) {
|
|
127
221
|
if (firstRender) {
|
|
@@ -185,6 +279,33 @@ var EditableTable = function () {
|
|
|
185
279
|
return record.test2 !== preRecord.test2;
|
|
186
280
|
},
|
|
187
281
|
},
|
|
282
|
+
{
|
|
283
|
+
title: "\u91D1\u989D(\u542B\u7A0E)",
|
|
284
|
+
width: 130,
|
|
285
|
+
dataIndex: 'orderAmount',
|
|
286
|
+
key: 'orderAmount',
|
|
287
|
+
align: 'center',
|
|
288
|
+
editable: false,
|
|
289
|
+
shouldCellUpdate: function (record, preRecord) {
|
|
290
|
+
if (lengthChange) {
|
|
291
|
+
setLengthChange(false);
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
294
|
+
if (moveChange) {
|
|
295
|
+
setMoveChange(false);
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
return (record.test111 !== preRecord.test111 ||
|
|
299
|
+
record.test2 !== preRecord.test2);
|
|
300
|
+
},
|
|
301
|
+
render: function (text, record, index) {
|
|
302
|
+
// const value =
|
|
303
|
+
// Number(record?.orderPurchasePrice) * Number(record?.orderQuantity);
|
|
304
|
+
var value = divide((record === null || record === void 0 ? void 0 : record.test2) || 0, (record === null || record === void 0 ? void 0 : record.test111) || 0);
|
|
305
|
+
console.log(record === null || record === void 0 ? void 0 : record.test111, record === null || record === void 0 ? void 0 : record.test2, value);
|
|
306
|
+
return React.createElement("div", null, toThousand(exactRound(value || 0, 2)));
|
|
307
|
+
},
|
|
308
|
+
},
|
|
188
309
|
{
|
|
189
310
|
title: '测试3',
|
|
190
311
|
width: 100,
|
|
@@ -328,6 +449,7 @@ var EditableTable = function () {
|
|
|
328
449
|
}, [setRecords]);
|
|
329
450
|
// 表格改变
|
|
330
451
|
var onTableChange = useCallback(function (changeRecords, startIndex) {
|
|
452
|
+
console.log(changeRecords);
|
|
331
453
|
if (!Array.isArray(changeRecords)) {
|
|
332
454
|
return;
|
|
333
455
|
}
|
|
@@ -133,7 +133,7 @@ var PrintContainer = function (_a) {
|
|
|
133
133
|
useEffect(function () {
|
|
134
134
|
if (deptId && flowId && request) {
|
|
135
135
|
loadSealPromise = request({
|
|
136
|
-
url: '/api/zmdms-resource/flowdeptseal/
|
|
136
|
+
url: '/api/zmdms-resource/flowdeptseal/select-seal-info-list',
|
|
137
137
|
method: 'GET',
|
|
138
138
|
params: {
|
|
139
139
|
size: 200,
|
|
@@ -9,6 +9,42 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (_) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
12
48
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
49
|
var t = {};
|
|
14
50
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -29,7 +65,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
29
65
|
* @author 陈亚雄
|
|
30
66
|
* @description 电子签章组件
|
|
31
67
|
*/
|
|
32
|
-
import React, { useImperativeHandle, useCallback, useState, useMemo, useEffect, } from 'react';
|
|
68
|
+
import React, { useImperativeHandle, useCallback, useState, useMemo, useEffect, useRef, } from 'react';
|
|
33
69
|
// redux
|
|
34
70
|
// ztxkui公共组件
|
|
35
71
|
import { Table, Upload, message, Button, Modal, Checkbox, Form, } from '../../../index';
|
|
@@ -111,6 +147,17 @@ var Sinatures = function (_a) {
|
|
|
111
147
|
var _t = useState(false), tbloading = _t[0], setTbLoading = _t[1];
|
|
112
148
|
// 仅需要群杰印章
|
|
113
149
|
var _u = useState(false), isOnlyQj = _u[0], setIsOnlyQj = _u[1];
|
|
150
|
+
// 存放onSigValuesChange缓存回调方法
|
|
151
|
+
var fnRef = useRef();
|
|
152
|
+
// 是否加盖经济责任人手签章
|
|
153
|
+
var _v = useState(true), isEconomic = _v[0], setIsEconomic = _v[1];
|
|
154
|
+
// 一级责任人名字
|
|
155
|
+
var _w = useState(''), yjzrr = _w[0], setYjzrr = _w[1];
|
|
156
|
+
// 上一次盖章所勾选的电子印章列表
|
|
157
|
+
var _x = useState([]), oldSealIdList = _x[0], setOldSealIdList = _x[1];
|
|
158
|
+
useEffect(function () {
|
|
159
|
+
fnRef.current = onSigValuesChange;
|
|
160
|
+
}, [onSigValuesChange]);
|
|
114
161
|
useEffect(function () {
|
|
115
162
|
// 是否有勾选加盖电子印章
|
|
116
163
|
if (isInit) {
|
|
@@ -120,12 +167,24 @@ var Sinatures = function (_a) {
|
|
|
120
167
|
setSealedIds(checkAttachIdList || []);
|
|
121
168
|
setAttachMap(docAttachMap);
|
|
122
169
|
setDocumentIds(documentIdList);
|
|
170
|
+
setOldSealIdList(electronicSeal);
|
|
171
|
+
// 从docAttachMap中获取是否加盖经济责任人手签章
|
|
172
|
+
if (typeof docAttachMap === 'string') {
|
|
173
|
+
var _isEconomic = Object.entries(JSON.parse(docAttachMap)).find(function (_a) {
|
|
174
|
+
var key = _a[0], value = _a[1];
|
|
175
|
+
return key === 'needYjzrr';
|
|
176
|
+
});
|
|
177
|
+
if (_isEconomic && typeof _isEconomic[1] === 'string') {
|
|
178
|
+
setIsEconomic(_isEconomic[1] === 'false' ? false : true);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
123
181
|
}
|
|
124
182
|
else {
|
|
125
183
|
setContractId(null);
|
|
126
184
|
setSealedIds([]);
|
|
127
185
|
setAttachMap(null);
|
|
128
186
|
setDocumentIds([]);
|
|
187
|
+
setIsEconomic(false);
|
|
129
188
|
}
|
|
130
189
|
if ((records === null || records === void 0 ? void 0 : records.length) > 0) {
|
|
131
190
|
setIsInit(false);
|
|
@@ -136,6 +195,7 @@ var Sinatures = function (_a) {
|
|
|
136
195
|
contract_id,
|
|
137
196
|
docAttachMap,
|
|
138
197
|
documentIdList,
|
|
198
|
+
electronicSeal,
|
|
139
199
|
isInit,
|
|
140
200
|
records,
|
|
141
201
|
]);
|
|
@@ -149,6 +209,12 @@ var Sinatures = function (_a) {
|
|
|
149
209
|
qunjSealChangeHandle(_value);
|
|
150
210
|
setChecked(e.target.checked);
|
|
151
211
|
};
|
|
212
|
+
/** 是否加盖经济责任人手签章 */
|
|
213
|
+
var needEconomic = function (e) {
|
|
214
|
+
setIsEconomic(e.target.checked);
|
|
215
|
+
onSigValuesChange &&
|
|
216
|
+
onSigValuesChange(sigValuesChange('needYjzrr', e.target.checked));
|
|
217
|
+
};
|
|
152
218
|
/** 查询用印状态 */
|
|
153
219
|
var querySealStatus = function () {
|
|
154
220
|
var url = ZT_API_BASEURL + "/api/zmdms-esb-outer/outer/qj/view-stamp?caseId=" + caseId + "&systemId=1493475945847648257";
|
|
@@ -164,7 +230,7 @@ var Sinatures = function (_a) {
|
|
|
164
230
|
params.flowId = flowId;
|
|
165
231
|
}
|
|
166
232
|
request({
|
|
167
|
-
url: '/api/zmdms-resource/flowdeptseal/
|
|
233
|
+
url: '/api/zmdms-resource/flowdeptseal/select-seal-info-list',
|
|
168
234
|
params: params,
|
|
169
235
|
method: 'GET',
|
|
170
236
|
})
|
|
@@ -203,6 +269,25 @@ var Sinatures = function (_a) {
|
|
|
203
269
|
message.error(((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.msg) || '请求失败!');
|
|
204
270
|
});
|
|
205
271
|
}, [deptId, flowId, request]);
|
|
272
|
+
/** 获取一级责任人名字 */
|
|
273
|
+
var getYjzrrName = useCallback(function () {
|
|
274
|
+
request({
|
|
275
|
+
url: "/api/zmdms-resource/seal/get-yjzrr-name/" + deptId,
|
|
276
|
+
method: 'GET',
|
|
277
|
+
})
|
|
278
|
+
.then(function (res) {
|
|
279
|
+
var _a, _b, _c;
|
|
280
|
+
if (res.status === 200 && ((_a = res.data) === null || _a === void 0 ? void 0 : _a.code) === 200) {
|
|
281
|
+
setYjzrr(((_b = res.data.data) === null || _b === void 0 ? void 0 : _b.userName) || '');
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
message.error(((_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.msg) || '出错了');
|
|
285
|
+
}
|
|
286
|
+
})
|
|
287
|
+
.catch(function (error) {
|
|
288
|
+
//
|
|
289
|
+
});
|
|
290
|
+
}, [deptId, request]);
|
|
206
291
|
/** 获取群杰印章列表 */
|
|
207
292
|
var getQunjSealList = useCallback(function () {
|
|
208
293
|
request({
|
|
@@ -241,13 +326,16 @@ var Sinatures = function (_a) {
|
|
|
241
326
|
useEffect(function () {
|
|
242
327
|
if (needQys) {
|
|
243
328
|
getElectronicList();
|
|
329
|
+
getYjzrrName();
|
|
244
330
|
}
|
|
245
331
|
if (needQj) {
|
|
246
332
|
getQunjSealList();
|
|
247
333
|
}
|
|
248
|
-
}, [getElectronicList, getQunjSealList, needQj, needQys]);
|
|
334
|
+
}, [getElectronicList, getQunjSealList, getYjzrrName, needQj, needQys]);
|
|
249
335
|
/** 指定签署位置 */
|
|
250
336
|
var checkSealFn = function () {
|
|
337
|
+
// 记录上一次盖章勾选的oldSealIdList
|
|
338
|
+
setOldSealIdList(innerElectronicSeal);
|
|
251
339
|
// 已勾选的附件中存在attachId为空的标识
|
|
252
340
|
var isError = false;
|
|
253
341
|
// 已勾选的要加盖电子印章的附件id列表
|
|
@@ -277,6 +365,7 @@ var Sinatures = function (_a) {
|
|
|
277
365
|
deleteAttachIdList: [],
|
|
278
366
|
docAttachMap: attachMap,
|
|
279
367
|
deptId: deptId,
|
|
368
|
+
oldSealIdList: oldSealIdList,
|
|
280
369
|
};
|
|
281
370
|
if (!contractId) {
|
|
282
371
|
setDocumentIds([]);
|
|
@@ -340,6 +429,43 @@ var Sinatures = function (_a) {
|
|
|
340
429
|
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) || '请求失败!');
|
|
341
430
|
});
|
|
342
431
|
};
|
|
432
|
+
/** 查询未确认盖章位置的印章信息列表 */
|
|
433
|
+
var getNoSealInfoList = function () {
|
|
434
|
+
return new Promise(function (resolve, reject) {
|
|
435
|
+
request({
|
|
436
|
+
url: '/api/zmdms-resource/seal/query-unconfirmed-position-seal-list',
|
|
437
|
+
data: {
|
|
438
|
+
contractId: contractId,
|
|
439
|
+
sealIdList: innerElectronicSeal,
|
|
440
|
+
deptId: deptId,
|
|
441
|
+
needYjzrr: isEconomic,
|
|
442
|
+
},
|
|
443
|
+
method: 'POST',
|
|
444
|
+
})
|
|
445
|
+
.then(function (res) {
|
|
446
|
+
var _a;
|
|
447
|
+
if ((res === null || res === void 0 ? void 0 : res.status) === 200 && ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.code) === 200) {
|
|
448
|
+
// 未确认盖章位置的印章信息列表
|
|
449
|
+
var noSealList = res.data.data;
|
|
450
|
+
if (Array.isArray(noSealList) && noSealList.length > 0) {
|
|
451
|
+
Modal.info({
|
|
452
|
+
title: '下列印章未确认盖章位置,如不需要请取消勾选并重新点击指定签署位置按钮进行保存操作',
|
|
453
|
+
width: 800,
|
|
454
|
+
content: (React.createElement("div", null, noSealList.map(function (item) { return (React.createElement("p", null, item.sealName)); }))),
|
|
455
|
+
});
|
|
456
|
+
resolve(false);
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
resolve(true);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
})
|
|
463
|
+
.catch(function (error) {
|
|
464
|
+
var _a, _b;
|
|
465
|
+
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) || '请求失败!');
|
|
466
|
+
});
|
|
467
|
+
});
|
|
468
|
+
};
|
|
343
469
|
/** 查看盖章页面 */
|
|
344
470
|
var viewSealPageFn = function () {
|
|
345
471
|
if (contractId) {
|
|
@@ -542,8 +668,18 @@ var Sinatures = function (_a) {
|
|
|
542
668
|
render: function (value, row, index) {
|
|
543
669
|
// 是否有勾选加盖电子印章
|
|
544
670
|
var hasElectronicSeal = records === null || records === void 0 ? void 0 : records.some(function (item) { return !!item.isElectronicSeal; });
|
|
671
|
+
var _label = "\u662F\u5426\u52A0\u76D6\u7ECF\u6D4E\u8D23\u4EFB\u4EBA\u624B\u7B7E\u7AE0" + (yjzrr ? "\uFF08\u7ECF\u6D4E\u8D23\u4EFB\u4EBA: " + yjzrr + "\uFF09" : '');
|
|
545
672
|
var obj = {
|
|
546
|
-
children: (React.createElement(
|
|
673
|
+
children: (React.createElement("div", { style: { height: '100%' } },
|
|
674
|
+
React.createElement("div", { style: __assign({ height: '36px', borderBottom: '1px solid #EBEBEB', marginBottom: '5px', lineHeight: '36px' }, (yjzrr ? {} : { display: 'none' })), title: _label },
|
|
675
|
+
React.createElement(Checkbox, { checked: isEconomic, disabled: !isEdit, onChange: function (e) { return needEconomic(e); } },
|
|
676
|
+
React.createElement("div", { style: {
|
|
677
|
+
width: '300px',
|
|
678
|
+
whiteSpace: 'nowrap',
|
|
679
|
+
textOverflow: 'ellipsis',
|
|
680
|
+
overflow: 'hidden',
|
|
681
|
+
} }, _label))),
|
|
682
|
+
React.createElement(ElectronicSeal, { value: innerElectronicSeal, onChange: electronicSealChangeHandle, isEdit: hasElectronicSeal && isEdit, electronicList: electronicList, setElectronicSeal: setElectronicSeal }))),
|
|
547
683
|
props: {},
|
|
548
684
|
};
|
|
549
685
|
obj.props['rowSpan'] = index === 0 ? records.length : 0;
|
|
@@ -623,9 +759,9 @@ var Sinatures = function (_a) {
|
|
|
623
759
|
});
|
|
624
760
|
}
|
|
625
761
|
// 上传组件的数据
|
|
626
|
-
var
|
|
762
|
+
var _y = useState(), originFileList = _y[0], setOriginFileList = _y[1];
|
|
627
763
|
/** 签章组件onChange事件 */
|
|
628
|
-
var sigValuesChange = function (type, value) {
|
|
764
|
+
var sigValuesChange = useCallback(function (type, value) {
|
|
629
765
|
var _a, _b;
|
|
630
766
|
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);
|
|
631
767
|
if (type === 'clearContractPrevInfo') {
|
|
@@ -646,13 +782,14 @@ var Sinatures = function (_a) {
|
|
|
646
782
|
info[type] = value;
|
|
647
783
|
}
|
|
648
784
|
return __assign(__assign({}, otherParams), info);
|
|
649
|
-
};
|
|
785
|
+
}, [handleRef, otherParams]);
|
|
650
786
|
// 是否存入样板 添加水印 电子印章发生改变触发事件
|
|
651
787
|
function onSwitchChangeHandle(value, type, index) {
|
|
652
788
|
if (type === 'isElectronicSeal') {
|
|
653
789
|
var hasElecSeal = records.filter(function (item) { return item.isElectronicSeal; });
|
|
654
790
|
// 勾选加盖电子印章后 显示确认盖章按钮
|
|
655
791
|
setCheckSealVisible(value ? true : hasElecSeal.length > 1 ? true : false);
|
|
792
|
+
setIsEconomic(value ? true : false);
|
|
656
793
|
// 去除加盖电子印章勾选时 清除合同id 等之前的信息
|
|
657
794
|
if (!value && hasElecSeal.length === 1) {
|
|
658
795
|
setSealedIds([]);
|
|
@@ -660,6 +797,7 @@ var Sinatures = function (_a) {
|
|
|
660
797
|
setAttachMap(null);
|
|
661
798
|
setDocumentIds([]);
|
|
662
799
|
setElectronicSeal([]);
|
|
800
|
+
setOldSealIdList([]);
|
|
663
801
|
if (onSigValuesChange) {
|
|
664
802
|
onSigValuesChange(sigValuesChange('clearContractPrevInfo'));
|
|
665
803
|
}
|
|
@@ -701,20 +839,22 @@ var Sinatures = function (_a) {
|
|
|
701
839
|
});
|
|
702
840
|
});
|
|
703
841
|
console.log(successFileList_1);
|
|
842
|
+
var getNewRecord_2 = function (data) {
|
|
843
|
+
if (data === void 0) { data = []; }
|
|
844
|
+
var newRecords = __spreadArray(__spreadArray([], data), successFileList_1).filter(function (item) { return item.attachId !== '123456789'; });
|
|
845
|
+
return newRecords;
|
|
846
|
+
};
|
|
704
847
|
setRecords(function (preRecords) {
|
|
705
|
-
|
|
706
|
-
if (onSigValuesChange) {
|
|
707
|
-
onSigValuesChange(sigValuesChange('fileList', _records));
|
|
708
|
-
}
|
|
709
|
-
return _records;
|
|
848
|
+
return getNewRecord_2(preRecords);
|
|
710
849
|
});
|
|
850
|
+
if (typeof fnRef.current === 'function') {
|
|
851
|
+
fnRef.current(sigValuesChange('fileList', getNewRecord_2(records)));
|
|
852
|
+
}
|
|
711
853
|
}
|
|
712
854
|
if (filelist.every(function (item) { return item.status === 'error'; })) {
|
|
713
855
|
message.error('文件上传失败!');
|
|
714
856
|
}
|
|
715
|
-
},
|
|
716
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
717
|
-
[setRecords]);
|
|
857
|
+
}, [records, setRecords, sigValuesChange]);
|
|
718
858
|
/** 群杰印章修改 */
|
|
719
859
|
function qunjSealChangeHandle(value) {
|
|
720
860
|
qunjSealChange && qunjSealChange(value);
|
|
@@ -741,12 +881,18 @@ var Sinatures = function (_a) {
|
|
|
741
881
|
else if (flag === 'enable') {
|
|
742
882
|
setIsTotalSealNumTooMore(false);
|
|
743
883
|
}
|
|
884
|
+
var _attachMap = attachMap;
|
|
885
|
+
if (typeof _attachMap === 'string') {
|
|
886
|
+
_attachMap = JSON.parse(_attachMap);
|
|
887
|
+
_attachMap.needYjzrr = isEconomic;
|
|
888
|
+
_attachMap = JSON.stringify(_attachMap);
|
|
889
|
+
}
|
|
744
890
|
return {
|
|
745
891
|
fileList: records,
|
|
746
892
|
qunjSeal: innerQunjSeal,
|
|
747
893
|
electronicSealIdList: innerElectronicSeal,
|
|
748
894
|
checkAttachIdList: sealedIds,
|
|
749
|
-
docAttachMap:
|
|
895
|
+
docAttachMap: _attachMap,
|
|
750
896
|
documentIdList: documentIds,
|
|
751
897
|
contractId: contractId,
|
|
752
898
|
isTotalSealNumTooMore: isTotalSealNumTooMore,
|
|
@@ -761,74 +907,86 @@ var Sinatures = function (_a) {
|
|
|
761
907
|
});
|
|
762
908
|
},
|
|
763
909
|
/** 签章组件相关校验 */
|
|
764
|
-
validateSealFn: function () {
|
|
910
|
+
validateSealFn: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
911
|
+
var hasElectronicSeal;
|
|
765
912
|
var _a;
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
// 勾选加盖电子印章时未勾选电子印章
|
|
790
|
-
if (needQys &&
|
|
791
|
-
isEdit &&
|
|
792
|
-
(innerElectronicSeal === null || innerElectronicSeal === void 0 ? void 0 : innerElectronicSeal.length) === 0 &&
|
|
793
|
-
hasElectronicSeal &&
|
|
794
|
-
!isOnlyQj) {
|
|
795
|
-
message.warning('请勾选加盖电子印章所需要的印章列表!');
|
|
796
|
-
return false;
|
|
797
|
-
}
|
|
798
|
-
// 超过4倍禁止提交审批
|
|
799
|
-
if (isEdit && needQj && isTotalSealNumTooMore && showContranctNum) {
|
|
800
|
-
message.warning('您的用印次数远超超过合理次数范围,请修改。');
|
|
801
|
-
return false;
|
|
802
|
-
}
|
|
803
|
-
// 没有确认盖章
|
|
804
|
-
if (isEdit && needQys && hasElectronicSeal && !contractId && !isOnlyQj) {
|
|
805
|
-
message.warning('请点击确认盖章按钮,确认盖章位置后方可提交!');
|
|
806
|
-
return false;
|
|
807
|
-
}
|
|
808
|
-
if (isEdit && checked && needQj) {
|
|
809
|
-
// 合同份数为空
|
|
810
|
-
if (!(innerQunjSeal === null || innerQunjSeal === void 0 ? void 0 : innerQunjSeal.contranctNum) && showContranctNum) {
|
|
811
|
-
message.warning('请填写合同份数!');
|
|
812
|
-
return false;
|
|
813
|
-
}
|
|
814
|
-
// 勾选的群杰印章 没有填用印次数
|
|
815
|
-
if (((_a = innerQunjSeal === null || innerQunjSeal === void 0 ? void 0 : innerQunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
816
|
-
innerQunjSeal.details.forEach(function (item) {
|
|
817
|
-
if (!item.sealCount) {
|
|
818
|
-
message.warning("\u8BF7\u586B\u5199" + item.sealName + " \u7684\u7528\u5370\u6B21\u6570\uFF01");
|
|
913
|
+
return __generator(this, function (_b) {
|
|
914
|
+
switch (_b.label) {
|
|
915
|
+
case 0:
|
|
916
|
+
// 确认盖章后 勾选的信息有更改
|
|
917
|
+
if (isEdit &&
|
|
918
|
+
needQys &&
|
|
919
|
+
(prevParam === null || prevParam === void 0 ? void 0 : prevParam.sealIdList) &&
|
|
920
|
+
(prevParam === null || prevParam === void 0 ? void 0 : prevParam.sealIdList.length) !== (innerElectronicSeal === null || innerElectronicSeal === void 0 ? void 0 : innerElectronicSeal.length) &&
|
|
921
|
+
!isSure &&
|
|
922
|
+
!isOnlyQj) {
|
|
923
|
+
Modal.confirm({
|
|
924
|
+
title: '当前所勾选的电子印章信息与上一次盖章时有差异,请确认是否继续?',
|
|
925
|
+
okText: '是',
|
|
926
|
+
okType: 'danger',
|
|
927
|
+
cancelText: '否',
|
|
928
|
+
onOk: function () {
|
|
929
|
+
setIsSure(true);
|
|
930
|
+
},
|
|
931
|
+
onCancel: function () {
|
|
932
|
+
setIsSure(false);
|
|
933
|
+
},
|
|
934
|
+
});
|
|
935
|
+
return [2 /*return*/, false];
|
|
819
936
|
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
937
|
+
hasElectronicSeal = records === null || records === void 0 ? void 0 : records.some(function (item) { return !!item.isElectronicSeal; });
|
|
938
|
+
// 勾选加盖电子印章时未勾选电子印章
|
|
939
|
+
if (needQys &&
|
|
940
|
+
isEdit &&
|
|
941
|
+
(innerElectronicSeal === null || innerElectronicSeal === void 0 ? void 0 : innerElectronicSeal.length) === 0 &&
|
|
942
|
+
hasElectronicSeal &&
|
|
943
|
+
!isOnlyQj) {
|
|
944
|
+
message.warning('请勾选加盖电子印章所需要的印章列表!');
|
|
945
|
+
return [2 /*return*/, false];
|
|
946
|
+
}
|
|
947
|
+
if (!(needQys &&
|
|
948
|
+
isEdit &&
|
|
949
|
+
hasElectronicSeal &&
|
|
950
|
+
(innerElectronicSeal === null || innerElectronicSeal === void 0 ? void 0 : innerElectronicSeal.length) > 0)) return [3 /*break*/, 2];
|
|
951
|
+
return [4 /*yield*/, getNoSealInfoList()];
|
|
952
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
953
|
+
case 2:
|
|
954
|
+
// 超过4倍禁止提交审批
|
|
955
|
+
if (isEdit && needQj && isTotalSealNumTooMore && showContranctNum) {
|
|
956
|
+
message.warning('您的用印次数远超超过合理次数范围,请修改。');
|
|
957
|
+
return [2 /*return*/, false];
|
|
958
|
+
}
|
|
959
|
+
// 没有确认盖章
|
|
960
|
+
if (isEdit && needQys && hasElectronicSeal && !contractId && !isOnlyQj) {
|
|
961
|
+
message.warning('请点击确认盖章按钮,确认盖章位置后方可提交!');
|
|
962
|
+
return [2 /*return*/, false];
|
|
963
|
+
}
|
|
964
|
+
if (isEdit && checked && needQj) {
|
|
965
|
+
// 合同份数为空
|
|
966
|
+
if (!(innerQunjSeal === null || innerQunjSeal === void 0 ? void 0 : innerQunjSeal.contranctNum) && showContranctNum) {
|
|
967
|
+
message.warning('请填写合同份数!');
|
|
968
|
+
return [2 /*return*/, false];
|
|
969
|
+
}
|
|
970
|
+
// 勾选的群杰印章 没有填用印次数
|
|
971
|
+
if (((_a = innerQunjSeal === null || innerQunjSeal === void 0 ? void 0 : innerQunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
972
|
+
innerQunjSeal.details.forEach(function (item) {
|
|
973
|
+
if (!item.sealCount) {
|
|
974
|
+
message.warning("\u8BF7\u586B\u5199" + item.sealName + " \u7684\u7528\u5370\u6B21\u6570\uFF01");
|
|
975
|
+
}
|
|
976
|
+
});
|
|
977
|
+
if (innerQunjSeal.details.filter(function (item) { return !item.sealCount; }).length > 0) {
|
|
978
|
+
return [2 /*return*/, false];
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
else {
|
|
982
|
+
message.warning('请选择群杰用印!');
|
|
983
|
+
return [2 /*return*/, false];
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
return [2 /*return*/, true];
|
|
828
987
|
}
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
},
|
|
988
|
+
});
|
|
989
|
+
}); },
|
|
832
990
|
}); });
|
|
833
991
|
var detail = {
|
|
834
992
|
contractId: contract_id,
|