kts-component-invoice-operate 1.2.20 → 2.0.0

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.
Files changed (88) hide show
  1. package/d.dio +2 -69
  2. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{EndowCode.d.ts → EndowCode/index.d.ts} +2 -2
  3. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{IGood.d.ts → IGood/index.d.ts} +15 -5
  4. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{ImportGoods.d.ts → ImportGoods/index.d.ts} +0 -0
  5. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{LineAttributeType.d.ts → LineAttributeType/index.d.ts} +0 -0
  6. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ProductComparison/index.d.ts +7 -0
  7. package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.d.ts +7 -0
  8. package/dist/Invoice/InvoiceController/fns/addGood.d.ts +1 -1
  9. package/dist/Invoice/InvoiceController/fns/addGoodDiscount.d.ts +1 -1
  10. package/dist/Invoice/InvoiceController/fns/delGood.d.ts +1 -1
  11. package/dist/Invoice/InvoiceController/fns/saveEditGood.d.ts +1 -1
  12. package/dist/Invoice/InvoiceController/fns/setEditGood.d.ts +1 -1
  13. package/dist/Invoice/InvoiceController/fns/setGoods.d.ts +1 -1
  14. package/dist/Invoice/InvoiceController/fns/updateInvoiceNo.d.ts +1 -1
  15. package/dist/Invoice/_test/buyerNameSearch/index.d.ts +1 -0
  16. package/dist/Invoice/_test/deduction/index.d.ts +1 -0
  17. package/dist/Invoice/_test/draft/index.d.ts +1 -0
  18. package/dist/Invoice/_test/easiest/index.d.ts +1 -0
  19. package/dist/Invoice/_test/endowCode/index.d.ts +1 -0
  20. package/dist/Invoice/_test/goodsMenuExpand/index.d.ts +1 -0
  21. package/dist/Invoice/_test/importBuyer/index.d.ts +1 -0
  22. package/dist/Invoice/_test/importGoods/index.d.ts +1 -0
  23. package/dist/Invoice/_test/invoiceType/index.d.ts +1 -0
  24. package/dist/Invoice/_test/isInvoiceNo/index.d.ts +1 -0
  25. package/dist/Invoice/_test/replaceHead/index.d.ts +1 -0
  26. package/dist/Invoice/_test/retrieveData/index.d.ts +1 -0
  27. package/dist/Invoice/_test/seller/index.d.ts +1 -0
  28. package/dist/Invoice/_test/setDataSource/index.d.ts +1 -0
  29. package/dist/Invoice/_test/unit/index.d.ts +1 -0
  30. package/dist/Invoice/index.d.ts +1 -1
  31. package/dist/Invoice/tools/coolingFn/index.d.ts +1 -1
  32. package/dist/Invoice/tools/itemName/index.d.ts +14 -0
  33. package/dist/Invoice/tools/lazyFn/index.d.ts +1 -1
  34. package/dist/Invoice/ui/AddComparisonDrawer/index.d.ts +3 -0
  35. package/dist/Invoice/ui/Buyer/ui/BuyerNameInput/index.d.ts +1 -0
  36. package/dist/Invoice/ui/Buyer/ui/ImportBuyerButton/index.d.ts +1 -0
  37. package/dist/Invoice/ui/EndowCodeDrawer/index.d.ts +1 -0
  38. package/dist/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.d.ts +2 -0
  39. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowEditButton/index.d.ts +1 -0
  40. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddComparison/index.d.ts +5 -0
  41. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +1 -0
  42. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +1 -0
  43. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +1 -0
  44. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/index.d.ts +1 -0
  45. package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowSaveButton/index.d.ts +1 -0
  46. package/dist/Invoice/ui/GoodsList/hook/useRowSelection/index.d.ts +1 -0
  47. package/dist/Invoice/ui/GoodsList/ui/AddRowButton/index.d.ts +1 -0
  48. package/dist/Invoice/ui/GoodsList/ui/CommodityComparisonButton/index.d.ts +3 -0
  49. package/dist/Invoice/ui/GoodsList/ui/DelRowButton/index.d.ts +1 -0
  50. package/dist/Invoice/ui/GoodsList/ui/DescribeSwitch/index.d.ts +3 -0
  51. package/dist/Invoice/ui/GoodsList/ui/EndowCodeButton/index.d.ts +1 -0
  52. package/dist/Invoice/ui/GoodsList/ui/Statistics/index.d.ts +1 -0
  53. package/dist/Invoice/ui/GoodsList/ui/TableRow/index.d.ts +1 -0
  54. package/dist/Invoice/ui/GoodsList/ui/TableVirtual/index.d.ts +1 -0
  55. package/dist/Invoice/ui/GoodsList/ui/TaxIncludedSwitch/index.d.ts +1 -0
  56. package/dist/Invoice/ui/ImportBuyerDrawer/index.d.ts +1 -0
  57. package/dist/Invoice/ui/ImportGoodsDrawer/index.d.ts +1 -0
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.esm.js +1740 -626
  60. package/dist/index.js +1739 -625
  61. package/docs/index.md +2 -2
  62. package/docs-dist/umi.js +1 -1
  63. package/package.json +4 -1
  64. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{EndowCode.tsx → EndowCode/index.tsx} +3 -3
  65. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{IGood.ts → IGood/index.ts} +20 -5
  66. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{ImportGoods.ts → ImportGoods/index.ts} +0 -0
  67. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{LineAttributeType.ts → LineAttributeType/index.ts} +0 -0
  68. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ProductComparison/index.ts +10 -0
  69. package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +12 -2
  70. package/src/Invoice/InvoiceController/fns/addGoodDiscount.ts +4 -3
  71. package/src/Invoice/_test/importGoods/index.tsx +21 -3
  72. package/src/Invoice/index.tsx +5 -1
  73. package/src/Invoice/tools/itemName/index.ts +48 -0
  74. package/src/Invoice/ui/AddComparisonDrawer/index.tsx +179 -0
  75. package/src/Invoice/ui/EndowCodeDrawer/index.tsx +23 -28
  76. package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +21 -24
  77. package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +71 -29
  78. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddComparison/index.tsx +39 -0
  79. package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +5 -2
  80. package/src/Invoice/ui/GoodsList/index.less +34 -37
  81. package/src/Invoice/ui/GoodsList/index.tsx +8 -0
  82. package/src/Invoice/ui/GoodsList/ui/AddDiscountRowButton/index.tsx +6 -16
  83. package/src/Invoice/ui/GoodsList/ui/CommodityComparisonButton/index.tsx +74 -0
  84. package/src/Invoice/ui/GoodsList/ui/DescribeSwitch/index.tsx +37 -0
  85. package/src/Invoice/ui/GoodsList/ui/TaxIncludedSwitch/index.tsx +2 -2
  86. package/src/Invoice/ui/ImportGoodsDrawer/index.tsx +70 -18
  87. package/src/index.ts +1 -0
  88. package/yarn.o.lock +14800 -0
package/dist/index.esm.js CHANGED
@@ -2,7 +2,7 @@ import 'kts-components-antd-x3/dist/kts-components-antd-x3.css';
2
2
  import React, { createElement } from 'react';
3
3
  import GreyReactBox, { decorator } from 'grey-react-box';
4
4
  import { chain as chain$1, bignumber, create, all } from 'mathjs';
5
- import { message, Form, Input, Icon, Tag, Select, Row, Col, Table, Button, Switch, Typography, Drawer, Menu, Dropdown, AutoComplete, Spin, Checkbox, Descriptions, Empty, Divider, Popover, Tree, Modal } from 'kts-components-antd-x3';
5
+ import { message, Form, Input, Icon, Tag, Select, Row, Col, Table, Button, Switch, Tooltip, Typography, Drawer, Menu, Dropdown, AutoComplete, Spin, Checkbox, Descriptions, Empty, Divider, Popover, Tree, Modal } from 'kts-components-antd-x3';
6
6
  import { v4 } from 'uuid';
7
7
  import classnames from 'classnames';
8
8
  import { Input as Input$1, NumberPicker } from '@formily/antd-components';
@@ -13,14 +13,9 @@ function ownKeys(object, enumerableOnly) {
13
13
 
14
14
  if (Object.getOwnPropertySymbols) {
15
15
  var symbols = Object.getOwnPropertySymbols(object);
16
-
17
- if (enumerableOnly) {
18
- symbols = symbols.filter(function (sym) {
19
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
20
- });
21
- }
22
-
23
- keys.push.apply(keys, symbols);
16
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
17
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
18
+ })), keys.push.apply(keys, symbols);
24
19
  }
25
20
 
26
21
  return keys;
@@ -28,22 +23,360 @@ function ownKeys(object, enumerableOnly) {
28
23
 
29
24
  function _objectSpread2(target) {
30
25
  for (var i = 1; i < arguments.length; i++) {
31
- var source = arguments[i] != null ? arguments[i] : {};
26
+ var source = null != arguments[i] ? arguments[i] : {};
27
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
28
+ _defineProperty(target, key, source[key]);
29
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
30
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
31
+ });
32
+ }
32
33
 
33
- if (i % 2) {
34
- ownKeys(Object(source), true).forEach(function (key) {
35
- _defineProperty(target, key, source[key]);
36
- });
37
- } else if (Object.getOwnPropertyDescriptors) {
38
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
39
- } else {
40
- ownKeys(Object(source)).forEach(function (key) {
41
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
34
+ return target;
35
+ }
36
+
37
+ function _regeneratorRuntime() {
38
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
39
+
40
+ _regeneratorRuntime = function () {
41
+ return exports;
42
+ };
43
+
44
+ var exports = {},
45
+ Op = Object.prototype,
46
+ hasOwn = Op.hasOwnProperty,
47
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
48
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
49
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
50
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
51
+
52
+ function define(obj, key, value) {
53
+ return Object.defineProperty(obj, key, {
54
+ value: value,
55
+ enumerable: !0,
56
+ configurable: !0,
57
+ writable: !0
58
+ }), obj[key];
59
+ }
60
+
61
+ try {
62
+ define({}, "");
63
+ } catch (err) {
64
+ define = function (obj, key, value) {
65
+ return obj[key] = value;
66
+ };
67
+ }
68
+
69
+ function wrap(innerFn, outerFn, self, tryLocsList) {
70
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
71
+ generator = Object.create(protoGenerator.prototype),
72
+ context = new Context(tryLocsList || []);
73
+ return generator._invoke = function (innerFn, self, context) {
74
+ var state = "suspendedStart";
75
+ return function (method, arg) {
76
+ if ("executing" === state) throw new Error("Generator is already running");
77
+
78
+ if ("completed" === state) {
79
+ if ("throw" === method) throw arg;
80
+ return doneResult();
81
+ }
82
+
83
+ for (context.method = method, context.arg = arg;;) {
84
+ var delegate = context.delegate;
85
+
86
+ if (delegate) {
87
+ var delegateResult = maybeInvokeDelegate(delegate, context);
88
+
89
+ if (delegateResult) {
90
+ if (delegateResult === ContinueSentinel) continue;
91
+ return delegateResult;
92
+ }
93
+ }
94
+
95
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
96
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
97
+ context.dispatchException(context.arg);
98
+ } else "return" === context.method && context.abrupt("return", context.arg);
99
+ state = "executing";
100
+ var record = tryCatch(innerFn, self, context);
101
+
102
+ if ("normal" === record.type) {
103
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
104
+ return {
105
+ value: record.arg,
106
+ done: context.done
107
+ };
108
+ }
109
+
110
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
111
+ }
112
+ };
113
+ }(innerFn, self, context), generator;
114
+ }
115
+
116
+ function tryCatch(fn, obj, arg) {
117
+ try {
118
+ return {
119
+ type: "normal",
120
+ arg: fn.call(obj, arg)
121
+ };
122
+ } catch (err) {
123
+ return {
124
+ type: "throw",
125
+ arg: err
126
+ };
127
+ }
128
+ }
129
+
130
+ exports.wrap = wrap;
131
+ var ContinueSentinel = {};
132
+
133
+ function Generator() {}
134
+
135
+ function GeneratorFunction() {}
136
+
137
+ function GeneratorFunctionPrototype() {}
138
+
139
+ var IteratorPrototype = {};
140
+ define(IteratorPrototype, iteratorSymbol, function () {
141
+ return this;
142
+ });
143
+ var getProto = Object.getPrototypeOf,
144
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
145
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
146
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
147
+
148
+ function defineIteratorMethods(prototype) {
149
+ ["next", "throw", "return"].forEach(function (method) {
150
+ define(prototype, method, function (arg) {
151
+ return this._invoke(method, arg);
42
152
  });
153
+ });
154
+ }
155
+
156
+ function AsyncIterator(generator, PromiseImpl) {
157
+ function invoke(method, arg, resolve, reject) {
158
+ var record = tryCatch(generator[method], generator, arg);
159
+
160
+ if ("throw" !== record.type) {
161
+ var result = record.arg,
162
+ value = result.value;
163
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
164
+ invoke("next", value, resolve, reject);
165
+ }, function (err) {
166
+ invoke("throw", err, resolve, reject);
167
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
168
+ result.value = unwrapped, resolve(result);
169
+ }, function (error) {
170
+ return invoke("throw", error, resolve, reject);
171
+ });
172
+ }
173
+
174
+ reject(record.arg);
43
175
  }
176
+
177
+ var previousPromise;
178
+
179
+ this._invoke = function (method, arg) {
180
+ function callInvokeWithMethodAndArg() {
181
+ return new PromiseImpl(function (resolve, reject) {
182
+ invoke(method, arg, resolve, reject);
183
+ });
184
+ }
185
+
186
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
187
+ };
44
188
  }
45
189
 
46
- return target;
190
+ function maybeInvokeDelegate(delegate, context) {
191
+ var method = delegate.iterator[context.method];
192
+
193
+ if (undefined === method) {
194
+ if (context.delegate = null, "throw" === context.method) {
195
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
196
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
197
+ }
198
+
199
+ return ContinueSentinel;
200
+ }
201
+
202
+ var record = tryCatch(method, delegate.iterator, context.arg);
203
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
204
+ var info = record.arg;
205
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
206
+ }
207
+
208
+ function pushTryEntry(locs) {
209
+ var entry = {
210
+ tryLoc: locs[0]
211
+ };
212
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
213
+ }
214
+
215
+ function resetTryEntry(entry) {
216
+ var record = entry.completion || {};
217
+ record.type = "normal", delete record.arg, entry.completion = record;
218
+ }
219
+
220
+ function Context(tryLocsList) {
221
+ this.tryEntries = [{
222
+ tryLoc: "root"
223
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
224
+ }
225
+
226
+ function values(iterable) {
227
+ if (iterable) {
228
+ var iteratorMethod = iterable[iteratorSymbol];
229
+ if (iteratorMethod) return iteratorMethod.call(iterable);
230
+ if ("function" == typeof iterable.next) return iterable;
231
+
232
+ if (!isNaN(iterable.length)) {
233
+ var i = -1,
234
+ next = function next() {
235
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
236
+
237
+ return next.value = undefined, next.done = !0, next;
238
+ };
239
+
240
+ return next.next = next;
241
+ }
242
+ }
243
+
244
+ return {
245
+ next: doneResult
246
+ };
247
+ }
248
+
249
+ function doneResult() {
250
+ return {
251
+ value: undefined,
252
+ done: !0
253
+ };
254
+ }
255
+
256
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
257
+ var ctor = "function" == typeof genFun && genFun.constructor;
258
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
259
+ }, exports.mark = function (genFun) {
260
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
261
+ }, exports.awrap = function (arg) {
262
+ return {
263
+ __await: arg
264
+ };
265
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
266
+ return this;
267
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
268
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
269
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
270
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
271
+ return result.done ? result.value : iter.next();
272
+ });
273
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
274
+ return this;
275
+ }), define(Gp, "toString", function () {
276
+ return "[object Generator]";
277
+ }), exports.keys = function (object) {
278
+ var keys = [];
279
+
280
+ for (var key in object) keys.push(key);
281
+
282
+ return keys.reverse(), function next() {
283
+ for (; keys.length;) {
284
+ var key = keys.pop();
285
+ if (key in object) return next.value = key, next.done = !1, next;
286
+ }
287
+
288
+ return next.done = !0, next;
289
+ };
290
+ }, exports.values = values, Context.prototype = {
291
+ constructor: Context,
292
+ reset: function (skipTempReset) {
293
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
294
+ },
295
+ stop: function () {
296
+ this.done = !0;
297
+ var rootRecord = this.tryEntries[0].completion;
298
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
299
+ return this.rval;
300
+ },
301
+ dispatchException: function (exception) {
302
+ if (this.done) throw exception;
303
+ var context = this;
304
+
305
+ function handle(loc, caught) {
306
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
307
+ }
308
+
309
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
310
+ var entry = this.tryEntries[i],
311
+ record = entry.completion;
312
+ if ("root" === entry.tryLoc) return handle("end");
313
+
314
+ if (entry.tryLoc <= this.prev) {
315
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
316
+ hasFinally = hasOwn.call(entry, "finallyLoc");
317
+
318
+ if (hasCatch && hasFinally) {
319
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
320
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
321
+ } else if (hasCatch) {
322
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
323
+ } else {
324
+ if (!hasFinally) throw new Error("try statement without catch or finally");
325
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
326
+ }
327
+ }
328
+ }
329
+ },
330
+ abrupt: function (type, arg) {
331
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
332
+ var entry = this.tryEntries[i];
333
+
334
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
335
+ var finallyEntry = entry;
336
+ break;
337
+ }
338
+ }
339
+
340
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
341
+ var record = finallyEntry ? finallyEntry.completion : {};
342
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
343
+ },
344
+ complete: function (record, afterLoc) {
345
+ if ("throw" === record.type) throw record.arg;
346
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
347
+ },
348
+ finish: function (finallyLoc) {
349
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
350
+ var entry = this.tryEntries[i];
351
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
352
+ }
353
+ },
354
+ catch: function (tryLoc) {
355
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
356
+ var entry = this.tryEntries[i];
357
+
358
+ if (entry.tryLoc === tryLoc) {
359
+ var record = entry.completion;
360
+
361
+ if ("throw" === record.type) {
362
+ var thrown = record.arg;
363
+ resetTryEntry(entry);
364
+ }
365
+
366
+ return thrown;
367
+ }
368
+ }
369
+
370
+ throw new Error("illegal catch attempt");
371
+ },
372
+ delegateYield: function (iterable, resultName, nextLoc) {
373
+ return this.delegate = {
374
+ iterator: values(iterable),
375
+ resultName: resultName,
376
+ nextLoc: nextLoc
377
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
378
+ }
379
+ }, exports;
47
380
  }
48
381
 
49
382
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
@@ -101,6 +434,9 @@ function _defineProperties(target, props) {
101
434
  function _createClass(Constructor, protoProps, staticProps) {
102
435
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
103
436
  if (staticProps) _defineProperties(Constructor, staticProps);
437
+ Object.defineProperty(Constructor, "prototype", {
438
+ writable: false
439
+ });
104
440
  return Constructor;
105
441
  }
106
442
 
@@ -131,22 +467,24 @@ function _inherits(subClass, superClass) {
131
467
  configurable: true
132
468
  }
133
469
  });
470
+ Object.defineProperty(subClass, "prototype", {
471
+ writable: false
472
+ });
134
473
  if (superClass) _setPrototypeOf(subClass, superClass);
135
474
  }
136
475
 
137
476
  function _getPrototypeOf(o) {
138
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
477
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
139
478
  return o.__proto__ || Object.getPrototypeOf(o);
140
479
  };
141
480
  return _getPrototypeOf(o);
142
481
  }
143
482
 
144
483
  function _setPrototypeOf(o, p) {
145
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
484
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
146
485
  o.__proto__ = p;
147
486
  return o;
148
487
  };
149
-
150
488
  return _setPrototypeOf(o, p);
151
489
  }
152
490
 
@@ -345,12 +683,12 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
345
683
  }, {
346
684
  key: "validateFields",
347
685
  value: function () {
348
- var _validateFields2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
686
+ var _validateFields2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
349
687
  var _this3 = this;
350
688
 
351
689
  var _errors, _values, arr, i, key, _yield$_validateField, errors, values, _this$state$goodsList;
352
690
 
353
- return regeneratorRuntime.wrap(function _callee$(_context) {
691
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
354
692
  while (1) {
355
693
  switch (_context.prev = _context.next) {
356
694
  case 0:
@@ -479,7 +817,7 @@ var _validateFields = function _validateFields(form) {
479
817
  });
480
818
  };
481
819
 
482
- var ImportGoods = function ImportGoods() {
820
+ var ImportGoods = /*#__PURE__*/_createClass(function ImportGoods() {
483
821
  _classCallCheck(this, ImportGoods);
484
822
 
485
823
  this.columns = [{
@@ -521,8 +859,8 @@ var ImportGoods = function ImportGoods() {
521
859
  this.topExpand = void 0;
522
860
 
523
861
  this.verifyFn = /*#__PURE__*/function () {
524
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(record) {
525
- return regeneratorRuntime.wrap(function _callee$(_context) {
862
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(record) {
863
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
526
864
  while (1) {
527
865
  switch (_context.prev = _context.next) {
528
866
  case 0:
@@ -564,7 +902,7 @@ var ImportGoods = function ImportGoods() {
564
902
  return _ref.apply(this, arguments);
565
903
  };
566
904
  }();
567
- };
905
+ });
568
906
 
569
907
  var LineAttributeType;
570
908
 
@@ -576,12 +914,12 @@ var LineAttributeType;
576
914
 
577
915
  var LineAttributeType$1 = LineAttributeType;
578
916
 
579
- var EndowCode = function EndowCode() {
917
+ var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
580
918
  _classCallCheck(this, EndowCode);
581
919
 
582
920
  this.endowcodeGoodIndex = [];
583
- this.getTaxCategoryCodeList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
584
- return regeneratorRuntime.wrap(function _callee$(_context) {
921
+ this.getTaxCategoryCodeList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
922
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
585
923
  while (1) {
586
924
  switch (_context.prev = _context.next) {
587
925
  case 0:
@@ -613,7 +951,7 @@ var EndowCode = function EndowCode() {
613
951
  value: 3
614
952
  }];
615
953
  this.cache = {};
616
- };
954
+ });
617
955
 
618
956
  function draft(value) {
619
957
  if (!value) return true; // isDiscount
@@ -634,7 +972,14 @@ function draft(value) {
634
972
  }
635
973
  }
636
974
 
637
- var GoodsListState = function GoodsListState() {
975
+ var ProductComparison = /*#__PURE__*/_createClass(function ProductComparison() {
976
+ _classCallCheck(this, ProductComparison);
977
+
978
+ this.onComply = void 0;
979
+ this.onUpdateComparisonTable = void 0;
980
+ });
981
+
982
+ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
638
983
  _classCallCheck(this, GoodsListState);
639
984
 
640
985
  this.deduction = 0;
@@ -642,11 +987,12 @@ var GoodsListState = function GoodsListState() {
642
987
  this.isSwitchTax = void 0;
643
988
  this.isAddDiscount = void 0;
644
989
  this.isTaxIncluded = true;
990
+ this.isMyShow = false;
645
991
  this.editGood = void 0;
646
992
  this.form = void 0;
647
993
  this.unitList = [];
648
994
  this.defaultRate = 3;
649
- this.taxRateList = [0, 3, 5, 6, 9, 12];
995
+ this.taxRateList = [0, 3, 5, 6, 9, 13];
650
996
  this.goodsList = [];
651
997
  this.goodsMap = new Map();
652
998
  this.goodsMenuExpand = [];
@@ -654,10 +1000,12 @@ var GoodsListState = function GoodsListState() {
654
1000
  this.discountGoodIndex = [];
655
1001
  this.endowCode = new EndowCode();
656
1002
  this.importGoods = new ImportGoods();
1003
+ this.productComparison = new ProductComparison();
657
1004
  this.isVisibleDrawer = false;
658
- };
1005
+ this.addComparisonIndex = void 0;
1006
+ });
659
1007
 
660
- var BuyerState = function BuyerState() {
1008
+ var BuyerState = /*#__PURE__*/_createClass(function BuyerState() {
661
1009
  _classCallCheck(this, BuyerState);
662
1010
 
663
1011
  this.columns = [{
@@ -683,8 +1031,8 @@ var BuyerState = function BuyerState() {
683
1031
  }];
684
1032
 
685
1033
  this.onRowClick = /*#__PURE__*/function () {
686
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(record) {
687
- return regeneratorRuntime.wrap(function _callee$(_context) {
1034
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(record) {
1035
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
688
1036
  while (1) {
689
1037
  switch (_context.prev = _context.next) {
690
1038
  case 0:
@@ -708,9 +1056,9 @@ var BuyerState = function BuyerState() {
708
1056
  this.isVisibleDrawer = false;
709
1057
  this.topExpand = void 0;
710
1058
  this.autoContainer = void 0;
711
- };
1059
+ });
712
1060
 
713
- var InvoiceControllerState = function InvoiceControllerState() {
1061
+ var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControllerState() {
714
1062
  _classCallCheck(this, InvoiceControllerState);
715
1063
 
716
1064
  this.model = 'default';
@@ -718,15 +1066,15 @@ var InvoiceControllerState = function InvoiceControllerState() {
718
1066
  this.invoiceType = '08';
719
1067
  this.buyerState = new BuyerState();
720
1068
  this.goodsListState = new GoodsListState();
721
- };
1069
+ });
722
1070
 
723
1071
  /**
724
1072
  * 设置当前的编辑货物
725
1073
  */
726
1074
  var setEditGood = /*#__PURE__*/(function () {
727
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(state, newEditGood) {
1075
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, newEditGood) {
728
1076
  var editGood;
729
- return regeneratorRuntime.wrap(function _callee$(_context) {
1077
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
730
1078
  while (1) {
731
1079
  switch (_context.prev = _context.next) {
732
1080
  case 0:
@@ -758,9 +1106,9 @@ var setEditGood = /*#__PURE__*/(function () {
758
1106
  * 设置单个货物属性
759
1107
  */
760
1108
  var setGoods = /*#__PURE__*/(function () {
761
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(state, options) {
1109
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
762
1110
  var goodsList;
763
- return regeneratorRuntime.wrap(function _callee$(_context) {
1111
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
764
1112
  while (1) {
765
1113
  switch (_context.prev = _context.next) {
766
1114
  case 0:
@@ -797,9 +1145,9 @@ var setGoods = /*#__PURE__*/(function () {
797
1145
  */
798
1146
 
799
1147
  var delGood = /*#__PURE__*/(function () {
800
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(state, $index) {
1148
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, $index) {
801
1149
  var goods;
802
- return regeneratorRuntime.wrap(function _callee$(_context) {
1150
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
803
1151
  while (1) {
804
1152
  switch (_context.prev = _context.next) {
805
1153
  case 0:
@@ -872,15 +1220,86 @@ var idGenerator = (function () {
872
1220
  return ++id;
873
1221
  });
874
1222
 
1223
+ /** 格式化 保留2位小数 */
1224
+
1225
+ var format2 = function format2(value) {
1226
+ if (value === Infinity) return '';
1227
+ if ("".concat(value) === 'NaN') return '';
1228
+ if (typeof value === 'string') value = parseFloat(value);
1229
+ return parseFloat(value.toFixed(2));
1230
+ };
1231
+ /** 格式化 保留15位数字 */
1232
+
1233
+ var format15 = function format15(value) {
1234
+ if (value === Infinity) return '';
1235
+ if ("".concat(value) === 'NaN') return '';
1236
+ if (typeof value === 'string') value = parseFloat(value);
1237
+ var fractionDigits = 15 - "".concat(value || 0).indexOf('.');
1238
+ return parseFloat(value.toFixed(fractionDigits > 8 ? 8 : fractionDigits));
1239
+ };
1240
+ /**
1241
+ * 金额(含税) = 数量 * 单价(含税)
1242
+ * @param quantity 数量
1243
+ * @param priceIncludeTax 单价(含税)
1244
+ * @returns 金额(含税)
1245
+ */
1246
+
1247
+ function countAmountIncludeTax(quantity, priceIncludeTax) {
1248
+ if (!quantity && quantity !== 0) return undefined;
1249
+ if (!priceIncludeTax && priceIncludeTax !== 0) return undefined;
1250
+ quantity = format15(quantity);
1251
+ priceIncludeTax = format15(priceIncludeTax);
1252
+ return parseFloat(chain$1(bignumber(priceIncludeTax)).multiply(bignumber(quantity)).done().toNumber().toFixed(2)); // return parseFloat(evaluate(`${priceIncludeTax} * ${quantity}`).toFixed(2));
1253
+ }
1254
+ /**
1255
+ * 不含税金额 = 含税金额-税额
1256
+ * @param amountIncludeTax 含税金额
1257
+ * @param taxAmount 税额
1258
+ * @returns 不含税金额
1259
+ */
1260
+
1261
+ function countAmountExcludeTax(amountIncludeTax, taxAmount) {
1262
+ if (!amountIncludeTax && amountIncludeTax !== 0) return undefined;
1263
+ if (!taxAmount && taxAmount !== 0) return undefined;
1264
+ return chain$1(bignumber(amountIncludeTax)).subtract(bignumber(taxAmount)).done().toNumber();
1265
+ }
1266
+ /**
1267
+ * 税额 = (含税金额-扣除额)/(1+税率)*税率
1268
+ * @param amountIncludeTax 含税金额
1269
+ * @param deduction 扣除额
1270
+ * @param taxRate 税率
1271
+ * @returns 税额
1272
+ */
1273
+
1274
+ function countTaxAmount(amountIncludeTax, deduction, taxRate) {
1275
+ if (!amountIncludeTax && amountIncludeTax !== 0) return undefined;
1276
+ if (!deduction && deduction !== 0) return undefined;
1277
+ if (!taxRate && taxRate !== 0) return undefined;
1278
+ var taxRateBu = chain$1(bignumber(taxRate)).divide(bignumber(100)).done();
1279
+ return parseFloat(chain$1(bignumber(amountIncludeTax)).subtract(bignumber(deduction)).divide(chain$1(bignumber(1)).add(taxRateBu).done()).multiply(taxRateBu).done().toNumber().toFixed(2));
1280
+ }
1281
+ /**
1282
+ * 单价 = 金额/数量
1283
+ * @param amount 金额
1284
+ * @param quantity 数量
1285
+ * @returns 单价
1286
+ */
1287
+
1288
+ function countPrice(amount, quantity) {
1289
+ if (!amount && amount !== 0) return undefined;
1290
+ if (!quantity && quantity !== 0) return undefined;
1291
+ return format15(chain$1(bignumber(amount)).divide(bignumber(quantity)).done().toNumber());
1292
+ }
1293
+
875
1294
  /**
876
1295
  * 设置当前的编辑货物
877
1296
  */
878
1297
 
879
1298
  var addGoodDiscount = /*#__PURE__*/(function () {
880
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(state, options) {
1299
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
881
1300
  var _options$indexList, indexList, discount, goodsMap, goodsList, discountGroup, amountSum, _loop, t, _ret;
882
1301
 
883
- return regeneratorRuntime.wrap(function _callee$(_context) {
1302
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
884
1303
  while (1) {
885
1304
  switch (_context.prev = _context.next) {
886
1305
  case 0:
@@ -935,7 +1354,7 @@ var addGoodDiscount = /*#__PURE__*/(function () {
935
1354
  amountSum = amountSum.add(bignumber(lineAmountExcludeTax));
936
1355
  /** 金额(含税) lineAmountExcludeTax * (1+${good.taxRate}/100)*/
937
1356
 
938
- lineAmountIncludeTax = chain$1(bignumber(lineAmountExcludeTax)).multiply(chain$1(bignumber(1)).add(taxRate).done()).done().toNumber();
1357
+ lineAmountIncludeTax = format2(chain$1(bignumber(lineAmountExcludeTax)).multiply(chain$1(bignumber(1)).add(taxRate).done()).done().toNumber());
939
1358
  }
940
1359
  /** 税额 */
941
1360
 
@@ -999,8 +1418,8 @@ var addGoodDiscount = /*#__PURE__*/(function () {
999
1418
  */
1000
1419
 
1001
1420
  var addGood = /*#__PURE__*/(function () {
1002
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(state, options) {
1003
- return regeneratorRuntime.wrap(function _callee$(_context) {
1421
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
1422
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1004
1423
  while (1) {
1005
1424
  switch (_context.prev = _context.next) {
1006
1425
  case 0:
@@ -1025,9 +1444,9 @@ var addGood = /*#__PURE__*/(function () {
1025
1444
  * 保存正在编辑的货物
1026
1445
  */
1027
1446
  var saveEditGood = /*#__PURE__*/(function () {
1028
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(state) {
1447
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state) {
1029
1448
  var editGood, form;
1030
- return regeneratorRuntime.wrap(function _callee$(_context) {
1449
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1031
1450
  while (1) {
1032
1451
  switch (_context.prev = _context.next) {
1033
1452
  case 0:
@@ -1075,8 +1494,8 @@ var saveEditGood = /*#__PURE__*/(function () {
1075
1494
  var validateFields = function validateFields(form) {
1076
1495
  return new Promise(function (resolve) {
1077
1496
  form.validateFields( /*#__PURE__*/function () {
1078
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(err, values) {
1079
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
1497
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
1498
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1080
1499
  while (1) {
1081
1500
  switch (_context2.prev = _context2.next) {
1082
1501
  case 0:
@@ -1129,12 +1548,12 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
1129
1548
  /** 更新发票单据编号 */
1130
1549
 
1131
1550
 
1132
- return InvoiceController;
1551
+ return _createClass(InvoiceController);
1133
1552
  }(InvoiceControllerForm);
1134
1553
 
1135
1554
  var _defs, _path, _path2, _path3;
1136
1555
 
1137
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1556
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1138
1557
 
1139
1558
  function SvgAuto(props) {
1140
1559
  return /*#__PURE__*/createElement("svg", _extends({
@@ -1170,7 +1589,7 @@ var InvoiceHeader = decorator(Form.create())(function (props) {
1170
1589
  /** 控制器 */
1171
1590
 
1172
1591
 
1173
- var controller = default_1.useInvoiceController();
1592
+ var controller = Invoice.useInvoiceController();
1174
1593
  var model = controller.useMemo(function (s) {
1175
1594
  return s.model;
1176
1595
  }, []);
@@ -1278,8 +1697,8 @@ var InvoiceHeader = decorator(Form.create())(function (props) {
1278
1697
  },
1279
1698
  component: SvgAuto,
1280
1699
  onClick: function () {
1281
- var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
1282
- return regeneratorRuntime.wrap(function _callee$(_context) {
1700
+ var _onClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1701
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1283
1702
  while (1) {
1284
1703
  switch (_context.prev = _context.next) {
1285
1704
  case 0:
@@ -1484,7 +1903,7 @@ styleInject(css_248z$3);
1484
1903
  var nzhcn = require('nzh').cn;
1485
1904
 
1486
1905
  var Statistics = (function () {
1487
- var controller = default_1.useInvoiceController();
1906
+ var controller = Invoice.useInvoiceController();
1488
1907
  /** 是否不含税) */
1489
1908
 
1490
1909
  var isTaxIncluded = controller.useMemo(function (s) {
@@ -1592,7 +2011,7 @@ var Statistics = (function () {
1592
2011
  });
1593
2012
 
1594
2013
  var AddRowButton = (function () {
1595
- var controller = default_1.useInvoiceController();
2014
+ var controller = Invoice.useInvoiceController();
1596
2015
  var model = controller.useMemo(function (s) {
1597
2016
  return s.model;
1598
2017
  }, []);
@@ -1611,8 +2030,8 @@ var AddRowButton = (function () {
1611
2030
  var disabled = React.useMemo(function () {
1612
2031
  return typeof goodMax === 'number' ? goodsNum >= goodMax : false;
1613
2032
  }, [goodMax, goodsNum]);
1614
- var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
1615
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
2033
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2034
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1616
2035
  while (1) {
1617
2036
  switch (_context2.prev = _context2.next) {
1618
2037
  case 0:
@@ -1626,8 +2045,8 @@ var AddRowButton = (function () {
1626
2045
  case 4:
1627
2046
  _context2.next = 6;
1628
2047
  return controller.pipeline( /*#__PURE__*/function () {
1629
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
1630
- return regeneratorRuntime.wrap(function _callee$(_context) {
2048
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2049
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1631
2050
  while (1) {
1632
2051
  switch (_context.prev = _context.next) {
1633
2052
  case 0:
@@ -1681,7 +2100,7 @@ var AddRowButton = (function () {
1681
2100
  });
1682
2101
 
1683
2102
  var TaxIncludedSwitch = (function () {
1684
- var controller = default_1.useInvoiceController();
2103
+ var controller = Invoice.useInvoiceController();
1685
2104
  /** 是否含税 */
1686
2105
 
1687
2106
  var isTaxIncluded = controller.useMemo(function (e) {
@@ -1694,8 +2113,8 @@ var TaxIncludedSwitch = (function () {
1694
2113
  }, []);
1695
2114
  var onChange = React.useCallback(function (e) {
1696
2115
  controller.pipeline( /*#__PURE__*/function () {
1697
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
1698
- return regeneratorRuntime.wrap(function _callee$(_context) {
2116
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2117
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1699
2118
  while (1) {
1700
2119
  switch (_context.prev = _context.next) {
1701
2120
  case 0:
@@ -1716,7 +2135,11 @@ var TaxIncludedSwitch = (function () {
1716
2135
  };
1717
2136
  }())();
1718
2137
  }, []);
1719
- return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", null, "\u542B\u7A0E:"), /*#__PURE__*/React.createElement(Switch, {
2138
+ return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", {
2139
+ style: {
2140
+ marginRight: 2
2141
+ }
2142
+ }, "\u542B\u7A0E:"), /*#__PURE__*/React.createElement(Switch, {
1720
2143
  disabled: isSwitchTax === false,
1721
2144
  checked: isTaxIncluded,
1722
2145
  checkedChildren: "\u5F00",
@@ -1726,8 +2149,59 @@ var TaxIncludedSwitch = (function () {
1726
2149
  }));
1727
2150
  });
1728
2151
 
2152
+ var DescribeSwitch = (function () {
2153
+ var controller = Invoice.useInvoiceController();
2154
+ var productComparison = controller.useMemo(function (s) {
2155
+ return s.goodsListState.productComparison;
2156
+ }, []);
2157
+ var isMyShow = controller.useMemo(function (s) {
2158
+ return s.goodsListState.isMyShow;
2159
+ }, []);
2160
+ var onChange = React.useCallback(function (e) {
2161
+ controller.run( /*#__PURE__*/function () {
2162
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2163
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2164
+ while (1) {
2165
+ switch (_context.prev = _context.next) {
2166
+ case 0:
2167
+ return _context.abrupt("return", s.goodsListState.isMyShow = !s.goodsListState.isMyShow);
2168
+
2169
+ case 1:
2170
+ case "end":
2171
+ return _context.stop();
2172
+ }
2173
+ }
2174
+ }, _callee);
2175
+ }));
2176
+
2177
+ return function (_x) {
2178
+ return _ref.apply(this, arguments);
2179
+ };
2180
+ }());
2181
+ }, []);
2182
+ if (!productComparison.onComply) return /*#__PURE__*/React.createElement(React.Fragment, null);
2183
+ return /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("label", {
2184
+ style: {
2185
+ marginRight: 2
2186
+ }
2187
+ }, /*#__PURE__*/React.createElement(Tooltip, {
2188
+ title: "\u84DD\u8272\u4EE3\u8868\u6211\u65B9\u5546\u54C1\u63CF\u8FF0\uFF0C\u9ED1\u8272\u4EE3\u8868\u5BF9\u65B9\u7684\u5546\u54C1\u63CF\u8FF0\u3002"
2189
+ }, /*#__PURE__*/React.createElement(Icon, {
2190
+ style: {
2191
+ marginRight: 3
2192
+ },
2193
+ type: "info-circle"
2194
+ })), "\u4F7F\u7528\u54EA\u65B9\u5546\u54C1\u63CF\u8FF0:"), /*#__PURE__*/React.createElement(Switch, {
2195
+ checked: isMyShow,
2196
+ checkedChildren: "\u6211\u65B9",
2197
+ unCheckedChildren: "\u5BF9\u65B9",
2198
+ defaultChecked: true,
2199
+ onChange: onChange
2200
+ }));
2201
+ });
2202
+
1729
2203
  function TableRow(props) {
1730
- var controller = default_1.useInvoiceController();
2204
+ var controller = Invoice.useInvoiceController();
1731
2205
  var goodsMap = controller.useMemo(function (s) {
1732
2206
  return s.goodsListState.goodsMap;
1733
2207
  }, []);
@@ -1789,7 +2263,7 @@ var _create = create(all, {
1789
2263
 
1790
2264
  var AddDiscountRowButton = decorator(Form.create())(function (props) {
1791
2265
  /** 控制器 */
1792
- var controller = default_1.useInvoiceController();
2266
+ var controller = Invoice.useInvoiceController();
1793
2267
  var model = controller.useMemo(function (s) {
1794
2268
  return s.model;
1795
2269
  }, []);
@@ -1820,8 +2294,8 @@ var AddDiscountRowButton = decorator(Form.create())(function (props) {
1820
2294
 
1821
2295
  var onClose = React.useCallback(function () {
1822
2296
  controller.pipeline( /*#__PURE__*/function () {
1823
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
1824
- return regeneratorRuntime.wrap(function _callee$(_context) {
2297
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2298
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1825
2299
  while (1) {
1826
2300
  switch (_context.prev = _context.next) {
1827
2301
  case 0:
@@ -1842,8 +2316,8 @@ var AddDiscountRowButton = decorator(Form.create())(function (props) {
1842
2316
  }, []);
1843
2317
  /** 点击了 添加折扣行 按钮 */
1844
2318
 
1845
- var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
1846
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
2319
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
2320
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1847
2321
  while (1) {
1848
2322
  switch (_context3.prev = _context3.next) {
1849
2323
  case 0:
@@ -1857,9 +2331,9 @@ var AddDiscountRowButton = decorator(Form.create())(function (props) {
1857
2331
  case 4:
1858
2332
  _context3.next = 6;
1859
2333
  return controller.pipeline( /*#__PURE__*/function () {
1860
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
2334
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
1861
2335
  var isOk;
1862
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
2336
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1863
2337
  while (1) {
1864
2338
  switch (_context2.prev = _context2.next) {
1865
2339
  case 0:
@@ -1951,7 +2425,7 @@ var AddDiscountRowButton = decorator(Form.create())(function (props) {
1951
2425
  var DrawerBody = decorator(Form.create())(function (props) {
1952
2426
  var form = props.form;
1953
2427
  var getFieldDecorator = form.getFieldDecorator;
1954
- var controller = default_1.useInvoiceController();
2428
+ var controller = Invoice.useInvoiceController();
1955
2429
  /** 选中的货物索引列表 */
1956
2430
 
1957
2431
  var discountGoodIndex = controller.useMemo(function (s) {
@@ -1980,8 +2454,8 @@ var DrawerBody = decorator(Form.create())(function (props) {
1980
2454
 
1981
2455
  var onClose = React.useCallback(function () {
1982
2456
  controller.pipeline( /*#__PURE__*/function () {
1983
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(s) {
1984
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
2457
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
2458
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1985
2459
  while (1) {
1986
2460
  switch (_context4.prev = _context4.next) {
1987
2461
  case 0:
@@ -2009,8 +2483,8 @@ var DrawerBody = decorator(Form.create())(function (props) {
2009
2483
  var discount = parseFloat(parseFloat(values.discount).toFixed(4));
2010
2484
  var indexList = discountGoodIndex;
2011
2485
  controller.pipeline( /*#__PURE__*/function () {
2012
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(s) {
2013
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
2486
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
2487
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2014
2488
  while (1) {
2015
2489
  switch (_context5.prev = _context5.next) {
2016
2490
  case 0:
@@ -2046,7 +2520,7 @@ var DrawerBody = decorator(Form.create())(function (props) {
2046
2520
  });
2047
2521
  });
2048
2522
  }, 300), [form, lineAmountSum]);
2049
- /** 折扣率变化 */
2523
+ /** 折扣变化 */
2050
2524
 
2051
2525
  var onChangeDiscolineAmountunt = React.useCallback(lazyFn(function (e) {
2052
2526
  form.validateFields(function (err, values) {
@@ -2171,14 +2645,14 @@ var coolingFn = (function () {
2171
2645
  });
2172
2646
 
2173
2647
  var EndowCodeButton = (function () {
2174
- var controller = default_1.useInvoiceController();
2648
+ var controller = Invoice.useInvoiceController();
2175
2649
  /** 是否禁用 */
2176
2650
 
2177
2651
  var disabled = controller.useMemo(function (s) {
2178
2652
  if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
2179
2653
  }, []);
2180
- var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
2181
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
2654
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2655
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2182
2656
  while (1) {
2183
2657
  switch (_context2.prev = _context2.next) {
2184
2658
  case 0:
@@ -2192,8 +2666,8 @@ var EndowCodeButton = (function () {
2192
2666
  case 4:
2193
2667
  _context2.next = 6;
2194
2668
  return controller.pipeline( /*#__PURE__*/function () {
2195
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
2196
- return regeneratorRuntime.wrap(function _callee$(_context) {
2669
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2670
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2197
2671
  while (1) {
2198
2672
  switch (_context.prev = _context.next) {
2199
2673
  case 0:
@@ -2256,7 +2730,7 @@ var EndowCodeButton = (function () {
2256
2730
  });
2257
2731
 
2258
2732
  var DelRowButton = (function () {
2259
- var controller = default_1.useInvoiceController();
2733
+ var controller = Invoice.useInvoiceController();
2260
2734
  var model = controller.useMemo(function (s) {
2261
2735
  return s.model;
2262
2736
  }, []);
@@ -2272,9 +2746,9 @@ var DelRowButton = (function () {
2272
2746
  }, []);
2273
2747
  var onClick = React.useCallback(function () {
2274
2748
  controller.pipeline( /*#__PURE__*/function () {
2275
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
2749
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2276
2750
  var goodsList;
2277
- return regeneratorRuntime.wrap(function _callee$(_context) {
2751
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2278
2752
  while (1) {
2279
2753
  switch (_context.prev = _context.next) {
2280
2754
  case 0:
@@ -2314,9 +2788,165 @@ var DelRowButton = (function () {
2314
2788
  }, "\u5220\u9664\u884C");
2315
2789
  });
2316
2790
 
2791
+ /** 拆分全称加简称 */
2792
+ var getSN = function getSN(value) {
2793
+ debugger;
2794
+ if (!value) return undefined;
2795
+ var arr = value.match(/\*[^*]+\*/);
2796
+
2797
+ if (arr && arr[0]) {
2798
+ return {
2799
+ shorthand: arr[0].split('*')[1],
2800
+ full: value.replace(arr[0], '')
2801
+ };
2802
+ } else {
2803
+ return {
2804
+ shorthand: undefined,
2805
+ full: value
2806
+ };
2807
+ }
2808
+ };
2809
+ /** 组合全称加简称 */
2810
+
2811
+ var getItemName = function getItemName(value) {
2812
+ if (value.shorthand) {
2813
+ return "*".concat(value.shorthand, "*").concat(value.full);
2814
+ } else {
2815
+ return value.full;
2816
+ }
2817
+ };
2818
+ /** 设置简称 */
2819
+
2820
+ var setShorthand = function setShorthand(name, shorthand) {
2821
+ if (!name) return undefined;
2822
+ var sn = getSN(name);
2823
+ if (!sn) return undefined;
2824
+ sn.shorthand = shorthand || '';
2825
+ return getItemName(sn);
2826
+ };
2827
+
2828
+ var CommodityComparisonButton = (function () {
2829
+ var controller = Invoice.useInvoiceController();
2830
+
2831
+ var _controller$useMemo = controller.useMemo(function (s) {
2832
+ return s.goodsListState.productComparison;
2833
+ }, []),
2834
+ onComply = _controller$useMemo.onComply;
2835
+ /** 是否禁用 */
2836
+
2837
+
2838
+ var disabled = controller.useMemo(function (s) {
2839
+ if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
2840
+ }, []);
2841
+ /** 点击了 */
2842
+
2843
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2844
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2845
+ while (1) {
2846
+ switch (_context2.prev = _context2.next) {
2847
+ case 0:
2848
+ _context2.next = 2;
2849
+ return controller.saveEditGood();
2850
+
2851
+ case 2:
2852
+ _context2.next = 4;
2853
+ return controller.wait();
2854
+
2855
+ case 4:
2856
+ _context2.next = 6;
2857
+ return controller.run( /*#__PURE__*/function () {
2858
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2859
+ var _s$goodsListState, _s$goodsListState$pro;
2860
+
2861
+ var goods, newGoods;
2862
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2863
+ while (1) {
2864
+ switch (_context.prev = _context.next) {
2865
+ case 0:
2866
+ if (!(s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0)) {
2867
+ _context.next = 3;
2868
+ break;
2869
+ }
2870
+
2871
+ coolingFn('不能给正在编辑的货物执行商品对照', 3000, function () {
2872
+ message.error('不能给正在编辑的货物执行商品对照');
2873
+ });
2874
+ return _context.abrupt("return");
2875
+
2876
+ case 3:
2877
+ if ((_s$goodsListState = s.goodsListState) === null || _s$goodsListState === void 0 ? void 0 : (_s$goodsListState$pro = _s$goodsListState.productComparison) === null || _s$goodsListState$pro === void 0 ? void 0 : _s$goodsListState$pro.onComply) {
2878
+ _context.next = 5;
2879
+ break;
2880
+ }
2881
+
2882
+ return _context.abrupt("return");
2883
+
2884
+ case 5:
2885
+ goods = s.goodsListState.selectedGoodIndex.map(function (e) {
2886
+ var _getSN, _getSN2;
2887
+
2888
+ var t = s.goodsListState.goodsMap.get(e);
2889
+ if (!t) return undefined;
2890
+ return _objectSpread2(_objectSpread2({}, t), {}, {
2891
+ itemName: (_getSN = getSN(t.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.full,
2892
+ itemNameOther: (_getSN2 = getSN(t.itemNameOther)) === null || _getSN2 === void 0 ? void 0 : _getSN2.full
2893
+ });
2894
+ }).filter(function (e) {
2895
+ return !!e;
2896
+ }); // 比对后的商品
2897
+
2898
+ _context.next = 8;
2899
+ return s.goodsListState.productComparison.onComply(goods);
2900
+
2901
+ case 8:
2902
+ newGoods = _context.sent;
2903
+ newGoods.filter(function (e) {
2904
+ var _getSN3, _getSN4;
2905
+
2906
+ var vt = s.goodsListState.goodsMap.get(e.$index);
2907
+ if (!vt) return undefined;
2908
+ vt.itemName = e.itemName ? setShorthand(e.itemName, (_getSN3 = getSN(vt.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.shorthand) : vt.itemName;
2909
+ vt.itemNameOther = e.itemNameOther ? setShorthand(e.itemNameOther, (_getSN4 = getSN(vt.itemNameOther)) === null || _getSN4 === void 0 ? void 0 : _getSN4.shorthand) : vt.itemNameOther;
2910
+ vt.unit = e.unit ? e.unit : vt.unit;
2911
+ vt.unitOther = e.unitOther ? e.unitOther : vt.unitOther;
2912
+ vt.itemModelName = e.itemModelName ? e.itemModelName : vt.itemModelName;
2913
+ vt.itemModelNameOther = e.itemModelNameOther ? e.itemModelNameOther : vt.itemModelNameOther;
2914
+ vt.itemCode = e.itemCode ? e.itemCode : vt.itemCode;
2915
+ vt.itemCodeOther = e.itemCodeOther ? e.itemCodeOther : vt.itemCodeOther;
2916
+ });
2917
+
2918
+ case 10:
2919
+ case "end":
2920
+ return _context.stop();
2921
+ }
2922
+ }
2923
+ }, _callee);
2924
+ }));
2925
+
2926
+ return function (_x) {
2927
+ return _ref2.apply(this, arguments);
2928
+ };
2929
+ }());
2930
+
2931
+ case 6:
2932
+ case "end":
2933
+ return _context2.stop();
2934
+ }
2935
+ }
2936
+ }, _callee2);
2937
+ })), []); // 没用 执行商品对照 的方法 不显示按钮
2938
+
2939
+ if (!onComply) return /*#__PURE__*/React.createElement(React.Fragment, null);
2940
+ return /*#__PURE__*/React.createElement(Button, {
2941
+ icon: 'swap',
2942
+ disabled: disabled,
2943
+ onClick: onClick
2944
+ }, "\u6267\u884C\u5546\u54C1\u5BF9\u7167");
2945
+ });
2946
+
2317
2947
  var _defs$1, _path$1;
2318
2948
 
2319
- function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
2949
+ function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
2320
2950
 
2321
2951
  function SvgSpot(props) {
2322
2952
  return /*#__PURE__*/createElement("svg", _extends$1({
@@ -2330,7 +2960,7 @@ function SvgSpot(props) {
2330
2960
 
2331
2961
  var Text$1 = Typography.Text;
2332
2962
  var useDelItem = (function (goods) {
2333
- var controller = default_1.useInvoiceController();
2963
+ var controller = Invoice.useInvoiceController();
2334
2964
  var onClick = React.useCallback(function () {
2335
2965
  controller.delGood(goods.$index);
2336
2966
  }, [controller, goods.$index]);
@@ -2352,11 +2982,11 @@ var useDelItem = (function (goods) {
2352
2982
 
2353
2983
  var Text$2 = Typography.Text;
2354
2984
  var useAddDiscount = (function (goods) {
2355
- var controller = default_1.useInvoiceController();
2985
+ var controller = Invoice.useInvoiceController();
2356
2986
  /** 点击了 添加折扣行 按钮 */
2357
2987
 
2358
- var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
2359
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
2988
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2989
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2360
2990
  while (1) {
2361
2991
  switch (_context2.prev = _context2.next) {
2362
2992
  case 0:
@@ -2370,9 +3000,9 @@ var useAddDiscount = (function (goods) {
2370
3000
  case 4:
2371
3001
  _context2.next = 6;
2372
3002
  return controller.pipeline( /*#__PURE__*/function () {
2373
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
3003
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2374
3004
  var err, key;
2375
- return regeneratorRuntime.wrap(function _callee$(_context) {
3005
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2376
3006
  while (1) {
2377
3007
  switch (_context.prev = _context.next) {
2378
3008
  case 0:
@@ -2382,7 +3012,7 @@ var useAddDiscount = (function (goods) {
2382
3012
  }
2383
3013
 
2384
3014
  err = s.goodsListState.form.getFieldsError();
2385
- _context.t0 = regeneratorRuntime.keys(err);
3015
+ _context.t0 = _regeneratorRuntime().keys(err);
2386
3016
 
2387
3017
  case 3:
2388
3018
  if ((_context.t1 = _context.t0()).done) {
@@ -2457,93 +3087,22 @@ var useAddDiscount = (function (goods) {
2457
3087
  return undefined;
2458
3088
  }
2459
3089
 
2460
- return React.useMemo(function () {
2461
- if (goods.lineAttribute !== LineAttributeType$1.正常) {
2462
- return undefined;
2463
- }
2464
-
2465
- return /*#__PURE__*/React.createElement(Menu.Item, {
2466
- key: "addDiscount",
2467
- onClick: onClick
2468
- }, /*#__PURE__*/React.createElement(Text$2, {
2469
- strong: true
2470
- }, "\u6DFB\u52A0\u6298\u6263\u884C"));
2471
- }, [onClick, goods.lineAttribute]);
2472
- });
2473
-
2474
- /** 格式化 保留2位小数 */
2475
-
2476
- var format2 = function format2(value) {
2477
- if (value === Infinity) return '';
2478
- if ("".concat(value) === 'NaN') return '';
2479
- if (typeof value === 'string') value = parseFloat(value);
2480
- return parseFloat(value.toFixed(2));
2481
- };
2482
- /** 格式化 保留15位数字 */
2483
-
2484
- var format15 = function format15(value) {
2485
- if (value === Infinity) return '';
2486
- if ("".concat(value) === 'NaN') return '';
2487
- if (typeof value === 'string') value = parseFloat(value);
2488
- var fractionDigits = 15 - "".concat(value || 0).indexOf('.');
2489
- return parseFloat(value.toFixed(fractionDigits > 8 ? 8 : fractionDigits));
2490
- };
2491
- /**
2492
- * 金额(含税) = 数量 * 单价(含税)
2493
- * @param quantity 数量
2494
- * @param priceIncludeTax 单价(含税)
2495
- * @returns 金额(含税)
2496
- */
2497
-
2498
- function countAmountIncludeTax(quantity, priceIncludeTax) {
2499
- if (!quantity && quantity !== 0) return undefined;
2500
- if (!priceIncludeTax && priceIncludeTax !== 0) return undefined;
2501
- quantity = format15(quantity);
2502
- priceIncludeTax = format15(priceIncludeTax);
2503
- return parseFloat(chain$1(bignumber(priceIncludeTax)).multiply(bignumber(quantity)).done().toNumber().toFixed(2)); // return parseFloat(evaluate(`${priceIncludeTax} * ${quantity}`).toFixed(2));
2504
- }
2505
- /**
2506
- * 不含税金额 = 含税金额-税额
2507
- * @param amountIncludeTax 含税金额
2508
- * @param taxAmount 税额
2509
- * @returns 不含税金额
2510
- */
2511
-
2512
- function countAmountExcludeTax(amountIncludeTax, taxAmount) {
2513
- if (!amountIncludeTax && amountIncludeTax !== 0) return undefined;
2514
- if (!taxAmount && taxAmount !== 0) return undefined;
2515
- return chain$1(bignumber(amountIncludeTax)).subtract(bignumber(taxAmount)).done().toNumber();
2516
- }
2517
- /**
2518
- * 税额 = (含税金额-扣除额)/(1+税率)*税率
2519
- * @param amountIncludeTax 含税金额
2520
- * @param deduction 扣除额
2521
- * @param taxRate 税率
2522
- * @returns 税额
2523
- */
2524
-
2525
- function countTaxAmount(amountIncludeTax, deduction, taxRate) {
2526
- if (!amountIncludeTax && amountIncludeTax !== 0) return undefined;
2527
- if (!deduction && deduction !== 0) return undefined;
2528
- if (!taxRate && taxRate !== 0) return undefined;
2529
- var taxRateBu = chain$1(bignumber(taxRate)).divide(bignumber(100)).done();
2530
- return parseFloat(chain$1(bignumber(amountIncludeTax)).subtract(bignumber(deduction)).divide(chain$1(bignumber(1)).add(taxRateBu).done()).multiply(taxRateBu).done().toNumber().toFixed(2));
2531
- }
2532
- /**
2533
- * 单价 = 金额/数量
2534
- * @param amount 金额
2535
- * @param quantity 数量
2536
- * @returns 单价
2537
- */
3090
+ return React.useMemo(function () {
3091
+ if (goods.lineAttribute !== LineAttributeType$1.正常) {
3092
+ return undefined;
3093
+ }
2538
3094
 
2539
- function countPrice(amount, quantity) {
2540
- if (!amount && amount !== 0) return undefined;
2541
- if (!quantity && quantity !== 0) return undefined;
2542
- return format15(chain$1(bignumber(amount)).divide(bignumber(quantity)).done().toNumber());
2543
- }
3095
+ return /*#__PURE__*/React.createElement(Menu.Item, {
3096
+ key: "addDiscount",
3097
+ onClick: onClick
3098
+ }, /*#__PURE__*/React.createElement(Text$2, {
3099
+ strong: true
3100
+ }, "\u6DFB\u52A0\u6298\u6263\u884C"));
3101
+ }, [onClick, goods.lineAttribute]);
3102
+ });
2544
3103
 
2545
3104
  //! moment.js
2546
- //! version : 2.29.1
3105
+ //! version : 2.29.3
2547
3106
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
2548
3107
  //! license : MIT
2549
3108
  //! momentjs.com
@@ -2614,8 +3173,9 @@ function isDate(input) {
2614
3173
 
2615
3174
  function map(arr, fn) {
2616
3175
  var res = [],
2617
- i;
2618
- for (i = 0; i < arr.length; ++i) {
3176
+ i,
3177
+ arrLen = arr.length;
3178
+ for (i = 0; i < arrLen; ++i) {
2619
3179
  res.push(fn(arr[i], i));
2620
3180
  }
2621
3181
  return res;
@@ -2744,7 +3304,10 @@ var momentProperties = (hooks.momentProperties = []),
2744
3304
  updateInProgress = false;
2745
3305
 
2746
3306
  function copyConfig(to, from) {
2747
- var i, prop, val;
3307
+ var i,
3308
+ prop,
3309
+ val,
3310
+ momentPropertiesLen = momentProperties.length;
2748
3311
 
2749
3312
  if (!isUndefined(from._isAMomentObject)) {
2750
3313
  to._isAMomentObject = from._isAMomentObject;
@@ -2777,8 +3340,8 @@ function copyConfig(to, from) {
2777
3340
  to._locale = from._locale;
2778
3341
  }
2779
3342
 
2780
- if (momentProperties.length > 0) {
2781
- for (i = 0; i < momentProperties.length; i++) {
3343
+ if (momentPropertiesLen > 0) {
3344
+ for (i = 0; i < momentPropertiesLen; i++) {
2782
3345
  prop = momentProperties[i];
2783
3346
  val = from[prop];
2784
3347
  if (!isUndefined(val)) {
@@ -2833,8 +3396,9 @@ function deprecate(msg, fn) {
2833
3396
  var args = [],
2834
3397
  arg,
2835
3398
  i,
2836
- key;
2837
- for (i = 0; i < arguments.length; i++) {
3399
+ key,
3400
+ argLen = arguments.length;
3401
+ for (i = 0; i < argLen; i++) {
2838
3402
  arg = '';
2839
3403
  if (typeof arguments[i] === 'object') {
2840
3404
  arg += '\n[' + i + '] ';
@@ -2984,7 +3548,8 @@ function zeroFill(number, targetLength, forceSign) {
2984
3548
  );
2985
3549
  }
2986
3550
 
2987
- var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
3551
+ var formattingTokens =
3552
+ /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
2988
3553
  localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
2989
3554
  formatFunctions = {},
2990
3555
  formatTokenFunctions = {};
@@ -3288,8 +3853,9 @@ function stringSet(units, value) {
3288
3853
  if (typeof units === 'object') {
3289
3854
  units = normalizeObjectUnits(units);
3290
3855
  var prioritized = getPrioritizedUnits(units),
3291
- i;
3292
- for (i = 0; i < prioritized.length; i++) {
3856
+ i,
3857
+ prioritizedLen = prioritized.length;
3858
+ for (i = 0; i < prioritizedLen; i++) {
3293
3859
  this[prioritized[i].unit](units[prioritized[i].unit]);
3294
3860
  }
3295
3861
  } else {
@@ -3319,7 +3885,8 @@ var match1 = /\d/, // 0 - 9
3319
3885
  matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
3320
3886
  // any word (or two) characters or numbers including two/three word month in arabic.
3321
3887
  // includes scottish gaelic two word and hyphenated months
3322
- matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
3888
+ matchWord =
3889
+ /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
3323
3890
  regexes;
3324
3891
 
3325
3892
  regexes = {};
@@ -3345,15 +3912,12 @@ function unescapeFormat(s) {
3345
3912
  return regexEscape(
3346
3913
  s
3347
3914
  .replace('\\', '')
3348
- .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
3349
- matched,
3350
- p1,
3351
- p2,
3352
- p3,
3353
- p4
3354
- ) {
3355
- return p1 || p2 || p3 || p4;
3356
- })
3915
+ .replace(
3916
+ /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
3917
+ function (matched, p1, p2, p3, p4) {
3918
+ return p1 || p2 || p3 || p4;
3919
+ }
3920
+ )
3357
3921
  );
3358
3922
  }
3359
3923
 
@@ -3365,7 +3929,8 @@ var tokens = {};
3365
3929
 
3366
3930
  function addParseToken(token, callback) {
3367
3931
  var i,
3368
- func = callback;
3932
+ func = callback,
3933
+ tokenLen;
3369
3934
  if (typeof token === 'string') {
3370
3935
  token = [token];
3371
3936
  }
@@ -3374,7 +3939,8 @@ function addParseToken(token, callback) {
3374
3939
  array[callback] = toInt(input);
3375
3940
  };
3376
3941
  }
3377
- for (i = 0; i < token.length; i++) {
3942
+ tokenLen = token.length;
3943
+ for (i = 0; i < tokenLen; i++) {
3378
3944
  tokens[token[i]] = func;
3379
3945
  }
3380
3946
  }
@@ -3485,12 +4051,12 @@ addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
3485
4051
 
3486
4052
  // LOCALES
3487
4053
 
3488
- var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
3489
- '_'
3490
- ),
3491
- defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
3492
- '_'
3493
- ),
4054
+ var defaultLocaleMonths =
4055
+ 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
4056
+ '_'
4057
+ ),
4058
+ defaultLocaleMonthsShort =
4059
+ 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
3494
4060
  MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
3495
4061
  defaultMonthsShortRegex = matchWord,
3496
4062
  defaultMonthsRegex = matchWord;
@@ -3932,14 +4498,12 @@ addRegexToken('ww', match1to2, match2);
3932
4498
  addRegexToken('W', match1to2);
3933
4499
  addRegexToken('WW', match1to2, match2);
3934
4500
 
3935
- addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
3936
- input,
3937
- week,
3938
- config,
3939
- token
3940
- ) {
3941
- week[token.substr(0, 1)] = toInt(input);
3942
- });
4501
+ addWeekParseToken(
4502
+ ['w', 'ww', 'W', 'WW'],
4503
+ function (input, week, config, token) {
4504
+ week[token.substr(0, 1)] = toInt(input);
4505
+ }
4506
+ );
3943
4507
 
3944
4508
  // HELPERS
3945
4509
 
@@ -4064,9 +4628,8 @@ function shiftWeekdays(ws, n) {
4064
4628
  return ws.slice(n, 7).concat(ws.slice(0, n));
4065
4629
  }
4066
4630
 
4067
- var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
4068
- '_'
4069
- ),
4631
+ var defaultLocaleWeekdays =
4632
+ 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
4070
4633
  defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
4071
4634
  defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
4072
4635
  defaultWeekdaysRegex = matchWord,
@@ -4614,6 +5177,11 @@ function chooseLocale(names) {
4614
5177
  return globalLocale;
4615
5178
  }
4616
5179
 
5180
+ function isLocaleNameSane(name) {
5181
+ // Prevent names that look like filesystem paths, i.e contain '/' or '\'
5182
+ return name.match('^[^/\\\\]*$') != null;
5183
+ }
5184
+
4617
5185
  function loadLocale(name) {
4618
5186
  var oldLocale = null,
4619
5187
  aliasedRequire;
@@ -4622,7 +5190,8 @@ function loadLocale(name) {
4622
5190
  locales[name] === undefined &&
4623
5191
  typeof module !== 'undefined' &&
4624
5192
  module &&
4625
- module.exports
5193
+ module.exports &&
5194
+ isLocaleNameSane(name)
4626
5195
  ) {
4627
5196
  try {
4628
5197
  oldLocale = globalLocale._abbr;
@@ -4839,8 +5408,10 @@ function checkOverflow(m) {
4839
5408
 
4840
5409
  // iso 8601 regex
4841
5410
  // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
4842
- var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
4843
- basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
5411
+ var extendedIsoRegex =
5412
+ /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
5413
+ basicIsoRegex =
5414
+ /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
4844
5415
  tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
4845
5416
  isoDates = [
4846
5417
  ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
@@ -4871,7 +5442,8 @@ var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\
4871
5442
  ],
4872
5443
  aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
4873
5444
  // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
4874
- rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
5445
+ rfc2822 =
5446
+ /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
4875
5447
  obsOffsets = {
4876
5448
  UT: 0,
4877
5449
  GMT: 0,
@@ -4894,12 +5466,13 @@ function configFromISO(config) {
4894
5466
  allowTime,
4895
5467
  dateFormat,
4896
5468
  timeFormat,
4897
- tzFormat;
5469
+ tzFormat,
5470
+ isoDatesLen = isoDates.length,
5471
+ isoTimesLen = isoTimes.length;
4898
5472
 
4899
5473
  if (match) {
4900
5474
  getParsingFlags(config).iso = true;
4901
-
4902
- for (i = 0, l = isoDates.length; i < l; i++) {
5475
+ for (i = 0, l = isoDatesLen; i < l; i++) {
4903
5476
  if (isoDates[i][1].exec(match[1])) {
4904
5477
  dateFormat = isoDates[i][0];
4905
5478
  allowTime = isoDates[i][2] !== false;
@@ -4911,7 +5484,7 @@ function configFromISO(config) {
4911
5484
  return;
4912
5485
  }
4913
5486
  if (match[3]) {
4914
- for (i = 0, l = isoTimes.length; i < l; i++) {
5487
+ for (i = 0, l = isoTimesLen; i < l; i++) {
4915
5488
  if (isoTimes[i][1].exec(match[3])) {
4916
5489
  // match[2] should be 'T' or space
4917
5490
  timeFormat = (match[2] || ' ') + isoTimes[i][0];
@@ -5291,12 +5864,13 @@ function configFromStringAndFormat(config) {
5291
5864
  skipped,
5292
5865
  stringLength = string.length,
5293
5866
  totalParsedInputLength = 0,
5294
- era;
5867
+ era,
5868
+ tokenLen;
5295
5869
 
5296
5870
  tokens =
5297
5871
  expandFormat(config._f, config._locale).match(formattingTokens) || [];
5298
-
5299
- for (i = 0; i < tokens.length; i++) {
5872
+ tokenLen = tokens.length;
5873
+ for (i = 0; i < tokenLen; i++) {
5300
5874
  token = tokens[i];
5301
5875
  parsedInput = (string.match(getParseRegexForToken(token, config)) ||
5302
5876
  [])[0];
@@ -5391,15 +5965,16 @@ function configFromStringAndArray(config) {
5391
5965
  i,
5392
5966
  currentScore,
5393
5967
  validFormatFound,
5394
- bestFormatIsValid = false;
5968
+ bestFormatIsValid = false,
5969
+ configfLen = config._f.length;
5395
5970
 
5396
- if (config._f.length === 0) {
5971
+ if (configfLen === 0) {
5397
5972
  getParsingFlags(config).invalidFormat = true;
5398
5973
  config._d = new Date(NaN);
5399
5974
  return;
5400
5975
  }
5401
5976
 
5402
- for (i = 0; i < config._f.length; i++) {
5977
+ for (i = 0; i < configfLen; i++) {
5403
5978
  currentScore = 0;
5404
5979
  validFormatFound = false;
5405
5980
  tempConfig = copyConfig({}, config);
@@ -5640,7 +6215,8 @@ var ordering = [
5640
6215
  function isDurationValid(m) {
5641
6216
  var key,
5642
6217
  unitHasDecimal = false,
5643
- i;
6218
+ i,
6219
+ orderLen = ordering.length;
5644
6220
  for (key in m) {
5645
6221
  if (
5646
6222
  hasOwnProp(m, key) &&
@@ -5653,7 +6229,7 @@ function isDurationValid(m) {
5653
6229
  }
5654
6230
  }
5655
6231
 
5656
- for (i = 0; i < ordering.length; ++i) {
6232
+ for (i = 0; i < orderLen; ++i) {
5657
6233
  if (m[ordering[i]]) {
5658
6234
  if (unitHasDecimal) {
5659
6235
  return false; // only allow non-integers for smallest unit
@@ -5978,7 +6554,8 @@ var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
5978
6554
  // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
5979
6555
  // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
5980
6556
  // and further modified to allow for strings containing both week and day
5981
- isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
6557
+ isoRegex =
6558
+ /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
5982
6559
 
5983
6560
  function createDuration(input, key) {
5984
6561
  var duration = input,
@@ -6199,9 +6776,10 @@ function isMomentInputObject(input) {
6199
6776
  'ms',
6200
6777
  ],
6201
6778
  i,
6202
- property;
6779
+ property,
6780
+ propertyLen = properties.length;
6203
6781
 
6204
- for (i = 0; i < properties.length; i += 1) {
6782
+ for (i = 0; i < propertyLen; i += 1) {
6205
6783
  property = properties[i];
6206
6784
  propertyTest = propertyTest || hasOwnProp(input, property);
6207
6785
  }
@@ -6824,19 +7402,17 @@ addRegexToken('NNN', matchEraAbbr);
6824
7402
  addRegexToken('NNNN', matchEraName);
6825
7403
  addRegexToken('NNNNN', matchEraNarrow);
6826
7404
 
6827
- addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
6828
- input,
6829
- array,
6830
- config,
6831
- token
6832
- ) {
6833
- var era = config._locale.erasParse(input, token, config._strict);
6834
- if (era) {
6835
- getParsingFlags(config).era = era;
6836
- } else {
6837
- getParsingFlags(config).invalidEra = input;
7405
+ addParseToken(
7406
+ ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],
7407
+ function (input, array, config, token) {
7408
+ var era = config._locale.erasParse(input, token, config._strict);
7409
+ if (era) {
7410
+ getParsingFlags(config).era = era;
7411
+ } else {
7412
+ getParsingFlags(config).invalidEra = input;
7413
+ }
6838
7414
  }
6839
- });
7415
+ );
6840
7416
 
6841
7417
  addRegexToken('y', matchUnsigned);
6842
7418
  addRegexToken('yy', matchUnsigned);
@@ -7128,14 +7704,12 @@ addRegexToken('gggg', match1to4, match4);
7128
7704
  addRegexToken('GGGGG', match1to6, match6);
7129
7705
  addRegexToken('ggggg', match1to6, match6);
7130
7706
 
7131
- addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
7132
- input,
7133
- week,
7134
- config,
7135
- token
7136
- ) {
7137
- week[token.substr(0, 2)] = toInt(input);
7138
- });
7707
+ addWeekParseToken(
7708
+ ['gggg', 'ggggg', 'GGGG', 'GGGGG'],
7709
+ function (input, week, config, token) {
7710
+ week[token.substr(0, 2)] = toInt(input);
7711
+ }
7712
+ );
7139
7713
 
7140
7714
  addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
7141
7715
  week[token] = hooks.parseTwoDigitYear(input);
@@ -8158,7 +8732,7 @@ addParseToken('x', function (input, array, config) {
8158
8732
 
8159
8733
  //! moment.js
8160
8734
 
8161
- hooks.version = '2.29.1';
8735
+ hooks.version = '2.29.3';
8162
8736
 
8163
8737
  setHookCallback(createLocal);
8164
8738
 
@@ -8247,10 +8821,10 @@ var promptErr = function promptErr(err) {
8247
8821
 
8248
8822
  var onChangeQuantity = lazyFn$1(function (controller, form, record) {
8249
8823
  form.validateFields( /*#__PURE__*/function () {
8250
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(err, values) {
8824
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(err, values) {
8251
8825
  var quantity, priceIncludeTax, lineAmountIncludeTax, _lineAmountIncludeTax, _priceIncludeTax, priceExcludeTax, lineAmountExcludeTax, _lineAmountExcludeTax, _priceExcludeTax;
8252
8826
 
8253
- return regeneratorRuntime.wrap(function _callee$(_context) {
8827
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
8254
8828
  while (1) {
8255
8829
  switch (_context.prev = _context.next) {
8256
8830
  case 0:
@@ -8396,10 +8970,10 @@ var onChangeQuantity = lazyFn$1(function (controller, form, record) {
8396
8970
 
8397
8971
  var onChangePriceIncludeTax = lazyFn$1(function (controller, form, record) {
8398
8972
  form.validateFields( /*#__PURE__*/function () {
8399
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(err, values) {
8973
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
8400
8974
  var priceIncludeTax, quantity, lineAmountIncludeTax, _lineAmountIncludeTax2, _quantity;
8401
8975
 
8402
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
8976
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8403
8977
  while (1) {
8404
8978
  switch (_context2.prev = _context2.next) {
8405
8979
  case 0:
@@ -8495,10 +9069,10 @@ var onChangePriceIncludeTax = lazyFn$1(function (controller, form, record) {
8495
9069
 
8496
9070
  var onChangePriceExcludeTax = lazyFn$1(function (controller, form, record) {
8497
9071
  form.validateFields( /*#__PURE__*/function () {
8498
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(err, values) {
9072
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(err, values) {
8499
9073
  var priceExcludeTax, quantity, lineAmountExcludeTax, _lineAmountExcludeTax2, _quantity2;
8500
9074
 
8501
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
9075
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
8502
9076
  while (1) {
8503
9077
  switch (_context3.prev = _context3.next) {
8504
9078
  case 0:
@@ -8594,10 +9168,10 @@ var onChangePriceExcludeTax = lazyFn$1(function (controller, form, record) {
8594
9168
 
8595
9169
  var onChangeLineAmountIncludeTax = lazyFn$1(function (controller, form, record) {
8596
9170
  form.validateFields( /*#__PURE__*/function () {
8597
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(err, values) {
9171
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(err, values) {
8598
9172
  var lineAmountIncludeTax, quantity, priceIncludeTax, _priceIncludeTax2, _quantity3;
8599
9173
 
8600
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
9174
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
8601
9175
  while (1) {
8602
9176
  switch (_context4.prev = _context4.next) {
8603
9177
  case 0:
@@ -8686,10 +9260,10 @@ var onChangeLineAmountIncludeTax = lazyFn$1(function (controller, form, record)
8686
9260
 
8687
9261
  var onChangeLineAmountExcludeTax = lazyFn$1(function (controller, form, record) {
8688
9262
  form.validateFields( /*#__PURE__*/function () {
8689
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(err, values) {
9263
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(err, values) {
8690
9264
  var lineAmountExcludeTax, quantity, priceExcludeTax, _priceExcludeTax2, _quantity4;
8691
9265
 
8692
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
9266
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
8693
9267
  while (1) {
8694
9268
  switch (_context5.prev = _context5.next) {
8695
9269
  case 0:
@@ -8778,9 +9352,9 @@ var onChangeLineAmountExcludeTax = lazyFn$1(function (controller, form, record)
8778
9352
 
8779
9353
  var onChangeTaxRate = lazyFn$1(function (controller, form, record) {
8780
9354
  form.validateFields( /*#__PURE__*/function () {
8781
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(err, values) {
9355
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(err, values) {
8782
9356
  var taxRate;
8783
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
9357
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
8784
9358
  while (1) {
8785
9359
  switch (_context6.prev = _context6.next) {
8786
9360
  case 0:
@@ -8840,6 +9414,11 @@ function dutyFree(controller, taxRate, form, record) {
8840
9414
  var cache = controller.state.goodsListState.endowCode.cache;
8841
9415
  var invoiceType = controller.state.invoiceType; // 4月1日至12月31日
8842
9416
 
9417
+ console.log('===> 小规模纳税人免税逻辑');
9418
+ console.log('===> invoiceType', invoiceType);
9419
+ console.log('===> en', controller.state.en);
9420
+ console.log('===> taxRate', taxRate);
9421
+ console.log('===> state', controller.state);
8843
9422
  if (hooks().valueOf() > hooks('2022-12-31 23:59').valueOf()) return taxRate;
8844
9423
  if (controller.state.en !== '08') return taxRate;
8845
9424
  if (invoiceType !== '10' && invoiceType !== '04') return taxRate;
@@ -8858,38 +9437,15 @@ function dutyFree(controller, taxRate, form, record) {
8858
9437
  taxRate: 0
8859
9438
  });
8860
9439
  return 0;
8861
- } // 选择的 1或者3
8862
- // if (taxRate === 1 || taxRate === 3) {
8863
- // 是否处理过
8864
- // if (cache[record.$index]) {
8865
- // return taxRate;
8866
- // } else {
8867
- // cache[record.$index] = { favouredPolicyName: record.favouredPolicyName, favouredPolicyMark: record.favouredPolicyMark,taxFreeType:record.taxFreeType }
8868
- // record.favouredPolicyName = '免税';
8869
- // record.taxRate = 0;
8870
- // record.favouredPolicyMark = 1;
8871
- // record.taxFreeType = 1 as any;
8872
- // form.setFieldsValue({ taxRate: 0 });
8873
- // return 0;
8874
- // }
8875
- // } else {
8876
- // if (cache[record.$index] && cache[record.$index] !== true) {
8877
- // record.favouredPolicyName = cache[record.$index].favouredPolicyName;
8878
- // record.favouredPolicyMark = cache[record.$index].favouredPolicyMark;
8879
- // record.taxFreeType = cache[record.$index].taxFreeType;
8880
- // cache[record.$index] = true;
8881
- // }
8882
- // return taxRate;
8883
- // }
8884
-
9440
+ }
8885
9441
  }
8886
9442
  /** 含税 => 更新(不含税) */
8887
9443
 
8888
9444
  var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controller, form, record) {
8889
9445
  form.validateFields( /*#__PURE__*/function () {
8890
- var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(err, values) {
9446
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(err, values) {
8891
9447
  var taxAmount, lineAmountExcludeTax, priceExcludeTax, deduction;
8892
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
9448
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
8893
9449
  while (1) {
8894
9450
  switch (_context7.prev = _context7.next) {
8895
9451
  case 0:
@@ -8953,9 +9509,9 @@ var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controlle
8953
9509
 
8954
9510
  var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
8955
9511
  form.validateFields( /*#__PURE__*/function () {
8956
- var _ref8 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(err, values) {
9512
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(err, values) {
8957
9513
  var lineAmountExcludeTax, lineAmountIncludeTax, taxAmount, priceExcludeTax, priceIncludeTax;
8958
- return regeneratorRuntime.wrap(function _callee8$(_context8) {
9514
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
8959
9515
  while (1) {
8960
9516
  switch (_context8.prev = _context8.next) {
8961
9517
  case 0:
@@ -9024,49 +9580,11 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
9024
9580
  };
9025
9581
  }());
9026
9582
  };
9027
- /** 保存到编辑货物 */
9028
-
9029
- var onSaveEditGood = lazyFn$1(function (controller, form, record, id) {
9030
- form.validateFields( /*#__PURE__*/function () {
9031
- var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(err, values) {
9032
- var v;
9033
- return regeneratorRuntime.wrap(function _callee9$(_context9) {
9034
- while (1) {
9035
- switch (_context9.prev = _context9.next) {
9036
- case 0:
9037
- err = err || {};
9038
-
9039
- if (!err[id]) {
9040
- _context9.next = 3;
9041
- break;
9042
- }
9043
-
9044
- return _context9.abrupt("return");
9045
-
9046
- case 3:
9047
- v = {};
9048
- v[id] = values[id];
9049
- _context9.next = 7;
9050
- return controller.setEditGood(_objectSpread2({}, v));
9051
-
9052
- case 7:
9053
- case "end":
9054
- return _context9.stop();
9055
- }
9056
- }
9057
- }, _callee9);
9058
- }));
9059
-
9060
- return function (_x17, _x18) {
9061
- return _ref9.apply(this, arguments);
9062
- };
9063
- }());
9064
- }, 1000);
9065
9583
  /** 单调赋码 */
9066
9584
 
9067
9585
  var endowCode = /*#__PURE__*/function () {
9068
- var _ref10 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11(controller, goods) {
9069
- return regeneratorRuntime.wrap(function _callee11$(_context11) {
9586
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(controller, goods) {
9587
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
9070
9588
  while (1) {
9071
9589
  switch (_context11.prev = _context11.next) {
9072
9590
  case 0:
@@ -9080,9 +9598,9 @@ var endowCode = /*#__PURE__*/function () {
9080
9598
  case 4:
9081
9599
  _context11.next = 6;
9082
9600
  return controller.pipeline( /*#__PURE__*/function () {
9083
- var _ref11 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(s) {
9601
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(s) {
9084
9602
  var err, key, g, i;
9085
- return regeneratorRuntime.wrap(function _callee10$(_context10) {
9603
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
9086
9604
  while (1) {
9087
9605
  switch (_context10.prev = _context10.next) {
9088
9606
  case 0:
@@ -9092,7 +9610,7 @@ var endowCode = /*#__PURE__*/function () {
9092
9610
  }
9093
9611
 
9094
9612
  err = s.goodsListState.form.getFieldsError();
9095
- _context10.t0 = regeneratorRuntime.keys(err);
9613
+ _context10.t0 = _regeneratorRuntime().keys(err);
9096
9614
 
9097
9615
  case 3:
9098
9616
  if ((_context10.t1 = _context10.t0()).done) {
@@ -9157,12 +9675,103 @@ var endowCode = /*#__PURE__*/function () {
9157
9675
  return _ref10.apply(this, arguments);
9158
9676
  };
9159
9677
  }();
9678
+ /** 修改了 货物名称 */
9679
+
9680
+ var onChangeItemName = /*#__PURE__*/function () {
9681
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(controller, form, record) {
9682
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
9683
+ while (1) {
9684
+ switch (_context13.prev = _context13.next) {
9685
+ case 0:
9686
+ controller.run( /*#__PURE__*/function () {
9687
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
9688
+ var _getSN$shorthand, _getSN;
9689
+
9690
+ var value, shorthand;
9691
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
9692
+ while (1) {
9693
+ switch (_context12.prev = _context12.next) {
9694
+ case 0:
9695
+ value = form.getFieldsValue().itemName;
9696
+ shorthand = (_getSN$shorthand = (_getSN = getSN(value)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand) !== null && _getSN$shorthand !== void 0 ? _getSN$shorthand : '';
9697
+
9698
+ if (!s.goodsListState.isMyShow) {
9699
+ _context12.next = 11;
9700
+ break;
9701
+ }
9702
+
9703
+ _context12.next = 5;
9704
+ return controller.setEditGood({
9705
+ itemName: value
9706
+ });
9707
+
9708
+ case 5:
9709
+ _context12.t0 = record.itemNameOther;
9710
+
9711
+ if (!_context12.t0) {
9712
+ _context12.next = 9;
9713
+ break;
9714
+ }
9715
+
9716
+ _context12.next = 9;
9717
+ return controller.setEditGood({
9718
+ itemNameOther: setShorthand(record.itemNameOther, shorthand)
9719
+ });
9720
+
9721
+ case 9:
9722
+ _context12.next = 17;
9723
+ break;
9724
+
9725
+ case 11:
9726
+ _context12.next = 13;
9727
+ return controller.setEditGood({
9728
+ itemNameOther: value
9729
+ });
9730
+
9731
+ case 13:
9732
+ _context12.t1 = record.itemName;
9733
+
9734
+ if (!_context12.t1) {
9735
+ _context12.next = 17;
9736
+ break;
9737
+ }
9738
+
9739
+ _context12.next = 17;
9740
+ return controller.setEditGood({
9741
+ itemName: setShorthand(record.itemName, shorthand)
9742
+ });
9743
+
9744
+ case 17:
9745
+ case "end":
9746
+ return _context12.stop();
9747
+ }
9748
+ }
9749
+ }, _callee12);
9750
+ }));
9751
+
9752
+ return function (_x25) {
9753
+ return _ref13.apply(this, arguments);
9754
+ };
9755
+ }());
9756
+
9757
+ case 1:
9758
+ case "end":
9759
+ return _context13.stop();
9760
+ }
9761
+ }
9762
+ }, _callee13);
9763
+ }));
9764
+
9765
+ return function onChangeItemName(_x22, _x23, _x24) {
9766
+ return _ref12.apply(this, arguments);
9767
+ };
9768
+ }();
9160
9769
 
9161
9770
  var Text$3 = Typography.Text;
9162
9771
  var useEndowCode = (function (goods) {
9163
- var controller = default_1.useInvoiceController();
9164
- var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
9165
- return regeneratorRuntime.wrap(function _callee$(_context) {
9772
+ var controller = Invoice.useInvoiceController();
9773
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9774
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9166
9775
  while (1) {
9167
9776
  switch (_context.prev = _context.next) {
9168
9777
  case 0:
@@ -9185,11 +9794,102 @@ var useEndowCode = (function (goods) {
9185
9794
  }, [goods.lineAttribute, onClick]);
9186
9795
  });
9187
9796
 
9797
+ var Text$4 = Typography.Text;
9798
+ var useAddComparison = (function (goods) {
9799
+ var controller = Invoice.useInvoiceController();
9800
+ var productComparison = controller.useMemo(function (s) {
9801
+ return s.goodsListState.productComparison;
9802
+ }, []);
9803
+ var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9804
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9805
+ while (1) {
9806
+ switch (_context2.prev = _context2.next) {
9807
+ case 0:
9808
+ _context2.next = 2;
9809
+ return controller.saveEditGood();
9810
+
9811
+ case 2:
9812
+ _context2.next = 4;
9813
+ return controller.wait();
9814
+
9815
+ case 4:
9816
+ _context2.next = 6;
9817
+ return controller.run( /*#__PURE__*/function () {
9818
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
9819
+ var err, key;
9820
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9821
+ while (1) {
9822
+ switch (_context.prev = _context.next) {
9823
+ case 0:
9824
+ if (!s.goodsListState.form) {
9825
+ _context.next = 11;
9826
+ break;
9827
+ }
9828
+
9829
+ err = s.goodsListState.form.getFieldsError();
9830
+ _context.t0 = _regeneratorRuntime().keys(err);
9831
+
9832
+ case 3:
9833
+ if ((_context.t1 = _context.t0()).done) {
9834
+ _context.next = 11;
9835
+ break;
9836
+ }
9837
+
9838
+ key = _context.t1.value;
9839
+
9840
+ if (err[key]) {
9841
+ _context.next = 7;
9842
+ break;
9843
+ }
9844
+
9845
+ return _context.abrupt("continue", 3);
9846
+
9847
+ case 7:
9848
+ message.error(err[key][0]);
9849
+ return _context.abrupt("return");
9850
+
9851
+ case 11:
9852
+ s.goodsListState.addComparisonIndex = goods.$index;
9853
+
9854
+ case 12:
9855
+ case "end":
9856
+ return _context.stop();
9857
+ }
9858
+ }
9859
+ }, _callee);
9860
+ }));
9861
+
9862
+ return function (_x) {
9863
+ return _ref2.apply(this, arguments);
9864
+ };
9865
+ }());
9866
+
9867
+ case 6:
9868
+ case "end":
9869
+ return _context2.stop();
9870
+ }
9871
+ }
9872
+ }, _callee2);
9873
+ })), [controller, goods.$index]);
9874
+ return React.useMemo(function () {
9875
+ if (productComparison.onComply) {
9876
+ return /*#__PURE__*/React.createElement(Menu.Item, {
9877
+ key: "delItem",
9878
+ onClick: onClick
9879
+ }, /*#__PURE__*/React.createElement(Text$4, {
9880
+ strong: true
9881
+ }, "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167"));
9882
+ } else {
9883
+ return /*#__PURE__*/React.createElement(React.Fragment, null);
9884
+ }
9885
+ }, [onClick, productComparison]);
9886
+ });
9887
+
9188
9888
  var css_248z$5 = ".ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:focus,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:hover,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu {\n font-size: 16px;\n color: #000;\n text-align: center;\n padding: 0;\n}\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:hover,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu.ktsAnt3x-dropdown-open {\n background: #ebebeb;\n border-radius: 9999px;\n}\n";
9189
9889
  styleInject(css_248z$5);
9190
9890
 
9191
9891
  var RowMenu = (function (props) {
9192
- var controller = default_1.useInvoiceController();
9892
+ var controller = Invoice.useInvoiceController();
9193
9893
  var model = controller.useMemo(function (s) {
9194
9894
  return s.model;
9195
9895
  }, []);
@@ -9204,10 +9904,13 @@ var RowMenu = (function (props) {
9204
9904
  var delItem = useDelItem(props.goods);
9205
9905
  var addDiscount = useAddDiscount(props.goods);
9206
9906
  var endowCode = useEndowCode(props.goods);
9907
+ var addComparison = useAddComparison(props.goods);
9207
9908
  var itemList = React.useMemo(function () {
9208
9909
  var arr = [];
9209
9910
  model !== 'prefab' && isAddDiscount !== false && addDiscount && arr.push(addDiscount); // 添加折扣行
9210
9911
 
9912
+ arr.push(addComparison); // 添加商品对照
9913
+
9211
9914
  endowCode && arr.push(endowCode); // 赋码
9212
9915
 
9213
9916
  model !== 'prefab' && delItem && arr.push(delItem); // 删除
@@ -9240,16 +9943,21 @@ var RowMenu = (function (props) {
9240
9943
  })));
9241
9944
  });
9242
9945
 
9243
- var Text$4 = Typography.Text;
9946
+ var Text$5 = Typography.Text;
9244
9947
  var useColumns = (function (form) {
9245
9948
  var getFieldDecorator = form.getFieldDecorator,
9246
9949
  getFieldValue = form.getFieldValue;
9247
- var controller = default_1.useInvoiceController();
9950
+ var controller = Invoice.useInvoiceController();
9248
9951
  /** 是否含税 */
9249
9952
 
9250
9953
  var isTaxIncluded = controller.useMemo(function (e) {
9251
9954
  return e.goodsListState.isTaxIncluded;
9252
9955
  }, []);
9956
+ /** 是否显示我方 */
9957
+
9958
+ var isMyShow = controller.useMemo(function (e) {
9959
+ return e.goodsListState.isMyShow;
9960
+ }, []);
9253
9961
  /** 正在编辑的货物 */
9254
9962
 
9255
9963
  var editGood = controller.useMemo(function (e) {
@@ -9281,12 +9989,11 @@ var useColumns = (function (form) {
9281
9989
 
9282
9990
  var columns = React.useMemo(function () {
9283
9991
  return [{
9284
- title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text$4, {
9992
+ title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text$5, {
9285
9993
  type: "danger"
9286
9994
  }, "*"), "\u8D27\u7269\u540D\u79F0"),
9287
- dataIndex: 'itemName',
9288
9995
  key: 'itemName',
9289
- render: function render(value, record) {
9996
+ render: function render(_, record) {
9290
9997
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
9291
9998
  var _editGood$itemName;
9292
9999
 
@@ -9295,17 +10002,54 @@ var useColumns = (function (form) {
9295
10002
  display: 'flex'
9296
10003
  }
9297
10004
  }, getFieldDecorator('itemName', {
9298
- initialValue: editGood.itemName,
10005
+ initialValue: isMyShow ? record.itemName : record.itemNameOther,
9299
10006
  rules: [{
9300
- required: true,
9301
- message: '货物名称不能为空'
10007
+ validator: function () {
10008
+ var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, __, callback) {
10009
+ var value;
10010
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10011
+ while (1) {
10012
+ switch (_context.prev = _context.next) {
10013
+ case 0:
10014
+ _context.next = 2;
10015
+ return controller.wait();
10016
+
10017
+ case 2:
10018
+ value = controller.state.goodsListState.editGood;
10019
+
10020
+ if (!(!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameOther))) {
10021
+ _context.next = 7;
10022
+ break;
10023
+ }
10024
+
10025
+ callback('货物名称不能为空');
10026
+ _context.next = 8;
10027
+ break;
10028
+
10029
+ case 7:
10030
+ return _context.abrupt("return");
10031
+
10032
+ case 8:
10033
+ case "end":
10034
+ return _context.stop();
10035
+ }
10036
+ }
10037
+ }, _callee);
10038
+ }));
10039
+
10040
+ function validator(_x, _x2, _x3) {
10041
+ return _validator.apply(this, arguments);
10042
+ }
10043
+
10044
+ return validator;
10045
+ }()
9302
10046
  }]
9303
10047
  })( /*#__PURE__*/React.createElement(MyInput, {
9304
10048
  style: {
9305
10049
  flex: 1
9306
10050
  },
9307
10051
  onChange: function onChange() {
9308
- onSaveEditGood(controller, form, record, 'itemName');
10052
+ onChangeItemName(controller, form, record);
9309
10053
  }
9310
10054
  })), /*#__PURE__*/React.createElement("div", {
9311
10055
  className: "kts-invoice-operate-goods-list-able-list-itemName-import"
@@ -9316,67 +10060,90 @@ var useColumns = (function (form) {
9316
10060
  type: "link",
9317
10061
  icon: "file-add"
9318
10062
  }), controller.getGoodsList && /*#__PURE__*/React.createElement(Button, {
9319
- onClick: function onClick() {
9320
- controller.pipeline( /*#__PURE__*/function () {
9321
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
9322
- return regeneratorRuntime.wrap(function _callee$(_context) {
9323
- while (1) {
9324
- switch (_context.prev = _context.next) {
9325
- case 0:
9326
- s.goodsListState.importGoods.isVisibleDrawer = true;
10063
+ onClick: controller.pipeline( /*#__PURE__*/function () {
10064
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
10065
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10066
+ while (1) {
10067
+ switch (_context2.prev = _context2.next) {
10068
+ case 0:
10069
+ s.goodsListState.importGoods.isVisibleDrawer = true;
9327
10070
 
9328
- case 1:
9329
- case "end":
9330
- return _context.stop();
9331
- }
10071
+ case 1:
10072
+ case "end":
10073
+ return _context2.stop();
9332
10074
  }
9333
- }, _callee);
9334
- }));
10075
+ }
10076
+ }, _callee2);
10077
+ }));
9335
10078
 
9336
- return function (_x) {
9337
- return _ref.apply(this, arguments);
9338
- };
9339
- }())();
9340
- },
10079
+ return function (_x4) {
10080
+ return _ref.apply(this, arguments);
10081
+ };
10082
+ }()),
9341
10083
  type: "link",
9342
10084
  icon: "plus-circle"
9343
10085
  }))));
9344
10086
  } else {
9345
- return /*#__PURE__*/React.createElement("span", {
9346
- style: {
9347
- padding: '0 10px'
9348
- }
9349
- }, value);
10087
+ return /*#__PURE__*/React.createElement(MyItemNameDiv, {
10088
+ valueT: record.itemName,
10089
+ valueF: record.itemNameOther,
10090
+ isMyShow: isMyShow
10091
+ });
9350
10092
  }
9351
10093
  }
9352
10094
  }, {
9353
10095
  title: '货物规格型号',
9354
- dataIndex: 'itemModelName',
9355
10096
  key: 'itemModelName',
9356
10097
  width: 119,
9357
- render: function render(value, record) {
10098
+ render: function render(_, record) {
9358
10099
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
9359
10100
  return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('itemModelName', {
9360
- initialValue: editGood.itemModelName
10101
+ initialValue: isMyShow ? editGood.itemModelName : editGood.itemModelNameOther
9361
10102
  })( /*#__PURE__*/React.createElement(MyInput, {
9362
- onChange: function onChange() {
9363
- onSaveEditGood(controller, form, record, 'itemModelName');
9364
- }
10103
+ onChange: function () {
10104
+ var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
10105
+ var key, value;
10106
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10107
+ while (1) {
10108
+ switch (_context3.prev = _context3.next) {
10109
+ case 0:
10110
+ _context3.next = 2;
10111
+ return controller.wait();
10112
+
10113
+ case 2:
10114
+ key = isMyShow ? 'itemModelName' : 'itemModelNameOther';
10115
+ value = {};
10116
+ value[key] = form.getFieldsValue().itemModelName;
10117
+ controller.setEditGood(value);
10118
+
10119
+ case 6:
10120
+ case "end":
10121
+ return _context3.stop();
10122
+ }
10123
+ }
10124
+ }, _callee3);
10125
+ }));
10126
+
10127
+ function onChange() {
10128
+ return _onChange.apply(this, arguments);
10129
+ }
10130
+
10131
+ return onChange;
10132
+ }()
9365
10133
  })));
9366
10134
  } else {
9367
- return /*#__PURE__*/React.createElement("span", {
9368
- style: {
9369
- padding: '0 10px'
9370
- }
9371
- }, value);
10135
+ return /*#__PURE__*/React.createElement(MyItemNameDiv, {
10136
+ valueT: record.itemModelName,
10137
+ valueF: record.itemModelNameOther,
10138
+ isMyShow: isMyShow
10139
+ });
9372
10140
  }
9373
10141
  }
9374
10142
  }, {
9375
10143
  title: '单位',
9376
- dataIndex: 'unit',
9377
10144
  key: 'unit',
9378
10145
  width: 70,
9379
- render: function render(value, record) {
10146
+ render: function render(_, record) {
9380
10147
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
9381
10148
  return /*#__PURE__*/React.createElement(Form.Item, null, getFieldDecorator('unit', {
9382
10149
  initialValue: editGood.unit
@@ -9385,16 +10152,43 @@ var useColumns = (function (form) {
9385
10152
  width: '100%'
9386
10153
  },
9387
10154
  dataSource: unitList,
9388
- onChange: function onChange() {
9389
- onSaveEditGood(controller, form, record, 'unit');
9390
- }
10155
+ onChange: function () {
10156
+ var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
10157
+ var key, value;
10158
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10159
+ while (1) {
10160
+ switch (_context4.prev = _context4.next) {
10161
+ case 0:
10162
+ _context4.next = 2;
10163
+ return controller.wait();
10164
+
10165
+ case 2:
10166
+ key = isMyShow ? 'unit' : 'unitOther';
10167
+ value = {};
10168
+ value[key] = form.getFieldsValue().unit;
10169
+ controller.setEditGood(value);
10170
+
10171
+ case 6:
10172
+ case "end":
10173
+ return _context4.stop();
10174
+ }
10175
+ }
10176
+ }, _callee4);
10177
+ }));
10178
+
10179
+ function onChange() {
10180
+ return _onChange2.apply(this, arguments);
10181
+ }
10182
+
10183
+ return onChange;
10184
+ }()
9391
10185
  })));
9392
10186
  } else {
9393
- return /*#__PURE__*/React.createElement("span", {
9394
- style: {
9395
- padding: '0 10px'
9396
- }
9397
- }, value);
10187
+ return /*#__PURE__*/React.createElement(MyItemNameDiv, {
10188
+ valueT: record.unit,
10189
+ valueF: record.unitOther,
10190
+ isMyShow: isMyShow
10191
+ });
9398
10192
  }
9399
10193
  }
9400
10194
  }, {
@@ -9412,13 +10206,13 @@ var useColumns = (function (form) {
9412
10206
  message: '数量必须为数字'
9413
10207
  }, {
9414
10208
  validator: function () {
9415
- var _validator = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_, value, callback) {
10209
+ var _validator2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_, value, callback) {
9416
10210
  var isvalue, isPrice;
9417
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
10211
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
9418
10212
  while (1) {
9419
- switch (_context2.prev = _context2.next) {
10213
+ switch (_context5.prev = _context5.next) {
9420
10214
  case 0:
9421
- _context2.next = 2;
10215
+ _context5.next = 2;
9422
10216
  return controller.wait();
9423
10217
 
9424
10218
  case 2:
@@ -9426,25 +10220,25 @@ var useColumns = (function (form) {
9426
10220
  isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
9427
10221
 
9428
10222
  if (!(isvalue || isPrice === isvalue)) {
9429
- _context2.next = 6;
10223
+ _context5.next = 6;
9430
10224
  break;
9431
10225
  }
9432
10226
 
9433
- return _context2.abrupt("return");
10227
+ return _context5.abrupt("return");
9434
10228
 
9435
10229
  case 6:
9436
10230
  callback('请输入数量');
9437
10231
 
9438
10232
  case 7:
9439
10233
  case "end":
9440
- return _context2.stop();
10234
+ return _context5.stop();
9441
10235
  }
9442
10236
  }
9443
- }, _callee2);
10237
+ }, _callee5);
9444
10238
  }));
9445
10239
 
9446
- function validator(_x2, _x3, _x4) {
9447
- return _validator.apply(this, arguments);
10240
+ function validator(_x5, _x6, _x7) {
10241
+ return _validator2.apply(this, arguments);
9448
10242
  }
9449
10243
 
9450
10244
  return validator;
@@ -9484,13 +10278,13 @@ var useColumns = (function (form) {
9484
10278
  message: '单价必须为数字'
9485
10279
  }, {
9486
10280
  validator: function () {
9487
- var _validator2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(_, value, callback) {
10281
+ var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_, value, callback) {
9488
10282
  var isQuantity, isvalue;
9489
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
10283
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
9490
10284
  while (1) {
9491
- switch (_context3.prev = _context3.next) {
10285
+ switch (_context6.prev = _context6.next) {
9492
10286
  case 0:
9493
- _context3.next = 2;
10287
+ _context6.next = 2;
9494
10288
  return controller.wait();
9495
10289
 
9496
10290
  case 2:
@@ -9498,25 +10292,25 @@ var useColumns = (function (form) {
9498
10292
  isvalue = !!value || value === 0;
9499
10293
 
9500
10294
  if (!(isvalue || isQuantity === isvalue)) {
9501
- _context3.next = 6;
10295
+ _context6.next = 6;
9502
10296
  break;
9503
10297
  }
9504
10298
 
9505
- return _context3.abrupt("return");
10299
+ return _context6.abrupt("return");
9506
10300
 
9507
10301
  case 6:
9508
10302
  callback('请输入单价');
9509
10303
 
9510
10304
  case 7:
9511
10305
  case "end":
9512
- return _context3.stop();
10306
+ return _context6.stop();
9513
10307
  }
9514
10308
  }
9515
- }, _callee3);
10309
+ }, _callee6);
9516
10310
  }));
9517
10311
 
9518
- function validator(_x5, _x6, _x7) {
9519
- return _validator2.apply(this, arguments);
10312
+ function validator(_x8, _x9, _x10) {
10313
+ return _validator3.apply(this, arguments);
9520
10314
  }
9521
10315
 
9522
10316
  return validator;
@@ -9556,13 +10350,13 @@ var useColumns = (function (form) {
9556
10350
  message: '单价必须为数字'
9557
10351
  }, {
9558
10352
  validator: function () {
9559
- var _validator3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(_, value, callback) {
10353
+ var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_, value, callback) {
9560
10354
  var isQuantity, isvalue;
9561
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
10355
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
9562
10356
  while (1) {
9563
- switch (_context4.prev = _context4.next) {
10357
+ switch (_context7.prev = _context7.next) {
9564
10358
  case 0:
9565
- _context4.next = 2;
10359
+ _context7.next = 2;
9566
10360
  return controller.wait();
9567
10361
 
9568
10362
  case 2:
@@ -9570,25 +10364,25 @@ var useColumns = (function (form) {
9570
10364
  isvalue = !!value || value === 0;
9571
10365
 
9572
10366
  if (!(isvalue || isQuantity === isvalue)) {
9573
- _context4.next = 6;
10367
+ _context7.next = 6;
9574
10368
  break;
9575
10369
  }
9576
10370
 
9577
- return _context4.abrupt("return");
10371
+ return _context7.abrupt("return");
9578
10372
 
9579
10373
  case 6:
9580
10374
  callback('请输入单价');
9581
10375
 
9582
10376
  case 7:
9583
10377
  case "end":
9584
- return _context4.stop();
10378
+ return _context7.stop();
9585
10379
  }
9586
10380
  }
9587
- }, _callee4);
10381
+ }, _callee7);
9588
10382
  }));
9589
10383
 
9590
- function validator(_x8, _x9, _x10) {
9591
- return _validator3.apply(this, arguments);
10384
+ function validator(_x11, _x12, _x13) {
10385
+ return _validator4.apply(this, arguments);
9592
10386
  }
9593
10387
 
9594
10388
  return validator;
@@ -9614,7 +10408,7 @@ var useColumns = (function (form) {
9614
10408
  }
9615
10409
  }
9616
10410
  }, {
9617
- title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text$4, {
10411
+ title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text$5, {
9618
10412
  type: "danger"
9619
10413
  }, "*"), "\u91D1\u989D(\u542B\u7A0E)"),
9620
10414
  dataIndex: 'lineAmountIncludeTax',
@@ -9633,10 +10427,10 @@ var useColumns = (function (form) {
9633
10427
  message: '金额必须为数字'
9634
10428
  }, {
9635
10429
  validator: function () {
9636
- var _validator4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(_, value, callback) {
9637
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
10430
+ var _validator5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_, value, callback) {
10431
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
9638
10432
  while (1) {
9639
- switch (_context5.prev = _context5.next) {
10433
+ switch (_context8.prev = _context8.next) {
9640
10434
  case 0:
9641
10435
  if ("".concat(value).split('.')[0].length > 9) {
9642
10436
  callback('金额整数部分不能大于9位,小数点后最多2位');
@@ -9644,24 +10438,24 @@ var useColumns = (function (form) {
9644
10438
 
9645
10439
  case 1:
9646
10440
  case "end":
9647
- return _context5.stop();
10441
+ return _context8.stop();
9648
10442
  }
9649
10443
  }
9650
- }, _callee5);
10444
+ }, _callee8);
9651
10445
  }));
9652
10446
 
9653
- function validator(_x11, _x12, _x13) {
9654
- return _validator4.apply(this, arguments);
10447
+ function validator(_x14, _x15, _x16) {
10448
+ return _validator5.apply(this, arguments);
9655
10449
  }
9656
10450
 
9657
10451
  return validator;
9658
10452
  }()
9659
10453
  }, {
9660
10454
  validator: function () {
9661
- var _validator5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(_, value, callback) {
9662
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
10455
+ var _validator6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
10456
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
9663
10457
  while (1) {
9664
- switch (_context6.prev = _context6.next) {
10458
+ switch (_context9.prev = _context9.next) {
9665
10459
  case 0:
9666
10460
  if (deduction && parseFloat(value) <= deduction) {
9667
10461
  callback('扣除额不能大于等于价税合计');
@@ -9669,14 +10463,14 @@ var useColumns = (function (form) {
9669
10463
 
9670
10464
  case 1:
9671
10465
  case "end":
9672
- return _context6.stop();
10466
+ return _context9.stop();
9673
10467
  }
9674
10468
  }
9675
- }, _callee6);
10469
+ }, _callee9);
9676
10470
  }));
9677
10471
 
9678
- function validator(_x14, _x15, _x16) {
9679
- return _validator5.apply(this, arguments);
10472
+ function validator(_x17, _x18, _x19) {
10473
+ return _validator6.apply(this, arguments);
9680
10474
  }
9681
10475
 
9682
10476
  return validator;
@@ -9701,7 +10495,7 @@ var useColumns = (function (form) {
9701
10495
  }
9702
10496
  }
9703
10497
  }, {
9704
- title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text$4, {
10498
+ title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text$5, {
9705
10499
  type: "danger"
9706
10500
  }, "*"), "\u91D1\u989D(\u4E0D\u542B\u7A0E)"),
9707
10501
  dataIndex: 'lineAmountExcludeTax',
@@ -9720,10 +10514,10 @@ var useColumns = (function (form) {
9720
10514
  message: '金额必须为数字'
9721
10515
  }, {
9722
10516
  validator: function () {
9723
- var _validator6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(_, value, callback) {
9724
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
10517
+ var _validator7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
10518
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
9725
10519
  while (1) {
9726
- switch (_context7.prev = _context7.next) {
10520
+ switch (_context10.prev = _context10.next) {
9727
10521
  case 0:
9728
10522
  if ("".concat(value).split('.')[0].length > 9) {
9729
10523
  callback('金额整数部分不能大于9位,小数点后最多2位');
@@ -9731,14 +10525,14 @@ var useColumns = (function (form) {
9731
10525
 
9732
10526
  case 1:
9733
10527
  case "end":
9734
- return _context7.stop();
10528
+ return _context10.stop();
9735
10529
  }
9736
10530
  }
9737
- }, _callee7);
10531
+ }, _callee10);
9738
10532
  }));
9739
10533
 
9740
- function validator(_x17, _x18, _x19) {
9741
- return _validator6.apply(this, arguments);
10534
+ function validator(_x20, _x21, _x22) {
10535
+ return _validator7.apply(this, arguments);
9742
10536
  }
9743
10537
 
9744
10538
  return validator;
@@ -9763,7 +10557,7 @@ var useColumns = (function (form) {
9763
10557
  }
9764
10558
  }
9765
10559
  }, {
9766
- title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text$4, {
10560
+ title: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text$5, {
9767
10561
  type: "danger"
9768
10562
  }, "*"), "\u7A0E\u7387"),
9769
10563
  dataIndex: 'taxRate',
@@ -9849,7 +10643,7 @@ var useColumns = (function (form) {
9849
10643
  ellipsis: true
9850
10644
  });
9851
10645
  });
9852
- }, [isTaxIncluded, editGood, controller, changeField, deduction]);
10646
+ }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow]);
9853
10647
  React.useEffect(function () {
9854
10648
  if (!changeField) return;
9855
10649
  var t = setTimeout(function () {
@@ -9924,16 +10718,72 @@ var MyDiv = /*#__PURE__*/function (_React$Component2) {
9924
10718
  return MyDiv;
9925
10719
  }(React.Component);
9926
10720
 
10721
+ var MyItemNameDiv = /*#__PURE__*/function (_React$Component3) {
10722
+ _inherits(MyItemNameDiv, _React$Component3);
10723
+
10724
+ var _super3 = _createSuper(MyItemNameDiv);
10725
+
10726
+ function MyItemNameDiv() {
10727
+ _classCallCheck(this, MyItemNameDiv);
10728
+
10729
+ return _super3.apply(this, arguments);
10730
+ }
10731
+
10732
+ _createClass(MyItemNameDiv, [{
10733
+ key: "render",
10734
+ value: function render() {
10735
+ var _this$props = this.props,
10736
+ isMyShow = _this$props.isMyShow,
10737
+ valueT = _this$props.valueT,
10738
+ valueF = _this$props.valueF;
10739
+
10740
+ if (isMyShow) {
10741
+ if (valueT) {
10742
+ return /*#__PURE__*/React.createElement("span", {
10743
+ style: {
10744
+ padding: '0 10px',
10745
+ color: '#0074ff'
10746
+ }
10747
+ }, valueT);
10748
+ } else {
10749
+ return /*#__PURE__*/React.createElement("span", {
10750
+ style: {
10751
+ padding: '0 10px'
10752
+ }
10753
+ }, valueF);
10754
+ }
10755
+ } else {
10756
+ if (valueF) {
10757
+ return /*#__PURE__*/React.createElement("span", {
10758
+ style: {
10759
+ padding: '0 10px'
10760
+ }
10761
+ }, valueF);
10762
+ } else {
10763
+ return /*#__PURE__*/React.createElement("span", {
10764
+ style: {
10765
+ padding: '0 10px',
10766
+ color: '#0074ff'
10767
+ }
10768
+ }, valueT);
10769
+ }
10770
+ }
10771
+ }
10772
+ }]);
10773
+
10774
+ return MyItemNameDiv;
10775
+ }(React.Component);
10776
+
9927
10777
  var useOnRow = (function () {
9928
10778
  /** 控制器 */
9929
- var controller = default_1.useInvoiceController();
10779
+ var controller = Invoice.useInvoiceController();
9930
10780
  var model = controller.useMemo(function (s) {
9931
10781
  return s.model;
9932
10782
  }, []);
9933
10783
  var onClick = React.useCallback( /*#__PURE__*/function () {
9934
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(record) {
10784
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(record) {
9935
10785
  var editGood;
9936
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
10786
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9937
10787
  while (1) {
9938
10788
  switch (_context2.prev = _context2.next) {
9939
10789
  case 0:
@@ -9978,8 +10828,8 @@ var useOnRow = (function () {
9978
10828
  case 12:
9979
10829
  _context2.next = 14;
9980
10830
  return controller.pipeline( /*#__PURE__*/function () {
9981
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
9982
- return regeneratorRuntime.wrap(function _callee$(_context) {
10831
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
10832
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9983
10833
  while (1) {
9984
10834
  switch (_context.prev = _context.next) {
9985
10835
  case 0:
@@ -10040,8 +10890,8 @@ function useDeduction(controller) {
10040
10890
  // 更新 扣除额
10041
10891
  React.useEffect(function () {
10042
10892
  controller.pipeline( /*#__PURE__*/function () {
10043
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
10044
- return regeneratorRuntime.wrap(function _callee$(_context) {
10893
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
10894
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10045
10895
  while (1) {
10046
10896
  switch (_context.prev = _context.next) {
10047
10897
  case 0:
@@ -10063,8 +10913,8 @@ function useDeduction(controller) {
10063
10913
 
10064
10914
  React.useEffect(function () {
10065
10915
  controller.pipeline( /*#__PURE__*/function () {
10066
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
10067
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
10916
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
10917
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10068
10918
  while (1) {
10069
10919
  switch (_context2.prev = _context2.next) {
10070
10920
  case 0:
@@ -10109,7 +10959,7 @@ function useWindowClick(controller) {
10109
10959
 
10110
10960
  var useRowSelection = (function () {
10111
10961
  /** 控制器 */
10112
- var controller = default_1.useInvoiceController();
10962
+ var controller = Invoice.useInvoiceController();
10113
10963
  /** 列表选中的货物索引列表 */
10114
10964
 
10115
10965
  var selectedRowKeys = controller.useMemo(function (s) {
@@ -10130,8 +10980,8 @@ var useRowSelection = (function () {
10130
10980
  var onClickSelectAll = React.useCallback(function () {
10131
10981
  if (isAll) {
10132
10982
  controller.pipeline( /*#__PURE__*/function () {
10133
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
10134
- return regeneratorRuntime.wrap(function _callee$(_context) {
10983
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
10984
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10135
10985
  while (1) {
10136
10986
  switch (_context.prev = _context.next) {
10137
10987
  case 0:
@@ -10151,8 +11001,8 @@ var useRowSelection = (function () {
10151
11001
  }())();
10152
11002
  } else {
10153
11003
  controller.pipeline( /*#__PURE__*/function () {
10154
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
10155
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
11004
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
11005
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10156
11006
  while (1) {
10157
11007
  switch (_context2.prev = _context2.next) {
10158
11008
  case 0:
@@ -10175,8 +11025,8 @@ var useRowSelection = (function () {
10175
11025
  }
10176
11026
  }, [controller, isAll]);
10177
11027
  var onSelect = React.useCallback( /*#__PURE__*/function () {
10178
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(record, selected) {
10179
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
11028
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(record, selected) {
11029
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
10180
11030
  while (1) {
10181
11031
  switch (_context5.prev = _context5.next) {
10182
11032
  case 0:
@@ -10187,8 +11037,8 @@ var useRowSelection = (function () {
10187
11037
 
10188
11038
  _context5.next = 3;
10189
11039
  return controller.pipeline( /*#__PURE__*/function () {
10190
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(s) {
10191
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
11040
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
11041
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10192
11042
  while (1) {
10193
11043
  switch (_context3.prev = _context3.next) {
10194
11044
  case 0:
@@ -10215,8 +11065,8 @@ var useRowSelection = (function () {
10215
11065
  case 5:
10216
11066
  _context5.next = 7;
10217
11067
  return controller.pipeline( /*#__PURE__*/function () {
10218
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(s) {
10219
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
11068
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
11069
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10220
11070
  while (1) {
10221
11071
  switch (_context4.prev = _context4.next) {
10222
11072
  case 0:
@@ -10264,8 +11114,8 @@ var useRowSelection = (function () {
10264
11114
  /** 选择了商品后 调整 折扣行 和 被折扣行 */
10265
11115
 
10266
11116
  var sortOut = React.useCallback( /*#__PURE__*/function () {
10267
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(selected) {
10268
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
11117
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(selected) {
11118
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
10269
11119
  while (1) {
10270
11120
  switch (_context7.prev = _context7.next) {
10271
11121
  case 0:
@@ -10275,8 +11125,8 @@ var useRowSelection = (function () {
10275
11125
  case 2:
10276
11126
  _context7.next = 4;
10277
11127
  return controller.pipeline( /*#__PURE__*/function () {
10278
- var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(s) {
10279
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
11128
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(s) {
11129
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
10280
11130
  while (1) {
10281
11131
  switch (_context6.prev = _context6.next) {
10282
11132
  case 0:
@@ -10284,7 +11134,6 @@ var useRowSelection = (function () {
10284
11134
  var goods = s.goodsListState.goodsMap.get($index);
10285
11135
  if (!goods || goods.lineAttribute === LineAttributeType$1.正常) return; // 数组位置
10286
11136
 
10287
- // 数组位置
10288
11137
  var t = s.goodsListState.goodsList.indexOf(goods);
10289
11138
  goods.lineAttribute === LineAttributeType$1.折扣行 ? t-- : t++;
10290
11139
  var i = s.goodsListState.goodsList[t].$index;
@@ -10334,7 +11183,7 @@ var useRowSelection = (function () {
10334
11183
  };
10335
11184
  });
10336
11185
 
10337
- var css_248z$6 = ".kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list {\n flex: 1;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button {\n padding-left: 10px;\n padding-right: 10px;\n border-radius: 12px;\n color: #0074ff;\n border: 1px solid #0074ff;\n margin: 0 10px;\n height: 24px;\n line-height: 22px;\n cursor: pointer;\n font-size: 12px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button[disabled] {\n color: rgba(0, 0, 0, 0.25);\n border: 1px solid;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend {\n flex: none;\n display: flex;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend label {\n margin-right: 5px;\n}\n.kts-invoice-operate-goods-list-table.kts-invoice-operate-prefab .ktsAnt3x-table-row {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table {\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-discount {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import {\n display: flex;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import .ktsAnt3x-btn {\n display: block;\n line-height: 0;\n width: auto;\n padding-right: 5px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-item-children {\n height: 30px;\n display: block;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-table-body {\n height: 263px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-explain {\n position: absolute;\n right: 6px;\n top: 6px;\n}\n.kts-invoice-operate-goods-list-table table {\n border-bottom: 1px solid #d9d9d9 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td {\n padding: 0 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-explain {\n display: none;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item {\n padding: 0;\n margin: 0;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item .ktsAnt3x-form-item-control {\n line-height: inherit;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-select-selection,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input:hover {\n border-right-width: 1px !important;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom-width: 1px;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-selection--single,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-auto-complete.ktsAnt3x-select .ktsAnt3x-input:hover,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-input {\n height: 30px;\n border-radius: 0;\n border-right-width: 0 !important;\n border-top-width: 0;\n border-left-width: 0;\n border-bottom-width: 0;\n box-shadow: none;\n}\n";
11186
+ var css_248z$6 = ".kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list {\n flex: 1;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button {\n padding-left: 10px;\n padding-right: 10px;\n border-radius: 12px;\n color: #0074ff;\n border: 1px solid #0074ff;\n margin: 0 10px;\n height: 24px;\n line-height: 22px;\n cursor: pointer;\n font-size: 12px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button[disabled] {\n color: rgba(0, 0, 0, 0.25);\n border: 1px solid;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend {\n flex: none;\n display: flex;\n gap: 5px;\n}\n.kts-invoice-operate-goods-list-table.kts-invoice-operate-prefab .ktsAnt3x-table-row {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table {\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-discount {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import {\n display: flex;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import .ktsAnt3x-btn {\n display: block;\n line-height: 0;\n width: auto;\n padding-right: 5px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-item-children {\n height: 30px;\n display: block;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-table-body {\n height: 263px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-explain {\n position: absolute;\n right: 6px;\n top: 6px;\n}\n.kts-invoice-operate-goods-list-table table {\n border-bottom: 1px solid #d9d9d9 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td {\n padding: 0 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-explain {\n display: none;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item {\n padding: 0;\n margin: 0;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item .ktsAnt3x-form-item-control {\n line-height: inherit;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-select-selection,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input:hover {\n border-right-width: 1px !important;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom-width: 1px;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-selection--single,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-auto-complete.ktsAnt3x-select .ktsAnt3x-input:hover,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-input {\n height: 30px;\n border-radius: 0;\n border-right-width: 0 !important;\n border-top-width: 0;\n border-left-width: 0;\n border-bottom-width: 0;\n box-shadow: none;\n}\n";
10338
11187
  styleInject(css_248z$6);
10339
11188
 
10340
11189
  var GoodsList = /*#__PURE__*/function (_React$Component) {
@@ -10359,7 +11208,7 @@ var GoodsList = /*#__PURE__*/function (_React$Component) {
10359
11208
  }(React.Component);
10360
11209
  var Main = decorator(Form.create())(function (props) {
10361
11210
  /** 控制器 */
10362
- var controller = default_1.useInvoiceController();
11211
+ var controller = Invoice.useInvoiceController();
10363
11212
  var goodsList = controller.useMemo(function (s) {
10364
11213
  return s.goodsListState.goodsList;
10365
11214
  }, []);
@@ -10376,8 +11225,8 @@ var Main = decorator(Form.create())(function (props) {
10376
11225
 
10377
11226
  React.useEffect(function () {
10378
11227
  controller.run( /*#__PURE__*/function () {
10379
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
10380
- return regeneratorRuntime.wrap(function _callee$(_context) {
11228
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
11229
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10381
11230
  while (1) {
10382
11231
  switch (_context.prev = _context.next) {
10383
11232
  case 0:
@@ -10400,8 +11249,8 @@ var Main = decorator(Form.create())(function (props) {
10400
11249
 
10401
11250
  React.useEffect(function () {
10402
11251
  controller.pipeline( /*#__PURE__*/function () {
10403
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s, form) {
10404
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
11252
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s, form) {
11253
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10405
11254
  while (1) {
10406
11255
  switch (_context2.prev = _context2.next) {
10407
11256
  case 0:
@@ -10425,8 +11274,8 @@ var Main = decorator(Form.create())(function (props) {
10425
11274
 
10426
11275
  React.useEffect(function () {
10427
11276
  controller.pipeline( /*#__PURE__*/function () {
10428
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(s) {
10429
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
11277
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
11278
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10430
11279
  while (1) {
10431
11280
  switch (_context3.prev = _context3.next) {
10432
11281
  case 0:
@@ -10452,8 +11301,8 @@ var Main = decorator(Form.create())(function (props) {
10452
11301
 
10453
11302
  React.useEffect(function () {
10454
11303
  controller.pipeline( /*#__PURE__*/function () {
10455
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(s) {
10456
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
11304
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
11305
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10457
11306
  while (1) {
10458
11307
  switch (_context4.prev = _context4.next) {
10459
11308
  case 0:
@@ -10476,8 +11325,8 @@ var Main = decorator(Form.create())(function (props) {
10476
11325
 
10477
11326
  React.useEffect(function () {
10478
11327
  controller.pipeline( /*#__PURE__*/function () {
10479
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(s) {
10480
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
11328
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
11329
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
10481
11330
  while (1) {
10482
11331
  switch (_context5.prev = _context5.next) {
10483
11332
  case 0:
@@ -10500,8 +11349,8 @@ var Main = decorator(Form.create())(function (props) {
10500
11349
 
10501
11350
  React.useEffect(function () {
10502
11351
  controller.pipeline( /*#__PURE__*/function () {
10503
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(s) {
10504
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
11352
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(s) {
11353
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
10505
11354
  while (1) {
10506
11355
  switch (_context6.prev = _context6.next) {
10507
11356
  case 0:
@@ -10529,9 +11378,9 @@ var Main = decorator(Form.create())(function (props) {
10529
11378
  className: "kts-invoice-operate-goods-list-able"
10530
11379
  }, /*#__PURE__*/React.createElement("div", {
10531
11380
  className: "kts-invoice-operate-goods-list-able-list"
10532
- }, /*#__PURE__*/React.createElement(AddRowButton, null), /*#__PURE__*/React.createElement(DelRowButton, null), /*#__PURE__*/React.createElement(AddDiscountRowButton, null), /*#__PURE__*/React.createElement(EndowCodeButton, null)), /*#__PURE__*/React.createElement("div", {
11381
+ }, /*#__PURE__*/React.createElement(AddRowButton, null), /*#__PURE__*/React.createElement(DelRowButton, null), /*#__PURE__*/React.createElement(AddDiscountRowButton, null), /*#__PURE__*/React.createElement(EndowCodeButton, null), /*#__PURE__*/React.createElement(CommodityComparisonButton, null)), /*#__PURE__*/React.createElement("div", {
10533
11382
  className: "kts-invoice-operate-goods-list-able-extend"
10534
- }, props.menuExpansion, /*#__PURE__*/React.createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React.createElement("div", {
11383
+ }, props.menuExpansion, /*#__PURE__*/React.createElement(DescribeSwitch, null), /*#__PURE__*/React.createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React.createElement("div", {
10535
11384
  className: classnames('kts-invoice-operate-goods-list-table', {
10536
11385
  'kts-invoice-operate-prefab': isprefab
10537
11386
  })
@@ -10591,14 +11440,14 @@ var Buyer = /*#__PURE__*/function (_React$Component) {
10591
11440
  return _this;
10592
11441
  }
10593
11442
 
10594
- return Buyer;
11443
+ return _createClass(Buyer);
10595
11444
  }(React.Component);
10596
11445
  var Main$1 = decorator(Form.create())(function (props) {
10597
11446
  var form = props.form;
10598
11447
  var getFieldDecorator = form.getFieldDecorator;
10599
11448
  /** 控制器 */
10600
11449
 
10601
- var controller = default_1.useInvoiceController();
11450
+ var controller = Invoice.useInvoiceController();
10602
11451
  /** 控制器 */
10603
11452
 
10604
11453
  var model = controller.useMemo(function (s) {
@@ -10716,7 +11565,7 @@ var Sign = decorator(Form.create())(function (props) {
10716
11565
  var getFieldDecorator = form.getFieldDecorator;
10717
11566
  /** 控制器 */
10718
11567
 
10719
- var controller = default_1.useInvoiceController();
11568
+ var controller = Invoice.useInvoiceController();
10720
11569
  var model = controller.useMemo(function (s) {
10721
11570
  return s.model;
10722
11571
  }, []); // 注册 form
@@ -10758,11 +11607,11 @@ var formItemLayout = {
10758
11607
  };
10759
11608
 
10760
11609
  var ImportBuyerButton = (function () {
10761
- var controller = default_1.useInvoiceController();
11610
+ var controller = Invoice.useInvoiceController();
10762
11611
  var onClick = React.useCallback(function () {
10763
11612
  controller.pipeline( /*#__PURE__*/function () {
10764
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
10765
- return regeneratorRuntime.wrap(function _callee$(_context) {
11613
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
11614
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10766
11615
  while (1) {
10767
11616
  switch (_context.prev = _context.next) {
10768
11617
  case 0:
@@ -10790,7 +11639,7 @@ var ImportBuyerButton = (function () {
10790
11639
 
10791
11640
  var BuyerNameInput = (function (props) {
10792
11641
  /** 控制器 */
10793
- var controller = default_1.useInvoiceController();
11642
+ var controller = Invoice.useInvoiceController();
10794
11643
  /** 组件模式 */
10795
11644
 
10796
11645
  var model = controller.useMemo(function (s) {
@@ -10888,10 +11737,10 @@ var BuyerNameInput = (function (props) {
10888
11737
  /** 点击了选择项 */
10889
11738
 
10890
11739
  var onClickItem = React.useCallback( /*#__PURE__*/function () {
10891
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(e) {
11740
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
10892
11741
  var _controller$formList$;
10893
11742
 
10894
- return regeneratorRuntime.wrap(function _callee$(_context) {
11743
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10895
11744
  while (1) {
10896
11745
  switch (_context.prev = _context.next) {
10897
11746
  case 0:
@@ -10950,7 +11799,7 @@ var BuyerNameInput = (function (props) {
10950
11799
 
10951
11800
  function useDataSource() {
10952
11801
  /** 控制器 */
10953
- var controller = default_1.useInvoiceController();
11802
+ var controller = Invoice.useInvoiceController();
10954
11803
 
10955
11804
  var _React$useState3 = React.useState(false),
10956
11805
  _React$useState4 = _slicedToArray(_React$useState3, 2),
@@ -10969,8 +11818,8 @@ function useDataSource() {
10969
11818
  return s.buyerState.autoContainer;
10970
11819
  }, []);
10971
11820
  var onBuyNameChange = React.useCallback( /*#__PURE__*/function () {
10972
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(e) {
10973
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
11821
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
11822
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10974
11823
  while (1) {
10975
11824
  switch (_context2.prev = _context2.next) {
10976
11825
  case 0:
@@ -11034,7 +11883,7 @@ function interval(i, t) {
11034
11883
  var css_248z$9 = ".kts-invoice-operate-buyer {\n display: flex;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message {\n flex: 1;\n display: flex;\n position: relative;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .ktsAnt3x-descriptions-item-label {\n width: 179px;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list {\n width: 100%;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-view {\n border: none;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-label {\n padding: 0 10px;\n font-size: 12px;\n background-color: #fff;\n line-height: 30px;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content {\n padding: 0;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content .ktsAnt3x-input {\n box-shadow: none;\n border-color: #fff;\n border-radius: 0;\n padding: 0 10px;\n font-size: 12px;\n line-height: 30px;\n width: 100%;\n height: 100%;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content .ktsAnt3x-input:hover {\n border: 1 solid;\n border-color: #40a9ff;\n border-right-width: 1px !important;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content .has-error .ktsAnt3x-input,\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content .has-error .ktsAnt3x-input:hover {\n background-color: #fff;\n border: 1 solid;\n border-color: #f5222d;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-item {\n margin: 0;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-item-control {\n line-height: 0;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-item-children {\n height: 30px;\n display: block;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-item-children .ktsAnt3x-btn {\n line-height: 0;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-explain {\n position: absolute;\n left: 5px;\n top: 6px;\n z-index: 10;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-Import {\n position: absolute;\n right: 0px;\n top: 0px;\n z-index: 10;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-password {\n border-left: 1px solid #dcdcdc;\n display: flex;\n flex: none;\n width: 458px;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-title {\n flex: none;\n width: 30px;\n height: 100%;\n text-align: center;\n border-right: 1px solid #dcdcdc;\n display: table;\n padding: 0 5px;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-title label {\n display: table-cell;\n vertical-align: middle;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover {\n padding-top: 0;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .ktsAnt3x-popover-inner-content {\n padding: 6px 0;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n overflow-x: hidden;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .ktsAnt3x-popover-arrow {\n display: none;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content {\n width: 567px;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-block {\n padding: 14px 0;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-block label {\n display: block;\n font-size: 12px;\n color: #666666;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-recently-issued {\n padding: 0;\n margin: 0;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-recently-issued li {\n list-style: none;\n width: 50%;\n float: left;\n margin-bottom: 20px;\n padding: 0 10px;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-recently-issued::after {\n content: \".\";\n display: block;\n height: 0;\n clear: left;\n visibility: hidden;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company {\n padding: 0;\n margin: 0;\n font-size: 12px;\n padding: 10px;\n font-weight: bold;\n color: #000000;\n cursor: pointer;\n transition: background 0.4s;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company:hover {\n background: #e6e6e6e6;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company:last-child {\n margin-bottom: 0;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company li {\n list-style: none;\n width: 50%;\n float: left;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n padding-right: 10px;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company::after {\n content: \".\";\n display: block;\n height: 0;\n clear: left;\n visibility: hidden;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content-tag {\n line-height: 1;\n padding: 4px 12px;\n background: #F3F3F3;\n border-radius: 9999px;\n font-size: 12px;\n font-weight: bold;\n color: #000;\n cursor: pointer;\n transition: background 0.4s;\n display: inline-block;\n max-width: 100%;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content-tag:hover {\n background: #e6e6e6e6;\n}\n";
11035
11884
  styleInject(css_248z$9);
11036
11885
 
11037
- var Text$5 = Typography.Text;
11886
+ var Text$6 = Typography.Text;
11038
11887
 
11039
11888
  var Buyer$1 = /*#__PURE__*/function (_React$Component) {
11040
11889
  _inherits(Buyer, _React$Component);
@@ -11059,14 +11908,14 @@ var Buyer$1 = /*#__PURE__*/function (_React$Component) {
11059
11908
  return _this;
11060
11909
  }
11061
11910
 
11062
- return Buyer;
11911
+ return _createClass(Buyer);
11063
11912
  }(React.Component);
11064
11913
  var Main$2 = decorator(Form.create())(function (props) {
11065
11914
  var form = props.form;
11066
11915
  var getFieldDecorator = form.getFieldDecorator;
11067
11916
  /** 控制器 */
11068
11917
 
11069
- var controller = default_1.useInvoiceController();
11918
+ var controller = Invoice.useInvoiceController();
11070
11919
  /** 组件模式 */
11071
11920
 
11072
11921
  var model = controller.useMemo(function (s) {
@@ -11148,7 +11997,7 @@ var Main$2 = decorator(Form.create())(function (props) {
11148
11997
  if (e.options.rules.some(function (e) {
11149
11998
  return e.required;
11150
11999
  })) {
11151
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text$5, {
12000
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text$6, {
11152
12001
  type: "danger"
11153
12002
  }, "*"), e.label);
11154
12003
  } else {
@@ -11184,7 +12033,7 @@ var Main$2 = decorator(Form.create())(function (props) {
11184
12033
  });
11185
12034
 
11186
12035
  var ImportBuyerDrawer = (function () {
11187
- var controller = default_1.useInvoiceController();
12036
+ var controller = Invoice.useInvoiceController();
11188
12037
  var visible = controller.useMemo(function (s) {
11189
12038
  return s.buyerState.isVisibleDrawer;
11190
12039
  }, []);
@@ -11194,8 +12043,8 @@ var ImportBuyerDrawer = (function () {
11194
12043
 
11195
12044
  var onClose = React.useCallback(function () {
11196
12045
  controller.pipeline( /*#__PURE__*/function () {
11197
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
11198
- return regeneratorRuntime.wrap(function _callee$(_context) {
12046
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
12047
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11199
12048
  while (1) {
11200
12049
  switch (_context.prev = _context.next) {
11201
12050
  case 0:
@@ -11226,7 +12075,7 @@ var ImportBuyerDrawer = (function () {
11226
12075
  });
11227
12076
 
11228
12077
  var DrawerBody$1 = function DrawerBody() {
11229
- var controller = default_1.useInvoiceController();
12078
+ var controller = Invoice.useInvoiceController();
11230
12079
  var columns = controller.useMemo(function (e) {
11231
12080
  return e.buyerState.columns;
11232
12081
  }, []);
@@ -11257,10 +12106,10 @@ var DrawerBody$1 = function DrawerBody() {
11257
12106
  onRow: function onRow(record) {
11258
12107
  return {
11259
12108
  onClick: function () {
11260
- var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
12109
+ var _onClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
11261
12110
  var re, _controller$formList$;
11262
12111
 
11263
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
12112
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
11264
12113
  while (1) {
11265
12114
  switch (_context3.prev = _context3.next) {
11266
12115
  case 0:
@@ -11273,8 +12122,8 @@ var DrawerBody$1 = function DrawerBody() {
11273
12122
  if (re) {
11274
12123
  (_controller$formList$ = controller.formList.get('buyer')) === null || _controller$formList$ === void 0 ? void 0 : _controller$formList$.setFieldsValue(re);
11275
12124
  controller.pipeline( /*#__PURE__*/function () {
11276
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
11277
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
12125
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
12126
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11278
12127
  while (1) {
11279
12128
  switch (_context2.prev = _context2.next) {
11280
12129
  case 0:
@@ -11314,7 +12163,7 @@ var DrawerBody$1 = function DrawerBody() {
11314
12163
  };
11315
12164
 
11316
12165
  var ImportGoodsDrawer = (function () {
11317
- var controller = default_1.useInvoiceController();
12166
+ var controller = Invoice.useInvoiceController();
11318
12167
  var visible = controller.useMemo(function (s) {
11319
12168
  return s.goodsListState.importGoods.isVisibleDrawer;
11320
12169
  }, []);
@@ -11324,8 +12173,8 @@ var ImportGoodsDrawer = (function () {
11324
12173
  var onClose = React.useCallback(function () {
11325
12174
  console.log('===> 关闭抽屉');
11326
12175
  controller.pipeline( /*#__PURE__*/function () {
11327
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
11328
- return regeneratorRuntime.wrap(function _callee$(_context) {
12176
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
12177
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11329
12178
  while (1) {
11330
12179
  switch (_context.prev = _context.next) {
11331
12180
  case 0:
@@ -11360,7 +12209,7 @@ var ImportGoodsDrawer = (function () {
11360
12209
  });
11361
12210
 
11362
12211
  var DrawerBody$2 = function DrawerBody() {
11363
- var controller = default_1.useInvoiceController();
12212
+ var controller = Invoice.useInvoiceController();
11364
12213
  var columns = controller.useMemo(function (s) {
11365
12214
  return s.goodsListState.importGoods.columns;
11366
12215
  }, []);
@@ -11393,8 +12242,9 @@ var DrawerBody$2 = function DrawerBody() {
11393
12242
  return {
11394
12243
  onClick: function onClick() {
11395
12244
  controller.run( /*#__PURE__*/function () {
11396
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
11397
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
12245
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
12246
+ var between, editGood;
12247
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11398
12248
  while (1) {
11399
12249
  switch (_context2.prev = _context2.next) {
11400
12250
  case 0:
@@ -11402,7 +12252,8 @@ var DrawerBody$2 = function DrawerBody() {
11402
12252
  return !record[e] && record[e] !== 0;
11403
12253
  }).forEach(function (e) {
11404
12254
  delete record[e];
11405
- });
12255
+ }); // 导入时校验函数
12256
+
11406
12257
  _context2.next = 3;
11407
12258
  return s.goodsListState.importGoods.verifyFn(record);
11408
12259
 
@@ -11430,30 +12281,41 @@ var DrawerBody$2 = function DrawerBody() {
11430
12281
  record.priceIncludeTax = s.goodsListState.editGood.priceIncludeTax;
11431
12282
  record.lineAmountExcludeTax = s.goodsListState.editGood.lineAmountExcludeTax;
11432
12283
  record.lineAmountIncludeTax = s.goodsListState.editGood.lineAmountIncludeTax;
11433
- }
12284
+ } // 中间数据
11434
12285
 
11435
- s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), record);
11436
12286
 
11437
- if (s.goodsListState.editGood) {
11438
- _context2.next = 12;
11439
- break;
12287
+ between = _objectSpread2({}, record);
12288
+ between.itemName = getItemName$1(record, s.goodsListState.editGood);
12289
+ between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
12290
+
12291
+ editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
12292
+
12293
+ if (editGood.taxRate) {
12294
+ editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood);
11440
12295
  }
11441
12296
 
11442
- return _context2.abrupt("return");
12297
+ if ("".concat(editGood.priceIncludeTax) === '0') {
12298
+ editGood.priceIncludeTax = undefined;
12299
+ editGood.priceExcludeTax = undefined;
12300
+ } else {
12301
+ editGood.priceExcludeTax = getPriceExcludeTax(editGood, record);
12302
+ }
11443
12303
 
11444
- case 12:
11445
- if (s.goodsListState.editGood.taxRate) s.goodsListState.editGood.taxRate = dutyFree(controller, s.goodsListState.editGood.taxRate, s.goodsListState.form, s.goodsListState.editGood);
12304
+ if (editGood.quantity && editGood.priceIncludeTax) {
12305
+ editGood.lineAmountIncludeTax = countAmountIncludeTax(editGood.quantity, editGood.priceIncludeTax);
12306
+ } // 导入FORM里
11446
12307
 
11447
- if ("".concat(s.goodsListState.editGood.priceIncludeTax) === '0') {
11448
- s.goodsListState.editGood.priceIncludeTax = undefined;
11449
- s.goodsListState.editGood.priceExcludeTax = undefined;
12308
+
12309
+ if (s.goodsListState.isMyShow) {
12310
+ s.goodsListState.form.setFieldsValue(editGood);
11450
12311
  } else {
11451
- s.goodsListState.editGood.priceExcludeTax = getPriceExcludeTax(s.goodsListState.editGood, record);
12312
+ s.goodsListState.form.setFieldsValue(_objectSpread2(_objectSpread2({}, editGood), {}, {
12313
+ itemName: editGood.itemNameOther,
12314
+ unit: editGood.unitOther,
12315
+ itemModelName: editGood.itemModelNameOther
12316
+ }));
11452
12317
  }
11453
12318
 
11454
- if (s.goodsListState.editGood.quantity && s.goodsListState.editGood.priceIncludeTax) s.goodsListState.editGood.lineAmountIncludeTax = countAmountIncludeTax(s.goodsListState.editGood.quantity, s.goodsListState.editGood.priceIncludeTax);
11455
- s.goodsListState.editGood.itemName = getItemName(record);
11456
- s.goodsListState.form.setFieldsValue(s.goodsListState.editGood);
11457
12319
  s.goodsListState.importGoods.isVisibleDrawer = false;
11458
12320
  s.goodsListState.isTaxIncluded ? updateUnitPriceExcludingTax(controller, s.goodsListState.form) : updateUnitPriceTax(controller, s.goodsListState.form);
11459
12321
 
@@ -11475,11 +12337,12 @@ var DrawerBody$2 = function DrawerBody() {
11475
12337
  });
11476
12338
  };
11477
12339
  /** 货物名称 */
12340
+ // const getItemName = (record: any) => {
12341
+ // return record.shorthand
12342
+ // ? `*${record.shorthand}*${record.itemName}`
12343
+ // : record.itemName;
12344
+ // };
11478
12345
 
11479
-
11480
- var getItemName = function getItemName(record) {
11481
- return record.shorthand ? "*".concat(record.shorthand, "*").concat(record.itemName) : record.itemName;
11482
- };
11483
12346
  /** 货物单价,不含税 */
11484
12347
 
11485
12348
 
@@ -11487,6 +12350,39 @@ var getPriceExcludeTax = function getPriceExcludeTax(s, record) {
11487
12350
  if (!s.taxRate && s.taxRate !== 0 || !record.priceIncludeTax && record.priceIncludeTax !== 0) return; // 单价(含税)/(1+税率) = 单价(不含税)
11488
12351
 
11489
12352
  return format15(evaluate("".concat(record.priceIncludeTax, " / (1+").concat(s.taxRate, "/100)")));
12353
+ }; // 获取我方名称
12354
+
12355
+
12356
+ var getItemName$1 = function getItemName(record, editGood) {
12357
+ var _getSN;
12358
+
12359
+ var shorthand;
12360
+ shorthand = record.shorthand;
12361
+
12362
+ if (shorthand) {
12363
+ return "*".concat(shorthand, "*").concat(record.itemName);
12364
+ }
12365
+
12366
+ shorthand = (_getSN = getSN(editGood.itemNameOther)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand;
12367
+
12368
+ if (shorthand) {
12369
+ return "*".concat(shorthand, "*").concat(record.itemName);
12370
+ }
12371
+
12372
+ return record.itemName;
12373
+ }; // 获取他方名称
12374
+
12375
+
12376
+ var getItemNameOther = function getItemNameOther(record, editGood) {
12377
+ if (!editGood.itemNameOther) return editGood.itemNameOther;
12378
+ var shorthand;
12379
+ shorthand = record.shorthand;
12380
+
12381
+ if (shorthand) {
12382
+ return "*".concat(shorthand, "*").concat(record.itemName);
12383
+ }
12384
+
12385
+ return record.itemNameOther;
11490
12386
  };
11491
12387
 
11492
12388
  /**
@@ -11546,7 +12442,7 @@ styleInject(css_248z$a);
11546
12442
  var TreeNode = Tree.TreeNode;
11547
12443
  var confirm = Modal.confirm;
11548
12444
  var EndowCodeDrawer = (function () {
11549
- var controller = default_1.useInvoiceController();
12445
+ var controller = Invoice.useInvoiceController();
11550
12446
  var visible = controller.useMemo(function (s) {
11551
12447
  return s.goodsListState.endowCode.endowcodeGoodIndex.length > 0;
11552
12448
  }, []);
@@ -11558,8 +12454,8 @@ var EndowCodeDrawer = (function () {
11558
12454
 
11559
12455
  var onClose = React.useCallback(function () {
11560
12456
  controller.pipeline( /*#__PURE__*/function () {
11561
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
11562
- return regeneratorRuntime.wrap(function _callee$(_context) {
12457
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
12458
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11563
12459
  while (1) {
11564
12460
  switch (_context.prev = _context.next) {
11565
12461
  case 0:
@@ -11582,9 +12478,9 @@ var EndowCodeDrawer = (function () {
11582
12478
  React.useEffect(function () {
11583
12479
  if (visible) {
11584
12480
  controller.pipeline( /*#__PURE__*/function () {
11585
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
12481
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
11586
12482
  var endowcodeGoodIndex, good, getDefaultValue;
11587
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
12483
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11588
12484
  while (1) {
11589
12485
  switch (_context2.prev = _context2.next) {
11590
12486
  case 0:
@@ -11661,7 +12557,7 @@ var EndowCodeDrawer = (function () {
11661
12557
  var DrawerBody$3 = function DrawerBody(props) {
11662
12558
  var _defaultValue$taxRate, _defaultValue$favoure;
11663
12559
 
11664
- var controller = default_1.useInvoiceController();
12560
+ var controller = Invoice.useInvoiceController();
11665
12561
  var defaultValue = props.defaultValue;
11666
12562
  var actions = React.useMemo(function () {
11667
12563
  return createAsyncFormActions();
@@ -11714,9 +12610,9 @@ var DrawerBody$3 = function DrawerBody(props) {
11714
12610
  setDataSource = _React$useState6[1];
11715
12611
 
11716
12612
  var onSearch = React.useCallback( /*#__PURE__*/function () {
11717
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(e) {
12613
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
11718
12614
  var arr;
11719
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
12615
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
11720
12616
  while (1) {
11721
12617
  switch (_context3.prev = _context3.next) {
11722
12618
  case 0:
@@ -11749,8 +12645,8 @@ var DrawerBody$3 = function DrawerBody(props) {
11749
12645
  })[0];
11750
12646
  if (!info) return;
11751
12647
  !readOnlyTaxRate && actions.setFieldState('taxRate', /*#__PURE__*/function () {
11752
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(s) {
11753
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
12648
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
12649
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
11754
12650
  while (1) {
11755
12651
  switch (_context4.prev = _context4.next) {
11756
12652
  case 0:
@@ -11771,8 +12667,8 @@ var DrawerBody$3 = function DrawerBody(props) {
11771
12667
  };
11772
12668
  }());
11773
12669
  actions.setFieldState('shorthand', /*#__PURE__*/function () {
11774
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(s) {
11775
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
12670
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
12671
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
11776
12672
  while (1) {
11777
12673
  switch (_context5.prev = _context5.next) {
11778
12674
  case 0:
@@ -11873,8 +12769,8 @@ var DrawerBody$3 = function DrawerBody(props) {
11873
12769
  return e.id === id;
11874
12770
  })[0];
11875
12771
  !readOnlyTaxRate && actions.setFieldState('taxRate', /*#__PURE__*/function () {
11876
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(s) {
11877
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
12772
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(s) {
12773
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
11878
12774
  while (1) {
11879
12775
  switch (_context6.prev = _context6.next) {
11880
12776
  case 0:
@@ -11895,8 +12791,8 @@ var DrawerBody$3 = function DrawerBody(props) {
11895
12791
  };
11896
12792
  }());
11897
12793
  actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
11898
- var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(s) {
11899
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
12794
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(s) {
12795
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
11900
12796
  while (1) {
11901
12797
  switch (_context7.prev = _context7.next) {
11902
12798
  case 0:
@@ -11917,8 +12813,8 @@ var DrawerBody$3 = function DrawerBody(props) {
11917
12813
  };
11918
12814
  }());
11919
12815
  actions.setFieldState('shorthand', /*#__PURE__*/function () {
11920
- var _ref8 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(s) {
11921
- return regeneratorRuntime.wrap(function _callee8$(_context8) {
12816
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(s) {
12817
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
11922
12818
  while (1) {
11923
12819
  switch (_context8.prev = _context8.next) {
11924
12820
  case 0:
@@ -11941,14 +12837,14 @@ var DrawerBody$3 = function DrawerBody(props) {
11941
12837
  setVisible(false);
11942
12838
  }, [list, actions, readOnlyTaxRate]);
11943
12839
  React.useEffect(function () {
11944
- _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
12840
+ _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
11945
12841
  var fn, list;
11946
- return regeneratorRuntime.wrap(function _callee10$(_context10) {
12842
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
11947
12843
  while (1) {
11948
12844
  switch (_context10.prev = _context10.next) {
11949
12845
  case 0:
11950
- fn = controller.state.goodsListState.endowCode.getTaxCategoryCodeTree || /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
11951
- return regeneratorRuntime.wrap(function _callee9$(_context9) {
12846
+ fn = controller.state.goodsListState.endowCode.getTaxCategoryCodeTree || /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
12847
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
11952
12848
  while (1) {
11953
12849
  switch (_context9.prev = _context9.next) {
11954
12850
  case 0:
@@ -12035,9 +12931,9 @@ var DrawerBody$3 = function DrawerBody(props) {
12035
12931
 
12036
12932
  var onSubmit = React.useCallback(function (values) {
12037
12933
  controller.pipeline( /*#__PURE__*/function () {
12038
- var _ref11 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11(s) {
12934
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(s) {
12039
12935
  var endowCodeGood;
12040
- return regeneratorRuntime.wrap(function _callee11$(_context11) {
12936
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
12041
12937
  while (1) {
12042
12938
  switch (_context11.prev = _context11.next) {
12043
12939
  case 0:
@@ -12046,9 +12942,10 @@ var DrawerBody$3 = function DrawerBody(props) {
12046
12942
  }); // 赋码
12047
12943
 
12048
12944
  endowCodeGood.forEach(function (good) {
12049
- if (!good) return; // const name = getItemName(good.itemName, values.shorthand);
12050
-
12051
- good.itemName = getItemName$1(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
12945
+ if (!good) return;
12946
+ good.itemName = setShorthand(good.itemName, values.shorthand);
12947
+ good.itemNameOther = setShorthand(good.itemNameOther, values.shorthand); // const name = getItemName(good.itemName, values.shorthand);
12948
+ // good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
12052
12949
 
12053
12950
  good.taxClassificationCode = values.taxClassificationCode;
12054
12951
  good.taxRate = values.taxRate;
@@ -12057,17 +12954,20 @@ var DrawerBody$3 = function DrawerBody(props) {
12057
12954
  good.favouredPolicyName = values.favouredPolicyName;
12058
12955
  var taxRate = chain$1(bignumber(values.taxRate)).dotDivide(bignumber(100)).add(bignumber(1)).done(); // 是否含税
12059
12956
 
12060
- if (s.goodsListState.isTaxIncluded) {
12061
- var lineAmountExcludeTax = chain$1(bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
12062
- var priceExcludeTax = good.priceIncludeTax ? chain$1(bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined;
12063
- good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
12064
- good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
12065
- } else {
12066
- var lineAmountIncludeTax = chain$1(bignumber(good.lineAmountExcludeTax)).multiply(taxRate).done();
12067
- var priceIncludeTax = good.priceExcludeTax ? chain$1(bignumber(good.priceExcludeTax)).multiply(taxRate).done() : undefined;
12068
- good.lineAmountIncludeTax = lineAmountIncludeTax.toNumber().toFixed(2);
12069
- good.priceIncludeTax = (priceIncludeTax ? format15(priceIncludeTax.toNumber()) : undefined) || undefined;
12070
- }
12957
+ var lineAmountExcludeTax = chain$1(bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
12958
+ var priceExcludeTax = good.priceIncludeTax ? chain$1(bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined;
12959
+ good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
12960
+ good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined; // if (s.goodsListState.isTaxIncluded) {
12961
+ // const lineAmountExcludeTax = chain(bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
12962
+ // const priceExcludeTax = good.priceIncludeTax ? chain(bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined
12963
+ // good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
12964
+ // good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
12965
+ // } else {
12966
+ // const lineAmountIncludeTax = chain(bignumber(good.lineAmountExcludeTax)).multiply(taxRate).done();
12967
+ // const priceIncludeTax = good.priceExcludeTax ? chain(bignumber(good.priceExcludeTax)).multiply(taxRate).done() : undefined
12968
+ // good.lineAmountIncludeTax = lineAmountIncludeTax.toNumber().toFixed(2);
12969
+ // good.priceIncludeTax = (priceIncludeTax ? format15(priceIncludeTax.toNumber()) : undefined) || undefined;
12970
+ // }
12071
12971
 
12072
12972
  good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction, values.taxRate);
12073
12973
  }); //截取名称
@@ -12125,8 +13025,8 @@ var DrawerBody$3 = function DrawerBody(props) {
12125
13025
  FormEffectHooks.onFieldValueChange$('taxRate').subscribe(function (e) {
12126
13026
  setTaxRate(e.value);
12127
13027
  actions.setFieldState('taxFreeType', /*#__PURE__*/function () {
12128
- var _ref12 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12(s) {
12129
- return regeneratorRuntime.wrap(function _callee12$(_context12) {
13028
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
13029
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
12130
13030
  while (1) {
12131
13031
  switch (_context12.prev = _context12.next) {
12132
13032
  case 0:
@@ -12149,8 +13049,8 @@ var DrawerBody$3 = function DrawerBody(props) {
12149
13049
  FormEffectHooks.onFieldValueChange$('favouredPolicyMark').subscribe(function (e) {
12150
13050
  setFavouredPolicyMark(e.value);
12151
13051
  actions.setFieldState('favouredPolicyName', /*#__PURE__*/function () {
12152
- var _ref13 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13(s) {
12153
- return regeneratorRuntime.wrap(function _callee13$(_context13) {
13052
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
13053
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
12154
13054
  while (1) {
12155
13055
  switch (_context13.prev = _context13.next) {
12156
13056
  case 0:
@@ -12254,8 +13154,8 @@ var DrawerBody$3 = function DrawerBody(props) {
12254
13154
  }, "\u786E\u5B9A"), /*#__PURE__*/React.createElement(Button, {
12255
13155
  onClick: function onClick() {
12256
13156
  controller.pipeline( /*#__PURE__*/function () {
12257
- var _ref14 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14(s) {
12258
- return regeneratorRuntime.wrap(function _callee14$(_context14) {
13157
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
13158
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
12259
13159
  while (1) {
12260
13160
  switch (_context14.prev = _context14.next) {
12261
13161
  case 0:
@@ -12293,41 +13193,255 @@ var getShorthand = function getShorthand(value) {
12293
13193
  return undefined;
12294
13194
  }
12295
13195
  };
12296
- /** 简称填入名称 */
12297
13196
 
13197
+ var AddComparisonDrawer = decorator(Form.create())(function (props) {
13198
+ var form = props.form;
13199
+ var getFieldDecorator = form.getFieldDecorator;
13200
+ /** 控制器 */
12298
13201
 
12299
- var getItemName$1 = function getItemName(value, shorthand) {
12300
- if (!value) value = '';
13202
+ var controller = Invoice.useInvoiceController();
13203
+ /** 正在 添加商品对照 的货物索引 */
12301
13204
 
12302
- if (!shorthand) {
12303
- return value.replace(/\*[^*]+\*/, "");
12304
- }
13205
+ var addComparisonIndex = controller.useMemo(function (s) {
13206
+ return s.goodsListState.addComparisonIndex;
13207
+ }, []);
13208
+ /** 货物字典 */
12305
13209
 
12306
- var arr = value.match(/\*[^*]+\*/);
13210
+ var goodsMap = controller.useMemo(function (s) {
13211
+ return s.goodsListState.goodsMap;
13212
+ }, []);
13213
+ /** 正在 对照 的货物 */
12307
13214
 
12308
- if (arr) {
12309
- return value.replace(/\*[^*]+\*/, "*".concat(shorthand, "*"));
12310
- } else {
12311
- return "*".concat(shorthand, "*").concat(value);
12312
- }
12313
- };
13215
+ var good = React.useMemo(function () {
13216
+ return addComparisonIndex ? goodsMap.get(addComparisonIndex) : undefined;
13217
+ }, [addComparisonIndex]);
13218
+ /** 关闭对照 */
13219
+
13220
+ var onClose = React.useCallback(controller.pipeline( /*#__PURE__*/function () {
13221
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
13222
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13223
+ while (1) {
13224
+ switch (_context.prev = _context.next) {
13225
+ case 0:
13226
+ s.goodsListState.addComparisonIndex = undefined;
13227
+
13228
+ case 1:
13229
+ case "end":
13230
+ return _context.stop();
13231
+ }
13232
+ }
13233
+ }, _callee);
13234
+ }));
13235
+
13236
+ return function (_x) {
13237
+ return _ref.apply(this, arguments);
13238
+ };
13239
+ }()), [controller]);
13240
+ /** 提交数据 */
13241
+
13242
+ var onSubmit = React.useCallback(function () {
13243
+ controller.run( /*#__PURE__*/function () {
13244
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
13245
+ var _getSN, _getSN2, _s$goodsListState, _s$goodsListState$pro;
13246
+
13247
+ var _yield$validateFields, err, values, shorthand;
13248
+
13249
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
13250
+ while (1) {
13251
+ switch (_context2.prev = _context2.next) {
13252
+ case 0:
13253
+ if (good) {
13254
+ _context2.next = 2;
13255
+ break;
13256
+ }
13257
+
13258
+ return _context2.abrupt("return");
13259
+
13260
+ case 2:
13261
+ _context2.next = 4;
13262
+ return validateFields$1(form);
13263
+
13264
+ case 4:
13265
+ _yield$validateFields = _context2.sent;
13266
+ err = _yield$validateFields.err;
13267
+ values = _yield$validateFields.values;
13268
+
13269
+ if (!err) {
13270
+ _context2.next = 9;
13271
+ break;
13272
+ }
13273
+
13274
+ return _context2.abrupt("return");
13275
+
13276
+ case 9:
13277
+ shorthand = s.goodsListState.isMyShow ? (_getSN = getSN(good.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand : (_getSN2 = getSN(good.itemNameOther)) === null || _getSN2 === void 0 ? void 0 : _getSN2.shorthand;
13278
+ good.itemCode = values.itemCode;
13279
+ good.itemCodeOther = values.itemCodeOther;
13280
+ good.itemName = shorthand ? "*".concat(shorthand, "*").concat(values.itemName) : values.itemName;
13281
+ good.itemNameOther = shorthand ? "*".concat(shorthand, "*").concat(values.itemNameOther) : values.itemNameOther;
13282
+ good.itemModelName = values.itemModelName;
13283
+ good.itemModelNameOther = values.itemModelNameOther;
13284
+ good.unit = values.unit;
13285
+ good.unitOther = values.unitOther;
13286
+ s.goodsListState.addComparisonIndex = undefined;
13287
+ s.goodsListState.goodsList = _toConsumableArray(s.goodsListState.goodsList);
13288
+
13289
+ if (!(((_s$goodsListState = s.goodsListState) === null || _s$goodsListState === void 0 ? void 0 : (_s$goodsListState$pro = _s$goodsListState.productComparison) === null || _s$goodsListState$pro === void 0 ? void 0 : _s$goodsListState$pro.onUpdateComparisonTable) && values.isUpdate)) {
13290
+ _context2.next = 24;
13291
+ break;
13292
+ }
13293
+
13294
+ debugger;
13295
+ _context2.next = 24;
13296
+ return s.goodsListState.productComparison.onUpdateComparisonTable(good, values);
13297
+
13298
+ case 24:
13299
+ case "end":
13300
+ return _context2.stop();
13301
+ }
13302
+ }
13303
+ }, _callee2);
13304
+ }));
13305
+
13306
+ return function (_x2) {
13307
+ return _ref2.apply(this, arguments);
13308
+ };
13309
+ }());
13310
+ }, [form, good]);
13311
+ React.useEffect(function () {
13312
+ form.resetFields();
13313
+
13314
+ if (good) {
13315
+ var _getSN3, _getSN4;
13316
+
13317
+ form.setFieldsValue(_objectSpread2(_objectSpread2({}, good), {}, {
13318
+ itemName: (_getSN3 = getSN(good.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.full,
13319
+ itemNameOther: (_getSN4 = getSN(good.itemNameOther)) === null || _getSN4 === void 0 ? void 0 : _getSN4.full
13320
+ }));
13321
+ }
13322
+ }, [good]);
13323
+ return /*#__PURE__*/React.createElement(Drawer, {
13324
+ width: 500,
13325
+ onClose: onClose,
13326
+ placement: "right",
13327
+ title: "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167",
13328
+ visible: !!addComparisonIndex,
13329
+ drawerStyle: {
13330
+ display: 'flex',
13331
+ flexDirection: 'column'
13332
+ },
13333
+ bodyStyle: {
13334
+ flex: 1,
13335
+ display: 'flex',
13336
+ flexDirection: 'column'
13337
+ }
13338
+ }, /*#__PURE__*/React.createElement(Form, {
13339
+ layout: "vertical",
13340
+ style: {
13341
+ flex: 1
13342
+ }
13343
+ }, /*#__PURE__*/React.createElement(Row, {
13344
+ gutter: [8, 8]
13345
+ }, /*#__PURE__*/React.createElement(Col, {
13346
+ span: 12
13347
+ }, getFieldDecorator('itemCode', {})( /*#__PURE__*/React.createElement(Form.Item, {
13348
+ label: "\u6211\u65B9\u5546\u54C1\u7F16\u7801"
13349
+ }, /*#__PURE__*/React.createElement(Input, null)))), /*#__PURE__*/React.createElement(Col, {
13350
+ span: 12
13351
+ }, getFieldDecorator('itemCodeOther', {})( /*#__PURE__*/React.createElement(Form.Item, {
13352
+ label: "\u5BF9\u65B9\u5546\u54C1\u7F16\u7801"
13353
+ }, /*#__PURE__*/React.createElement(Input, null)))), /*#__PURE__*/React.createElement(Col, {
13354
+ span: 12
13355
+ }, getFieldDecorator('itemName', {
13356
+ rules: [{
13357
+ required: true,
13358
+ message: "请输入我方商品名称"
13359
+ }]
13360
+ })( /*#__PURE__*/React.createElement(Form.Item, {
13361
+ label: "\u6211\u65B9\u5546\u54C1\u540D\u79F0"
13362
+ }, /*#__PURE__*/React.createElement(Input, null)))), /*#__PURE__*/React.createElement(Col, {
13363
+ span: 12
13364
+ }, getFieldDecorator('itemNameOther', {
13365
+ rules: [{
13366
+ required: true,
13367
+ message: "请输入对方商品名称"
13368
+ }]
13369
+ })( /*#__PURE__*/React.createElement(Form.Item, {
13370
+ label: "\u5BF9\u65B9\u5546\u54C1\u540D\u79F0"
13371
+ }, /*#__PURE__*/React.createElement(Input, null)))), /*#__PURE__*/React.createElement(Col, {
13372
+ span: 12
13373
+ }, /*#__PURE__*/React.createElement(Form.Item, {
13374
+ label: "\u6211\u65B9\u89C4\u683C\u578B\u53F7"
13375
+ }, /*#__PURE__*/React.createElement(Input, null))), /*#__PURE__*/React.createElement(Col, {
13376
+ span: 12
13377
+ }, getFieldDecorator('itemModelNameOther', {
13378
+ rules: [{
13379
+ required: true,
13380
+ message: "请输入对方规格型号"
13381
+ }]
13382
+ })( /*#__PURE__*/React.createElement(Form.Item, {
13383
+ label: "\u5BF9\u65B9\u89C4\u683C\u578B\u53F7"
13384
+ }, /*#__PURE__*/React.createElement(Input, null)))), /*#__PURE__*/React.createElement(Col, {
13385
+ span: 12
13386
+ }, getFieldDecorator('unit', {
13387
+ rules: [{
13388
+ required: true,
13389
+ message: "请输入对方规格型号"
13390
+ }]
13391
+ })( /*#__PURE__*/React.createElement(Form.Item, {
13392
+ label: "\u6211\u65B9\u8BA1\u91CF\u5355\u4F4D"
13393
+ }, /*#__PURE__*/React.createElement(Input, null)))), /*#__PURE__*/React.createElement(Col, {
13394
+ span: 12
13395
+ }, getFieldDecorator('unitOther', {
13396
+ rules: [{
13397
+ required: true,
13398
+ message: "请输入对方计量单位"
13399
+ }]
13400
+ })( /*#__PURE__*/React.createElement(Form.Item, {
13401
+ label: "\u5BF9\u65B9\u8BA1\u91CF\u5355\u4F4D"
13402
+ }, /*#__PURE__*/React.createElement(Input, null)))), /*#__PURE__*/React.createElement(Col, {
13403
+ span: 24
13404
+ }, getFieldDecorator('isUpdate', {})( /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Checkbox, null, "\u66F4\u65B0\u5230\u5546\u54C1\u5BF9\u7167\u8868\u4E2D")))))), /*#__PURE__*/React.createElement("div", {
13405
+ style: {
13406
+ display: 'flex',
13407
+ justifyContent: 'flex-end',
13408
+ gap: 10
13409
+ }
13410
+ }, /*#__PURE__*/React.createElement(Button, {
13411
+ type: "primary",
13412
+ onClick: onSubmit
13413
+ }, "\u63D0\u4EA4"), /*#__PURE__*/React.createElement(Button, {
13414
+ onClick: onClose
13415
+ }, "\u53D6\u6D88")));
13416
+ });
13417
+
13418
+ function validateFields$1(form) {
13419
+ return new Promise(function (resolve) {
13420
+ form.validateFields(function (err, values) {
13421
+ resolve({
13422
+ err: err,
13423
+ values: values
13424
+ });
13425
+ });
13426
+ });
13427
+ }
12314
13428
 
12315
13429
  /** 发票组件的上下文 */
12316
13430
 
12317
13431
  var InvoiceContext = /*#__PURE__*/React.createContext(undefined);
12318
13432
 
12319
- var default_1 = /*#__PURE__*/function (_React$PureComponent) {
12320
- _inherits(default_1, _React$PureComponent);
13433
+ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
13434
+ _inherits(Invoice, _React$PureComponent);
12321
13435
 
12322
- var _super = _createSuper(default_1);
13436
+ var _super = _createSuper(Invoice);
12323
13437
 
12324
- function default_1() {
12325
- _classCallCheck(this, default_1);
13438
+ function Invoice() {
13439
+ _classCallCheck(this, Invoice);
12326
13440
 
12327
13441
  return _super.apply(this, arguments);
12328
13442
  }
12329
13443
 
12330
- _createClass(default_1, [{
13444
+ _createClass(Invoice, [{
12331
13445
  key: "render",
12332
13446
  value:
12333
13447
  /** 控制器 */
@@ -12350,18 +13464,18 @@ var default_1 = /*#__PURE__*/function (_React$PureComponent) {
12350
13464
  }
12351
13465
  }]);
12352
13466
 
12353
- return default_1;
13467
+ return Invoice;
12354
13468
  }(React.PureComponent);
12355
13469
 
12356
- default_1.InvoiceController = InvoiceController;
12357
- default_1.InvoiceHeader = InvoiceHeader;
12358
- default_1.GoodsList = GoodsList;
12359
- default_1.Seller = Buyer;
12360
- default_1.Sign = Sign;
12361
- default_1.Buyer = Buyer$1;
12362
- default_1.idGenerator = idGenerator;
13470
+ Invoice.InvoiceController = InvoiceController;
13471
+ Invoice.InvoiceHeader = InvoiceHeader;
13472
+ Invoice.GoodsList = GoodsList;
13473
+ Invoice.Seller = Buyer;
13474
+ Invoice.Sign = Sign;
13475
+ Invoice.Buyer = Buyer$1;
13476
+ Invoice.idGenerator = idGenerator;
12363
13477
 
12364
- default_1.useInvoiceController = function () {
13478
+ Invoice.useInvoiceController = function () {
12365
13479
  return React.useContext(InvoiceContext);
12366
13480
  };
12367
13481
 
@@ -12393,7 +13507,7 @@ var Main$3 = function Main(props) {
12393
13507
  /** 销售方 */
12394
13508
  , props.sign || /*#__PURE__*/React.createElement(Sign, null)
12395
13509
  /** 落款 */
12396
- , props.footExpand), /*#__PURE__*/React.createElement(ImportBuyerDrawer, null), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null));
13510
+ , props.footExpand), /*#__PURE__*/React.createElement(ImportBuyerDrawer, null), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null), /*#__PURE__*/React.createElement(AddComparisonDrawer, null));
12397
13511
  };
12398
13512
 
12399
- export { default_1 as Invoice, InvoiceController };
13513
+ export { Invoice, InvoiceController };