kmkf-work-order-service-component 0.3.3 → 0.3.4-alpha.2

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.
@@ -0,0 +1,34 @@
1
+ .customizeFormModalWrapper {
2
+ p,
3
+ lable {
4
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
5
+ 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
6
+ 'Noto Color Emoji';
7
+ }
8
+ // .ant-modal-body {
9
+ // overflow-x: hidden;
10
+ // overflow-y: auto;
11
+ // }
12
+ .ant-select.ant-select-single.ant-select-show-arrow.ant-select-show-search {
13
+ margin-bottom: 8px;
14
+ }
15
+ .ant-picker-suffix,
16
+ .ant-select-arrow svg {
17
+ color: #4e5969;
18
+ }
19
+ .status-payment--basic {
20
+ .ant-row.ant-form-item {
21
+ margin-bottom: 5px;
22
+ }
23
+ }
24
+ .ant-modal-footer {
25
+ margin-top: 20px;
26
+ }
27
+ .ant-input[disabled],
28
+ .ant-input-number-disabled {
29
+ border: none;
30
+ }
31
+ .ant-select-disabled .ant-select-arrow svg {
32
+ color: #c9cdd4;
33
+ }
34
+ }
@@ -32,7 +32,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
32
32
 
33
33
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
34
34
 
35
- import React, { useState, useMemo, useCallback, useEffect } from 'react';
35
+ import React, { useState, useMemo, useCallback, useEffect, useRef } from 'react';
36
36
  import { useSelector, useDispatch } from 'react-redux';
37
37
  import { Drawer, Form, Spin, ConfigProvider, Button, message, Space } from 'antd';
38
38
  import { LeftOutlined } from '@ant-design/icons';
@@ -40,9 +40,9 @@ import { get, find, some, set, debounce } from 'lodash';
40
40
  import zhCN from 'antd/es/locale/zh_CN';
41
41
  import moment from 'moment';
42
42
  import 'moment/locale/zh-cn';
43
- import { calcWorkOrderList, submitDataTransOldFormat, orderBack } from "../../../../../common/utils/tools";
43
+ import { calcWorkOrderList, submitDataTransOldFormat, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME } from "../../../../../common/utils/tools";
44
44
  import { factory } from "../../../Widget";
45
- import { queryTemplateDetail, addWorkOrder, queryWorkOrderDetail, updateWorkOrder } from "../../../../../model/servers/api";
45
+ import { queryTemplateDetail, addWorkOrder, queryWorkOrderDetail, updateWorkOrder, replaceCheck } from "../../../../../model/servers/api";
46
46
  import { selectorFormModalVisible } from "../../../../../model/customizeWorkOrder/selector";
47
47
  import { setFormModalVisible } from "../../../../../model/customizeWorkOrder";
48
48
  import { selectorCurrentCustomizeRecord } from "../../../../../model/customizeWorkOrder/selector";
@@ -81,6 +81,12 @@ var CustomizeFormModal = function CustomizeFormModal(props) {
81
81
  workOrderDetail = _useState6[0],
82
82
  setWorkOrderDetail = _useState6[1];
83
83
 
84
+ var _useState7 = useState({}),
85
+ _useState8 = _slicedToArray(_useState7, 2),
86
+ replaceValue = _useState8[0],
87
+ setReplaceValue = _useState8[1]; //字段重复校验
88
+
89
+
84
90
  var visible = useSelector(selectorFormModalVisible);
85
91
 
86
92
  var _Form$useForm = Form.useForm(),
@@ -88,6 +94,7 @@ var CustomizeFormModal = function CustomizeFormModal(props) {
88
94
  form = _Form$useForm2[0];
89
95
 
90
96
  var dispatch = useDispatch();
97
+ var time = useRef();
91
98
  useEffect(function () {
92
99
  if (visible) {
93
100
  queryDetail({
@@ -100,6 +107,7 @@ var CustomizeFormModal = function CustomizeFormModal(props) {
100
107
  buyerId: buyerId,
101
108
  buyerNick: buyerNick
102
109
  });
110
+ setReplaceValue({});
103
111
  }
104
112
  }, [visible, templateId, workOrderId, currentShopId]);
105
113
 
@@ -316,9 +324,137 @@ var CustomizeFormModal = function CustomizeFormModal(props) {
316
324
  formItemIndex: formItemIndex
317
325
  });
318
326
  return instance.editRender({
319
- formItemIndex: formItemIndex
327
+ formItemIndex: formItemIndex,
328
+ onBlur: componentOnBlur
320
329
  });
321
330
  };
331
+ }; //组件失焦事件
332
+
333
+
334
+ var componentOnBlur = /*#__PURE__*/function () {
335
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(value, type) {
336
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
337
+ while (1) {
338
+ switch (_context2.prev = _context2.next) {
339
+ case 0:
340
+ if (value) {
341
+ _context2.next = 3;
342
+ break;
343
+ }
344
+
345
+ setReplaceValue(function (prev) {
346
+ return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, type, 0));
347
+ });
348
+ return _context2.abrupt("return");
349
+
350
+ case 3:
351
+ queryReplaceCount(_defineProperty({}, type, value));
352
+
353
+ if (type === 'tradeId' || type === 'enterprisePaymentTid') {
354
+ changeHandle(value);
355
+ }
356
+
357
+ case 5:
358
+ case "end":
359
+ return _context2.stop();
360
+ }
361
+ }
362
+ }, _callee2);
363
+ }));
364
+
365
+ return function componentOnBlur(_x3, _x4) {
366
+ return _ref2.apply(this, arguments);
367
+ };
368
+ }(); //查询重复数量
369
+
370
+
371
+ var queryReplaceCount = /*#__PURE__*/function () {
372
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(componentValue) {
373
+ var needCheckComponentList, params, _yield$replaceCheck, resultList, resultParams;
374
+
375
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
376
+ while (1) {
377
+ switch (_context3.prev = _context3.next) {
378
+ case 0:
379
+ needCheckComponentList = getReplaceWarnValues(templateDetail, componentValue);
380
+
381
+ if (!needCheckComponentList.length) {
382
+ _context3.next = 9;
383
+ break;
384
+ }
385
+
386
+ params = {
387
+ templateId: templateDetail.uniqueKey,
388
+ workOrderUniqueKey: workOrderDetail === null || workOrderDetail === void 0 ? void 0 : workOrderDetail.uniqueKey,
389
+ needCheckComponentList: needCheckComponentList
390
+ };
391
+ _context3.next = 5;
392
+ return replaceCheck(params);
393
+
394
+ case 5:
395
+ _yield$replaceCheck = _context3.sent;
396
+ resultList = _yield$replaceCheck.data.resultList;
397
+ resultParams = (resultList || []).reduce(function (prv, next) {
398
+ var _next$componentKey$sp = next.componentKey.split('_'),
399
+ _next$componentKey$sp2 = _slicedToArray(_next$componentKey$sp, 2),
400
+ _ = _next$componentKey$sp2[0],
401
+ name = _next$componentKey$sp2[1];
402
+
403
+ prv[name] = next.repeatCount;
404
+ return prv;
405
+ }, {});
406
+ setReplaceValue(function (prev) {
407
+ return _objectSpread(_objectSpread({}, prev), resultParams);
408
+ });
409
+
410
+ case 9:
411
+ case "end":
412
+ return _context3.stop();
413
+ }
414
+ }
415
+ }, _callee3);
416
+ }));
417
+
418
+ return function queryReplaceCount(_x5) {
419
+ return _ref3.apply(this, arguments);
420
+ };
421
+ }(); //订单返填
422
+
423
+
424
+ var changeHandle = function changeHandle(order_no) {
425
+ if (!order_no) return;
426
+
427
+ if (time.current) {
428
+ clearTimeout(time.current);
429
+ }
430
+
431
+ time.current = setTimeout(function () {
432
+ orderBack({
433
+ order_no: order_no,
434
+ form: form,
435
+ shopId: currentShopId,
436
+ shopList: shopList,
437
+ templateDetail: templateDetail,
438
+ type: !!workOrderId ? 'edit' : 'add',
439
+ callback: orderBackReplace
440
+ });
441
+ }, 1000);
442
+ }; //自动返填重复校验
443
+
444
+
445
+ var orderBackReplace = function orderBackReplace(value) {
446
+ var tradeId = value.tradeId,
447
+ buyer = value.buyer,
448
+ receiveMobile = value.receiveMobile,
449
+ alipayAccount = value.alipayAccount,
450
+ expressLogisticsCode = value.expressLogisticsCode;
451
+ queryReplaceCount({
452
+ tradeId: tradeId,
453
+ buyerNick: buyer === null || buyer === void 0 ? void 0 : buyer.buyerNick,
454
+ receiveMobile: receiveMobile,
455
+ alipayAccount: alipayAccount,
456
+ expressLogisticsCode: expressLogisticsCode
457
+ });
322
458
  };
323
459
 
324
460
  var finalFormItems = useMemo(function () {
@@ -334,25 +470,25 @@ var CustomizeFormModal = function CustomizeFormModal(props) {
334
470
  }, [templateDetail, shopList, currentShopId, workOrderDetail]);
335
471
 
336
472
  var queryDetail = /*#__PURE__*/function () {
337
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
473
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref4) {
338
474
  var templateId, workOrderId, shopId, shopList, record, orderNo, buyerId, buyerNick, _workOrderDetail2, _workOrderDetail2$dat, _workOrderDetail2$dat2, _workOrderDetail, _templateDetail, _workOrderDetail3, _templateDetail$data, transData, _templateDetail$data2, _templateDetail$data3, jsonMap, _transData, antFormEl;
339
475
 
340
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
476
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
341
477
  while (1) {
342
- switch (_context2.prev = _context2.next) {
478
+ switch (_context4.prev = _context4.next) {
343
479
  case 0:
344
- templateId = _ref2.templateId, workOrderId = _ref2.workOrderId, shopId = _ref2.shopId, shopList = _ref2.shopList, record = _ref2.record, orderNo = _ref2.orderNo, buyerId = _ref2.buyerId, buyerNick = _ref2.buyerNick;
480
+ templateId = _ref4.templateId, workOrderId = _ref4.workOrderId, shopId = _ref4.shopId, shopList = _ref4.shopList, record = _ref4.record, orderNo = _ref4.orderNo, buyerId = _ref4.buyerId, buyerNick = _ref4.buyerNick;
345
481
  form.resetFields();
346
- _context2.prev = 2;
482
+ _context4.prev = 2;
347
483
  setLoading(true);
348
484
  _workOrderDetail = {};
349
485
 
350
486
  if (!workOrderId) {
351
- _context2.next = 9;
487
+ _context4.next = 9;
352
488
  break;
353
489
  }
354
490
 
355
- _context2.next = 8;
491
+ _context4.next = 8;
356
492
  return queryWorkOrderDetail({
357
493
  checkIsAllowedExport: false,
358
494
  shopId: shopId,
@@ -360,16 +496,16 @@ var CustomizeFormModal = function CustomizeFormModal(props) {
360
496
  });
361
497
 
362
498
  case 8:
363
- _workOrderDetail = _context2.sent;
499
+ _workOrderDetail = _context4.sent;
364
500
 
365
501
  case 9:
366
- _context2.next = 11;
502
+ _context4.next = 11;
367
503
  return queryTemplateDetail({
368
504
  uniqueKey: templateId || ((_workOrderDetail2 = _workOrderDetail) === null || _workOrderDetail2 === void 0 ? void 0 : (_workOrderDetail2$dat = _workOrderDetail2.data) === null || _workOrderDetail2$dat === void 0 ? void 0 : (_workOrderDetail2$dat2 = _workOrderDetail2$dat.jsonMap) === null || _workOrderDetail2$dat2 === void 0 ? void 0 : _workOrderDetail2$dat2.templateId)
369
505
  });
370
506
 
371
507
  case 11:
372
- _templateDetail = _context2.sent;
508
+ _templateDetail = _context4.sent;
373
509
  setTemplateDetail(_templateDetail.data);
374
510
  setWorkOrderDetail(_workOrderDetail.data);
375
511
 
@@ -412,35 +548,36 @@ var CustomizeFormModal = function CustomizeFormModal(props) {
412
548
  form: form,
413
549
  shopId: shopId,
414
550
  shopList: shopList,
415
- templateDetail: _templateDetail === null || _templateDetail === void 0 ? void 0 : _templateDetail.data
551
+ templateDetail: _templateDetail === null || _templateDetail === void 0 ? void 0 : _templateDetail.data,
552
+ callback: orderBackReplace
416
553
  });
417
554
  }
418
555
 
419
556
  antFormEl = document.getElementsByClassName('ant-form');
420
557
  (antFormEl === null || antFormEl === void 0 ? void 0 : antFormEl.length) > 0 && set(antFormEl, '0.scrollTop', 0);
421
- _context2.next = 23;
558
+ _context4.next = 23;
422
559
  break;
423
560
 
424
561
  case 20:
425
- _context2.prev = 20;
426
- _context2.t0 = _context2["catch"](2);
427
- console.error('获取模板信息错误', _context2.t0);
562
+ _context4.prev = 20;
563
+ _context4.t0 = _context4["catch"](2);
564
+ console.error('获取模板信息错误', _context4.t0);
428
565
 
429
566
  case 23:
430
- _context2.prev = 23;
567
+ _context4.prev = 23;
431
568
  setLoading(false);
432
- return _context2.finish(23);
569
+ return _context4.finish(23);
433
570
 
434
571
  case 26:
435
572
  case "end":
436
- return _context2.stop();
573
+ return _context4.stop();
437
574
  }
438
575
  }
439
- }, _callee2, null, [[2, 20, 23, 26]]);
576
+ }, _callee4, null, [[2, 20, 23, 26]]);
440
577
  }));
441
578
 
442
- return function queryDetail(_x3) {
443
- return _ref3.apply(this, arguments);
579
+ return function queryDetail(_x6) {
580
+ return _ref5.apply(this, arguments);
444
581
  };
445
582
  }();
446
583
 
@@ -496,9 +633,16 @@ var CustomizeFormModal = function CustomizeFormModal(props) {
496
633
  destroyOnClose: true,
497
634
  children: /*#__PURE__*/_jsx(Spin, {
498
635
  spinning: loading,
499
- children: /*#__PURE__*/_jsx(ConfigProvider, {
636
+ children: /*#__PURE__*/_jsxs(ConfigProvider, {
500
637
  locale: zhCN,
501
- children: /*#__PURE__*/_jsx(Form, {
638
+ children: [/*#__PURE__*/_jsx("div", {
639
+ className: "tipBox",
640
+ children: Object.keys(replaceValue).map(function (key) {
641
+ return replaceValue[key] > 0 && /*#__PURE__*/_jsxs("div", {
642
+ children: ["\u63D0\u793A\uFF1A\u8BE5", COMPONENT_MAP_NAME[key], "\u9488\u5BF9\u6B64\u6A21\u677F\u5DF2\u521B\u5EFA\u8FC7", replaceValue[key], "\u6761\u5DE5\u5355\uFF01"]
643
+ });
644
+ })
645
+ }), /*#__PURE__*/_jsx(Form, {
502
646
  form: form,
503
647
  labelCol: {
504
648
  span: 6
@@ -507,11 +651,10 @@ var CustomizeFormModal = function CustomizeFormModal(props) {
507
651
  span: 18
508
652
  },
509
653
  className: "customizeFormModalClassName",
510
- style: {
511
- maxHeight: '500px'
654
+ style: {// maxHeight: '500px',
512
655
  },
513
656
  children: finalFormItems
514
- })
657
+ })]
515
658
  })
516
659
  })
517
660
  });
@@ -124,3 +124,11 @@
124
124
  font-family: 'PingFangSC-Regular';
125
125
  }
126
126
  }
127
+
128
+ .tipBox {
129
+ position: sticky;
130
+ top: -24px;
131
+ z-index: 1;
132
+ color: #e99d42;
133
+ background-color: #fff;
134
+ }
@@ -26,10 +26,9 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
26
  import React from 'react';
27
27
  import { Divider } from 'antd';
28
28
  import moment from 'moment';
29
- import { isEmpty } from 'lodash';
30
29
  import { useAppDispatch } from "../../../../../model/hooks";
31
30
  import { factory } from "../../../Widget";
32
- import { calcWorkOrderList } from "../../../../../common/utils/tools";
31
+ import { calcWorkOrderList, isNull } from "../../../../../common/utils/tools";
33
32
  import { WORK_ORDER_STATUS, WAITING, HANDLING, STOPPING } from "../../../../../common/constant";
34
33
  import { setStatusSelectModalVisible, setLogModalVisible, setFormModalVisible, setTemplateId, setCustomizeFormShopId, setCurrentCustomizeRecord } from "../../../../../model/customizeWorkOrder";
35
34
  import "./index.less";
@@ -200,11 +199,11 @@ function CustomizeWorkOrderCard(props) {
200
199
  var subColumns = instance.getColumns(); // 复合组件存在多个字段展示
201
200
 
202
201
  return subColumns !== null && subColumns !== void 0 && subColumns.children ? subColumns.children.map(function (item) {
203
- return !isEmpty(transData[(item === null || item === void 0 ? void 0 : item.dataIndex) || '']) ? /*#__PURE__*/_jsx(ItemView, {
202
+ return !isNull(transData[(item === null || item === void 0 ? void 0 : item.dataIndex) || '']) ? /*#__PURE__*/_jsx(ItemView, {
204
203
  label: item.title,
205
204
  value: item.render(transData[(item === null || item === void 0 ? void 0 : item.dataIndex) || ''], transData)
206
205
  }, item.dataIndex) : null;
207
- }) : !isEmpty(transData[(subColumns === null || subColumns === void 0 ? void 0 : subColumns.dataIndex) || '']) ? /*#__PURE__*/_jsx(ItemView, {
206
+ }) : !isNull(transData[(subColumns === null || subColumns === void 0 ? void 0 : subColumns.dataIndex) || '']) ? /*#__PURE__*/_jsx(ItemView, {
208
207
  label: t.name,
209
208
  value: instance.render(transData[(subColumns === null || subColumns === void 0 ? void 0 : subColumns.dataIndex) || ''], transData)
210
209
  }, t.uniqueKey) : null;
@@ -36,7 +36,7 @@ import { LeftOutlined } from '@ant-design/icons';
36
36
  import { get, debounce } from 'lodash';
37
37
  import { useDispatch, useSelector } from 'react-redux';
38
38
  import { useAppSelector } from "../../../../../model/hooks";
39
- import { decodeAlipayInfo, editRemitOrder, addPaymentOrder, getThirdOpenUidByOrderNo } from "../../../../../model/servers/api";
39
+ import { decodeAlipayInfo, editRemitOrder, addPaymentOrder, getThirdOpenUidByOrderNo, paymentReplaceCheck } from "../../../../../model/servers/api";
40
40
  import { selectPaymentFormModalVisible, selectCurrentPaymentRecord } from "../../../../../model/paymentWorkOrder/selector";
41
41
  import { setPaymentFormModalVisible } from "../../../../../model/paymentWorkOrder";
42
42
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -60,6 +60,12 @@ function ModifyModal(props) {
60
60
  shopInfo = _useState4[0],
61
61
  setShopInfo = _useState4[1];
62
62
 
63
+ var _useState5 = useState(0),
64
+ _useState6 = _slicedToArray(_useState5, 2),
65
+ count = _useState6[0],
66
+ setCount = _useState6[1]; //重复数量
67
+
68
+
63
69
  var _Form$useForm = Form.useForm(),
64
70
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
65
71
  form = _Form$useForm2[0];
@@ -84,6 +90,7 @@ function ModifyModal(props) {
84
90
  useEffect(function () {
85
91
  if (visible) {
86
92
  form.setFieldsValue(record);
93
+ setCount(0);
87
94
  }
88
95
  }, [visible]);
89
96
 
@@ -232,18 +239,61 @@ function ModifyModal(props) {
232
239
  getThirdUid(order_no, taobaoId);
233
240
  }, 1000);
234
241
  }
235
- }; //获取买家信息
242
+ };
236
243
 
244
+ var TidBlurHandle = /*#__PURE__*/function () {
245
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
246
+ var tid, _yield$paymentReplace, data;
237
247
 
238
- var getThirdUid = /*#__PURE__*/function () {
239
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(order_no, taobaoId) {
240
- var buyer, buyerInfo;
241
248
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
242
249
  while (1) {
243
250
  switch (_context3.prev = _context3.next) {
244
251
  case 0:
245
- _context3.prev = 0;
246
- _context3.next = 3;
252
+ tid = e.target.value;
253
+
254
+ if (tid) {
255
+ _context3.next = 4;
256
+ break;
257
+ }
258
+
259
+ setCount(0);
260
+ return _context3.abrupt("return");
261
+
262
+ case 4:
263
+ _context3.next = 6;
264
+ return paymentReplaceCheck({
265
+ tid: tid,
266
+ paymentOrderKey: record === null || record === void 0 ? void 0 : record.paymentOrderKey
267
+ });
268
+
269
+ case 6:
270
+ _yield$paymentReplace = _context3.sent;
271
+ data = _yield$paymentReplace.data;
272
+ setCount(+data || 0);
273
+
274
+ case 9:
275
+ case "end":
276
+ return _context3.stop();
277
+ }
278
+ }
279
+ }, _callee3);
280
+ }));
281
+
282
+ return function TidBlurHandle(_x3) {
283
+ return _ref3.apply(this, arguments);
284
+ };
285
+ }(); //获取买家信息
286
+
287
+
288
+ var getThirdUid = /*#__PURE__*/function () {
289
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(order_no, taobaoId) {
290
+ var buyer, buyerInfo;
291
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
292
+ while (1) {
293
+ switch (_context4.prev = _context4.next) {
294
+ case 0:
295
+ _context4.prev = 0;
296
+ _context4.next = 3;
247
297
  return getThirdOpenUidByOrderNo({
248
298
  orderNo: order_no,
249
299
  toAppKey: '21819818',
@@ -252,26 +302,26 @@ function ModifyModal(props) {
252
302
  });
253
303
 
254
304
  case 3:
255
- buyer = _context3.sent;
305
+ buyer = _context4.sent;
256
306
  buyerInfo = buyer === null || buyer === void 0 ? void 0 : buyer.data;
257
307
  form.setFieldsValue(_objectSpread({}, buyerInfo || {}));
258
- _context3.next = 10;
308
+ _context4.next = 10;
259
309
  break;
260
310
 
261
311
  case 8:
262
- _context3.prev = 8;
263
- _context3.t0 = _context3["catch"](0);
312
+ _context4.prev = 8;
313
+ _context4.t0 = _context4["catch"](0);
264
314
 
265
315
  case 10:
266
316
  case "end":
267
- return _context3.stop();
317
+ return _context4.stop();
268
318
  }
269
319
  }
270
- }, _callee3, null, [[0, 8]]);
320
+ }, _callee4, null, [[0, 8]]);
271
321
  }));
272
322
 
273
- return function getThirdUid(_x3, _x4) {
274
- return _ref3.apply(this, arguments);
323
+ return function getThirdUid(_x4, _x5) {
324
+ return _ref4.apply(this, arguments);
275
325
  };
276
326
  }();
277
327
 
@@ -298,9 +348,9 @@ function ModifyModal(props) {
298
348
  children: "\u786E\u5B9A"
299
349
  })]
300
350
  }),
301
- children: /*#__PURE__*/_jsx(Spin, {
351
+ children: /*#__PURE__*/_jsxs(Spin, {
302
352
  spinning: loading,
303
- children: /*#__PURE__*/_jsxs(Form, {
353
+ children: [/*#__PURE__*/_jsxs(Form, {
304
354
  form: form,
305
355
  labelCol: {
306
356
  span: 6
@@ -338,7 +388,8 @@ function ModifyModal(props) {
338
388
  message: '请输入正确的订单编号'
339
389
  }],
340
390
  children: /*#__PURE__*/_jsx(Input, {
341
- onChange: TidChangeHandle
391
+ onChange: TidChangeHandle,
392
+ onBlur: TidBlurHandle
342
393
  })
343
394
  }), /*#__PURE__*/_jsx(Form.Item, {
344
395
  label: "\u652F\u4ED8\u5B9D\u59D3\u540D",
@@ -353,7 +404,12 @@ function ModifyModal(props) {
353
404
  }],
354
405
  children: /*#__PURE__*/_jsx(Input, {})
355
406
  })]
356
- })
407
+ }), count > 0 && /*#__PURE__*/_jsxs("div", {
408
+ style: {
409
+ color: '#e99d42'
410
+ },
411
+ children: ["\u63D0\u793A\uFF1A\u8BE5\u8BA2\u5355\u53F7\u9488\u5BF9\u6B64\u6A21\u677F\u5DF2\u521B\u5EFA\u8FC7", count, "\u6761\u5DE5\u5355\uFF01"]
412
+ })]
357
413
  })
358
414
  });
359
415
  }
@@ -83,12 +83,15 @@ var EAlipay = /*#__PURE__*/function (_BasicComponent) {
83
83
  _defineProperty(_assertThisInitialized(_this), "editRender", function (value) {
84
84
  var _this$componentConfig, _this$componentConfig2;
85
85
 
86
+ var onBlur = value.onBlur;
86
87
  return getFormItem(_objectSpread({
87
88
  title: _this.name,
88
89
  name: _this.id,
89
90
  rules: (_this$componentConfig = _this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.required ? _this.customRules(_this.componentConfig) : [],
90
91
  required: (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required,
91
- component: /*#__PURE__*/_jsx(AliPay, _objectSpread({}, _this.componentConfig))
92
+ component: /*#__PURE__*/_jsx(AliPay, _objectSpread(_objectSpread({}, _this.componentConfig), {}, {
93
+ onBlur: onBlur
94
+ }))
92
95
  }, value));
93
96
  });
94
97
 
@@ -74,12 +74,15 @@ var EBuyerNick = /*#__PURE__*/function (_BasicComponent) {
74
74
  _defineProperty(_assertThisInitialized(_this), "editRender", function (value) {
75
75
  var _this$componentConfig, _this$componentConfig2;
76
76
 
77
+ var onBlur = value.onBlur;
77
78
  return getFormItem(_objectSpread({
78
79
  title: _this.name,
79
80
  name: _this.id,
80
81
  rules: (_this$componentConfig = _this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.required ? _this.customRules(_this.componentConfig) : [],
81
82
  required: (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required,
82
- component: /*#__PURE__*/_jsx(BuyerNick, _objectSpread({}, _this.componentConfig))
83
+ component: /*#__PURE__*/_jsx(BuyerNick, _objectSpread(_objectSpread({}, _this.componentConfig), {}, {
84
+ onBlur: onBlur
85
+ }))
83
86
  }, value));
84
87
  });
85
88
 
@@ -89,12 +89,15 @@ var ELogistics = /*#__PURE__*/function (_BasicComponent) {
89
89
  _defineProperty(_assertThisInitialized(_this), "editRender", function (value) {
90
90
  var _this$componentConfig, _this$componentConfig2;
91
91
 
92
+ var onBlur = value.onBlur;
92
93
  return getFormItem(_objectSpread({
93
94
  title: _this.name,
94
95
  name: _this.id,
95
96
  rules: (_this$componentConfig = _this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.required ? _this.customRules(_this.componentConfig) : [],
96
97
  required: (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required,
97
- component: /*#__PURE__*/_jsx(ExpressLogistics, _objectSpread({}, _this.componentConfig))
98
+ component: /*#__PURE__*/_jsx(ExpressLogistics, _objectSpread(_objectSpread({}, _this.componentConfig), {}, {
99
+ onBlur: onBlur
100
+ }))
98
101
  }, value));
99
102
  });
100
103
 
@@ -14,5 +14,6 @@ declare class ReceiverMobile extends Input {
14
14
  }[];
15
15
  constructor(options: any);
16
16
  render: (value: any, record: any) => JSX.Element;
17
+ editRender: (value: any) => JSX.Element;
17
18
  }
18
19
  export default ReceiverMobile;
@@ -1,5 +1,9 @@
1
1
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
2
 
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+
5
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6
+
3
7
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4
8
 
5
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
@@ -34,6 +38,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
34
38
  */
35
39
  import React from 'react';
36
40
  import Input from "../../basic/Input";
41
+ import { ApaasInput } from '@raycloud-apaas-fe-setup/apaas-react-basics-widgets';
42
+ import { getFormItem } from "../../common/formItemWrap";
37
43
  import { jsx as _jsx } from "react/jsx-runtime";
38
44
 
39
45
  var ReceiverMobile = /*#__PURE__*/function (_Input) {
@@ -76,6 +82,24 @@ var ReceiverMobile = /*#__PURE__*/function (_Input) {
76
82
  });
77
83
  });
78
84
 
85
+ _defineProperty(_assertThisInitialized(_this), "editRender", function (value) {
86
+ var _this$componentConfig;
87
+
88
+ var _onBlur = value.onBlur;
89
+ return getFormItem(_objectSpread({
90
+ title: _this.name,
91
+ name: _this.id,
92
+ rules: _this.rules,
93
+ required: (_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.required,
94
+ component: /*#__PURE__*/_jsx(ApaasInput, _objectSpread(_objectSpread({}, _this.componentConfig), {}, {
95
+ placeholder: "\u8BF7\u8F93\u5165".concat(_this.name),
96
+ onBlur: function onBlur(e) {
97
+ _onBlur(e.target.value, 'receiveMobile');
98
+ }
99
+ }))
100
+ }, value));
101
+ });
102
+
79
103
  _this.dataType = 'string';
80
104
  _this.showContains = true;
81
105
  _this.effects = options.effects;
@@ -84,7 +108,7 @@ var ReceiverMobile = /*#__PURE__*/function (_Input) {
84
108
  _this.canHidden = true;
85
109
  _this.editable = false;
86
110
  _this.rules = [{
87
- pattern: /^[0-9]*$/,
111
+ pattern: /^[0-9 |\-]*$/,
88
112
  message: '字段必须是数字'
89
113
  }];
90
114
  return _this;
@@ -75,6 +75,12 @@ var ETradeId = /*#__PURE__*/function (_Input) {
75
75
  _defineProperty(_assertThisInitialized(_this), "editRender", function (value) {
76
76
  var _this$componentConfig;
77
77
 
78
+ var onBlur = value.onBlur;
79
+
80
+ var onTradeIdBlur = function onTradeIdBlur(e) {
81
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(e.target.value, 'tradeId');
82
+ };
83
+
78
84
  return getFormItem(_objectSpread({
79
85
  title: _this.name,
80
86
  name: _this.id,
@@ -82,9 +88,7 @@ var ETradeId = /*#__PURE__*/function (_Input) {
82
88
  required: (_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.required,
83
89
  component: /*#__PURE__*/_jsx(TradeId, _objectSpread(_objectSpread({}, _this.componentConfig), {}, {
84
90
  placeholder: "\u8BF7\u8F93\u5165".concat(_this.name),
85
- onChange: function onChange(e) {
86
- return _this.changeHandle(e.target.value);
87
- }
91
+ onBlur: onTradeIdBlur
88
92
  }))
89
93
  }, value));
90
94
  });
@@ -120,6 +120,7 @@ var Payment = /*#__PURE__*/function (_BasicComponent) {
120
120
  _defineProperty(_assertThisInitialized(_this), "editRender", function (value) {
121
121
  var _this$componentConfig;
122
122
 
123
+ var onBlur = value.onBlur;
123
124
  return getFormItem(_objectSpread({
124
125
  title: _this.name,
125
126
  name: _this.id,
@@ -128,7 +129,8 @@ var Payment = /*#__PURE__*/function (_BasicComponent) {
128
129
  component: /*#__PURE__*/_jsx(ApaasPayment, _objectSpread(_objectSpread({}, _this.componentConfig), {}, {
129
130
  onSearch: function onSearch(e) {
130
131
  return _this.changeHandle(e.target.value);
131
- }
132
+ },
133
+ onBlur: onBlur
132
134
  }))
133
135
  }, value));
134
136
  });
@@ -60,5 +60,16 @@ export interface WorkOrderDetail {
60
60
  }
61
61
  export declare const formatPictures: (pictures: any) => any;
62
62
  export declare const calcWorkOrderList: (source: Partial<WorkOrderDetail>[], templateColumns: TemplateColumnConfig[], type?: string) => any[];
63
- export declare const orderBack: ({ order_no, form, shopId, shopList, templateDetail, type, }: any) => Promise<void>;
63
+ export declare const orderBack: ({ order_no, form, shopId, shopList, templateDetail, type, callback, }: any) => Promise<void>;
64
64
  export declare const imgResize: (url: string, w?: number, h?: number) => string;
65
+ export declare const COMPONENT_MAP: {
66
+ [key: string]: string;
67
+ };
68
+ export declare const COMPONENT_MAP_NAME: {
69
+ [key: string]: string;
70
+ };
71
+ export declare const getReplaceWarnValues: (templateDetail: {
72
+ componentDtoList: any[];
73
+ }, keyValues: {
74
+ [x: string]: any;
75
+ }) => any;
@@ -634,13 +634,13 @@ export var orderBack = /*#__PURE__*/function () {
634
634
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
635
635
  var _shopList$find;
636
636
 
637
- var order_no, form, shopId, shopList, templateDetail, _ref$type, type, shopSourceStr, _shopList$find2, _data$value, _buyer$value, taobaoId, promise, _yield$Promise$allSet, _yield$Promise$allSet2, data, buyer, orderInfo, buyerInfo, _ref3, orderNo, provinceCode, cityCode, townCode, orderCreateDateTime, orderPaymentDateTime, orderDeliveryDateTime, orderClosingDateTime, itemList, transField, finalResponse, formValue, detail, componentsParams, detailsValue, _templateDetail$compo, paymentUniqueKey;
637
+ var order_no, form, shopId, shopList, templateDetail, _ref$type, type, callback, shopSourceStr, _shopList$find2, _data$value, _buyer$value, taobaoId, promise, _yield$Promise$allSet, _yield$Promise$allSet2, data, buyer, orderInfo, buyerInfo, _ref3, orderNo, provinceCode, cityCode, townCode, orderCreateDateTime, orderPaymentDateTime, orderDeliveryDateTime, orderClosingDateTime, itemList, transField, finalResponse, formValue, detail, componentsParams, detailsValue, _templateDetail$compo, paymentUniqueKey;
638
638
 
639
639
  return _regeneratorRuntime().wrap(function _callee$(_context) {
640
640
  while (1) {
641
641
  switch (_context.prev = _context.next) {
642
642
  case 0:
643
- order_no = _ref.order_no, form = _ref.form, shopId = _ref.shopId, shopList = _ref.shopList, templateDetail = _ref.templateDetail, _ref$type = _ref.type, type = _ref$type === void 0 ? 'add' : _ref$type;
643
+ order_no = _ref.order_no, form = _ref.form, shopId = _ref.shopId, shopList = _ref.shopList, templateDetail = _ref.templateDetail, _ref$type = _ref.type, type = _ref$type === void 0 ? 'add' : _ref$type, callback = _ref.callback;
644
644
  shopSourceStr = (_shopList$find = shopList.find(function (item) {
645
645
  return item.shopId == shopId;
646
646
  })) === null || _shopList$find === void 0 ? void 0 : _shopList$find.shopSourceStr;
@@ -793,19 +793,20 @@ export var orderBack = /*#__PURE__*/function () {
793
793
 
794
794
 
795
795
  form.setFieldsValue(_objectSpread(_objectSpread({}, formValue), detailsValue));
796
- _context.next = 30;
796
+ callback === null || callback === void 0 ? void 0 : callback(finalResponse);
797
+ _context.next = 31;
797
798
  break;
798
799
 
799
- case 28:
800
- _context.prev = 28;
800
+ case 29:
801
+ _context.prev = 29;
801
802
  _context.t0 = _context["catch"](2);
802
803
 
803
- case 30:
804
+ case 31:
804
805
  case "end":
805
806
  return _context.stop();
806
807
  }
807
808
  }
808
- }, _callee, null, [[2, 28]]);
809
+ }, _callee, null, [[2, 29]]);
809
810
  }));
810
811
 
811
812
  return function orderBack(_x) {
@@ -901,4 +902,39 @@ export var imgResize = function imgResize(url) {
901
902
  var w = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 60;
902
903
  var h = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
903
904
  return "".concat(url, "?x-oss-process=image/resize,h_").concat(h, ",w_").concat(w);
905
+ }; //重复校验数据映射字段
906
+
907
+ export var COMPONENT_MAP = {
908
+ tradeId: 'TRADE_ID_INPUT',
909
+ buyerNick: 'BUYER_NICK_INPUT',
910
+ receiveMobile: 'RECEIVER_MOBILE_INPUT',
911
+ alipayAccount: 'ALI_PAY_INPUT',
912
+ expressLogisticsCode: 'EXPRESS_LOGISTICS_SELECT'
913
+ };
914
+ export var COMPONENT_MAP_NAME = {
915
+ tradeId: '订单号',
916
+ buyerNick: '买家昵称',
917
+ receiveMobile: '收件人手机号',
918
+ alipayAccount: '支付宝账号',
919
+ expressLogisticsCode: '快递物流单号'
920
+ }; //数据唯一性校验提交数据组装
921
+
922
+ export var getReplaceWarnValues = function getReplaceWarnValues(templateDetail, keyValues) {
923
+ return templateDetail.componentDtoList.reduce(function (prv, next) {
924
+ Object.keys(keyValues).forEach(function (key) {
925
+ if (COMPONENT_MAP[key] === next.workOrderComponentType) {
926
+ var componentConfig = next.componentConfig;
927
+
928
+ if (componentConfig !== null && componentConfig !== void 0 && componentConfig.replaceWarn && keyValues[key]) {
929
+ if (!(key === 'buyerNick' && keyValues[key].indexOf('*') > -1)) {
930
+ prv.push({
931
+ componentKey: "".concat(next.uniqueKey, "_").concat(key),
932
+ componentValue: keyValues[key]
933
+ });
934
+ }
935
+ }
936
+ }
937
+ });
938
+ return prv;
939
+ }, []);
904
940
  };
@@ -35,6 +35,8 @@ export declare const login: (data: LoginParams) => Promise<any>;
35
35
  export declare const queryShopList: () => Promise<any>;
36
36
  export declare const deleteWorkOrder: (data: any) => Promise<any>;
37
37
  export declare const getThirdOpenUidByOrderNo: (data: any) => Promise<any>;
38
+ export declare const replaceCheck: (data: any) => Promise<any>;
38
39
  export declare const queryCompanyUserList: (data: any) => Promise<any>;
40
+ export declare const paymentReplaceCheck: (data: any) => Promise<any>;
39
41
  export declare const appointTo: (data: any) => Promise<any>;
40
42
  export declare const updateFlowStatus: (data: any) => Promise<any>;
@@ -213,6 +213,14 @@ export var getThirdOpenUidByOrderNo = function getThirdOpenUidByOrderNo(data) {
213
213
  method: 'post',
214
214
  data: data
215
215
  });
216
+ }; // 重复校验
217
+
218
+ export var replaceCheck = function replaceCheck(data) {
219
+ return request({
220
+ url: '/qy/gdfw/workOrder/repeatCheck',
221
+ method: 'post',
222
+ data: data
223
+ });
216
224
  };
217
225
  export var queryCompanyUserList = function queryCompanyUserList(data) {
218
226
  return request({
@@ -220,6 +228,14 @@ export var queryCompanyUserList = function queryCompanyUserList(data) {
220
228
  method: 'post',
221
229
  data: data
222
230
  });
231
+ }; // 打款重复校验
232
+
233
+ export var paymentReplaceCheck = function paymentReplaceCheck(data) {
234
+ return request({
235
+ url: '/qy/payment/paymentOrder/repeatCheck',
236
+ method: 'post',
237
+ data: data
238
+ });
223
239
  };
224
240
  export var appointTo = function appointTo(data) {
225
241
  return request({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kmkf-work-order-service-component",
3
- "version": "0.3.3",
3
+ "version": "0.3.4-alpha.2",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -39,7 +39,7 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@ant-design/icons": "^4.7.0",
42
- "@raycloud-apaas-fe-setup/apaas-react-basics-widgets": "^1.0.28-alpha.3",
42
+ "@raycloud-apaas-fe-setup/apaas-react-basics-widgets": "^1.0.29-alpha.2",
43
43
  "@reduxjs/toolkit": "^1.8.5",
44
44
  "copy-to-clipboard": "^3.3.3",
45
45
  "js-md5": "^0.7.3",