ztxkui 3.9.10 → 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)
|
|
@@ -113,6 +149,12 @@ var Sinatures = function (_a) {
|
|
|
113
149
|
var _u = useState(false), isOnlyQj = _u[0], setIsOnlyQj = _u[1];
|
|
114
150
|
// 存放onSigValuesChange缓存回调方法
|
|
115
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];
|
|
116
158
|
useEffect(function () {
|
|
117
159
|
fnRef.current = onSigValuesChange;
|
|
118
160
|
}, [onSigValuesChange]);
|
|
@@ -125,12 +167,24 @@ var Sinatures = function (_a) {
|
|
|
125
167
|
setSealedIds(checkAttachIdList || []);
|
|
126
168
|
setAttachMap(docAttachMap);
|
|
127
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
|
+
}
|
|
128
181
|
}
|
|
129
182
|
else {
|
|
130
183
|
setContractId(null);
|
|
131
184
|
setSealedIds([]);
|
|
132
185
|
setAttachMap(null);
|
|
133
186
|
setDocumentIds([]);
|
|
187
|
+
setIsEconomic(false);
|
|
134
188
|
}
|
|
135
189
|
if ((records === null || records === void 0 ? void 0 : records.length) > 0) {
|
|
136
190
|
setIsInit(false);
|
|
@@ -141,6 +195,7 @@ var Sinatures = function (_a) {
|
|
|
141
195
|
contract_id,
|
|
142
196
|
docAttachMap,
|
|
143
197
|
documentIdList,
|
|
198
|
+
electronicSeal,
|
|
144
199
|
isInit,
|
|
145
200
|
records,
|
|
146
201
|
]);
|
|
@@ -154,6 +209,12 @@ var Sinatures = function (_a) {
|
|
|
154
209
|
qunjSealChangeHandle(_value);
|
|
155
210
|
setChecked(e.target.checked);
|
|
156
211
|
};
|
|
212
|
+
/** 是否加盖经济责任人手签章 */
|
|
213
|
+
var needEconomic = function (e) {
|
|
214
|
+
setIsEconomic(e.target.checked);
|
|
215
|
+
onSigValuesChange &&
|
|
216
|
+
onSigValuesChange(sigValuesChange('needYjzrr', e.target.checked));
|
|
217
|
+
};
|
|
157
218
|
/** 查询用印状态 */
|
|
158
219
|
var querySealStatus = function () {
|
|
159
220
|
var url = ZT_API_BASEURL + "/api/zmdms-esb-outer/outer/qj/view-stamp?caseId=" + caseId + "&systemId=1493475945847648257";
|
|
@@ -169,7 +230,7 @@ var Sinatures = function (_a) {
|
|
|
169
230
|
params.flowId = flowId;
|
|
170
231
|
}
|
|
171
232
|
request({
|
|
172
|
-
url: '/api/zmdms-resource/flowdeptseal/
|
|
233
|
+
url: '/api/zmdms-resource/flowdeptseal/select-seal-info-list',
|
|
173
234
|
params: params,
|
|
174
235
|
method: 'GET',
|
|
175
236
|
})
|
|
@@ -208,6 +269,25 @@ var Sinatures = function (_a) {
|
|
|
208
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) || '请求失败!');
|
|
209
270
|
});
|
|
210
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]);
|
|
211
291
|
/** 获取群杰印章列表 */
|
|
212
292
|
var getQunjSealList = useCallback(function () {
|
|
213
293
|
request({
|
|
@@ -246,13 +326,16 @@ var Sinatures = function (_a) {
|
|
|
246
326
|
useEffect(function () {
|
|
247
327
|
if (needQys) {
|
|
248
328
|
getElectronicList();
|
|
329
|
+
getYjzrrName();
|
|
249
330
|
}
|
|
250
331
|
if (needQj) {
|
|
251
332
|
getQunjSealList();
|
|
252
333
|
}
|
|
253
|
-
}, [getElectronicList, getQunjSealList, needQj, needQys]);
|
|
334
|
+
}, [getElectronicList, getQunjSealList, getYjzrrName, needQj, needQys]);
|
|
254
335
|
/** 指定签署位置 */
|
|
255
336
|
var checkSealFn = function () {
|
|
337
|
+
// 记录上一次盖章勾选的oldSealIdList
|
|
338
|
+
setOldSealIdList(innerElectronicSeal);
|
|
256
339
|
// 已勾选的附件中存在attachId为空的标识
|
|
257
340
|
var isError = false;
|
|
258
341
|
// 已勾选的要加盖电子印章的附件id列表
|
|
@@ -282,6 +365,7 @@ var Sinatures = function (_a) {
|
|
|
282
365
|
deleteAttachIdList: [],
|
|
283
366
|
docAttachMap: attachMap,
|
|
284
367
|
deptId: deptId,
|
|
368
|
+
oldSealIdList: oldSealIdList,
|
|
285
369
|
};
|
|
286
370
|
if (!contractId) {
|
|
287
371
|
setDocumentIds([]);
|
|
@@ -345,6 +429,43 @@ var Sinatures = function (_a) {
|
|
|
345
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) || '请求失败!');
|
|
346
430
|
});
|
|
347
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
|
+
};
|
|
348
469
|
/** 查看盖章页面 */
|
|
349
470
|
var viewSealPageFn = function () {
|
|
350
471
|
if (contractId) {
|
|
@@ -547,8 +668,18 @@ var Sinatures = function (_a) {
|
|
|
547
668
|
render: function (value, row, index) {
|
|
548
669
|
// 是否有勾选加盖电子印章
|
|
549
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" : '');
|
|
550
672
|
var obj = {
|
|
551
|
-
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 }))),
|
|
552
683
|
props: {},
|
|
553
684
|
};
|
|
554
685
|
obj.props['rowSpan'] = index === 0 ? records.length : 0;
|
|
@@ -628,7 +759,7 @@ var Sinatures = function (_a) {
|
|
|
628
759
|
});
|
|
629
760
|
}
|
|
630
761
|
// 上传组件的数据
|
|
631
|
-
var
|
|
762
|
+
var _y = useState(), originFileList = _y[0], setOriginFileList = _y[1];
|
|
632
763
|
/** 签章组件onChange事件 */
|
|
633
764
|
var sigValuesChange = useCallback(function (type, value) {
|
|
634
765
|
var _a, _b;
|
|
@@ -658,6 +789,7 @@ var Sinatures = function (_a) {
|
|
|
658
789
|
var hasElecSeal = records.filter(function (item) { return item.isElectronicSeal; });
|
|
659
790
|
// 勾选加盖电子印章后 显示确认盖章按钮
|
|
660
791
|
setCheckSealVisible(value ? true : hasElecSeal.length > 1 ? true : false);
|
|
792
|
+
setIsEconomic(value ? true : false);
|
|
661
793
|
// 去除加盖电子印章勾选时 清除合同id 等之前的信息
|
|
662
794
|
if (!value && hasElecSeal.length === 1) {
|
|
663
795
|
setSealedIds([]);
|
|
@@ -665,6 +797,7 @@ var Sinatures = function (_a) {
|
|
|
665
797
|
setAttachMap(null);
|
|
666
798
|
setDocumentIds([]);
|
|
667
799
|
setElectronicSeal([]);
|
|
800
|
+
setOldSealIdList([]);
|
|
668
801
|
if (onSigValuesChange) {
|
|
669
802
|
onSigValuesChange(sigValuesChange('clearContractPrevInfo'));
|
|
670
803
|
}
|
|
@@ -748,12 +881,18 @@ var Sinatures = function (_a) {
|
|
|
748
881
|
else if (flag === 'enable') {
|
|
749
882
|
setIsTotalSealNumTooMore(false);
|
|
750
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
|
+
}
|
|
751
890
|
return {
|
|
752
891
|
fileList: records,
|
|
753
892
|
qunjSeal: innerQunjSeal,
|
|
754
893
|
electronicSealIdList: innerElectronicSeal,
|
|
755
894
|
checkAttachIdList: sealedIds,
|
|
756
|
-
docAttachMap:
|
|
895
|
+
docAttachMap: _attachMap,
|
|
757
896
|
documentIdList: documentIds,
|
|
758
897
|
contractId: contractId,
|
|
759
898
|
isTotalSealNumTooMore: isTotalSealNumTooMore,
|
|
@@ -768,74 +907,86 @@ var Sinatures = function (_a) {
|
|
|
768
907
|
});
|
|
769
908
|
},
|
|
770
909
|
/** 签章组件相关校验 */
|
|
771
|
-
validateSealFn: function () {
|
|
910
|
+
validateSealFn: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
911
|
+
var hasElectronicSeal;
|
|
772
912
|
var _a;
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
// 勾选加盖电子印章时未勾选电子印章
|
|
797
|
-
if (needQys &&
|
|
798
|
-
isEdit &&
|
|
799
|
-
(innerElectronicSeal === null || innerElectronicSeal === void 0 ? void 0 : innerElectronicSeal.length) === 0 &&
|
|
800
|
-
hasElectronicSeal &&
|
|
801
|
-
!isOnlyQj) {
|
|
802
|
-
message.warning('请勾选加盖电子印章所需要的印章列表!');
|
|
803
|
-
return false;
|
|
804
|
-
}
|
|
805
|
-
// 超过4倍禁止提交审批
|
|
806
|
-
if (isEdit && needQj && isTotalSealNumTooMore && showContranctNum) {
|
|
807
|
-
message.warning('您的用印次数远超超过合理次数范围,请修改。');
|
|
808
|
-
return false;
|
|
809
|
-
}
|
|
810
|
-
// 没有确认盖章
|
|
811
|
-
if (isEdit && needQys && hasElectronicSeal && !contractId && !isOnlyQj) {
|
|
812
|
-
message.warning('请点击确认盖章按钮,确认盖章位置后方可提交!');
|
|
813
|
-
return false;
|
|
814
|
-
}
|
|
815
|
-
if (isEdit && checked && needQj) {
|
|
816
|
-
// 合同份数为空
|
|
817
|
-
if (!(innerQunjSeal === null || innerQunjSeal === void 0 ? void 0 : innerQunjSeal.contranctNum) && showContranctNum) {
|
|
818
|
-
message.warning('请填写合同份数!');
|
|
819
|
-
return false;
|
|
820
|
-
}
|
|
821
|
-
// 勾选的群杰印章 没有填用印次数
|
|
822
|
-
if (((_a = innerQunjSeal === null || innerQunjSeal === void 0 ? void 0 : innerQunjSeal.details) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
823
|
-
innerQunjSeal.details.forEach(function (item) {
|
|
824
|
-
if (!item.sealCount) {
|
|
825
|
-
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];
|
|
826
936
|
}
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
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];
|
|
835
987
|
}
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
},
|
|
988
|
+
});
|
|
989
|
+
}); },
|
|
839
990
|
}); });
|
|
840
991
|
var detail = {
|
|
841
992
|
contractId: contract_id,
|