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.js CHANGED
@@ -23,14 +23,9 @@ function ownKeys(object, enumerableOnly) {
23
23
 
24
24
  if (Object.getOwnPropertySymbols) {
25
25
  var symbols = Object.getOwnPropertySymbols(object);
26
-
27
- if (enumerableOnly) {
28
- symbols = symbols.filter(function (sym) {
29
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
30
- });
31
- }
32
-
33
- keys.push.apply(keys, symbols);
26
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
27
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
28
+ })), keys.push.apply(keys, symbols);
34
29
  }
35
30
 
36
31
  return keys;
@@ -38,22 +33,360 @@ function ownKeys(object, enumerableOnly) {
38
33
 
39
34
  function _objectSpread2(target) {
40
35
  for (var i = 1; i < arguments.length; i++) {
41
- var source = arguments[i] != null ? arguments[i] : {};
36
+ var source = null != arguments[i] ? arguments[i] : {};
37
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
38
+ _defineProperty(target, key, source[key]);
39
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
40
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
41
+ });
42
+ }
42
43
 
43
- if (i % 2) {
44
- ownKeys(Object(source), true).forEach(function (key) {
45
- _defineProperty(target, key, source[key]);
46
- });
47
- } else if (Object.getOwnPropertyDescriptors) {
48
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
49
- } else {
50
- ownKeys(Object(source)).forEach(function (key) {
51
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
44
+ return target;
45
+ }
46
+
47
+ function _regeneratorRuntime() {
48
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
49
+
50
+ _regeneratorRuntime = function () {
51
+ return exports;
52
+ };
53
+
54
+ var exports = {},
55
+ Op = Object.prototype,
56
+ hasOwn = Op.hasOwnProperty,
57
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
58
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
59
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
60
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
61
+
62
+ function define(obj, key, value) {
63
+ return Object.defineProperty(obj, key, {
64
+ value: value,
65
+ enumerable: !0,
66
+ configurable: !0,
67
+ writable: !0
68
+ }), obj[key];
69
+ }
70
+
71
+ try {
72
+ define({}, "");
73
+ } catch (err) {
74
+ define = function (obj, key, value) {
75
+ return obj[key] = value;
76
+ };
77
+ }
78
+
79
+ function wrap(innerFn, outerFn, self, tryLocsList) {
80
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
81
+ generator = Object.create(protoGenerator.prototype),
82
+ context = new Context(tryLocsList || []);
83
+ return generator._invoke = function (innerFn, self, context) {
84
+ var state = "suspendedStart";
85
+ return function (method, arg) {
86
+ if ("executing" === state) throw new Error("Generator is already running");
87
+
88
+ if ("completed" === state) {
89
+ if ("throw" === method) throw arg;
90
+ return doneResult();
91
+ }
92
+
93
+ for (context.method = method, context.arg = arg;;) {
94
+ var delegate = context.delegate;
95
+
96
+ if (delegate) {
97
+ var delegateResult = maybeInvokeDelegate(delegate, context);
98
+
99
+ if (delegateResult) {
100
+ if (delegateResult === ContinueSentinel) continue;
101
+ return delegateResult;
102
+ }
103
+ }
104
+
105
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
106
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
107
+ context.dispatchException(context.arg);
108
+ } else "return" === context.method && context.abrupt("return", context.arg);
109
+ state = "executing";
110
+ var record = tryCatch(innerFn, self, context);
111
+
112
+ if ("normal" === record.type) {
113
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
114
+ return {
115
+ value: record.arg,
116
+ done: context.done
117
+ };
118
+ }
119
+
120
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
121
+ }
122
+ };
123
+ }(innerFn, self, context), generator;
124
+ }
125
+
126
+ function tryCatch(fn, obj, arg) {
127
+ try {
128
+ return {
129
+ type: "normal",
130
+ arg: fn.call(obj, arg)
131
+ };
132
+ } catch (err) {
133
+ return {
134
+ type: "throw",
135
+ arg: err
136
+ };
137
+ }
138
+ }
139
+
140
+ exports.wrap = wrap;
141
+ var ContinueSentinel = {};
142
+
143
+ function Generator() {}
144
+
145
+ function GeneratorFunction() {}
146
+
147
+ function GeneratorFunctionPrototype() {}
148
+
149
+ var IteratorPrototype = {};
150
+ define(IteratorPrototype, iteratorSymbol, function () {
151
+ return this;
152
+ });
153
+ var getProto = Object.getPrototypeOf,
154
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
155
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
156
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
157
+
158
+ function defineIteratorMethods(prototype) {
159
+ ["next", "throw", "return"].forEach(function (method) {
160
+ define(prototype, method, function (arg) {
161
+ return this._invoke(method, arg);
52
162
  });
163
+ });
164
+ }
165
+
166
+ function AsyncIterator(generator, PromiseImpl) {
167
+ function invoke(method, arg, resolve, reject) {
168
+ var record = tryCatch(generator[method], generator, arg);
169
+
170
+ if ("throw" !== record.type) {
171
+ var result = record.arg,
172
+ value = result.value;
173
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
174
+ invoke("next", value, resolve, reject);
175
+ }, function (err) {
176
+ invoke("throw", err, resolve, reject);
177
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
178
+ result.value = unwrapped, resolve(result);
179
+ }, function (error) {
180
+ return invoke("throw", error, resolve, reject);
181
+ });
182
+ }
183
+
184
+ reject(record.arg);
53
185
  }
186
+
187
+ var previousPromise;
188
+
189
+ this._invoke = function (method, arg) {
190
+ function callInvokeWithMethodAndArg() {
191
+ return new PromiseImpl(function (resolve, reject) {
192
+ invoke(method, arg, resolve, reject);
193
+ });
194
+ }
195
+
196
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
197
+ };
54
198
  }
55
199
 
56
- return target;
200
+ function maybeInvokeDelegate(delegate, context) {
201
+ var method = delegate.iterator[context.method];
202
+
203
+ if (undefined === method) {
204
+ if (context.delegate = null, "throw" === context.method) {
205
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
206
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
207
+ }
208
+
209
+ return ContinueSentinel;
210
+ }
211
+
212
+ var record = tryCatch(method, delegate.iterator, context.arg);
213
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
214
+ var info = record.arg;
215
+ 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);
216
+ }
217
+
218
+ function pushTryEntry(locs) {
219
+ var entry = {
220
+ tryLoc: locs[0]
221
+ };
222
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
223
+ }
224
+
225
+ function resetTryEntry(entry) {
226
+ var record = entry.completion || {};
227
+ record.type = "normal", delete record.arg, entry.completion = record;
228
+ }
229
+
230
+ function Context(tryLocsList) {
231
+ this.tryEntries = [{
232
+ tryLoc: "root"
233
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
234
+ }
235
+
236
+ function values(iterable) {
237
+ if (iterable) {
238
+ var iteratorMethod = iterable[iteratorSymbol];
239
+ if (iteratorMethod) return iteratorMethod.call(iterable);
240
+ if ("function" == typeof iterable.next) return iterable;
241
+
242
+ if (!isNaN(iterable.length)) {
243
+ var i = -1,
244
+ next = function next() {
245
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
246
+
247
+ return next.value = undefined, next.done = !0, next;
248
+ };
249
+
250
+ return next.next = next;
251
+ }
252
+ }
253
+
254
+ return {
255
+ next: doneResult
256
+ };
257
+ }
258
+
259
+ function doneResult() {
260
+ return {
261
+ value: undefined,
262
+ done: !0
263
+ };
264
+ }
265
+
266
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
267
+ var ctor = "function" == typeof genFun && genFun.constructor;
268
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
269
+ }, exports.mark = function (genFun) {
270
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
271
+ }, exports.awrap = function (arg) {
272
+ return {
273
+ __await: arg
274
+ };
275
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
276
+ return this;
277
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
278
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
279
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
280
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
281
+ return result.done ? result.value : iter.next();
282
+ });
283
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
284
+ return this;
285
+ }), define(Gp, "toString", function () {
286
+ return "[object Generator]";
287
+ }), exports.keys = function (object) {
288
+ var keys = [];
289
+
290
+ for (var key in object) keys.push(key);
291
+
292
+ return keys.reverse(), function next() {
293
+ for (; keys.length;) {
294
+ var key = keys.pop();
295
+ if (key in object) return next.value = key, next.done = !1, next;
296
+ }
297
+
298
+ return next.done = !0, next;
299
+ };
300
+ }, exports.values = values, Context.prototype = {
301
+ constructor: Context,
302
+ reset: function (skipTempReset) {
303
+ 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);
304
+ },
305
+ stop: function () {
306
+ this.done = !0;
307
+ var rootRecord = this.tryEntries[0].completion;
308
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
309
+ return this.rval;
310
+ },
311
+ dispatchException: function (exception) {
312
+ if (this.done) throw exception;
313
+ var context = this;
314
+
315
+ function handle(loc, caught) {
316
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
317
+ }
318
+
319
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
320
+ var entry = this.tryEntries[i],
321
+ record = entry.completion;
322
+ if ("root" === entry.tryLoc) return handle("end");
323
+
324
+ if (entry.tryLoc <= this.prev) {
325
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
326
+ hasFinally = hasOwn.call(entry, "finallyLoc");
327
+
328
+ if (hasCatch && hasFinally) {
329
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
330
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
331
+ } else if (hasCatch) {
332
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
333
+ } else {
334
+ if (!hasFinally) throw new Error("try statement without catch or finally");
335
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
336
+ }
337
+ }
338
+ }
339
+ },
340
+ abrupt: function (type, arg) {
341
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
342
+ var entry = this.tryEntries[i];
343
+
344
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
345
+ var finallyEntry = entry;
346
+ break;
347
+ }
348
+ }
349
+
350
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
351
+ var record = finallyEntry ? finallyEntry.completion : {};
352
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
353
+ },
354
+ complete: function (record, afterLoc) {
355
+ if ("throw" === record.type) throw record.arg;
356
+ 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;
357
+ },
358
+ finish: function (finallyLoc) {
359
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
360
+ var entry = this.tryEntries[i];
361
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
362
+ }
363
+ },
364
+ catch: function (tryLoc) {
365
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
366
+ var entry = this.tryEntries[i];
367
+
368
+ if (entry.tryLoc === tryLoc) {
369
+ var record = entry.completion;
370
+
371
+ if ("throw" === record.type) {
372
+ var thrown = record.arg;
373
+ resetTryEntry(entry);
374
+ }
375
+
376
+ return thrown;
377
+ }
378
+ }
379
+
380
+ throw new Error("illegal catch attempt");
381
+ },
382
+ delegateYield: function (iterable, resultName, nextLoc) {
383
+ return this.delegate = {
384
+ iterator: values(iterable),
385
+ resultName: resultName,
386
+ nextLoc: nextLoc
387
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
388
+ }
389
+ }, exports;
57
390
  }
58
391
 
59
392
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
@@ -111,6 +444,9 @@ function _defineProperties(target, props) {
111
444
  function _createClass(Constructor, protoProps, staticProps) {
112
445
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
113
446
  if (staticProps) _defineProperties(Constructor, staticProps);
447
+ Object.defineProperty(Constructor, "prototype", {
448
+ writable: false
449
+ });
114
450
  return Constructor;
115
451
  }
116
452
 
@@ -141,22 +477,24 @@ function _inherits(subClass, superClass) {
141
477
  configurable: true
142
478
  }
143
479
  });
480
+ Object.defineProperty(subClass, "prototype", {
481
+ writable: false
482
+ });
144
483
  if (superClass) _setPrototypeOf(subClass, superClass);
145
484
  }
146
485
 
147
486
  function _getPrototypeOf(o) {
148
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
487
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
149
488
  return o.__proto__ || Object.getPrototypeOf(o);
150
489
  };
151
490
  return _getPrototypeOf(o);
152
491
  }
153
492
 
154
493
  function _setPrototypeOf(o, p) {
155
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
494
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
156
495
  o.__proto__ = p;
157
496
  return o;
158
497
  };
159
-
160
498
  return _setPrototypeOf(o, p);
161
499
  }
162
500
 
@@ -355,12 +693,12 @@ var InvoiceControllerForm = /*#__PURE__*/function (_GreyReactBox) {
355
693
  }, {
356
694
  key: "validateFields",
357
695
  value: function () {
358
- var _validateFields2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
696
+ var _validateFields2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
359
697
  var _this3 = this;
360
698
 
361
699
  var _errors, _values, arr, i, key, _yield$_validateField, errors, values, _this$state$goodsList;
362
700
 
363
- return regeneratorRuntime.wrap(function _callee$(_context) {
701
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
364
702
  while (1) {
365
703
  switch (_context.prev = _context.next) {
366
704
  case 0:
@@ -489,7 +827,7 @@ var _validateFields = function _validateFields(form) {
489
827
  });
490
828
  };
491
829
 
492
- var ImportGoods = function ImportGoods() {
830
+ var ImportGoods = /*#__PURE__*/_createClass(function ImportGoods() {
493
831
  _classCallCheck(this, ImportGoods);
494
832
 
495
833
  this.columns = [{
@@ -531,8 +869,8 @@ var ImportGoods = function ImportGoods() {
531
869
  this.topExpand = void 0;
532
870
 
533
871
  this.verifyFn = /*#__PURE__*/function () {
534
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(record) {
535
- return regeneratorRuntime.wrap(function _callee$(_context) {
872
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(record) {
873
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
536
874
  while (1) {
537
875
  switch (_context.prev = _context.next) {
538
876
  case 0:
@@ -574,7 +912,7 @@ var ImportGoods = function ImportGoods() {
574
912
  return _ref.apply(this, arguments);
575
913
  };
576
914
  }();
577
- };
915
+ });
578
916
 
579
917
  var LineAttributeType;
580
918
 
@@ -586,12 +924,12 @@ var LineAttributeType;
586
924
 
587
925
  var LineAttributeType$1 = LineAttributeType;
588
926
 
589
- var EndowCode = function EndowCode() {
927
+ var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
590
928
  _classCallCheck(this, EndowCode);
591
929
 
592
930
  this.endowcodeGoodIndex = [];
593
- this.getTaxCategoryCodeList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
594
- return regeneratorRuntime.wrap(function _callee$(_context) {
931
+ this.getTaxCategoryCodeList = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
932
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
595
933
  while (1) {
596
934
  switch (_context.prev = _context.next) {
597
935
  case 0:
@@ -623,7 +961,7 @@ var EndowCode = function EndowCode() {
623
961
  value: 3
624
962
  }];
625
963
  this.cache = {};
626
- };
964
+ });
627
965
 
628
966
  function draft(value) {
629
967
  if (!value) return true; // isDiscount
@@ -644,7 +982,14 @@ function draft(value) {
644
982
  }
645
983
  }
646
984
 
647
- var GoodsListState = function GoodsListState() {
985
+ var ProductComparison = /*#__PURE__*/_createClass(function ProductComparison() {
986
+ _classCallCheck(this, ProductComparison);
987
+
988
+ this.onComply = void 0;
989
+ this.onUpdateComparisonTable = void 0;
990
+ });
991
+
992
+ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
648
993
  _classCallCheck(this, GoodsListState);
649
994
 
650
995
  this.deduction = 0;
@@ -652,11 +997,12 @@ var GoodsListState = function GoodsListState() {
652
997
  this.isSwitchTax = void 0;
653
998
  this.isAddDiscount = void 0;
654
999
  this.isTaxIncluded = true;
1000
+ this.isMyShow = false;
655
1001
  this.editGood = void 0;
656
1002
  this.form = void 0;
657
1003
  this.unitList = [];
658
1004
  this.defaultRate = 3;
659
- this.taxRateList = [0, 3, 5, 6, 9, 12];
1005
+ this.taxRateList = [0, 3, 5, 6, 9, 13];
660
1006
  this.goodsList = [];
661
1007
  this.goodsMap = new Map();
662
1008
  this.goodsMenuExpand = [];
@@ -664,10 +1010,12 @@ var GoodsListState = function GoodsListState() {
664
1010
  this.discountGoodIndex = [];
665
1011
  this.endowCode = new EndowCode();
666
1012
  this.importGoods = new ImportGoods();
1013
+ this.productComparison = new ProductComparison();
667
1014
  this.isVisibleDrawer = false;
668
- };
1015
+ this.addComparisonIndex = void 0;
1016
+ });
669
1017
 
670
- var BuyerState = function BuyerState() {
1018
+ var BuyerState = /*#__PURE__*/_createClass(function BuyerState() {
671
1019
  _classCallCheck(this, BuyerState);
672
1020
 
673
1021
  this.columns = [{
@@ -693,8 +1041,8 @@ var BuyerState = function BuyerState() {
693
1041
  }];
694
1042
 
695
1043
  this.onRowClick = /*#__PURE__*/function () {
696
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(record) {
697
- return regeneratorRuntime.wrap(function _callee$(_context) {
1044
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(record) {
1045
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
698
1046
  while (1) {
699
1047
  switch (_context.prev = _context.next) {
700
1048
  case 0:
@@ -718,9 +1066,9 @@ var BuyerState = function BuyerState() {
718
1066
  this.isVisibleDrawer = false;
719
1067
  this.topExpand = void 0;
720
1068
  this.autoContainer = void 0;
721
- };
1069
+ });
722
1070
 
723
- var InvoiceControllerState = function InvoiceControllerState() {
1071
+ var InvoiceControllerState = /*#__PURE__*/_createClass(function InvoiceControllerState() {
724
1072
  _classCallCheck(this, InvoiceControllerState);
725
1073
 
726
1074
  this.model = 'default';
@@ -728,15 +1076,15 @@ var InvoiceControllerState = function InvoiceControllerState() {
728
1076
  this.invoiceType = '08';
729
1077
  this.buyerState = new BuyerState();
730
1078
  this.goodsListState = new GoodsListState();
731
- };
1079
+ });
732
1080
 
733
1081
  /**
734
1082
  * 设置当前的编辑货物
735
1083
  */
736
1084
  var setEditGood = /*#__PURE__*/(function () {
737
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(state, newEditGood) {
1085
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, newEditGood) {
738
1086
  var editGood;
739
- return regeneratorRuntime.wrap(function _callee$(_context) {
1087
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
740
1088
  while (1) {
741
1089
  switch (_context.prev = _context.next) {
742
1090
  case 0:
@@ -768,9 +1116,9 @@ var setEditGood = /*#__PURE__*/(function () {
768
1116
  * 设置单个货物属性
769
1117
  */
770
1118
  var setGoods = /*#__PURE__*/(function () {
771
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(state, options) {
1119
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
772
1120
  var goodsList;
773
- return regeneratorRuntime.wrap(function _callee$(_context) {
1121
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
774
1122
  while (1) {
775
1123
  switch (_context.prev = _context.next) {
776
1124
  case 0:
@@ -807,9 +1155,9 @@ var setGoods = /*#__PURE__*/(function () {
807
1155
  */
808
1156
 
809
1157
  var delGood = /*#__PURE__*/(function () {
810
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(state, $index) {
1158
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, $index) {
811
1159
  var goods;
812
- return regeneratorRuntime.wrap(function _callee$(_context) {
1160
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
813
1161
  while (1) {
814
1162
  switch (_context.prev = _context.next) {
815
1163
  case 0:
@@ -882,15 +1230,86 @@ var idGenerator = (function () {
882
1230
  return ++id;
883
1231
  });
884
1232
 
1233
+ /** 格式化 保留2位小数 */
1234
+
1235
+ var format2 = function format2(value) {
1236
+ if (value === Infinity) return '';
1237
+ if ("".concat(value) === 'NaN') return '';
1238
+ if (typeof value === 'string') value = parseFloat(value);
1239
+ return parseFloat(value.toFixed(2));
1240
+ };
1241
+ /** 格式化 保留15位数字 */
1242
+
1243
+ var format15 = function format15(value) {
1244
+ if (value === Infinity) return '';
1245
+ if ("".concat(value) === 'NaN') return '';
1246
+ if (typeof value === 'string') value = parseFloat(value);
1247
+ var fractionDigits = 15 - "".concat(value || 0).indexOf('.');
1248
+ return parseFloat(value.toFixed(fractionDigits > 8 ? 8 : fractionDigits));
1249
+ };
1250
+ /**
1251
+ * 金额(含税) = 数量 * 单价(含税)
1252
+ * @param quantity 数量
1253
+ * @param priceIncludeTax 单价(含税)
1254
+ * @returns 金额(含税)
1255
+ */
1256
+
1257
+ function countAmountIncludeTax(quantity, priceIncludeTax) {
1258
+ if (!quantity && quantity !== 0) return undefined;
1259
+ if (!priceIncludeTax && priceIncludeTax !== 0) return undefined;
1260
+ quantity = format15(quantity);
1261
+ priceIncludeTax = format15(priceIncludeTax);
1262
+ return parseFloat(mathjs.chain(mathjs.bignumber(priceIncludeTax)).multiply(mathjs.bignumber(quantity)).done().toNumber().toFixed(2)); // return parseFloat(evaluate(`${priceIncludeTax} * ${quantity}`).toFixed(2));
1263
+ }
1264
+ /**
1265
+ * 不含税金额 = 含税金额-税额
1266
+ * @param amountIncludeTax 含税金额
1267
+ * @param taxAmount 税额
1268
+ * @returns 不含税金额
1269
+ */
1270
+
1271
+ function countAmountExcludeTax(amountIncludeTax, taxAmount) {
1272
+ if (!amountIncludeTax && amountIncludeTax !== 0) return undefined;
1273
+ if (!taxAmount && taxAmount !== 0) return undefined;
1274
+ return mathjs.chain(mathjs.bignumber(amountIncludeTax)).subtract(mathjs.bignumber(taxAmount)).done().toNumber();
1275
+ }
1276
+ /**
1277
+ * 税额 = (含税金额-扣除额)/(1+税率)*税率
1278
+ * @param amountIncludeTax 含税金额
1279
+ * @param deduction 扣除额
1280
+ * @param taxRate 税率
1281
+ * @returns 税额
1282
+ */
1283
+
1284
+ function countTaxAmount(amountIncludeTax, deduction, taxRate) {
1285
+ if (!amountIncludeTax && amountIncludeTax !== 0) return undefined;
1286
+ if (!deduction && deduction !== 0) return undefined;
1287
+ if (!taxRate && taxRate !== 0) return undefined;
1288
+ var taxRateBu = mathjs.chain(mathjs.bignumber(taxRate)).divide(mathjs.bignumber(100)).done();
1289
+ return parseFloat(mathjs.chain(mathjs.bignumber(amountIncludeTax)).subtract(mathjs.bignumber(deduction)).divide(mathjs.chain(mathjs.bignumber(1)).add(taxRateBu).done()).multiply(taxRateBu).done().toNumber().toFixed(2));
1290
+ }
1291
+ /**
1292
+ * 单价 = 金额/数量
1293
+ * @param amount 金额
1294
+ * @param quantity 数量
1295
+ * @returns 单价
1296
+ */
1297
+
1298
+ function countPrice(amount, quantity) {
1299
+ if (!amount && amount !== 0) return undefined;
1300
+ if (!quantity && quantity !== 0) return undefined;
1301
+ return format15(mathjs.chain(mathjs.bignumber(amount)).divide(mathjs.bignumber(quantity)).done().toNumber());
1302
+ }
1303
+
885
1304
  /**
886
1305
  * 设置当前的编辑货物
887
1306
  */
888
1307
 
889
1308
  var addGoodDiscount = /*#__PURE__*/(function () {
890
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(state, options) {
1309
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
891
1310
  var _options$indexList, indexList, discount, goodsMap, goodsList, discountGroup, amountSum, _loop, t, _ret;
892
1311
 
893
- return regeneratorRuntime.wrap(function _callee$(_context) {
1312
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
894
1313
  while (1) {
895
1314
  switch (_context.prev = _context.next) {
896
1315
  case 0:
@@ -945,7 +1364,7 @@ var addGoodDiscount = /*#__PURE__*/(function () {
945
1364
  amountSum = amountSum.add(mathjs.bignumber(lineAmountExcludeTax));
946
1365
  /** 金额(含税) lineAmountExcludeTax * (1+${good.taxRate}/100)*/
947
1366
 
948
- lineAmountIncludeTax = mathjs.chain(mathjs.bignumber(lineAmountExcludeTax)).multiply(mathjs.chain(mathjs.bignumber(1)).add(taxRate).done()).done().toNumber();
1367
+ lineAmountIncludeTax = format2(mathjs.chain(mathjs.bignumber(lineAmountExcludeTax)).multiply(mathjs.chain(mathjs.bignumber(1)).add(taxRate).done()).done().toNumber());
949
1368
  }
950
1369
  /** 税额 */
951
1370
 
@@ -1009,8 +1428,8 @@ var addGoodDiscount = /*#__PURE__*/(function () {
1009
1428
  */
1010
1429
 
1011
1430
  var addGood = /*#__PURE__*/(function () {
1012
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(state, options) {
1013
- return regeneratorRuntime.wrap(function _callee$(_context) {
1431
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state, options) {
1432
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1014
1433
  while (1) {
1015
1434
  switch (_context.prev = _context.next) {
1016
1435
  case 0:
@@ -1035,9 +1454,9 @@ var addGood = /*#__PURE__*/(function () {
1035
1454
  * 保存正在编辑的货物
1036
1455
  */
1037
1456
  var saveEditGood = /*#__PURE__*/(function () {
1038
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(state) {
1457
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(state) {
1039
1458
  var editGood, form;
1040
- return regeneratorRuntime.wrap(function _callee$(_context) {
1459
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1041
1460
  while (1) {
1042
1461
  switch (_context.prev = _context.next) {
1043
1462
  case 0:
@@ -1085,8 +1504,8 @@ var saveEditGood = /*#__PURE__*/(function () {
1085
1504
  var validateFields = function validateFields(form) {
1086
1505
  return new Promise(function (resolve) {
1087
1506
  form.validateFields( /*#__PURE__*/function () {
1088
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(err, values) {
1089
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
1507
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
1508
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1090
1509
  while (1) {
1091
1510
  switch (_context2.prev = _context2.next) {
1092
1511
  case 0:
@@ -1139,12 +1558,12 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
1139
1558
  /** 更新发票单据编号 */
1140
1559
 
1141
1560
 
1142
- return InvoiceController;
1561
+ return _createClass(InvoiceController);
1143
1562
  }(InvoiceControllerForm);
1144
1563
 
1145
1564
  var _defs, _path, _path2, _path3;
1146
1565
 
1147
- 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); }
1566
+ 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); }
1148
1567
 
1149
1568
  function SvgAuto(props) {
1150
1569
  return /*#__PURE__*/React.createElement("svg", _extends({
@@ -1180,7 +1599,7 @@ var InvoiceHeader = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
1180
1599
  /** 控制器 */
1181
1600
 
1182
1601
 
1183
- var controller = default_1.useInvoiceController();
1602
+ var controller = Invoice.useInvoiceController();
1184
1603
  var model = controller.useMemo(function (s) {
1185
1604
  return s.model;
1186
1605
  }, []);
@@ -1288,8 +1707,8 @@ var InvoiceHeader = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
1288
1707
  },
1289
1708
  component: SvgAuto,
1290
1709
  onClick: function () {
1291
- var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
1292
- return regeneratorRuntime.wrap(function _callee$(_context) {
1710
+ var _onClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1711
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1293
1712
  while (1) {
1294
1713
  switch (_context.prev = _context.next) {
1295
1714
  case 0:
@@ -1494,7 +1913,7 @@ styleInject(css_248z$3);
1494
1913
  var nzhcn = require('nzh').cn;
1495
1914
 
1496
1915
  var Statistics = (function () {
1497
- var controller = default_1.useInvoiceController();
1916
+ var controller = Invoice.useInvoiceController();
1498
1917
  /** 是否不含税) */
1499
1918
 
1500
1919
  var isTaxIncluded = controller.useMemo(function (s) {
@@ -1602,7 +2021,7 @@ var Statistics = (function () {
1602
2021
  });
1603
2022
 
1604
2023
  var AddRowButton = (function () {
1605
- var controller = default_1.useInvoiceController();
2024
+ var controller = Invoice.useInvoiceController();
1606
2025
  var model = controller.useMemo(function (s) {
1607
2026
  return s.model;
1608
2027
  }, []);
@@ -1621,8 +2040,8 @@ var AddRowButton = (function () {
1621
2040
  var disabled = React__default['default'].useMemo(function () {
1622
2041
  return typeof goodMax === 'number' ? goodsNum >= goodMax : false;
1623
2042
  }, [goodMax, goodsNum]);
1624
- var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
1625
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
2043
+ var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2044
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1626
2045
  while (1) {
1627
2046
  switch (_context2.prev = _context2.next) {
1628
2047
  case 0:
@@ -1636,8 +2055,8 @@ var AddRowButton = (function () {
1636
2055
  case 4:
1637
2056
  _context2.next = 6;
1638
2057
  return controller.pipeline( /*#__PURE__*/function () {
1639
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
1640
- return regeneratorRuntime.wrap(function _callee$(_context) {
2058
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2059
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1641
2060
  while (1) {
1642
2061
  switch (_context.prev = _context.next) {
1643
2062
  case 0:
@@ -1691,7 +2110,7 @@ var AddRowButton = (function () {
1691
2110
  });
1692
2111
 
1693
2112
  var TaxIncludedSwitch = (function () {
1694
- var controller = default_1.useInvoiceController();
2113
+ var controller = Invoice.useInvoiceController();
1695
2114
  /** 是否含税 */
1696
2115
 
1697
2116
  var isTaxIncluded = controller.useMemo(function (e) {
@@ -1704,8 +2123,8 @@ var TaxIncludedSwitch = (function () {
1704
2123
  }, []);
1705
2124
  var onChange = React__default['default'].useCallback(function (e) {
1706
2125
  controller.pipeline( /*#__PURE__*/function () {
1707
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
1708
- return regeneratorRuntime.wrap(function _callee$(_context) {
2126
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2127
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1709
2128
  while (1) {
1710
2129
  switch (_context.prev = _context.next) {
1711
2130
  case 0:
@@ -1726,7 +2145,11 @@ var TaxIncludedSwitch = (function () {
1726
2145
  };
1727
2146
  }())();
1728
2147
  }, []);
1729
- return /*#__PURE__*/React__default['default'].createElement("span", null, /*#__PURE__*/React__default['default'].createElement("label", null, "\u542B\u7A0E:"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Switch, {
2148
+ return /*#__PURE__*/React__default['default'].createElement("span", null, /*#__PURE__*/React__default['default'].createElement("label", {
2149
+ style: {
2150
+ marginRight: 2
2151
+ }
2152
+ }, "\u542B\u7A0E:"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Switch, {
1730
2153
  disabled: isSwitchTax === false,
1731
2154
  checked: isTaxIncluded,
1732
2155
  checkedChildren: "\u5F00",
@@ -1736,8 +2159,59 @@ var TaxIncludedSwitch = (function () {
1736
2159
  }));
1737
2160
  });
1738
2161
 
2162
+ var DescribeSwitch = (function () {
2163
+ var controller = Invoice.useInvoiceController();
2164
+ var productComparison = controller.useMemo(function (s) {
2165
+ return s.goodsListState.productComparison;
2166
+ }, []);
2167
+ var isMyShow = controller.useMemo(function (s) {
2168
+ return s.goodsListState.isMyShow;
2169
+ }, []);
2170
+ var onChange = React__default['default'].useCallback(function (e) {
2171
+ controller.run( /*#__PURE__*/function () {
2172
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2173
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2174
+ while (1) {
2175
+ switch (_context.prev = _context.next) {
2176
+ case 0:
2177
+ return _context.abrupt("return", s.goodsListState.isMyShow = !s.goodsListState.isMyShow);
2178
+
2179
+ case 1:
2180
+ case "end":
2181
+ return _context.stop();
2182
+ }
2183
+ }
2184
+ }, _callee);
2185
+ }));
2186
+
2187
+ return function (_x) {
2188
+ return _ref.apply(this, arguments);
2189
+ };
2190
+ }());
2191
+ }, []);
2192
+ if (!productComparison.onComply) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
2193
+ return /*#__PURE__*/React__default['default'].createElement("span", null, /*#__PURE__*/React__default['default'].createElement("label", {
2194
+ style: {
2195
+ marginRight: 2
2196
+ }
2197
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Tooltip, {
2198
+ title: "\u84DD\u8272\u4EE3\u8868\u6211\u65B9\u5546\u54C1\u63CF\u8FF0\uFF0C\u9ED1\u8272\u4EE3\u8868\u5BF9\u65B9\u7684\u5546\u54C1\u63CF\u8FF0\u3002"
2199
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Icon, {
2200
+ style: {
2201
+ marginRight: 3
2202
+ },
2203
+ type: "info-circle"
2204
+ })), "\u4F7F\u7528\u54EA\u65B9\u5546\u54C1\u63CF\u8FF0:"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Switch, {
2205
+ checked: isMyShow,
2206
+ checkedChildren: "\u6211\u65B9",
2207
+ unCheckedChildren: "\u5BF9\u65B9",
2208
+ defaultChecked: true,
2209
+ onChange: onChange
2210
+ }));
2211
+ });
2212
+
1739
2213
  function TableRow(props) {
1740
- var controller = default_1.useInvoiceController();
2214
+ var controller = Invoice.useInvoiceController();
1741
2215
  var goodsMap = controller.useMemo(function (s) {
1742
2216
  return s.goodsListState.goodsMap;
1743
2217
  }, []);
@@ -1799,7 +2273,7 @@ var _create = mathjs.create(mathjs.all, {
1799
2273
 
1800
2274
  var AddDiscountRowButton = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
1801
2275
  /** 控制器 */
1802
- var controller = default_1.useInvoiceController();
2276
+ var controller = Invoice.useInvoiceController();
1803
2277
  var model = controller.useMemo(function (s) {
1804
2278
  return s.model;
1805
2279
  }, []);
@@ -1830,8 +2304,8 @@ var AddDiscountRowButton = GreyReactBox.decorator(ktsComponentsAntdX3.Form.creat
1830
2304
 
1831
2305
  var onClose = React__default['default'].useCallback(function () {
1832
2306
  controller.pipeline( /*#__PURE__*/function () {
1833
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
1834
- return regeneratorRuntime.wrap(function _callee$(_context) {
2307
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2308
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
1835
2309
  while (1) {
1836
2310
  switch (_context.prev = _context.next) {
1837
2311
  case 0:
@@ -1852,8 +2326,8 @@ var AddDiscountRowButton = GreyReactBox.decorator(ktsComponentsAntdX3.Form.creat
1852
2326
  }, []);
1853
2327
  /** 点击了 添加折扣行 按钮 */
1854
2328
 
1855
- var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
1856
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
2329
+ var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
2330
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1857
2331
  while (1) {
1858
2332
  switch (_context3.prev = _context3.next) {
1859
2333
  case 0:
@@ -1867,9 +2341,9 @@ var AddDiscountRowButton = GreyReactBox.decorator(ktsComponentsAntdX3.Form.creat
1867
2341
  case 4:
1868
2342
  _context3.next = 6;
1869
2343
  return controller.pipeline( /*#__PURE__*/function () {
1870
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
2344
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
1871
2345
  var isOk;
1872
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
2346
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1873
2347
  while (1) {
1874
2348
  switch (_context2.prev = _context2.next) {
1875
2349
  case 0:
@@ -1961,7 +2435,7 @@ var AddDiscountRowButton = GreyReactBox.decorator(ktsComponentsAntdX3.Form.creat
1961
2435
  var DrawerBody = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
1962
2436
  var form = props.form;
1963
2437
  var getFieldDecorator = form.getFieldDecorator;
1964
- var controller = default_1.useInvoiceController();
2438
+ var controller = Invoice.useInvoiceController();
1965
2439
  /** 选中的货物索引列表 */
1966
2440
 
1967
2441
  var discountGoodIndex = controller.useMemo(function (s) {
@@ -1990,8 +2464,8 @@ var DrawerBody = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(funct
1990
2464
 
1991
2465
  var onClose = React__default['default'].useCallback(function () {
1992
2466
  controller.pipeline( /*#__PURE__*/function () {
1993
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(s) {
1994
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
2467
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
2468
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
1995
2469
  while (1) {
1996
2470
  switch (_context4.prev = _context4.next) {
1997
2471
  case 0:
@@ -2019,8 +2493,8 @@ var DrawerBody = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(funct
2019
2493
  var discount = parseFloat(parseFloat(values.discount).toFixed(4));
2020
2494
  var indexList = discountGoodIndex;
2021
2495
  controller.pipeline( /*#__PURE__*/function () {
2022
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(s) {
2023
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
2496
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
2497
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
2024
2498
  while (1) {
2025
2499
  switch (_context5.prev = _context5.next) {
2026
2500
  case 0:
@@ -2056,7 +2530,7 @@ var DrawerBody = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(funct
2056
2530
  });
2057
2531
  });
2058
2532
  }, 300), [form, lineAmountSum]);
2059
- /** 折扣率变化 */
2533
+ /** 折扣变化 */
2060
2534
 
2061
2535
  var onChangeDiscolineAmountunt = React__default['default'].useCallback(lazyFn(function (e) {
2062
2536
  form.validateFields(function (err, values) {
@@ -2181,14 +2655,14 @@ var coolingFn = (function () {
2181
2655
  });
2182
2656
 
2183
2657
  var EndowCodeButton = (function () {
2184
- var controller = default_1.useInvoiceController();
2658
+ var controller = Invoice.useInvoiceController();
2185
2659
  /** 是否禁用 */
2186
2660
 
2187
2661
  var disabled = controller.useMemo(function (s) {
2188
2662
  if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
2189
2663
  }, []);
2190
- var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
2191
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
2664
+ var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2665
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2192
2666
  while (1) {
2193
2667
  switch (_context2.prev = _context2.next) {
2194
2668
  case 0:
@@ -2202,8 +2676,8 @@ var EndowCodeButton = (function () {
2202
2676
  case 4:
2203
2677
  _context2.next = 6;
2204
2678
  return controller.pipeline( /*#__PURE__*/function () {
2205
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
2206
- return regeneratorRuntime.wrap(function _callee$(_context) {
2679
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2680
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2207
2681
  while (1) {
2208
2682
  switch (_context.prev = _context.next) {
2209
2683
  case 0:
@@ -2266,7 +2740,7 @@ var EndowCodeButton = (function () {
2266
2740
  });
2267
2741
 
2268
2742
  var DelRowButton = (function () {
2269
- var controller = default_1.useInvoiceController();
2743
+ var controller = Invoice.useInvoiceController();
2270
2744
  var model = controller.useMemo(function (s) {
2271
2745
  return s.model;
2272
2746
  }, []);
@@ -2282,9 +2756,9 @@ var DelRowButton = (function () {
2282
2756
  }, []);
2283
2757
  var onClick = React__default['default'].useCallback(function () {
2284
2758
  controller.pipeline( /*#__PURE__*/function () {
2285
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
2759
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2286
2760
  var goodsList;
2287
- return regeneratorRuntime.wrap(function _callee$(_context) {
2761
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2288
2762
  while (1) {
2289
2763
  switch (_context.prev = _context.next) {
2290
2764
  case 0:
@@ -2324,9 +2798,165 @@ var DelRowButton = (function () {
2324
2798
  }, "\u5220\u9664\u884C");
2325
2799
  });
2326
2800
 
2801
+ /** 拆分全称加简称 */
2802
+ var getSN = function getSN(value) {
2803
+ debugger;
2804
+ if (!value) return undefined;
2805
+ var arr = value.match(/\*[^*]+\*/);
2806
+
2807
+ if (arr && arr[0]) {
2808
+ return {
2809
+ shorthand: arr[0].split('*')[1],
2810
+ full: value.replace(arr[0], '')
2811
+ };
2812
+ } else {
2813
+ return {
2814
+ shorthand: undefined,
2815
+ full: value
2816
+ };
2817
+ }
2818
+ };
2819
+ /** 组合全称加简称 */
2820
+
2821
+ var getItemName = function getItemName(value) {
2822
+ if (value.shorthand) {
2823
+ return "*".concat(value.shorthand, "*").concat(value.full);
2824
+ } else {
2825
+ return value.full;
2826
+ }
2827
+ };
2828
+ /** 设置简称 */
2829
+
2830
+ var setShorthand = function setShorthand(name, shorthand) {
2831
+ if (!name) return undefined;
2832
+ var sn = getSN(name);
2833
+ if (!sn) return undefined;
2834
+ sn.shorthand = shorthand || '';
2835
+ return getItemName(sn);
2836
+ };
2837
+
2838
+ var CommodityComparisonButton = (function () {
2839
+ var controller = Invoice.useInvoiceController();
2840
+
2841
+ var _controller$useMemo = controller.useMemo(function (s) {
2842
+ return s.goodsListState.productComparison;
2843
+ }, []),
2844
+ onComply = _controller$useMemo.onComply;
2845
+ /** 是否禁用 */
2846
+
2847
+
2848
+ var disabled = controller.useMemo(function (s) {
2849
+ if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
2850
+ }, []);
2851
+ /** 点击了 */
2852
+
2853
+ var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2854
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2855
+ while (1) {
2856
+ switch (_context2.prev = _context2.next) {
2857
+ case 0:
2858
+ _context2.next = 2;
2859
+ return controller.saveEditGood();
2860
+
2861
+ case 2:
2862
+ _context2.next = 4;
2863
+ return controller.wait();
2864
+
2865
+ case 4:
2866
+ _context2.next = 6;
2867
+ return controller.run( /*#__PURE__*/function () {
2868
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2869
+ var _s$goodsListState, _s$goodsListState$pro;
2870
+
2871
+ var goods, newGoods;
2872
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2873
+ while (1) {
2874
+ switch (_context.prev = _context.next) {
2875
+ case 0:
2876
+ if (!(s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0)) {
2877
+ _context.next = 3;
2878
+ break;
2879
+ }
2880
+
2881
+ coolingFn('不能给正在编辑的货物执行商品对照', 3000, function () {
2882
+ ktsComponentsAntdX3.message.error('不能给正在编辑的货物执行商品对照');
2883
+ });
2884
+ return _context.abrupt("return");
2885
+
2886
+ case 3:
2887
+ 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) {
2888
+ _context.next = 5;
2889
+ break;
2890
+ }
2891
+
2892
+ return _context.abrupt("return");
2893
+
2894
+ case 5:
2895
+ goods = s.goodsListState.selectedGoodIndex.map(function (e) {
2896
+ var _getSN, _getSN2;
2897
+
2898
+ var t = s.goodsListState.goodsMap.get(e);
2899
+ if (!t) return undefined;
2900
+ return _objectSpread2(_objectSpread2({}, t), {}, {
2901
+ itemName: (_getSN = getSN(t.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.full,
2902
+ itemNameOther: (_getSN2 = getSN(t.itemNameOther)) === null || _getSN2 === void 0 ? void 0 : _getSN2.full
2903
+ });
2904
+ }).filter(function (e) {
2905
+ return !!e;
2906
+ }); // 比对后的商品
2907
+
2908
+ _context.next = 8;
2909
+ return s.goodsListState.productComparison.onComply(goods);
2910
+
2911
+ case 8:
2912
+ newGoods = _context.sent;
2913
+ newGoods.filter(function (e) {
2914
+ var _getSN3, _getSN4;
2915
+
2916
+ var vt = s.goodsListState.goodsMap.get(e.$index);
2917
+ if (!vt) return undefined;
2918
+ vt.itemName = e.itemName ? setShorthand(e.itemName, (_getSN3 = getSN(vt.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.shorthand) : vt.itemName;
2919
+ vt.itemNameOther = e.itemNameOther ? setShorthand(e.itemNameOther, (_getSN4 = getSN(vt.itemNameOther)) === null || _getSN4 === void 0 ? void 0 : _getSN4.shorthand) : vt.itemNameOther;
2920
+ vt.unit = e.unit ? e.unit : vt.unit;
2921
+ vt.unitOther = e.unitOther ? e.unitOther : vt.unitOther;
2922
+ vt.itemModelName = e.itemModelName ? e.itemModelName : vt.itemModelName;
2923
+ vt.itemModelNameOther = e.itemModelNameOther ? e.itemModelNameOther : vt.itemModelNameOther;
2924
+ vt.itemCode = e.itemCode ? e.itemCode : vt.itemCode;
2925
+ vt.itemCodeOther = e.itemCodeOther ? e.itemCodeOther : vt.itemCodeOther;
2926
+ });
2927
+
2928
+ case 10:
2929
+ case "end":
2930
+ return _context.stop();
2931
+ }
2932
+ }
2933
+ }, _callee);
2934
+ }));
2935
+
2936
+ return function (_x) {
2937
+ return _ref2.apply(this, arguments);
2938
+ };
2939
+ }());
2940
+
2941
+ case 6:
2942
+ case "end":
2943
+ return _context2.stop();
2944
+ }
2945
+ }
2946
+ }, _callee2);
2947
+ })), []); // 没用 执行商品对照 的方法 不显示按钮
2948
+
2949
+ if (!onComply) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
2950
+ return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Button, {
2951
+ icon: 'swap',
2952
+ disabled: disabled,
2953
+ onClick: onClick
2954
+ }, "\u6267\u884C\u5546\u54C1\u5BF9\u7167");
2955
+ });
2956
+
2327
2957
  var _defs$1, _path$1;
2328
2958
 
2329
- 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); }
2959
+ 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); }
2330
2960
 
2331
2961
  function SvgSpot(props) {
2332
2962
  return /*#__PURE__*/React.createElement("svg", _extends$1({
@@ -2340,7 +2970,7 @@ function SvgSpot(props) {
2340
2970
 
2341
2971
  var Text$1 = ktsComponentsAntdX3.Typography.Text;
2342
2972
  var useDelItem = (function (goods) {
2343
- var controller = default_1.useInvoiceController();
2973
+ var controller = Invoice.useInvoiceController();
2344
2974
  var onClick = React__default['default'].useCallback(function () {
2345
2975
  controller.delGood(goods.$index);
2346
2976
  }, [controller, goods.$index]);
@@ -2362,11 +2992,11 @@ var useDelItem = (function (goods) {
2362
2992
 
2363
2993
  var Text$2 = ktsComponentsAntdX3.Typography.Text;
2364
2994
  var useAddDiscount = (function (goods) {
2365
- var controller = default_1.useInvoiceController();
2995
+ var controller = Invoice.useInvoiceController();
2366
2996
  /** 点击了 添加折扣行 按钮 */
2367
2997
 
2368
- var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
2369
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
2998
+ var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
2999
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
2370
3000
  while (1) {
2371
3001
  switch (_context2.prev = _context2.next) {
2372
3002
  case 0:
@@ -2380,9 +3010,9 @@ var useAddDiscount = (function (goods) {
2380
3010
  case 4:
2381
3011
  _context2.next = 6;
2382
3012
  return controller.pipeline( /*#__PURE__*/function () {
2383
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
3013
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
2384
3014
  var err, key;
2385
- return regeneratorRuntime.wrap(function _callee$(_context) {
3015
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
2386
3016
  while (1) {
2387
3017
  switch (_context.prev = _context.next) {
2388
3018
  case 0:
@@ -2392,7 +3022,7 @@ var useAddDiscount = (function (goods) {
2392
3022
  }
2393
3023
 
2394
3024
  err = s.goodsListState.form.getFieldsError();
2395
- _context.t0 = regeneratorRuntime.keys(err);
3025
+ _context.t0 = _regeneratorRuntime().keys(err);
2396
3026
 
2397
3027
  case 3:
2398
3028
  if ((_context.t1 = _context.t0()).done) {
@@ -2467,93 +3097,22 @@ var useAddDiscount = (function (goods) {
2467
3097
  return undefined;
2468
3098
  }
2469
3099
 
2470
- return React__default['default'].useMemo(function () {
2471
- if (goods.lineAttribute !== LineAttributeType$1.正常) {
2472
- return undefined;
2473
- }
2474
-
2475
- return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
2476
- key: "addDiscount",
2477
- onClick: onClick
2478
- }, /*#__PURE__*/React__default['default'].createElement(Text$2, {
2479
- strong: true
2480
- }, "\u6DFB\u52A0\u6298\u6263\u884C"));
2481
- }, [onClick, goods.lineAttribute]);
2482
- });
2483
-
2484
- /** 格式化 保留2位小数 */
2485
-
2486
- var format2 = function format2(value) {
2487
- if (value === Infinity) return '';
2488
- if ("".concat(value) === 'NaN') return '';
2489
- if (typeof value === 'string') value = parseFloat(value);
2490
- return parseFloat(value.toFixed(2));
2491
- };
2492
- /** 格式化 保留15位数字 */
2493
-
2494
- var format15 = function format15(value) {
2495
- if (value === Infinity) return '';
2496
- if ("".concat(value) === 'NaN') return '';
2497
- if (typeof value === 'string') value = parseFloat(value);
2498
- var fractionDigits = 15 - "".concat(value || 0).indexOf('.');
2499
- return parseFloat(value.toFixed(fractionDigits > 8 ? 8 : fractionDigits));
2500
- };
2501
- /**
2502
- * 金额(含税) = 数量 * 单价(含税)
2503
- * @param quantity 数量
2504
- * @param priceIncludeTax 单价(含税)
2505
- * @returns 金额(含税)
2506
- */
2507
-
2508
- function countAmountIncludeTax(quantity, priceIncludeTax) {
2509
- if (!quantity && quantity !== 0) return undefined;
2510
- if (!priceIncludeTax && priceIncludeTax !== 0) return undefined;
2511
- quantity = format15(quantity);
2512
- priceIncludeTax = format15(priceIncludeTax);
2513
- return parseFloat(mathjs.chain(mathjs.bignumber(priceIncludeTax)).multiply(mathjs.bignumber(quantity)).done().toNumber().toFixed(2)); // return parseFloat(evaluate(`${priceIncludeTax} * ${quantity}`).toFixed(2));
2514
- }
2515
- /**
2516
- * 不含税金额 = 含税金额-税额
2517
- * @param amountIncludeTax 含税金额
2518
- * @param taxAmount 税额
2519
- * @returns 不含税金额
2520
- */
2521
-
2522
- function countAmountExcludeTax(amountIncludeTax, taxAmount) {
2523
- if (!amountIncludeTax && amountIncludeTax !== 0) return undefined;
2524
- if (!taxAmount && taxAmount !== 0) return undefined;
2525
- return mathjs.chain(mathjs.bignumber(amountIncludeTax)).subtract(mathjs.bignumber(taxAmount)).done().toNumber();
2526
- }
2527
- /**
2528
- * 税额 = (含税金额-扣除额)/(1+税率)*税率
2529
- * @param amountIncludeTax 含税金额
2530
- * @param deduction 扣除额
2531
- * @param taxRate 税率
2532
- * @returns 税额
2533
- */
2534
-
2535
- function countTaxAmount(amountIncludeTax, deduction, taxRate) {
2536
- if (!amountIncludeTax && amountIncludeTax !== 0) return undefined;
2537
- if (!deduction && deduction !== 0) return undefined;
2538
- if (!taxRate && taxRate !== 0) return undefined;
2539
- var taxRateBu = mathjs.chain(mathjs.bignumber(taxRate)).divide(mathjs.bignumber(100)).done();
2540
- return parseFloat(mathjs.chain(mathjs.bignumber(amountIncludeTax)).subtract(mathjs.bignumber(deduction)).divide(mathjs.chain(mathjs.bignumber(1)).add(taxRateBu).done()).multiply(taxRateBu).done().toNumber().toFixed(2));
2541
- }
2542
- /**
2543
- * 单价 = 金额/数量
2544
- * @param amount 金额
2545
- * @param quantity 数量
2546
- * @returns 单价
2547
- */
3100
+ return React__default['default'].useMemo(function () {
3101
+ if (goods.lineAttribute !== LineAttributeType$1.正常) {
3102
+ return undefined;
3103
+ }
2548
3104
 
2549
- function countPrice(amount, quantity) {
2550
- if (!amount && amount !== 0) return undefined;
2551
- if (!quantity && quantity !== 0) return undefined;
2552
- return format15(mathjs.chain(mathjs.bignumber(amount)).divide(mathjs.bignumber(quantity)).done().toNumber());
2553
- }
3105
+ return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
3106
+ key: "addDiscount",
3107
+ onClick: onClick
3108
+ }, /*#__PURE__*/React__default['default'].createElement(Text$2, {
3109
+ strong: true
3110
+ }, "\u6DFB\u52A0\u6298\u6263\u884C"));
3111
+ }, [onClick, goods.lineAttribute]);
3112
+ });
2554
3113
 
2555
3114
  //! moment.js
2556
- //! version : 2.29.1
3115
+ //! version : 2.29.3
2557
3116
  //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
2558
3117
  //! license : MIT
2559
3118
  //! momentjs.com
@@ -2624,8 +3183,9 @@ function isDate(input) {
2624
3183
 
2625
3184
  function map(arr, fn) {
2626
3185
  var res = [],
2627
- i;
2628
- for (i = 0; i < arr.length; ++i) {
3186
+ i,
3187
+ arrLen = arr.length;
3188
+ for (i = 0; i < arrLen; ++i) {
2629
3189
  res.push(fn(arr[i], i));
2630
3190
  }
2631
3191
  return res;
@@ -2754,7 +3314,10 @@ var momentProperties = (hooks.momentProperties = []),
2754
3314
  updateInProgress = false;
2755
3315
 
2756
3316
  function copyConfig(to, from) {
2757
- var i, prop, val;
3317
+ var i,
3318
+ prop,
3319
+ val,
3320
+ momentPropertiesLen = momentProperties.length;
2758
3321
 
2759
3322
  if (!isUndefined(from._isAMomentObject)) {
2760
3323
  to._isAMomentObject = from._isAMomentObject;
@@ -2787,8 +3350,8 @@ function copyConfig(to, from) {
2787
3350
  to._locale = from._locale;
2788
3351
  }
2789
3352
 
2790
- if (momentProperties.length > 0) {
2791
- for (i = 0; i < momentProperties.length; i++) {
3353
+ if (momentPropertiesLen > 0) {
3354
+ for (i = 0; i < momentPropertiesLen; i++) {
2792
3355
  prop = momentProperties[i];
2793
3356
  val = from[prop];
2794
3357
  if (!isUndefined(val)) {
@@ -2843,8 +3406,9 @@ function deprecate(msg, fn) {
2843
3406
  var args = [],
2844
3407
  arg,
2845
3408
  i,
2846
- key;
2847
- for (i = 0; i < arguments.length; i++) {
3409
+ key,
3410
+ argLen = arguments.length;
3411
+ for (i = 0; i < argLen; i++) {
2848
3412
  arg = '';
2849
3413
  if (typeof arguments[i] === 'object') {
2850
3414
  arg += '\n[' + i + '] ';
@@ -2994,7 +3558,8 @@ function zeroFill(number, targetLength, forceSign) {
2994
3558
  );
2995
3559
  }
2996
3560
 
2997
- 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,
3561
+ var formattingTokens =
3562
+ /(\[[^\[]*\])|(\\)?([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,
2998
3563
  localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
2999
3564
  formatFunctions = {},
3000
3565
  formatTokenFunctions = {};
@@ -3298,8 +3863,9 @@ function stringSet(units, value) {
3298
3863
  if (typeof units === 'object') {
3299
3864
  units = normalizeObjectUnits(units);
3300
3865
  var prioritized = getPrioritizedUnits(units),
3301
- i;
3302
- for (i = 0; i < prioritized.length; i++) {
3866
+ i,
3867
+ prioritizedLen = prioritized.length;
3868
+ for (i = 0; i < prioritizedLen; i++) {
3303
3869
  this[prioritized[i].unit](units[prioritized[i].unit]);
3304
3870
  }
3305
3871
  } else {
@@ -3329,7 +3895,8 @@ var match1 = /\d/, // 0 - 9
3329
3895
  matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
3330
3896
  // any word (or two) characters or numbers including two/three word month in arabic.
3331
3897
  // includes scottish gaelic two word and hyphenated months
3332
- 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,
3898
+ matchWord =
3899
+ /[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,
3333
3900
  regexes;
3334
3901
 
3335
3902
  regexes = {};
@@ -3355,15 +3922,12 @@ function unescapeFormat(s) {
3355
3922
  return regexEscape(
3356
3923
  s
3357
3924
  .replace('\\', '')
3358
- .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
3359
- matched,
3360
- p1,
3361
- p2,
3362
- p3,
3363
- p4
3364
- ) {
3365
- return p1 || p2 || p3 || p4;
3366
- })
3925
+ .replace(
3926
+ /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
3927
+ function (matched, p1, p2, p3, p4) {
3928
+ return p1 || p2 || p3 || p4;
3929
+ }
3930
+ )
3367
3931
  );
3368
3932
  }
3369
3933
 
@@ -3375,7 +3939,8 @@ var tokens = {};
3375
3939
 
3376
3940
  function addParseToken(token, callback) {
3377
3941
  var i,
3378
- func = callback;
3942
+ func = callback,
3943
+ tokenLen;
3379
3944
  if (typeof token === 'string') {
3380
3945
  token = [token];
3381
3946
  }
@@ -3384,7 +3949,8 @@ function addParseToken(token, callback) {
3384
3949
  array[callback] = toInt(input);
3385
3950
  };
3386
3951
  }
3387
- for (i = 0; i < token.length; i++) {
3952
+ tokenLen = token.length;
3953
+ for (i = 0; i < tokenLen; i++) {
3388
3954
  tokens[token[i]] = func;
3389
3955
  }
3390
3956
  }
@@ -3495,12 +4061,12 @@ addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
3495
4061
 
3496
4062
  // LOCALES
3497
4063
 
3498
- var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
3499
- '_'
3500
- ),
3501
- defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
3502
- '_'
3503
- ),
4064
+ var defaultLocaleMonths =
4065
+ 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
4066
+ '_'
4067
+ ),
4068
+ defaultLocaleMonthsShort =
4069
+ 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
3504
4070
  MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
3505
4071
  defaultMonthsShortRegex = matchWord,
3506
4072
  defaultMonthsRegex = matchWord;
@@ -3942,14 +4508,12 @@ addRegexToken('ww', match1to2, match2);
3942
4508
  addRegexToken('W', match1to2);
3943
4509
  addRegexToken('WW', match1to2, match2);
3944
4510
 
3945
- addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
3946
- input,
3947
- week,
3948
- config,
3949
- token
3950
- ) {
3951
- week[token.substr(0, 1)] = toInt(input);
3952
- });
4511
+ addWeekParseToken(
4512
+ ['w', 'ww', 'W', 'WW'],
4513
+ function (input, week, config, token) {
4514
+ week[token.substr(0, 1)] = toInt(input);
4515
+ }
4516
+ );
3953
4517
 
3954
4518
  // HELPERS
3955
4519
 
@@ -4074,9 +4638,8 @@ function shiftWeekdays(ws, n) {
4074
4638
  return ws.slice(n, 7).concat(ws.slice(0, n));
4075
4639
  }
4076
4640
 
4077
- var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
4078
- '_'
4079
- ),
4641
+ var defaultLocaleWeekdays =
4642
+ 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
4080
4643
  defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
4081
4644
  defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
4082
4645
  defaultWeekdaysRegex = matchWord,
@@ -4624,6 +5187,11 @@ function chooseLocale(names) {
4624
5187
  return globalLocale;
4625
5188
  }
4626
5189
 
5190
+ function isLocaleNameSane(name) {
5191
+ // Prevent names that look like filesystem paths, i.e contain '/' or '\'
5192
+ return name.match('^[^/\\\\]*$') != null;
5193
+ }
5194
+
4627
5195
  function loadLocale(name) {
4628
5196
  var oldLocale = null,
4629
5197
  aliasedRequire;
@@ -4632,7 +5200,8 @@ function loadLocale(name) {
4632
5200
  locales[name] === undefined &&
4633
5201
  typeof module !== 'undefined' &&
4634
5202
  module &&
4635
- module.exports
5203
+ module.exports &&
5204
+ isLocaleNameSane(name)
4636
5205
  ) {
4637
5206
  try {
4638
5207
  oldLocale = globalLocale._abbr;
@@ -4849,8 +5418,10 @@ function checkOverflow(m) {
4849
5418
 
4850
5419
  // iso 8601 regex
4851
5420
  // 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)
4852
- 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)?)?$/,
4853
- 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)?)?$/,
5421
+ var extendedIsoRegex =
5422
+ /^\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)?)?$/,
5423
+ basicIsoRegex =
5424
+ /^\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)?)?$/,
4854
5425
  tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
4855
5426
  isoDates = [
4856
5427
  ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
@@ -4881,7 +5452,8 @@ var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\
4881
5452
  ],
4882
5453
  aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
4883
5454
  // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
4884
- 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}))$/,
5455
+ rfc2822 =
5456
+ /^(?:(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}))$/,
4885
5457
  obsOffsets = {
4886
5458
  UT: 0,
4887
5459
  GMT: 0,
@@ -4904,12 +5476,13 @@ function configFromISO(config) {
4904
5476
  allowTime,
4905
5477
  dateFormat,
4906
5478
  timeFormat,
4907
- tzFormat;
5479
+ tzFormat,
5480
+ isoDatesLen = isoDates.length,
5481
+ isoTimesLen = isoTimes.length;
4908
5482
 
4909
5483
  if (match) {
4910
5484
  getParsingFlags(config).iso = true;
4911
-
4912
- for (i = 0, l = isoDates.length; i < l; i++) {
5485
+ for (i = 0, l = isoDatesLen; i < l; i++) {
4913
5486
  if (isoDates[i][1].exec(match[1])) {
4914
5487
  dateFormat = isoDates[i][0];
4915
5488
  allowTime = isoDates[i][2] !== false;
@@ -4921,7 +5494,7 @@ function configFromISO(config) {
4921
5494
  return;
4922
5495
  }
4923
5496
  if (match[3]) {
4924
- for (i = 0, l = isoTimes.length; i < l; i++) {
5497
+ for (i = 0, l = isoTimesLen; i < l; i++) {
4925
5498
  if (isoTimes[i][1].exec(match[3])) {
4926
5499
  // match[2] should be 'T' or space
4927
5500
  timeFormat = (match[2] || ' ') + isoTimes[i][0];
@@ -5301,12 +5874,13 @@ function configFromStringAndFormat(config) {
5301
5874
  skipped,
5302
5875
  stringLength = string.length,
5303
5876
  totalParsedInputLength = 0,
5304
- era;
5877
+ era,
5878
+ tokenLen;
5305
5879
 
5306
5880
  tokens =
5307
5881
  expandFormat(config._f, config._locale).match(formattingTokens) || [];
5308
-
5309
- for (i = 0; i < tokens.length; i++) {
5882
+ tokenLen = tokens.length;
5883
+ for (i = 0; i < tokenLen; i++) {
5310
5884
  token = tokens[i];
5311
5885
  parsedInput = (string.match(getParseRegexForToken(token, config)) ||
5312
5886
  [])[0];
@@ -5401,15 +5975,16 @@ function configFromStringAndArray(config) {
5401
5975
  i,
5402
5976
  currentScore,
5403
5977
  validFormatFound,
5404
- bestFormatIsValid = false;
5978
+ bestFormatIsValid = false,
5979
+ configfLen = config._f.length;
5405
5980
 
5406
- if (config._f.length === 0) {
5981
+ if (configfLen === 0) {
5407
5982
  getParsingFlags(config).invalidFormat = true;
5408
5983
  config._d = new Date(NaN);
5409
5984
  return;
5410
5985
  }
5411
5986
 
5412
- for (i = 0; i < config._f.length; i++) {
5987
+ for (i = 0; i < configfLen; i++) {
5413
5988
  currentScore = 0;
5414
5989
  validFormatFound = false;
5415
5990
  tempConfig = copyConfig({}, config);
@@ -5650,7 +6225,8 @@ var ordering = [
5650
6225
  function isDurationValid(m) {
5651
6226
  var key,
5652
6227
  unitHasDecimal = false,
5653
- i;
6228
+ i,
6229
+ orderLen = ordering.length;
5654
6230
  for (key in m) {
5655
6231
  if (
5656
6232
  hasOwnProp(m, key) &&
@@ -5663,7 +6239,7 @@ function isDurationValid(m) {
5663
6239
  }
5664
6240
  }
5665
6241
 
5666
- for (i = 0; i < ordering.length; ++i) {
6242
+ for (i = 0; i < orderLen; ++i) {
5667
6243
  if (m[ordering[i]]) {
5668
6244
  if (unitHasDecimal) {
5669
6245
  return false; // only allow non-integers for smallest unit
@@ -5988,7 +6564,8 @@ var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
5988
6564
  // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
5989
6565
  // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
5990
6566
  // and further modified to allow for strings containing both week and day
5991
- isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
6567
+ isoRegex =
6568
+ /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
5992
6569
 
5993
6570
  function createDuration(input, key) {
5994
6571
  var duration = input,
@@ -6209,9 +6786,10 @@ function isMomentInputObject(input) {
6209
6786
  'ms',
6210
6787
  ],
6211
6788
  i,
6212
- property;
6789
+ property,
6790
+ propertyLen = properties.length;
6213
6791
 
6214
- for (i = 0; i < properties.length; i += 1) {
6792
+ for (i = 0; i < propertyLen; i += 1) {
6215
6793
  property = properties[i];
6216
6794
  propertyTest = propertyTest || hasOwnProp(input, property);
6217
6795
  }
@@ -6834,19 +7412,17 @@ addRegexToken('NNN', matchEraAbbr);
6834
7412
  addRegexToken('NNNN', matchEraName);
6835
7413
  addRegexToken('NNNNN', matchEraNarrow);
6836
7414
 
6837
- addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
6838
- input,
6839
- array,
6840
- config,
6841
- token
6842
- ) {
6843
- var era = config._locale.erasParse(input, token, config._strict);
6844
- if (era) {
6845
- getParsingFlags(config).era = era;
6846
- } else {
6847
- getParsingFlags(config).invalidEra = input;
7415
+ addParseToken(
7416
+ ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'],
7417
+ function (input, array, config, token) {
7418
+ var era = config._locale.erasParse(input, token, config._strict);
7419
+ if (era) {
7420
+ getParsingFlags(config).era = era;
7421
+ } else {
7422
+ getParsingFlags(config).invalidEra = input;
7423
+ }
6848
7424
  }
6849
- });
7425
+ );
6850
7426
 
6851
7427
  addRegexToken('y', matchUnsigned);
6852
7428
  addRegexToken('yy', matchUnsigned);
@@ -7138,14 +7714,12 @@ addRegexToken('gggg', match1to4, match4);
7138
7714
  addRegexToken('GGGGG', match1to6, match6);
7139
7715
  addRegexToken('ggggg', match1to6, match6);
7140
7716
 
7141
- addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
7142
- input,
7143
- week,
7144
- config,
7145
- token
7146
- ) {
7147
- week[token.substr(0, 2)] = toInt(input);
7148
- });
7717
+ addWeekParseToken(
7718
+ ['gggg', 'ggggg', 'GGGG', 'GGGGG'],
7719
+ function (input, week, config, token) {
7720
+ week[token.substr(0, 2)] = toInt(input);
7721
+ }
7722
+ );
7149
7723
 
7150
7724
  addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
7151
7725
  week[token] = hooks.parseTwoDigitYear(input);
@@ -8168,7 +8742,7 @@ addParseToken('x', function (input, array, config) {
8168
8742
 
8169
8743
  //! moment.js
8170
8744
 
8171
- hooks.version = '2.29.1';
8745
+ hooks.version = '2.29.3';
8172
8746
 
8173
8747
  setHookCallback(createLocal);
8174
8748
 
@@ -8257,10 +8831,10 @@ var promptErr = function promptErr(err) {
8257
8831
 
8258
8832
  var onChangeQuantity = lazyFn$1(function (controller, form, record) {
8259
8833
  form.validateFields( /*#__PURE__*/function () {
8260
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(err, values) {
8834
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(err, values) {
8261
8835
  var quantity, priceIncludeTax, lineAmountIncludeTax, _lineAmountIncludeTax, _priceIncludeTax, priceExcludeTax, lineAmountExcludeTax, _lineAmountExcludeTax, _priceExcludeTax;
8262
8836
 
8263
- return regeneratorRuntime.wrap(function _callee$(_context) {
8837
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
8264
8838
  while (1) {
8265
8839
  switch (_context.prev = _context.next) {
8266
8840
  case 0:
@@ -8406,10 +8980,10 @@ var onChangeQuantity = lazyFn$1(function (controller, form, record) {
8406
8980
 
8407
8981
  var onChangePriceIncludeTax = lazyFn$1(function (controller, form, record) {
8408
8982
  form.validateFields( /*#__PURE__*/function () {
8409
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(err, values) {
8983
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
8410
8984
  var priceIncludeTax, quantity, lineAmountIncludeTax, _lineAmountIncludeTax2, _quantity;
8411
8985
 
8412
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
8986
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8413
8987
  while (1) {
8414
8988
  switch (_context2.prev = _context2.next) {
8415
8989
  case 0:
@@ -8505,10 +9079,10 @@ var onChangePriceIncludeTax = lazyFn$1(function (controller, form, record) {
8505
9079
 
8506
9080
  var onChangePriceExcludeTax = lazyFn$1(function (controller, form, record) {
8507
9081
  form.validateFields( /*#__PURE__*/function () {
8508
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(err, values) {
9082
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(err, values) {
8509
9083
  var priceExcludeTax, quantity, lineAmountExcludeTax, _lineAmountExcludeTax2, _quantity2;
8510
9084
 
8511
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
9085
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
8512
9086
  while (1) {
8513
9087
  switch (_context3.prev = _context3.next) {
8514
9088
  case 0:
@@ -8604,10 +9178,10 @@ var onChangePriceExcludeTax = lazyFn$1(function (controller, form, record) {
8604
9178
 
8605
9179
  var onChangeLineAmountIncludeTax = lazyFn$1(function (controller, form, record) {
8606
9180
  form.validateFields( /*#__PURE__*/function () {
8607
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(err, values) {
9181
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(err, values) {
8608
9182
  var lineAmountIncludeTax, quantity, priceIncludeTax, _priceIncludeTax2, _quantity3;
8609
9183
 
8610
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
9184
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
8611
9185
  while (1) {
8612
9186
  switch (_context4.prev = _context4.next) {
8613
9187
  case 0:
@@ -8696,10 +9270,10 @@ var onChangeLineAmountIncludeTax = lazyFn$1(function (controller, form, record)
8696
9270
 
8697
9271
  var onChangeLineAmountExcludeTax = lazyFn$1(function (controller, form, record) {
8698
9272
  form.validateFields( /*#__PURE__*/function () {
8699
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(err, values) {
9273
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(err, values) {
8700
9274
  var lineAmountExcludeTax, quantity, priceExcludeTax, _priceExcludeTax2, _quantity4;
8701
9275
 
8702
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
9276
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
8703
9277
  while (1) {
8704
9278
  switch (_context5.prev = _context5.next) {
8705
9279
  case 0:
@@ -8788,9 +9362,9 @@ var onChangeLineAmountExcludeTax = lazyFn$1(function (controller, form, record)
8788
9362
 
8789
9363
  var onChangeTaxRate = lazyFn$1(function (controller, form, record) {
8790
9364
  form.validateFields( /*#__PURE__*/function () {
8791
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(err, values) {
9365
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(err, values) {
8792
9366
  var taxRate;
8793
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
9367
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
8794
9368
  while (1) {
8795
9369
  switch (_context6.prev = _context6.next) {
8796
9370
  case 0:
@@ -8850,6 +9424,11 @@ function dutyFree(controller, taxRate, form, record) {
8850
9424
  var cache = controller.state.goodsListState.endowCode.cache;
8851
9425
  var invoiceType = controller.state.invoiceType; // 4月1日至12月31日
8852
9426
 
9427
+ console.log('===> 小规模纳税人免税逻辑');
9428
+ console.log('===> invoiceType', invoiceType);
9429
+ console.log('===> en', controller.state.en);
9430
+ console.log('===> taxRate', taxRate);
9431
+ console.log('===> state', controller.state);
8853
9432
  if (hooks().valueOf() > hooks('2022-12-31 23:59').valueOf()) return taxRate;
8854
9433
  if (controller.state.en !== '08') return taxRate;
8855
9434
  if (invoiceType !== '10' && invoiceType !== '04') return taxRate;
@@ -8868,38 +9447,15 @@ function dutyFree(controller, taxRate, form, record) {
8868
9447
  taxRate: 0
8869
9448
  });
8870
9449
  return 0;
8871
- } // 选择的 1或者3
8872
- // if (taxRate === 1 || taxRate === 3) {
8873
- // 是否处理过
8874
- // if (cache[record.$index]) {
8875
- // return taxRate;
8876
- // } else {
8877
- // cache[record.$index] = { favouredPolicyName: record.favouredPolicyName, favouredPolicyMark: record.favouredPolicyMark,taxFreeType:record.taxFreeType }
8878
- // record.favouredPolicyName = '免税';
8879
- // record.taxRate = 0;
8880
- // record.favouredPolicyMark = 1;
8881
- // record.taxFreeType = 1 as any;
8882
- // form.setFieldsValue({ taxRate: 0 });
8883
- // return 0;
8884
- // }
8885
- // } else {
8886
- // if (cache[record.$index] && cache[record.$index] !== true) {
8887
- // record.favouredPolicyName = cache[record.$index].favouredPolicyName;
8888
- // record.favouredPolicyMark = cache[record.$index].favouredPolicyMark;
8889
- // record.taxFreeType = cache[record.$index].taxFreeType;
8890
- // cache[record.$index] = true;
8891
- // }
8892
- // return taxRate;
8893
- // }
8894
-
9450
+ }
8895
9451
  }
8896
9452
  /** 含税 => 更新(不含税) */
8897
9453
 
8898
9454
  var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controller, form, record) {
8899
9455
  form.validateFields( /*#__PURE__*/function () {
8900
- var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(err, values) {
9456
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(err, values) {
8901
9457
  var taxAmount, lineAmountExcludeTax, priceExcludeTax, deduction;
8902
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
9458
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
8903
9459
  while (1) {
8904
9460
  switch (_context7.prev = _context7.next) {
8905
9461
  case 0:
@@ -8963,9 +9519,9 @@ var updateUnitPriceExcludingTax = function updateUnitPriceExcludingTax(controlle
8963
9519
 
8964
9520
  var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
8965
9521
  form.validateFields( /*#__PURE__*/function () {
8966
- var _ref8 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(err, values) {
9522
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(err, values) {
8967
9523
  var lineAmountExcludeTax, lineAmountIncludeTax, taxAmount, priceExcludeTax, priceIncludeTax;
8968
- return regeneratorRuntime.wrap(function _callee8$(_context8) {
9524
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
8969
9525
  while (1) {
8970
9526
  switch (_context8.prev = _context8.next) {
8971
9527
  case 0:
@@ -9034,49 +9590,11 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
9034
9590
  };
9035
9591
  }());
9036
9592
  };
9037
- /** 保存到编辑货物 */
9038
-
9039
- var onSaveEditGood = lazyFn$1(function (controller, form, record, id) {
9040
- form.validateFields( /*#__PURE__*/function () {
9041
- var _ref9 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(err, values) {
9042
- var v;
9043
- return regeneratorRuntime.wrap(function _callee9$(_context9) {
9044
- while (1) {
9045
- switch (_context9.prev = _context9.next) {
9046
- case 0:
9047
- err = err || {};
9048
-
9049
- if (!err[id]) {
9050
- _context9.next = 3;
9051
- break;
9052
- }
9053
-
9054
- return _context9.abrupt("return");
9055
-
9056
- case 3:
9057
- v = {};
9058
- v[id] = values[id];
9059
- _context9.next = 7;
9060
- return controller.setEditGood(_objectSpread2({}, v));
9061
-
9062
- case 7:
9063
- case "end":
9064
- return _context9.stop();
9065
- }
9066
- }
9067
- }, _callee9);
9068
- }));
9069
-
9070
- return function (_x17, _x18) {
9071
- return _ref9.apply(this, arguments);
9072
- };
9073
- }());
9074
- }, 1000);
9075
9593
  /** 单调赋码 */
9076
9594
 
9077
9595
  var endowCode = /*#__PURE__*/function () {
9078
- var _ref10 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11(controller, goods) {
9079
- return regeneratorRuntime.wrap(function _callee11$(_context11) {
9596
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(controller, goods) {
9597
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
9080
9598
  while (1) {
9081
9599
  switch (_context11.prev = _context11.next) {
9082
9600
  case 0:
@@ -9090,9 +9608,9 @@ var endowCode = /*#__PURE__*/function () {
9090
9608
  case 4:
9091
9609
  _context11.next = 6;
9092
9610
  return controller.pipeline( /*#__PURE__*/function () {
9093
- var _ref11 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(s) {
9611
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(s) {
9094
9612
  var err, key, g, i;
9095
- return regeneratorRuntime.wrap(function _callee10$(_context10) {
9613
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
9096
9614
  while (1) {
9097
9615
  switch (_context10.prev = _context10.next) {
9098
9616
  case 0:
@@ -9102,7 +9620,7 @@ var endowCode = /*#__PURE__*/function () {
9102
9620
  }
9103
9621
 
9104
9622
  err = s.goodsListState.form.getFieldsError();
9105
- _context10.t0 = regeneratorRuntime.keys(err);
9623
+ _context10.t0 = _regeneratorRuntime().keys(err);
9106
9624
 
9107
9625
  case 3:
9108
9626
  if ((_context10.t1 = _context10.t0()).done) {
@@ -9167,12 +9685,103 @@ var endowCode = /*#__PURE__*/function () {
9167
9685
  return _ref10.apply(this, arguments);
9168
9686
  };
9169
9687
  }();
9688
+ /** 修改了 货物名称 */
9689
+
9690
+ var onChangeItemName = /*#__PURE__*/function () {
9691
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(controller, form, record) {
9692
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
9693
+ while (1) {
9694
+ switch (_context13.prev = _context13.next) {
9695
+ case 0:
9696
+ controller.run( /*#__PURE__*/function () {
9697
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
9698
+ var _getSN$shorthand, _getSN;
9699
+
9700
+ var value, shorthand;
9701
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
9702
+ while (1) {
9703
+ switch (_context12.prev = _context12.next) {
9704
+ case 0:
9705
+ value = form.getFieldsValue().itemName;
9706
+ shorthand = (_getSN$shorthand = (_getSN = getSN(value)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand) !== null && _getSN$shorthand !== void 0 ? _getSN$shorthand : '';
9707
+
9708
+ if (!s.goodsListState.isMyShow) {
9709
+ _context12.next = 11;
9710
+ break;
9711
+ }
9712
+
9713
+ _context12.next = 5;
9714
+ return controller.setEditGood({
9715
+ itemName: value
9716
+ });
9717
+
9718
+ case 5:
9719
+ _context12.t0 = record.itemNameOther;
9720
+
9721
+ if (!_context12.t0) {
9722
+ _context12.next = 9;
9723
+ break;
9724
+ }
9725
+
9726
+ _context12.next = 9;
9727
+ return controller.setEditGood({
9728
+ itemNameOther: setShorthand(record.itemNameOther, shorthand)
9729
+ });
9730
+
9731
+ case 9:
9732
+ _context12.next = 17;
9733
+ break;
9734
+
9735
+ case 11:
9736
+ _context12.next = 13;
9737
+ return controller.setEditGood({
9738
+ itemNameOther: value
9739
+ });
9740
+
9741
+ case 13:
9742
+ _context12.t1 = record.itemName;
9743
+
9744
+ if (!_context12.t1) {
9745
+ _context12.next = 17;
9746
+ break;
9747
+ }
9748
+
9749
+ _context12.next = 17;
9750
+ return controller.setEditGood({
9751
+ itemName: setShorthand(record.itemName, shorthand)
9752
+ });
9753
+
9754
+ case 17:
9755
+ case "end":
9756
+ return _context12.stop();
9757
+ }
9758
+ }
9759
+ }, _callee12);
9760
+ }));
9761
+
9762
+ return function (_x25) {
9763
+ return _ref13.apply(this, arguments);
9764
+ };
9765
+ }());
9766
+
9767
+ case 1:
9768
+ case "end":
9769
+ return _context13.stop();
9770
+ }
9771
+ }
9772
+ }, _callee13);
9773
+ }));
9774
+
9775
+ return function onChangeItemName(_x22, _x23, _x24) {
9776
+ return _ref12.apply(this, arguments);
9777
+ };
9778
+ }();
9170
9779
 
9171
9780
  var Text$3 = ktsComponentsAntdX3.Typography.Text;
9172
9781
  var useEndowCode = (function (goods) {
9173
- var controller = default_1.useInvoiceController();
9174
- var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
9175
- return regeneratorRuntime.wrap(function _callee$(_context) {
9782
+ var controller = Invoice.useInvoiceController();
9783
+ var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9784
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9176
9785
  while (1) {
9177
9786
  switch (_context.prev = _context.next) {
9178
9787
  case 0:
@@ -9195,11 +9804,102 @@ var useEndowCode = (function (goods) {
9195
9804
  }, [goods.lineAttribute, onClick]);
9196
9805
  });
9197
9806
 
9807
+ var Text$4 = ktsComponentsAntdX3.Typography.Text;
9808
+ var useAddComparison = (function (goods) {
9809
+ var controller = Invoice.useInvoiceController();
9810
+ var productComparison = controller.useMemo(function (s) {
9811
+ return s.goodsListState.productComparison;
9812
+ }, []);
9813
+ var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9814
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9815
+ while (1) {
9816
+ switch (_context2.prev = _context2.next) {
9817
+ case 0:
9818
+ _context2.next = 2;
9819
+ return controller.saveEditGood();
9820
+
9821
+ case 2:
9822
+ _context2.next = 4;
9823
+ return controller.wait();
9824
+
9825
+ case 4:
9826
+ _context2.next = 6;
9827
+ return controller.run( /*#__PURE__*/function () {
9828
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
9829
+ var err, key;
9830
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9831
+ while (1) {
9832
+ switch (_context.prev = _context.next) {
9833
+ case 0:
9834
+ if (!s.goodsListState.form) {
9835
+ _context.next = 11;
9836
+ break;
9837
+ }
9838
+
9839
+ err = s.goodsListState.form.getFieldsError();
9840
+ _context.t0 = _regeneratorRuntime().keys(err);
9841
+
9842
+ case 3:
9843
+ if ((_context.t1 = _context.t0()).done) {
9844
+ _context.next = 11;
9845
+ break;
9846
+ }
9847
+
9848
+ key = _context.t1.value;
9849
+
9850
+ if (err[key]) {
9851
+ _context.next = 7;
9852
+ break;
9853
+ }
9854
+
9855
+ return _context.abrupt("continue", 3);
9856
+
9857
+ case 7:
9858
+ ktsComponentsAntdX3.message.error(err[key][0]);
9859
+ return _context.abrupt("return");
9860
+
9861
+ case 11:
9862
+ s.goodsListState.addComparisonIndex = goods.$index;
9863
+
9864
+ case 12:
9865
+ case "end":
9866
+ return _context.stop();
9867
+ }
9868
+ }
9869
+ }, _callee);
9870
+ }));
9871
+
9872
+ return function (_x) {
9873
+ return _ref2.apply(this, arguments);
9874
+ };
9875
+ }());
9876
+
9877
+ case 6:
9878
+ case "end":
9879
+ return _context2.stop();
9880
+ }
9881
+ }
9882
+ }, _callee2);
9883
+ })), [controller, goods.$index]);
9884
+ return React__default['default'].useMemo(function () {
9885
+ if (productComparison.onComply) {
9886
+ return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
9887
+ key: "delItem",
9888
+ onClick: onClick
9889
+ }, /*#__PURE__*/React__default['default'].createElement(Text$4, {
9890
+ strong: true
9891
+ }, "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167"));
9892
+ } else {
9893
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
9894
+ }
9895
+ }, [onClick, productComparison]);
9896
+ });
9897
+
9198
9898
  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";
9199
9899
  styleInject(css_248z$5);
9200
9900
 
9201
9901
  var RowMenu = (function (props) {
9202
- var controller = default_1.useInvoiceController();
9902
+ var controller = Invoice.useInvoiceController();
9203
9903
  var model = controller.useMemo(function (s) {
9204
9904
  return s.model;
9205
9905
  }, []);
@@ -9214,10 +9914,13 @@ var RowMenu = (function (props) {
9214
9914
  var delItem = useDelItem(props.goods);
9215
9915
  var addDiscount = useAddDiscount(props.goods);
9216
9916
  var endowCode = useEndowCode(props.goods);
9917
+ var addComparison = useAddComparison(props.goods);
9217
9918
  var itemList = React__default['default'].useMemo(function () {
9218
9919
  var arr = [];
9219
9920
  model !== 'prefab' && isAddDiscount !== false && addDiscount && arr.push(addDiscount); // 添加折扣行
9220
9921
 
9922
+ arr.push(addComparison); // 添加商品对照
9923
+
9221
9924
  endowCode && arr.push(endowCode); // 赋码
9222
9925
 
9223
9926
  model !== 'prefab' && delItem && arr.push(delItem); // 删除
@@ -9250,16 +9953,21 @@ var RowMenu = (function (props) {
9250
9953
  })));
9251
9954
  });
9252
9955
 
9253
- var Text$4 = ktsComponentsAntdX3.Typography.Text;
9956
+ var Text$5 = ktsComponentsAntdX3.Typography.Text;
9254
9957
  var useColumns = (function (form) {
9255
9958
  var getFieldDecorator = form.getFieldDecorator,
9256
9959
  getFieldValue = form.getFieldValue;
9257
- var controller = default_1.useInvoiceController();
9960
+ var controller = Invoice.useInvoiceController();
9258
9961
  /** 是否含税 */
9259
9962
 
9260
9963
  var isTaxIncluded = controller.useMemo(function (e) {
9261
9964
  return e.goodsListState.isTaxIncluded;
9262
9965
  }, []);
9966
+ /** 是否显示我方 */
9967
+
9968
+ var isMyShow = controller.useMemo(function (e) {
9969
+ return e.goodsListState.isMyShow;
9970
+ }, []);
9263
9971
  /** 正在编辑的货物 */
9264
9972
 
9265
9973
  var editGood = controller.useMemo(function (e) {
@@ -9291,12 +9999,11 @@ var useColumns = (function (form) {
9291
9999
 
9292
10000
  var columns = React__default['default'].useMemo(function () {
9293
10001
  return [{
9294
- title: /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Text$4, {
10002
+ title: /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Text$5, {
9295
10003
  type: "danger"
9296
10004
  }, "*"), "\u8D27\u7269\u540D\u79F0"),
9297
- dataIndex: 'itemName',
9298
10005
  key: 'itemName',
9299
- render: function render(value, record) {
10006
+ render: function render(_, record) {
9300
10007
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
9301
10008
  var _editGood$itemName;
9302
10009
 
@@ -9305,17 +10012,54 @@ var useColumns = (function (form) {
9305
10012
  display: 'flex'
9306
10013
  }
9307
10014
  }, getFieldDecorator('itemName', {
9308
- initialValue: editGood.itemName,
10015
+ initialValue: isMyShow ? record.itemName : record.itemNameOther,
9309
10016
  rules: [{
9310
- required: true,
9311
- message: '货物名称不能为空'
10017
+ validator: function () {
10018
+ var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, __, callback) {
10019
+ var value;
10020
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10021
+ while (1) {
10022
+ switch (_context.prev = _context.next) {
10023
+ case 0:
10024
+ _context.next = 2;
10025
+ return controller.wait();
10026
+
10027
+ case 2:
10028
+ value = controller.state.goodsListState.editGood;
10029
+
10030
+ if (!(!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameOther))) {
10031
+ _context.next = 7;
10032
+ break;
10033
+ }
10034
+
10035
+ callback('货物名称不能为空');
10036
+ _context.next = 8;
10037
+ break;
10038
+
10039
+ case 7:
10040
+ return _context.abrupt("return");
10041
+
10042
+ case 8:
10043
+ case "end":
10044
+ return _context.stop();
10045
+ }
10046
+ }
10047
+ }, _callee);
10048
+ }));
10049
+
10050
+ function validator(_x, _x2, _x3) {
10051
+ return _validator.apply(this, arguments);
10052
+ }
10053
+
10054
+ return validator;
10055
+ }()
9312
10056
  }]
9313
10057
  })( /*#__PURE__*/React__default['default'].createElement(MyInput, {
9314
10058
  style: {
9315
10059
  flex: 1
9316
10060
  },
9317
10061
  onChange: function onChange() {
9318
- onSaveEditGood(controller, form, record, 'itemName');
10062
+ onChangeItemName(controller, form, record);
9319
10063
  }
9320
10064
  })), /*#__PURE__*/React__default['default'].createElement("div", {
9321
10065
  className: "kts-invoice-operate-goods-list-able-list-itemName-import"
@@ -9326,67 +10070,90 @@ var useColumns = (function (form) {
9326
10070
  type: "link",
9327
10071
  icon: "file-add"
9328
10072
  }), controller.getGoodsList && /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Button, {
9329
- onClick: function onClick() {
9330
- controller.pipeline( /*#__PURE__*/function () {
9331
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
9332
- return regeneratorRuntime.wrap(function _callee$(_context) {
9333
- while (1) {
9334
- switch (_context.prev = _context.next) {
9335
- case 0:
9336
- s.goodsListState.importGoods.isVisibleDrawer = true;
10073
+ onClick: controller.pipeline( /*#__PURE__*/function () {
10074
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
10075
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10076
+ while (1) {
10077
+ switch (_context2.prev = _context2.next) {
10078
+ case 0:
10079
+ s.goodsListState.importGoods.isVisibleDrawer = true;
9337
10080
 
9338
- case 1:
9339
- case "end":
9340
- return _context.stop();
9341
- }
10081
+ case 1:
10082
+ case "end":
10083
+ return _context2.stop();
9342
10084
  }
9343
- }, _callee);
9344
- }));
10085
+ }
10086
+ }, _callee2);
10087
+ }));
9345
10088
 
9346
- return function (_x) {
9347
- return _ref.apply(this, arguments);
9348
- };
9349
- }())();
9350
- },
10089
+ return function (_x4) {
10090
+ return _ref.apply(this, arguments);
10091
+ };
10092
+ }()),
9351
10093
  type: "link",
9352
10094
  icon: "plus-circle"
9353
10095
  }))));
9354
10096
  } else {
9355
- return /*#__PURE__*/React__default['default'].createElement("span", {
9356
- style: {
9357
- padding: '0 10px'
9358
- }
9359
- }, value);
10097
+ return /*#__PURE__*/React__default['default'].createElement(MyItemNameDiv, {
10098
+ valueT: record.itemName,
10099
+ valueF: record.itemNameOther,
10100
+ isMyShow: isMyShow
10101
+ });
9360
10102
  }
9361
10103
  }
9362
10104
  }, {
9363
10105
  title: '货物规格型号',
9364
- dataIndex: 'itemModelName',
9365
10106
  key: 'itemModelName',
9366
10107
  width: 119,
9367
- render: function render(value, record) {
10108
+ render: function render(_, record) {
9368
10109
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
9369
10110
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('itemModelName', {
9370
- initialValue: editGood.itemModelName
10111
+ initialValue: isMyShow ? editGood.itemModelName : editGood.itemModelNameOther
9371
10112
  })( /*#__PURE__*/React__default['default'].createElement(MyInput, {
9372
- onChange: function onChange() {
9373
- onSaveEditGood(controller, form, record, 'itemModelName');
9374
- }
10113
+ onChange: function () {
10114
+ var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
10115
+ var key, value;
10116
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10117
+ while (1) {
10118
+ switch (_context3.prev = _context3.next) {
10119
+ case 0:
10120
+ _context3.next = 2;
10121
+ return controller.wait();
10122
+
10123
+ case 2:
10124
+ key = isMyShow ? 'itemModelName' : 'itemModelNameOther';
10125
+ value = {};
10126
+ value[key] = form.getFieldsValue().itemModelName;
10127
+ controller.setEditGood(value);
10128
+
10129
+ case 6:
10130
+ case "end":
10131
+ return _context3.stop();
10132
+ }
10133
+ }
10134
+ }, _callee3);
10135
+ }));
10136
+
10137
+ function onChange() {
10138
+ return _onChange.apply(this, arguments);
10139
+ }
10140
+
10141
+ return onChange;
10142
+ }()
9375
10143
  })));
9376
10144
  } else {
9377
- return /*#__PURE__*/React__default['default'].createElement("span", {
9378
- style: {
9379
- padding: '0 10px'
9380
- }
9381
- }, value);
10145
+ return /*#__PURE__*/React__default['default'].createElement(MyItemNameDiv, {
10146
+ valueT: record.itemModelName,
10147
+ valueF: record.itemModelNameOther,
10148
+ isMyShow: isMyShow
10149
+ });
9382
10150
  }
9383
10151
  }
9384
10152
  }, {
9385
10153
  title: '单位',
9386
- dataIndex: 'unit',
9387
10154
  key: 'unit',
9388
10155
  width: 70,
9389
- render: function render(value, record) {
10156
+ render: function render(_, record) {
9390
10157
  if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
9391
10158
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('unit', {
9392
10159
  initialValue: editGood.unit
@@ -9395,16 +10162,43 @@ var useColumns = (function (form) {
9395
10162
  width: '100%'
9396
10163
  },
9397
10164
  dataSource: unitList,
9398
- onChange: function onChange() {
9399
- onSaveEditGood(controller, form, record, 'unit');
9400
- }
10165
+ onChange: function () {
10166
+ var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
10167
+ var key, value;
10168
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10169
+ while (1) {
10170
+ switch (_context4.prev = _context4.next) {
10171
+ case 0:
10172
+ _context4.next = 2;
10173
+ return controller.wait();
10174
+
10175
+ case 2:
10176
+ key = isMyShow ? 'unit' : 'unitOther';
10177
+ value = {};
10178
+ value[key] = form.getFieldsValue().unit;
10179
+ controller.setEditGood(value);
10180
+
10181
+ case 6:
10182
+ case "end":
10183
+ return _context4.stop();
10184
+ }
10185
+ }
10186
+ }, _callee4);
10187
+ }));
10188
+
10189
+ function onChange() {
10190
+ return _onChange2.apply(this, arguments);
10191
+ }
10192
+
10193
+ return onChange;
10194
+ }()
9401
10195
  })));
9402
10196
  } else {
9403
- return /*#__PURE__*/React__default['default'].createElement("span", {
9404
- style: {
9405
- padding: '0 10px'
9406
- }
9407
- }, value);
10197
+ return /*#__PURE__*/React__default['default'].createElement(MyItemNameDiv, {
10198
+ valueT: record.unit,
10199
+ valueF: record.unitOther,
10200
+ isMyShow: isMyShow
10201
+ });
9408
10202
  }
9409
10203
  }
9410
10204
  }, {
@@ -9422,13 +10216,13 @@ var useColumns = (function (form) {
9422
10216
  message: '数量必须为数字'
9423
10217
  }, {
9424
10218
  validator: function () {
9425
- var _validator = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_, value, callback) {
10219
+ var _validator2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_, value, callback) {
9426
10220
  var isvalue, isPrice;
9427
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
10221
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
9428
10222
  while (1) {
9429
- switch (_context2.prev = _context2.next) {
10223
+ switch (_context5.prev = _context5.next) {
9430
10224
  case 0:
9431
- _context2.next = 2;
10225
+ _context5.next = 2;
9432
10226
  return controller.wait();
9433
10227
 
9434
10228
  case 2:
@@ -9436,25 +10230,25 @@ var useColumns = (function (form) {
9436
10230
  isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
9437
10231
 
9438
10232
  if (!(isvalue || isPrice === isvalue)) {
9439
- _context2.next = 6;
10233
+ _context5.next = 6;
9440
10234
  break;
9441
10235
  }
9442
10236
 
9443
- return _context2.abrupt("return");
10237
+ return _context5.abrupt("return");
9444
10238
 
9445
10239
  case 6:
9446
10240
  callback('请输入数量');
9447
10241
 
9448
10242
  case 7:
9449
10243
  case "end":
9450
- return _context2.stop();
10244
+ return _context5.stop();
9451
10245
  }
9452
10246
  }
9453
- }, _callee2);
10247
+ }, _callee5);
9454
10248
  }));
9455
10249
 
9456
- function validator(_x2, _x3, _x4) {
9457
- return _validator.apply(this, arguments);
10250
+ function validator(_x5, _x6, _x7) {
10251
+ return _validator2.apply(this, arguments);
9458
10252
  }
9459
10253
 
9460
10254
  return validator;
@@ -9494,13 +10288,13 @@ var useColumns = (function (form) {
9494
10288
  message: '单价必须为数字'
9495
10289
  }, {
9496
10290
  validator: function () {
9497
- var _validator2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(_, value, callback) {
10291
+ var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_, value, callback) {
9498
10292
  var isQuantity, isvalue;
9499
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
10293
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
9500
10294
  while (1) {
9501
- switch (_context3.prev = _context3.next) {
10295
+ switch (_context6.prev = _context6.next) {
9502
10296
  case 0:
9503
- _context3.next = 2;
10297
+ _context6.next = 2;
9504
10298
  return controller.wait();
9505
10299
 
9506
10300
  case 2:
@@ -9508,25 +10302,25 @@ var useColumns = (function (form) {
9508
10302
  isvalue = !!value || value === 0;
9509
10303
 
9510
10304
  if (!(isvalue || isQuantity === isvalue)) {
9511
- _context3.next = 6;
10305
+ _context6.next = 6;
9512
10306
  break;
9513
10307
  }
9514
10308
 
9515
- return _context3.abrupt("return");
10309
+ return _context6.abrupt("return");
9516
10310
 
9517
10311
  case 6:
9518
10312
  callback('请输入单价');
9519
10313
 
9520
10314
  case 7:
9521
10315
  case "end":
9522
- return _context3.stop();
10316
+ return _context6.stop();
9523
10317
  }
9524
10318
  }
9525
- }, _callee3);
10319
+ }, _callee6);
9526
10320
  }));
9527
10321
 
9528
- function validator(_x5, _x6, _x7) {
9529
- return _validator2.apply(this, arguments);
10322
+ function validator(_x8, _x9, _x10) {
10323
+ return _validator3.apply(this, arguments);
9530
10324
  }
9531
10325
 
9532
10326
  return validator;
@@ -9566,13 +10360,13 @@ var useColumns = (function (form) {
9566
10360
  message: '单价必须为数字'
9567
10361
  }, {
9568
10362
  validator: function () {
9569
- var _validator3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(_, value, callback) {
10363
+ var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_, value, callback) {
9570
10364
  var isQuantity, isvalue;
9571
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
10365
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
9572
10366
  while (1) {
9573
- switch (_context4.prev = _context4.next) {
10367
+ switch (_context7.prev = _context7.next) {
9574
10368
  case 0:
9575
- _context4.next = 2;
10369
+ _context7.next = 2;
9576
10370
  return controller.wait();
9577
10371
 
9578
10372
  case 2:
@@ -9580,25 +10374,25 @@ var useColumns = (function (form) {
9580
10374
  isvalue = !!value || value === 0;
9581
10375
 
9582
10376
  if (!(isvalue || isQuantity === isvalue)) {
9583
- _context4.next = 6;
10377
+ _context7.next = 6;
9584
10378
  break;
9585
10379
  }
9586
10380
 
9587
- return _context4.abrupt("return");
10381
+ return _context7.abrupt("return");
9588
10382
 
9589
10383
  case 6:
9590
10384
  callback('请输入单价');
9591
10385
 
9592
10386
  case 7:
9593
10387
  case "end":
9594
- return _context4.stop();
10388
+ return _context7.stop();
9595
10389
  }
9596
10390
  }
9597
- }, _callee4);
10391
+ }, _callee7);
9598
10392
  }));
9599
10393
 
9600
- function validator(_x8, _x9, _x10) {
9601
- return _validator3.apply(this, arguments);
10394
+ function validator(_x11, _x12, _x13) {
10395
+ return _validator4.apply(this, arguments);
9602
10396
  }
9603
10397
 
9604
10398
  return validator;
@@ -9624,7 +10418,7 @@ var useColumns = (function (form) {
9624
10418
  }
9625
10419
  }
9626
10420
  }, {
9627
- title: /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Text$4, {
10421
+ title: /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Text$5, {
9628
10422
  type: "danger"
9629
10423
  }, "*"), "\u91D1\u989D(\u542B\u7A0E)"),
9630
10424
  dataIndex: 'lineAmountIncludeTax',
@@ -9643,10 +10437,10 @@ var useColumns = (function (form) {
9643
10437
  message: '金额必须为数字'
9644
10438
  }, {
9645
10439
  validator: function () {
9646
- var _validator4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(_, value, callback) {
9647
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
10440
+ var _validator5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_, value, callback) {
10441
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
9648
10442
  while (1) {
9649
- switch (_context5.prev = _context5.next) {
10443
+ switch (_context8.prev = _context8.next) {
9650
10444
  case 0:
9651
10445
  if ("".concat(value).split('.')[0].length > 9) {
9652
10446
  callback('金额整数部分不能大于9位,小数点后最多2位');
@@ -9654,24 +10448,24 @@ var useColumns = (function (form) {
9654
10448
 
9655
10449
  case 1:
9656
10450
  case "end":
9657
- return _context5.stop();
10451
+ return _context8.stop();
9658
10452
  }
9659
10453
  }
9660
- }, _callee5);
10454
+ }, _callee8);
9661
10455
  }));
9662
10456
 
9663
- function validator(_x11, _x12, _x13) {
9664
- return _validator4.apply(this, arguments);
10457
+ function validator(_x14, _x15, _x16) {
10458
+ return _validator5.apply(this, arguments);
9665
10459
  }
9666
10460
 
9667
10461
  return validator;
9668
10462
  }()
9669
10463
  }, {
9670
10464
  validator: function () {
9671
- var _validator5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(_, value, callback) {
9672
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
10465
+ var _validator6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
10466
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
9673
10467
  while (1) {
9674
- switch (_context6.prev = _context6.next) {
10468
+ switch (_context9.prev = _context9.next) {
9675
10469
  case 0:
9676
10470
  if (deduction && parseFloat(value) <= deduction) {
9677
10471
  callback('扣除额不能大于等于价税合计');
@@ -9679,14 +10473,14 @@ var useColumns = (function (form) {
9679
10473
 
9680
10474
  case 1:
9681
10475
  case "end":
9682
- return _context6.stop();
10476
+ return _context9.stop();
9683
10477
  }
9684
10478
  }
9685
- }, _callee6);
10479
+ }, _callee9);
9686
10480
  }));
9687
10481
 
9688
- function validator(_x14, _x15, _x16) {
9689
- return _validator5.apply(this, arguments);
10482
+ function validator(_x17, _x18, _x19) {
10483
+ return _validator6.apply(this, arguments);
9690
10484
  }
9691
10485
 
9692
10486
  return validator;
@@ -9711,7 +10505,7 @@ var useColumns = (function (form) {
9711
10505
  }
9712
10506
  }
9713
10507
  }, {
9714
- title: /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Text$4, {
10508
+ title: /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Text$5, {
9715
10509
  type: "danger"
9716
10510
  }, "*"), "\u91D1\u989D(\u4E0D\u542B\u7A0E)"),
9717
10511
  dataIndex: 'lineAmountExcludeTax',
@@ -9730,10 +10524,10 @@ var useColumns = (function (form) {
9730
10524
  message: '金额必须为数字'
9731
10525
  }, {
9732
10526
  validator: function () {
9733
- var _validator6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(_, value, callback) {
9734
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
10527
+ var _validator7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
10528
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
9735
10529
  while (1) {
9736
- switch (_context7.prev = _context7.next) {
10530
+ switch (_context10.prev = _context10.next) {
9737
10531
  case 0:
9738
10532
  if ("".concat(value).split('.')[0].length > 9) {
9739
10533
  callback('金额整数部分不能大于9位,小数点后最多2位');
@@ -9741,14 +10535,14 @@ var useColumns = (function (form) {
9741
10535
 
9742
10536
  case 1:
9743
10537
  case "end":
9744
- return _context7.stop();
10538
+ return _context10.stop();
9745
10539
  }
9746
10540
  }
9747
- }, _callee7);
10541
+ }, _callee10);
9748
10542
  }));
9749
10543
 
9750
- function validator(_x17, _x18, _x19) {
9751
- return _validator6.apply(this, arguments);
10544
+ function validator(_x20, _x21, _x22) {
10545
+ return _validator7.apply(this, arguments);
9752
10546
  }
9753
10547
 
9754
10548
  return validator;
@@ -9773,7 +10567,7 @@ var useColumns = (function (form) {
9773
10567
  }
9774
10568
  }
9775
10569
  }, {
9776
- title: /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Text$4, {
10570
+ title: /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Text$5, {
9777
10571
  type: "danger"
9778
10572
  }, "*"), "\u7A0E\u7387"),
9779
10573
  dataIndex: 'taxRate',
@@ -9859,7 +10653,7 @@ var useColumns = (function (form) {
9859
10653
  ellipsis: true
9860
10654
  });
9861
10655
  });
9862
- }, [isTaxIncluded, editGood, controller, changeField, deduction]);
10656
+ }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow]);
9863
10657
  React__default['default'].useEffect(function () {
9864
10658
  if (!changeField) return;
9865
10659
  var t = setTimeout(function () {
@@ -9934,16 +10728,72 @@ var MyDiv = /*#__PURE__*/function (_React$Component2) {
9934
10728
  return MyDiv;
9935
10729
  }(React__default['default'].Component);
9936
10730
 
10731
+ var MyItemNameDiv = /*#__PURE__*/function (_React$Component3) {
10732
+ _inherits(MyItemNameDiv, _React$Component3);
10733
+
10734
+ var _super3 = _createSuper(MyItemNameDiv);
10735
+
10736
+ function MyItemNameDiv() {
10737
+ _classCallCheck(this, MyItemNameDiv);
10738
+
10739
+ return _super3.apply(this, arguments);
10740
+ }
10741
+
10742
+ _createClass(MyItemNameDiv, [{
10743
+ key: "render",
10744
+ value: function render() {
10745
+ var _this$props = this.props,
10746
+ isMyShow = _this$props.isMyShow,
10747
+ valueT = _this$props.valueT,
10748
+ valueF = _this$props.valueF;
10749
+
10750
+ if (isMyShow) {
10751
+ if (valueT) {
10752
+ return /*#__PURE__*/React__default['default'].createElement("span", {
10753
+ style: {
10754
+ padding: '0 10px',
10755
+ color: '#0074ff'
10756
+ }
10757
+ }, valueT);
10758
+ } else {
10759
+ return /*#__PURE__*/React__default['default'].createElement("span", {
10760
+ style: {
10761
+ padding: '0 10px'
10762
+ }
10763
+ }, valueF);
10764
+ }
10765
+ } else {
10766
+ if (valueF) {
10767
+ return /*#__PURE__*/React__default['default'].createElement("span", {
10768
+ style: {
10769
+ padding: '0 10px'
10770
+ }
10771
+ }, valueF);
10772
+ } else {
10773
+ return /*#__PURE__*/React__default['default'].createElement("span", {
10774
+ style: {
10775
+ padding: '0 10px',
10776
+ color: '#0074ff'
10777
+ }
10778
+ }, valueT);
10779
+ }
10780
+ }
10781
+ }
10782
+ }]);
10783
+
10784
+ return MyItemNameDiv;
10785
+ }(React__default['default'].Component);
10786
+
9937
10787
  var useOnRow = (function () {
9938
10788
  /** 控制器 */
9939
- var controller = default_1.useInvoiceController();
10789
+ var controller = Invoice.useInvoiceController();
9940
10790
  var model = controller.useMemo(function (s) {
9941
10791
  return s.model;
9942
10792
  }, []);
9943
10793
  var onClick = React__default['default'].useCallback( /*#__PURE__*/function () {
9944
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(record) {
10794
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(record) {
9945
10795
  var editGood;
9946
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
10796
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9947
10797
  while (1) {
9948
10798
  switch (_context2.prev = _context2.next) {
9949
10799
  case 0:
@@ -9988,8 +10838,8 @@ var useOnRow = (function () {
9988
10838
  case 12:
9989
10839
  _context2.next = 14;
9990
10840
  return controller.pipeline( /*#__PURE__*/function () {
9991
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
9992
- return regeneratorRuntime.wrap(function _callee$(_context) {
10841
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
10842
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9993
10843
  while (1) {
9994
10844
  switch (_context.prev = _context.next) {
9995
10845
  case 0:
@@ -10050,8 +10900,8 @@ function useDeduction(controller) {
10050
10900
  // 更新 扣除额
10051
10901
  React__default['default'].useEffect(function () {
10052
10902
  controller.pipeline( /*#__PURE__*/function () {
10053
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
10054
- return regeneratorRuntime.wrap(function _callee$(_context) {
10903
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
10904
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10055
10905
  while (1) {
10056
10906
  switch (_context.prev = _context.next) {
10057
10907
  case 0:
@@ -10073,8 +10923,8 @@ function useDeduction(controller) {
10073
10923
 
10074
10924
  React__default['default'].useEffect(function () {
10075
10925
  controller.pipeline( /*#__PURE__*/function () {
10076
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
10077
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
10926
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
10927
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10078
10928
  while (1) {
10079
10929
  switch (_context2.prev = _context2.next) {
10080
10930
  case 0:
@@ -10119,7 +10969,7 @@ function useWindowClick(controller) {
10119
10969
 
10120
10970
  var useRowSelection = (function () {
10121
10971
  /** 控制器 */
10122
- var controller = default_1.useInvoiceController();
10972
+ var controller = Invoice.useInvoiceController();
10123
10973
  /** 列表选中的货物索引列表 */
10124
10974
 
10125
10975
  var selectedRowKeys = controller.useMemo(function (s) {
@@ -10140,8 +10990,8 @@ var useRowSelection = (function () {
10140
10990
  var onClickSelectAll = React__default['default'].useCallback(function () {
10141
10991
  if (isAll) {
10142
10992
  controller.pipeline( /*#__PURE__*/function () {
10143
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
10144
- return regeneratorRuntime.wrap(function _callee$(_context) {
10993
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
10994
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10145
10995
  while (1) {
10146
10996
  switch (_context.prev = _context.next) {
10147
10997
  case 0:
@@ -10161,8 +11011,8 @@ var useRowSelection = (function () {
10161
11011
  }())();
10162
11012
  } else {
10163
11013
  controller.pipeline( /*#__PURE__*/function () {
10164
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
10165
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
11014
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
11015
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10166
11016
  while (1) {
10167
11017
  switch (_context2.prev = _context2.next) {
10168
11018
  case 0:
@@ -10185,8 +11035,8 @@ var useRowSelection = (function () {
10185
11035
  }
10186
11036
  }, [controller, isAll]);
10187
11037
  var onSelect = React__default['default'].useCallback( /*#__PURE__*/function () {
10188
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(record, selected) {
10189
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
11038
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(record, selected) {
11039
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
10190
11040
  while (1) {
10191
11041
  switch (_context5.prev = _context5.next) {
10192
11042
  case 0:
@@ -10197,8 +11047,8 @@ var useRowSelection = (function () {
10197
11047
 
10198
11048
  _context5.next = 3;
10199
11049
  return controller.pipeline( /*#__PURE__*/function () {
10200
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(s) {
10201
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
11050
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
11051
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10202
11052
  while (1) {
10203
11053
  switch (_context3.prev = _context3.next) {
10204
11054
  case 0:
@@ -10225,8 +11075,8 @@ var useRowSelection = (function () {
10225
11075
  case 5:
10226
11076
  _context5.next = 7;
10227
11077
  return controller.pipeline( /*#__PURE__*/function () {
10228
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(s) {
10229
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
11078
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
11079
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10230
11080
  while (1) {
10231
11081
  switch (_context4.prev = _context4.next) {
10232
11082
  case 0:
@@ -10274,8 +11124,8 @@ var useRowSelection = (function () {
10274
11124
  /** 选择了商品后 调整 折扣行 和 被折扣行 */
10275
11125
 
10276
11126
  var sortOut = React__default['default'].useCallback( /*#__PURE__*/function () {
10277
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(selected) {
10278
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
11127
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(selected) {
11128
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
10279
11129
  while (1) {
10280
11130
  switch (_context7.prev = _context7.next) {
10281
11131
  case 0:
@@ -10285,8 +11135,8 @@ var useRowSelection = (function () {
10285
11135
  case 2:
10286
11136
  _context7.next = 4;
10287
11137
  return controller.pipeline( /*#__PURE__*/function () {
10288
- var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(s) {
10289
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
11138
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(s) {
11139
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
10290
11140
  while (1) {
10291
11141
  switch (_context6.prev = _context6.next) {
10292
11142
  case 0:
@@ -10294,7 +11144,6 @@ var useRowSelection = (function () {
10294
11144
  var goods = s.goodsListState.goodsMap.get($index);
10295
11145
  if (!goods || goods.lineAttribute === LineAttributeType$1.正常) return; // 数组位置
10296
11146
 
10297
- // 数组位置
10298
11147
  var t = s.goodsListState.goodsList.indexOf(goods);
10299
11148
  goods.lineAttribute === LineAttributeType$1.折扣行 ? t-- : t++;
10300
11149
  var i = s.goodsListState.goodsList[t].$index;
@@ -10344,7 +11193,7 @@ var useRowSelection = (function () {
10344
11193
  };
10345
11194
  });
10346
11195
 
10347
- 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";
11196
+ 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";
10348
11197
  styleInject(css_248z$6);
10349
11198
 
10350
11199
  var GoodsList = /*#__PURE__*/function (_React$Component) {
@@ -10369,7 +11218,7 @@ var GoodsList = /*#__PURE__*/function (_React$Component) {
10369
11218
  }(React__default['default'].Component);
10370
11219
  var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
10371
11220
  /** 控制器 */
10372
- var controller = default_1.useInvoiceController();
11221
+ var controller = Invoice.useInvoiceController();
10373
11222
  var goodsList = controller.useMemo(function (s) {
10374
11223
  return s.goodsListState.goodsList;
10375
11224
  }, []);
@@ -10386,8 +11235,8 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
10386
11235
 
10387
11236
  React__default['default'].useEffect(function () {
10388
11237
  controller.run( /*#__PURE__*/function () {
10389
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
10390
- return regeneratorRuntime.wrap(function _callee$(_context) {
11238
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
11239
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10391
11240
  while (1) {
10392
11241
  switch (_context.prev = _context.next) {
10393
11242
  case 0:
@@ -10410,8 +11259,8 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
10410
11259
 
10411
11260
  React__default['default'].useEffect(function () {
10412
11261
  controller.pipeline( /*#__PURE__*/function () {
10413
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s, form) {
10414
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
11262
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s, form) {
11263
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10415
11264
  while (1) {
10416
11265
  switch (_context2.prev = _context2.next) {
10417
11266
  case 0:
@@ -10435,8 +11284,8 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
10435
11284
 
10436
11285
  React__default['default'].useEffect(function () {
10437
11286
  controller.pipeline( /*#__PURE__*/function () {
10438
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(s) {
10439
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
11287
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
11288
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
10440
11289
  while (1) {
10441
11290
  switch (_context3.prev = _context3.next) {
10442
11291
  case 0:
@@ -10462,8 +11311,8 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
10462
11311
 
10463
11312
  React__default['default'].useEffect(function () {
10464
11313
  controller.pipeline( /*#__PURE__*/function () {
10465
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(s) {
10466
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
11314
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
11315
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
10467
11316
  while (1) {
10468
11317
  switch (_context4.prev = _context4.next) {
10469
11318
  case 0:
@@ -10486,8 +11335,8 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
10486
11335
 
10487
11336
  React__default['default'].useEffect(function () {
10488
11337
  controller.pipeline( /*#__PURE__*/function () {
10489
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(s) {
10490
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
11338
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
11339
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
10491
11340
  while (1) {
10492
11341
  switch (_context5.prev = _context5.next) {
10493
11342
  case 0:
@@ -10510,8 +11359,8 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
10510
11359
 
10511
11360
  React__default['default'].useEffect(function () {
10512
11361
  controller.pipeline( /*#__PURE__*/function () {
10513
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(s) {
10514
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
11362
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(s) {
11363
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
10515
11364
  while (1) {
10516
11365
  switch (_context6.prev = _context6.next) {
10517
11366
  case 0:
@@ -10539,9 +11388,9 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
10539
11388
  className: "kts-invoice-operate-goods-list-able"
10540
11389
  }, /*#__PURE__*/React__default['default'].createElement("div", {
10541
11390
  className: "kts-invoice-operate-goods-list-able-list"
10542
- }, /*#__PURE__*/React__default['default'].createElement(AddRowButton, null), /*#__PURE__*/React__default['default'].createElement(DelRowButton, null), /*#__PURE__*/React__default['default'].createElement(AddDiscountRowButton, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeButton, null)), /*#__PURE__*/React__default['default'].createElement("div", {
11391
+ }, /*#__PURE__*/React__default['default'].createElement(AddRowButton, null), /*#__PURE__*/React__default['default'].createElement(DelRowButton, null), /*#__PURE__*/React__default['default'].createElement(AddDiscountRowButton, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeButton, null), /*#__PURE__*/React__default['default'].createElement(CommodityComparisonButton, null)), /*#__PURE__*/React__default['default'].createElement("div", {
10543
11392
  className: "kts-invoice-operate-goods-list-able-extend"
10544
- }, props.menuExpansion, /*#__PURE__*/React__default['default'].createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React__default['default'].createElement("div", {
11393
+ }, props.menuExpansion, /*#__PURE__*/React__default['default'].createElement(DescribeSwitch, null), /*#__PURE__*/React__default['default'].createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React__default['default'].createElement("div", {
10545
11394
  className: classnames__default['default']('kts-invoice-operate-goods-list-table', {
10546
11395
  'kts-invoice-operate-prefab': isprefab
10547
11396
  })
@@ -10601,14 +11450,14 @@ var Buyer = /*#__PURE__*/function (_React$Component) {
10601
11450
  return _this;
10602
11451
  }
10603
11452
 
10604
- return Buyer;
11453
+ return _createClass(Buyer);
10605
11454
  }(React__default['default'].Component);
10606
11455
  var Main$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
10607
11456
  var form = props.form;
10608
11457
  var getFieldDecorator = form.getFieldDecorator;
10609
11458
  /** 控制器 */
10610
11459
 
10611
- var controller = default_1.useInvoiceController();
11460
+ var controller = Invoice.useInvoiceController();
10612
11461
  /** 控制器 */
10613
11462
 
10614
11463
  var model = controller.useMemo(function (s) {
@@ -10726,7 +11575,7 @@ var Sign = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
10726
11575
  var getFieldDecorator = form.getFieldDecorator;
10727
11576
  /** 控制器 */
10728
11577
 
10729
- var controller = default_1.useInvoiceController();
11578
+ var controller = Invoice.useInvoiceController();
10730
11579
  var model = controller.useMemo(function (s) {
10731
11580
  return s.model;
10732
11581
  }, []); // 注册 form
@@ -10768,11 +11617,11 @@ var formItemLayout = {
10768
11617
  };
10769
11618
 
10770
11619
  var ImportBuyerButton = (function () {
10771
- var controller = default_1.useInvoiceController();
11620
+ var controller = Invoice.useInvoiceController();
10772
11621
  var onClick = React__default['default'].useCallback(function () {
10773
11622
  controller.pipeline( /*#__PURE__*/function () {
10774
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
10775
- return regeneratorRuntime.wrap(function _callee$(_context) {
11623
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
11624
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10776
11625
  while (1) {
10777
11626
  switch (_context.prev = _context.next) {
10778
11627
  case 0:
@@ -10800,7 +11649,7 @@ var ImportBuyerButton = (function () {
10800
11649
 
10801
11650
  var BuyerNameInput = (function (props) {
10802
11651
  /** 控制器 */
10803
- var controller = default_1.useInvoiceController();
11652
+ var controller = Invoice.useInvoiceController();
10804
11653
  /** 组件模式 */
10805
11654
 
10806
11655
  var model = controller.useMemo(function (s) {
@@ -10898,10 +11747,10 @@ var BuyerNameInput = (function (props) {
10898
11747
  /** 点击了选择项 */
10899
11748
 
10900
11749
  var onClickItem = React__default['default'].useCallback( /*#__PURE__*/function () {
10901
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(e) {
11750
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
10902
11751
  var _controller$formList$;
10903
11752
 
10904
- return regeneratorRuntime.wrap(function _callee$(_context) {
11753
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10905
11754
  while (1) {
10906
11755
  switch (_context.prev = _context.next) {
10907
11756
  case 0:
@@ -10960,7 +11809,7 @@ var BuyerNameInput = (function (props) {
10960
11809
 
10961
11810
  function useDataSource() {
10962
11811
  /** 控制器 */
10963
- var controller = default_1.useInvoiceController();
11812
+ var controller = Invoice.useInvoiceController();
10964
11813
 
10965
11814
  var _React$useState3 = React__default['default'].useState(false),
10966
11815
  _React$useState4 = _slicedToArray(_React$useState3, 2),
@@ -10979,8 +11828,8 @@ function useDataSource() {
10979
11828
  return s.buyerState.autoContainer;
10980
11829
  }, []);
10981
11830
  var onBuyNameChange = React__default['default'].useCallback( /*#__PURE__*/function () {
10982
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(e) {
10983
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
11831
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
11832
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
10984
11833
  while (1) {
10985
11834
  switch (_context2.prev = _context2.next) {
10986
11835
  case 0:
@@ -11044,7 +11893,7 @@ function interval(i, t) {
11044
11893
  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";
11045
11894
  styleInject(css_248z$9);
11046
11895
 
11047
- var Text$5 = ktsComponentsAntdX3.Typography.Text;
11896
+ var Text$6 = ktsComponentsAntdX3.Typography.Text;
11048
11897
 
11049
11898
  var Buyer$1 = /*#__PURE__*/function (_React$Component) {
11050
11899
  _inherits(Buyer, _React$Component);
@@ -11069,14 +11918,14 @@ var Buyer$1 = /*#__PURE__*/function (_React$Component) {
11069
11918
  return _this;
11070
11919
  }
11071
11920
 
11072
- return Buyer;
11921
+ return _createClass(Buyer);
11073
11922
  }(React__default['default'].Component);
11074
11923
  var Main$2 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
11075
11924
  var form = props.form;
11076
11925
  var getFieldDecorator = form.getFieldDecorator;
11077
11926
  /** 控制器 */
11078
11927
 
11079
- var controller = default_1.useInvoiceController();
11928
+ var controller = Invoice.useInvoiceController();
11080
11929
  /** 组件模式 */
11081
11930
 
11082
11931
  var model = controller.useMemo(function (s) {
@@ -11158,7 +12007,7 @@ var Main$2 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
11158
12007
  if (e.options.rules.some(function (e) {
11159
12008
  return e.required;
11160
12009
  })) {
11161
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Text$5, {
12010
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Text$6, {
11162
12011
  type: "danger"
11163
12012
  }, "*"), e.label);
11164
12013
  } else {
@@ -11194,7 +12043,7 @@ var Main$2 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
11194
12043
  });
11195
12044
 
11196
12045
  var ImportBuyerDrawer = (function () {
11197
- var controller = default_1.useInvoiceController();
12046
+ var controller = Invoice.useInvoiceController();
11198
12047
  var visible = controller.useMemo(function (s) {
11199
12048
  return s.buyerState.isVisibleDrawer;
11200
12049
  }, []);
@@ -11204,8 +12053,8 @@ var ImportBuyerDrawer = (function () {
11204
12053
 
11205
12054
  var onClose = React__default['default'].useCallback(function () {
11206
12055
  controller.pipeline( /*#__PURE__*/function () {
11207
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
11208
- return regeneratorRuntime.wrap(function _callee$(_context) {
12056
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
12057
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11209
12058
  while (1) {
11210
12059
  switch (_context.prev = _context.next) {
11211
12060
  case 0:
@@ -11236,7 +12085,7 @@ var ImportBuyerDrawer = (function () {
11236
12085
  });
11237
12086
 
11238
12087
  var DrawerBody$1 = function DrawerBody() {
11239
- var controller = default_1.useInvoiceController();
12088
+ var controller = Invoice.useInvoiceController();
11240
12089
  var columns = controller.useMemo(function (e) {
11241
12090
  return e.buyerState.columns;
11242
12091
  }, []);
@@ -11267,10 +12116,10 @@ var DrawerBody$1 = function DrawerBody() {
11267
12116
  onRow: function onRow(record) {
11268
12117
  return {
11269
12118
  onClick: function () {
11270
- var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3() {
12119
+ var _onClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
11271
12120
  var re, _controller$formList$;
11272
12121
 
11273
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
12122
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
11274
12123
  while (1) {
11275
12124
  switch (_context3.prev = _context3.next) {
11276
12125
  case 0:
@@ -11283,8 +12132,8 @@ var DrawerBody$1 = function DrawerBody() {
11283
12132
  if (re) {
11284
12133
  (_controller$formList$ = controller.formList.get('buyer')) === null || _controller$formList$ === void 0 ? void 0 : _controller$formList$.setFieldsValue(re);
11285
12134
  controller.pipeline( /*#__PURE__*/function () {
11286
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
11287
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
12135
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
12136
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11288
12137
  while (1) {
11289
12138
  switch (_context2.prev = _context2.next) {
11290
12139
  case 0:
@@ -11324,7 +12173,7 @@ var DrawerBody$1 = function DrawerBody() {
11324
12173
  };
11325
12174
 
11326
12175
  var ImportGoodsDrawer = (function () {
11327
- var controller = default_1.useInvoiceController();
12176
+ var controller = Invoice.useInvoiceController();
11328
12177
  var visible = controller.useMemo(function (s) {
11329
12178
  return s.goodsListState.importGoods.isVisibleDrawer;
11330
12179
  }, []);
@@ -11334,8 +12183,8 @@ var ImportGoodsDrawer = (function () {
11334
12183
  var onClose = React__default['default'].useCallback(function () {
11335
12184
  console.log('===> 关闭抽屉');
11336
12185
  controller.pipeline( /*#__PURE__*/function () {
11337
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
11338
- return regeneratorRuntime.wrap(function _callee$(_context) {
12186
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
12187
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11339
12188
  while (1) {
11340
12189
  switch (_context.prev = _context.next) {
11341
12190
  case 0:
@@ -11370,7 +12219,7 @@ var ImportGoodsDrawer = (function () {
11370
12219
  });
11371
12220
 
11372
12221
  var DrawerBody$2 = function DrawerBody() {
11373
- var controller = default_1.useInvoiceController();
12222
+ var controller = Invoice.useInvoiceController();
11374
12223
  var columns = controller.useMemo(function (s) {
11375
12224
  return s.goodsListState.importGoods.columns;
11376
12225
  }, []);
@@ -11403,8 +12252,9 @@ var DrawerBody$2 = function DrawerBody() {
11403
12252
  return {
11404
12253
  onClick: function onClick() {
11405
12254
  controller.run( /*#__PURE__*/function () {
11406
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
11407
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
12255
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
12256
+ var between, editGood;
12257
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11408
12258
  while (1) {
11409
12259
  switch (_context2.prev = _context2.next) {
11410
12260
  case 0:
@@ -11412,7 +12262,8 @@ var DrawerBody$2 = function DrawerBody() {
11412
12262
  return !record[e] && record[e] !== 0;
11413
12263
  }).forEach(function (e) {
11414
12264
  delete record[e];
11415
- });
12265
+ }); // 导入时校验函数
12266
+
11416
12267
  _context2.next = 3;
11417
12268
  return s.goodsListState.importGoods.verifyFn(record);
11418
12269
 
@@ -11440,30 +12291,41 @@ var DrawerBody$2 = function DrawerBody() {
11440
12291
  record.priceIncludeTax = s.goodsListState.editGood.priceIncludeTax;
11441
12292
  record.lineAmountExcludeTax = s.goodsListState.editGood.lineAmountExcludeTax;
11442
12293
  record.lineAmountIncludeTax = s.goodsListState.editGood.lineAmountIncludeTax;
11443
- }
12294
+ } // 中间数据
11444
12295
 
11445
- s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), record);
11446
12296
 
11447
- if (s.goodsListState.editGood) {
11448
- _context2.next = 12;
11449
- break;
12297
+ between = _objectSpread2({}, record);
12298
+ between.itemName = getItemName$1(record, s.goodsListState.editGood);
12299
+ between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
12300
+
12301
+ editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
12302
+
12303
+ if (editGood.taxRate) {
12304
+ editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood);
11450
12305
  }
11451
12306
 
11452
- return _context2.abrupt("return");
12307
+ if ("".concat(editGood.priceIncludeTax) === '0') {
12308
+ editGood.priceIncludeTax = undefined;
12309
+ editGood.priceExcludeTax = undefined;
12310
+ } else {
12311
+ editGood.priceExcludeTax = getPriceExcludeTax(editGood, record);
12312
+ }
11453
12313
 
11454
- case 12:
11455
- if (s.goodsListState.editGood.taxRate) s.goodsListState.editGood.taxRate = dutyFree(controller, s.goodsListState.editGood.taxRate, s.goodsListState.form, s.goodsListState.editGood);
12314
+ if (editGood.quantity && editGood.priceIncludeTax) {
12315
+ editGood.lineAmountIncludeTax = countAmountIncludeTax(editGood.quantity, editGood.priceIncludeTax);
12316
+ } // 导入FORM里
11456
12317
 
11457
- if ("".concat(s.goodsListState.editGood.priceIncludeTax) === '0') {
11458
- s.goodsListState.editGood.priceIncludeTax = undefined;
11459
- s.goodsListState.editGood.priceExcludeTax = undefined;
12318
+
12319
+ if (s.goodsListState.isMyShow) {
12320
+ s.goodsListState.form.setFieldsValue(editGood);
11460
12321
  } else {
11461
- s.goodsListState.editGood.priceExcludeTax = getPriceExcludeTax(s.goodsListState.editGood, record);
12322
+ s.goodsListState.form.setFieldsValue(_objectSpread2(_objectSpread2({}, editGood), {}, {
12323
+ itemName: editGood.itemNameOther,
12324
+ unit: editGood.unitOther,
12325
+ itemModelName: editGood.itemModelNameOther
12326
+ }));
11462
12327
  }
11463
12328
 
11464
- if (s.goodsListState.editGood.quantity && s.goodsListState.editGood.priceIncludeTax) s.goodsListState.editGood.lineAmountIncludeTax = countAmountIncludeTax(s.goodsListState.editGood.quantity, s.goodsListState.editGood.priceIncludeTax);
11465
- s.goodsListState.editGood.itemName = getItemName(record);
11466
- s.goodsListState.form.setFieldsValue(s.goodsListState.editGood);
11467
12329
  s.goodsListState.importGoods.isVisibleDrawer = false;
11468
12330
  s.goodsListState.isTaxIncluded ? updateUnitPriceExcludingTax(controller, s.goodsListState.form) : updateUnitPriceTax(controller, s.goodsListState.form);
11469
12331
 
@@ -11485,11 +12347,12 @@ var DrawerBody$2 = function DrawerBody() {
11485
12347
  });
11486
12348
  };
11487
12349
  /** 货物名称 */
12350
+ // const getItemName = (record: any) => {
12351
+ // return record.shorthand
12352
+ // ? `*${record.shorthand}*${record.itemName}`
12353
+ // : record.itemName;
12354
+ // };
11488
12355
 
11489
-
11490
- var getItemName = function getItemName(record) {
11491
- return record.shorthand ? "*".concat(record.shorthand, "*").concat(record.itemName) : record.itemName;
11492
- };
11493
12356
  /** 货物单价,不含税 */
11494
12357
 
11495
12358
 
@@ -11497,6 +12360,39 @@ var getPriceExcludeTax = function getPriceExcludeTax(s, record) {
11497
12360
  if (!s.taxRate && s.taxRate !== 0 || !record.priceIncludeTax && record.priceIncludeTax !== 0) return; // 单价(含税)/(1+税率) = 单价(不含税)
11498
12361
 
11499
12362
  return format15(evaluate("".concat(record.priceIncludeTax, " / (1+").concat(s.taxRate, "/100)")));
12363
+ }; // 获取我方名称
12364
+
12365
+
12366
+ var getItemName$1 = function getItemName(record, editGood) {
12367
+ var _getSN;
12368
+
12369
+ var shorthand;
12370
+ shorthand = record.shorthand;
12371
+
12372
+ if (shorthand) {
12373
+ return "*".concat(shorthand, "*").concat(record.itemName);
12374
+ }
12375
+
12376
+ shorthand = (_getSN = getSN(editGood.itemNameOther)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand;
12377
+
12378
+ if (shorthand) {
12379
+ return "*".concat(shorthand, "*").concat(record.itemName);
12380
+ }
12381
+
12382
+ return record.itemName;
12383
+ }; // 获取他方名称
12384
+
12385
+
12386
+ var getItemNameOther = function getItemNameOther(record, editGood) {
12387
+ if (!editGood.itemNameOther) return editGood.itemNameOther;
12388
+ var shorthand;
12389
+ shorthand = record.shorthand;
12390
+
12391
+ if (shorthand) {
12392
+ return "*".concat(shorthand, "*").concat(record.itemName);
12393
+ }
12394
+
12395
+ return record.itemNameOther;
11500
12396
  };
11501
12397
 
11502
12398
  /**
@@ -11556,7 +12452,7 @@ styleInject(css_248z$a);
11556
12452
  var TreeNode = ktsComponentsAntdX3.Tree.TreeNode;
11557
12453
  var confirm = ktsComponentsAntdX3.Modal.confirm;
11558
12454
  var EndowCodeDrawer = (function () {
11559
- var controller = default_1.useInvoiceController();
12455
+ var controller = Invoice.useInvoiceController();
11560
12456
  var visible = controller.useMemo(function (s) {
11561
12457
  return s.goodsListState.endowCode.endowcodeGoodIndex.length > 0;
11562
12458
  }, []);
@@ -11568,8 +12464,8 @@ var EndowCodeDrawer = (function () {
11568
12464
 
11569
12465
  var onClose = React__default['default'].useCallback(function () {
11570
12466
  controller.pipeline( /*#__PURE__*/function () {
11571
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s) {
11572
- return regeneratorRuntime.wrap(function _callee$(_context) {
12467
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
12468
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11573
12469
  while (1) {
11574
12470
  switch (_context.prev = _context.next) {
11575
12471
  case 0:
@@ -11592,9 +12488,9 @@ var EndowCodeDrawer = (function () {
11592
12488
  React__default['default'].useEffect(function () {
11593
12489
  if (visible) {
11594
12490
  controller.pipeline( /*#__PURE__*/function () {
11595
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(s) {
12491
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
11596
12492
  var endowcodeGoodIndex, good, getDefaultValue;
11597
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
12493
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11598
12494
  while (1) {
11599
12495
  switch (_context2.prev = _context2.next) {
11600
12496
  case 0:
@@ -11671,7 +12567,7 @@ var EndowCodeDrawer = (function () {
11671
12567
  var DrawerBody$3 = function DrawerBody(props) {
11672
12568
  var _defaultValue$taxRate, _defaultValue$favoure;
11673
12569
 
11674
- var controller = default_1.useInvoiceController();
12570
+ var controller = Invoice.useInvoiceController();
11675
12571
  var defaultValue = props.defaultValue;
11676
12572
  var actions = React__default['default'].useMemo(function () {
11677
12573
  return antd.createAsyncFormActions();
@@ -11724,9 +12620,9 @@ var DrawerBody$3 = function DrawerBody(props) {
11724
12620
  setDataSource = _React$useState6[1];
11725
12621
 
11726
12622
  var onSearch = React__default['default'].useCallback( /*#__PURE__*/function () {
11727
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(e) {
12623
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
11728
12624
  var arr;
11729
- return regeneratorRuntime.wrap(function _callee3$(_context3) {
12625
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
11730
12626
  while (1) {
11731
12627
  switch (_context3.prev = _context3.next) {
11732
12628
  case 0:
@@ -11759,8 +12655,8 @@ var DrawerBody$3 = function DrawerBody(props) {
11759
12655
  })[0];
11760
12656
  if (!info) return;
11761
12657
  !readOnlyTaxRate && actions.setFieldState('taxRate', /*#__PURE__*/function () {
11762
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(s) {
11763
- return regeneratorRuntime.wrap(function _callee4$(_context4) {
12658
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
12659
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
11764
12660
  while (1) {
11765
12661
  switch (_context4.prev = _context4.next) {
11766
12662
  case 0:
@@ -11781,8 +12677,8 @@ var DrawerBody$3 = function DrawerBody(props) {
11781
12677
  };
11782
12678
  }());
11783
12679
  actions.setFieldState('shorthand', /*#__PURE__*/function () {
11784
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(s) {
11785
- return regeneratorRuntime.wrap(function _callee5$(_context5) {
12680
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
12681
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
11786
12682
  while (1) {
11787
12683
  switch (_context5.prev = _context5.next) {
11788
12684
  case 0:
@@ -11883,8 +12779,8 @@ var DrawerBody$3 = function DrawerBody(props) {
11883
12779
  return e.id === id;
11884
12780
  })[0];
11885
12781
  !readOnlyTaxRate && actions.setFieldState('taxRate', /*#__PURE__*/function () {
11886
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(s) {
11887
- return regeneratorRuntime.wrap(function _callee6$(_context6) {
12782
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(s) {
12783
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
11888
12784
  while (1) {
11889
12785
  switch (_context6.prev = _context6.next) {
11890
12786
  case 0:
@@ -11905,8 +12801,8 @@ var DrawerBody$3 = function DrawerBody(props) {
11905
12801
  };
11906
12802
  }());
11907
12803
  actions.setFieldState('taxClassificationCode', /*#__PURE__*/function () {
11908
- var _ref7 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(s) {
11909
- return regeneratorRuntime.wrap(function _callee7$(_context7) {
12804
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(s) {
12805
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
11910
12806
  while (1) {
11911
12807
  switch (_context7.prev = _context7.next) {
11912
12808
  case 0:
@@ -11927,8 +12823,8 @@ var DrawerBody$3 = function DrawerBody(props) {
11927
12823
  };
11928
12824
  }());
11929
12825
  actions.setFieldState('shorthand', /*#__PURE__*/function () {
11930
- var _ref8 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(s) {
11931
- return regeneratorRuntime.wrap(function _callee8$(_context8) {
12826
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(s) {
12827
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
11932
12828
  while (1) {
11933
12829
  switch (_context8.prev = _context8.next) {
11934
12830
  case 0:
@@ -11951,14 +12847,14 @@ var DrawerBody$3 = function DrawerBody(props) {
11951
12847
  setVisible(false);
11952
12848
  }, [list, actions, readOnlyTaxRate]);
11953
12849
  React__default['default'].useEffect(function () {
11954
- _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10() {
12850
+ _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
11955
12851
  var fn, list;
11956
- return regeneratorRuntime.wrap(function _callee10$(_context10) {
12852
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
11957
12853
  while (1) {
11958
12854
  switch (_context10.prev = _context10.next) {
11959
12855
  case 0:
11960
- fn = controller.state.goodsListState.endowCode.getTaxCategoryCodeTree || /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9() {
11961
- return regeneratorRuntime.wrap(function _callee9$(_context9) {
12856
+ fn = controller.state.goodsListState.endowCode.getTaxCategoryCodeTree || /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
12857
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
11962
12858
  while (1) {
11963
12859
  switch (_context9.prev = _context9.next) {
11964
12860
  case 0:
@@ -12045,9 +12941,9 @@ var DrawerBody$3 = function DrawerBody(props) {
12045
12941
 
12046
12942
  var onSubmit = React__default['default'].useCallback(function (values) {
12047
12943
  controller.pipeline( /*#__PURE__*/function () {
12048
- var _ref11 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11(s) {
12944
+ var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(s) {
12049
12945
  var endowCodeGood;
12050
- return regeneratorRuntime.wrap(function _callee11$(_context11) {
12946
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
12051
12947
  while (1) {
12052
12948
  switch (_context11.prev = _context11.next) {
12053
12949
  case 0:
@@ -12056,9 +12952,10 @@ var DrawerBody$3 = function DrawerBody(props) {
12056
12952
  }); // 赋码
12057
12953
 
12058
12954
  endowCodeGood.forEach(function (good) {
12059
- if (!good) return; // const name = getItemName(good.itemName, values.shorthand);
12060
-
12061
- good.itemName = getItemName$1(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
12955
+ if (!good) return;
12956
+ good.itemName = setShorthand(good.itemName, values.shorthand);
12957
+ good.itemNameOther = setShorthand(good.itemNameOther, values.shorthand); // const name = getItemName(good.itemName, values.shorthand);
12958
+ // good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
12062
12959
 
12063
12960
  good.taxClassificationCode = values.taxClassificationCode;
12064
12961
  good.taxRate = values.taxRate;
@@ -12067,17 +12964,20 @@ var DrawerBody$3 = function DrawerBody(props) {
12067
12964
  good.favouredPolicyName = values.favouredPolicyName;
12068
12965
  var taxRate = mathjs.chain(mathjs.bignumber(values.taxRate)).dotDivide(mathjs.bignumber(100)).add(mathjs.bignumber(1)).done(); // 是否含税
12069
12966
 
12070
- if (s.goodsListState.isTaxIncluded) {
12071
- var lineAmountExcludeTax = mathjs.chain(mathjs.bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
12072
- var priceExcludeTax = good.priceIncludeTax ? mathjs.chain(mathjs.bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined;
12073
- good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
12074
- good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
12075
- } else {
12076
- var lineAmountIncludeTax = mathjs.chain(mathjs.bignumber(good.lineAmountExcludeTax)).multiply(taxRate).done();
12077
- var priceIncludeTax = good.priceExcludeTax ? mathjs.chain(mathjs.bignumber(good.priceExcludeTax)).multiply(taxRate).done() : undefined;
12078
- good.lineAmountIncludeTax = lineAmountIncludeTax.toNumber().toFixed(2);
12079
- good.priceIncludeTax = (priceIncludeTax ? format15(priceIncludeTax.toNumber()) : undefined) || undefined;
12080
- }
12967
+ var lineAmountExcludeTax = mathjs.chain(mathjs.bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
12968
+ var priceExcludeTax = good.priceIncludeTax ? mathjs.chain(mathjs.bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined;
12969
+ good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
12970
+ good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined; // if (s.goodsListState.isTaxIncluded) {
12971
+ // const lineAmountExcludeTax = chain(bignumber(good.lineAmountIncludeTax)).dotDivide(taxRate).done();
12972
+ // const priceExcludeTax = good.priceIncludeTax ? chain(bignumber(good.priceIncludeTax)).dotDivide(taxRate).done() : undefined
12973
+ // good.lineAmountExcludeTax = lineAmountExcludeTax.toNumber().toFixed(2);
12974
+ // good.priceExcludeTax = (priceExcludeTax ? format15(priceExcludeTax.toNumber()) : undefined) || undefined;
12975
+ // } else {
12976
+ // const lineAmountIncludeTax = chain(bignumber(good.lineAmountExcludeTax)).multiply(taxRate).done();
12977
+ // const priceIncludeTax = good.priceExcludeTax ? chain(bignumber(good.priceExcludeTax)).multiply(taxRate).done() : undefined
12978
+ // good.lineAmountIncludeTax = lineAmountIncludeTax.toNumber().toFixed(2);
12979
+ // good.priceIncludeTax = (priceIncludeTax ? format15(priceIncludeTax.toNumber()) : undefined) || undefined;
12980
+ // }
12081
12981
 
12082
12982
  good.taxAmount = countTaxAmount(good.lineAmountIncludeTax || 0, s.goodsListState.deduction, values.taxRate);
12083
12983
  }); //截取名称
@@ -12135,8 +13035,8 @@ var DrawerBody$3 = function DrawerBody(props) {
12135
13035
  antd.FormEffectHooks.onFieldValueChange$('taxRate').subscribe(function (e) {
12136
13036
  setTaxRate(e.value);
12137
13037
  actions.setFieldState('taxFreeType', /*#__PURE__*/function () {
12138
- var _ref12 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee12(s) {
12139
- return regeneratorRuntime.wrap(function _callee12$(_context12) {
13038
+ var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
13039
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
12140
13040
  while (1) {
12141
13041
  switch (_context12.prev = _context12.next) {
12142
13042
  case 0:
@@ -12159,8 +13059,8 @@ var DrawerBody$3 = function DrawerBody(props) {
12159
13059
  antd.FormEffectHooks.onFieldValueChange$('favouredPolicyMark').subscribe(function (e) {
12160
13060
  setFavouredPolicyMark(e.value);
12161
13061
  actions.setFieldState('favouredPolicyName', /*#__PURE__*/function () {
12162
- var _ref13 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee13(s) {
12163
- return regeneratorRuntime.wrap(function _callee13$(_context13) {
13062
+ var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(s) {
13063
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
12164
13064
  while (1) {
12165
13065
  switch (_context13.prev = _context13.next) {
12166
13066
  case 0:
@@ -12264,8 +13164,8 @@ var DrawerBody$3 = function DrawerBody(props) {
12264
13164
  }, "\u786E\u5B9A"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Button, {
12265
13165
  onClick: function onClick() {
12266
13166
  controller.pipeline( /*#__PURE__*/function () {
12267
- var _ref14 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee14(s) {
12268
- return regeneratorRuntime.wrap(function _callee14$(_context14) {
13167
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(s) {
13168
+ return _regeneratorRuntime().wrap(function _callee14$(_context14) {
12269
13169
  while (1) {
12270
13170
  switch (_context14.prev = _context14.next) {
12271
13171
  case 0:
@@ -12303,41 +13203,255 @@ var getShorthand = function getShorthand(value) {
12303
13203
  return undefined;
12304
13204
  }
12305
13205
  };
12306
- /** 简称填入名称 */
12307
13206
 
13207
+ var AddComparisonDrawer = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
13208
+ var form = props.form;
13209
+ var getFieldDecorator = form.getFieldDecorator;
13210
+ /** 控制器 */
12308
13211
 
12309
- var getItemName$1 = function getItemName(value, shorthand) {
12310
- if (!value) value = '';
13212
+ var controller = Invoice.useInvoiceController();
13213
+ /** 正在 添加商品对照 的货物索引 */
12311
13214
 
12312
- if (!shorthand) {
12313
- return value.replace(/\*[^*]+\*/, "");
12314
- }
13215
+ var addComparisonIndex = controller.useMemo(function (s) {
13216
+ return s.goodsListState.addComparisonIndex;
13217
+ }, []);
13218
+ /** 货物字典 */
12315
13219
 
12316
- var arr = value.match(/\*[^*]+\*/);
13220
+ var goodsMap = controller.useMemo(function (s) {
13221
+ return s.goodsListState.goodsMap;
13222
+ }, []);
13223
+ /** 正在 对照 的货物 */
12317
13224
 
12318
- if (arr) {
12319
- return value.replace(/\*[^*]+\*/, "*".concat(shorthand, "*"));
12320
- } else {
12321
- return "*".concat(shorthand, "*").concat(value);
12322
- }
12323
- };
13225
+ var good = React__default['default'].useMemo(function () {
13226
+ return addComparisonIndex ? goodsMap.get(addComparisonIndex) : undefined;
13227
+ }, [addComparisonIndex]);
13228
+ /** 关闭对照 */
13229
+
13230
+ var onClose = React__default['default'].useCallback(controller.pipeline( /*#__PURE__*/function () {
13231
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
13232
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13233
+ while (1) {
13234
+ switch (_context.prev = _context.next) {
13235
+ case 0:
13236
+ s.goodsListState.addComparisonIndex = undefined;
13237
+
13238
+ case 1:
13239
+ case "end":
13240
+ return _context.stop();
13241
+ }
13242
+ }
13243
+ }, _callee);
13244
+ }));
13245
+
13246
+ return function (_x) {
13247
+ return _ref.apply(this, arguments);
13248
+ };
13249
+ }()), [controller]);
13250
+ /** 提交数据 */
13251
+
13252
+ var onSubmit = React__default['default'].useCallback(function () {
13253
+ controller.run( /*#__PURE__*/function () {
13254
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
13255
+ var _getSN, _getSN2, _s$goodsListState, _s$goodsListState$pro;
13256
+
13257
+ var _yield$validateFields, err, values, shorthand;
13258
+
13259
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
13260
+ while (1) {
13261
+ switch (_context2.prev = _context2.next) {
13262
+ case 0:
13263
+ if (good) {
13264
+ _context2.next = 2;
13265
+ break;
13266
+ }
13267
+
13268
+ return _context2.abrupt("return");
13269
+
13270
+ case 2:
13271
+ _context2.next = 4;
13272
+ return validateFields$1(form);
13273
+
13274
+ case 4:
13275
+ _yield$validateFields = _context2.sent;
13276
+ err = _yield$validateFields.err;
13277
+ values = _yield$validateFields.values;
13278
+
13279
+ if (!err) {
13280
+ _context2.next = 9;
13281
+ break;
13282
+ }
13283
+
13284
+ return _context2.abrupt("return");
13285
+
13286
+ case 9:
13287
+ 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;
13288
+ good.itemCode = values.itemCode;
13289
+ good.itemCodeOther = values.itemCodeOther;
13290
+ good.itemName = shorthand ? "*".concat(shorthand, "*").concat(values.itemName) : values.itemName;
13291
+ good.itemNameOther = shorthand ? "*".concat(shorthand, "*").concat(values.itemNameOther) : values.itemNameOther;
13292
+ good.itemModelName = values.itemModelName;
13293
+ good.itemModelNameOther = values.itemModelNameOther;
13294
+ good.unit = values.unit;
13295
+ good.unitOther = values.unitOther;
13296
+ s.goodsListState.addComparisonIndex = undefined;
13297
+ s.goodsListState.goodsList = _toConsumableArray(s.goodsListState.goodsList);
13298
+
13299
+ 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)) {
13300
+ _context2.next = 24;
13301
+ break;
13302
+ }
13303
+
13304
+ debugger;
13305
+ _context2.next = 24;
13306
+ return s.goodsListState.productComparison.onUpdateComparisonTable(good, values);
13307
+
13308
+ case 24:
13309
+ case "end":
13310
+ return _context2.stop();
13311
+ }
13312
+ }
13313
+ }, _callee2);
13314
+ }));
13315
+
13316
+ return function (_x2) {
13317
+ return _ref2.apply(this, arguments);
13318
+ };
13319
+ }());
13320
+ }, [form, good]);
13321
+ React__default['default'].useEffect(function () {
13322
+ form.resetFields();
13323
+
13324
+ if (good) {
13325
+ var _getSN3, _getSN4;
13326
+
13327
+ form.setFieldsValue(_objectSpread2(_objectSpread2({}, good), {}, {
13328
+ itemName: (_getSN3 = getSN(good.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.full,
13329
+ itemNameOther: (_getSN4 = getSN(good.itemNameOther)) === null || _getSN4 === void 0 ? void 0 : _getSN4.full
13330
+ }));
13331
+ }
13332
+ }, [good]);
13333
+ return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Drawer, {
13334
+ width: 500,
13335
+ onClose: onClose,
13336
+ placement: "right",
13337
+ title: "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167",
13338
+ visible: !!addComparisonIndex,
13339
+ drawerStyle: {
13340
+ display: 'flex',
13341
+ flexDirection: 'column'
13342
+ },
13343
+ bodyStyle: {
13344
+ flex: 1,
13345
+ display: 'flex',
13346
+ flexDirection: 'column'
13347
+ }
13348
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form, {
13349
+ layout: "vertical",
13350
+ style: {
13351
+ flex: 1
13352
+ }
13353
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Row, {
13354
+ gutter: [8, 8]
13355
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Col, {
13356
+ span: 12
13357
+ }, getFieldDecorator('itemCode', {})( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
13358
+ label: "\u6211\u65B9\u5546\u54C1\u7F16\u7801"
13359
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, null)))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Col, {
13360
+ span: 12
13361
+ }, getFieldDecorator('itemCodeOther', {})( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
13362
+ label: "\u5BF9\u65B9\u5546\u54C1\u7F16\u7801"
13363
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, null)))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Col, {
13364
+ span: 12
13365
+ }, getFieldDecorator('itemName', {
13366
+ rules: [{
13367
+ required: true,
13368
+ message: "请输入我方商品名称"
13369
+ }]
13370
+ })( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
13371
+ label: "\u6211\u65B9\u5546\u54C1\u540D\u79F0"
13372
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, null)))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Col, {
13373
+ span: 12
13374
+ }, getFieldDecorator('itemNameOther', {
13375
+ rules: [{
13376
+ required: true,
13377
+ message: "请输入对方商品名称"
13378
+ }]
13379
+ })( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
13380
+ label: "\u5BF9\u65B9\u5546\u54C1\u540D\u79F0"
13381
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, null)))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Col, {
13382
+ span: 12
13383
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
13384
+ label: "\u6211\u65B9\u89C4\u683C\u578B\u53F7"
13385
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, null))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Col, {
13386
+ span: 12
13387
+ }, getFieldDecorator('itemModelNameOther', {
13388
+ rules: [{
13389
+ required: true,
13390
+ message: "请输入对方规格型号"
13391
+ }]
13392
+ })( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
13393
+ label: "\u5BF9\u65B9\u89C4\u683C\u578B\u53F7"
13394
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, null)))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Col, {
13395
+ span: 12
13396
+ }, getFieldDecorator('unit', {
13397
+ rules: [{
13398
+ required: true,
13399
+ message: "请输入对方规格型号"
13400
+ }]
13401
+ })( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
13402
+ label: "\u6211\u65B9\u8BA1\u91CF\u5355\u4F4D"
13403
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, null)))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Col, {
13404
+ span: 12
13405
+ }, getFieldDecorator('unitOther', {
13406
+ rules: [{
13407
+ required: true,
13408
+ message: "请输入对方计量单位"
13409
+ }]
13410
+ })( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
13411
+ label: "\u5BF9\u65B9\u8BA1\u91CF\u5355\u4F4D"
13412
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Input, null)))), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Col, {
13413
+ span: 24
13414
+ }, getFieldDecorator('isUpdate', {})( /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Checkbox, null, "\u66F4\u65B0\u5230\u5546\u54C1\u5BF9\u7167\u8868\u4E2D")))))), /*#__PURE__*/React__default['default'].createElement("div", {
13415
+ style: {
13416
+ display: 'flex',
13417
+ justifyContent: 'flex-end',
13418
+ gap: 10
13419
+ }
13420
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Button, {
13421
+ type: "primary",
13422
+ onClick: onSubmit
13423
+ }, "\u63D0\u4EA4"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Button, {
13424
+ onClick: onClose
13425
+ }, "\u53D6\u6D88")));
13426
+ });
13427
+
13428
+ function validateFields$1(form) {
13429
+ return new Promise(function (resolve) {
13430
+ form.validateFields(function (err, values) {
13431
+ resolve({
13432
+ err: err,
13433
+ values: values
13434
+ });
13435
+ });
13436
+ });
13437
+ }
12324
13438
 
12325
13439
  /** 发票组件的上下文 */
12326
13440
 
12327
13441
  var InvoiceContext = /*#__PURE__*/React__default['default'].createContext(undefined);
12328
13442
 
12329
- var default_1 = /*#__PURE__*/function (_React$PureComponent) {
12330
- _inherits(default_1, _React$PureComponent);
13443
+ var Invoice = /*#__PURE__*/function (_React$PureComponent) {
13444
+ _inherits(Invoice, _React$PureComponent);
12331
13445
 
12332
- var _super = _createSuper(default_1);
13446
+ var _super = _createSuper(Invoice);
12333
13447
 
12334
- function default_1() {
12335
- _classCallCheck(this, default_1);
13448
+ function Invoice() {
13449
+ _classCallCheck(this, Invoice);
12336
13450
 
12337
13451
  return _super.apply(this, arguments);
12338
13452
  }
12339
13453
 
12340
- _createClass(default_1, [{
13454
+ _createClass(Invoice, [{
12341
13455
  key: "render",
12342
13456
  value:
12343
13457
  /** 控制器 */
@@ -12360,18 +13474,18 @@ var default_1 = /*#__PURE__*/function (_React$PureComponent) {
12360
13474
  }
12361
13475
  }]);
12362
13476
 
12363
- return default_1;
13477
+ return Invoice;
12364
13478
  }(React__default['default'].PureComponent);
12365
13479
 
12366
- default_1.InvoiceController = InvoiceController;
12367
- default_1.InvoiceHeader = InvoiceHeader;
12368
- default_1.GoodsList = GoodsList;
12369
- default_1.Seller = Buyer;
12370
- default_1.Sign = Sign;
12371
- default_1.Buyer = Buyer$1;
12372
- default_1.idGenerator = idGenerator;
13480
+ Invoice.InvoiceController = InvoiceController;
13481
+ Invoice.InvoiceHeader = InvoiceHeader;
13482
+ Invoice.GoodsList = GoodsList;
13483
+ Invoice.Seller = Buyer;
13484
+ Invoice.Sign = Sign;
13485
+ Invoice.Buyer = Buyer$1;
13486
+ Invoice.idGenerator = idGenerator;
12373
13487
 
12374
- default_1.useInvoiceController = function () {
13488
+ Invoice.useInvoiceController = function () {
12375
13489
  return React__default['default'].useContext(InvoiceContext);
12376
13490
  };
12377
13491
 
@@ -12403,8 +13517,8 @@ var Main$3 = function Main(props) {
12403
13517
  /** 销售方 */
12404
13518
  , props.sign || /*#__PURE__*/React__default['default'].createElement(Sign, null)
12405
13519
  /** 落款 */
12406
- , props.footExpand), /*#__PURE__*/React__default['default'].createElement(ImportBuyerDrawer, null), /*#__PURE__*/React__default['default'].createElement(ImportGoodsDrawer, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeDrawer, null));
13520
+ , props.footExpand), /*#__PURE__*/React__default['default'].createElement(ImportBuyerDrawer, null), /*#__PURE__*/React__default['default'].createElement(ImportGoodsDrawer, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeDrawer, null), /*#__PURE__*/React__default['default'].createElement(AddComparisonDrawer, null));
12407
13521
  };
12408
13522
 
12409
- exports.Invoice = default_1;
13523
+ exports.Invoice = Invoice;
12410
13524
  exports.InvoiceController = InvoiceController;