kts-component-invoice-operate 3.2.106 → 3.2.107

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ import { InvoiceControllerState } from '../';
2
+ /**
3
+ * 项目名称智能赋码
4
+ */
5
+ declare const _default: (s: InvoiceControllerState, record: any, controller: any) => Promise<void>;
6
+ export default _default;
@@ -32,6 +32,8 @@ export default class InvoiceController extends InvoiceControllerForm {
32
32
  addGoodDiscountV2: (option?: import("./fns/addGoodDiscountV2").IOptions[] | undefined) => Promise<any>;
33
33
  /** 导入商品 */
34
34
  importGoodsDrawer: (option?: any) => Promise<any>;
35
+ /** 项目名称智能赋码 */
36
+ itemNameBlur: (option?: any) => Promise<any>;
35
37
  /** 获取 商品 列表 */
36
38
  getGoodsList?: (option?: IGetGoodsListOption | undefined) => Promise<any>;
37
39
  /** 税收分类编码列表 */
package/dist/index.esm.js CHANGED
@@ -9403,6 +9403,76 @@ var getPriceExcludeTax = function getPriceExcludeTax(s, record, calculatingDigit
9403
9403
  return format15(evaluate("".concat(record.priceIncludeTax, " / (1+").concat(s.taxRate, "/100)")), calculatingDigits);
9404
9404
  };
9405
9405
 
9406
+ /**
9407
+ * 项目名称智能赋码
9408
+ */
9409
+
9410
+ var itemBlur = /*#__PURE__*/(function () {
9411
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s, record, controller) {
9412
+ var between, editGood;
9413
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9414
+ while (1) {
9415
+ switch (_context.prev = _context.next) {
9416
+ case 0:
9417
+ Object.keys(record).filter(function (e) {
9418
+ return !record[e] && record[e] !== 0;
9419
+ }).forEach(function (e) {
9420
+ delete record[e];
9421
+ }); // 没用 被编辑的货物 和 form 就退出
9422
+
9423
+ if (!(!s.goodsListState.editGood || !s.goodsListState.form)) {
9424
+ _context.next = 3;
9425
+ break;
9426
+ }
9427
+
9428
+ return _context.abrupt("return");
9429
+
9430
+ case 3:
9431
+ // 中间数据
9432
+ between = _objectSpread2({}, record);
9433
+ between.taxClassificationCode = record.taxClassificationCode;
9434
+ between.shorthand = record.shorthand; // 设置编辑货物
9435
+
9436
+ editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between); // 导入FORM里
9437
+
9438
+ if (s.goodsListState.isMyShow) {
9439
+ s.goodsListState.form.setFieldsValue(_objectSpread2(_objectSpread2({}, editGood), {}, {
9440
+ itemName: editGood.itemNameSelf,
9441
+ itemModelName: editGood.itemModelNameSelf
9442
+ }));
9443
+ } else {
9444
+ s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
9445
+ }
9446
+
9447
+ if (!s.goodsListState.isTaxIncluded) {
9448
+ _context.next = 13;
9449
+ break;
9450
+ }
9451
+
9452
+ _context.next = 11;
9453
+ return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
9454
+
9455
+ case 11:
9456
+ _context.next = 15;
9457
+ break;
9458
+
9459
+ case 13:
9460
+ _context.next = 15;
9461
+ return updateUnitPriceTax(controller, s.goodsListState.form, record);
9462
+
9463
+ case 15:
9464
+ case "end":
9465
+ return _context.stop();
9466
+ }
9467
+ }
9468
+ }, _callee);
9469
+ }));
9470
+
9471
+ return function (_x, _x2, _x3) {
9472
+ return _ref.apply(this, arguments);
9473
+ };
9474
+ })();
9475
+
9406
9476
  var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
9407
9477
  _inherits(InvoiceController, _InvoiceControllerFor);
9408
9478
 
@@ -9428,6 +9498,7 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
9428
9498
  _this.addGoodDiscount = _this.pipeline(addGoodDiscount);
9429
9499
  _this.addGoodDiscountV2 = _this.pipeline(addGoodDiscountV2);
9430
9500
  _this.importGoodsDrawer = _this.pipeline(importGoodsDrawer);
9501
+ _this.itemNameBlur = _this.pipeline(itemBlur);
9431
9502
  _this.getGoodsList = void 0;
9432
9503
  _this.getTaxCategoryCodeList = void 0;
9433
9504
  _this.getGoodsSearch = getGoodsSearch;
@@ -10923,11 +10994,11 @@ function ItemNameInput(props) {
10923
10994
  taxCategoryData = _context.sent;
10924
10995
 
10925
10996
  if (taxCategoryData && taxCategoryData[0]) {
10926
- params = _objectSpread2(_objectSpread2({}, props.editGood), {}, {
10997
+ params = {
10927
10998
  taxClassificationCode: taxCategoryData[0].taxCategoryCode,
10928
10999
  shorthand: taxCategoryData[0].shorthand
10929
- });
10930
- controller.importGoodsDrawer(params);
11000
+ };
11001
+ controller.itemNameBlur(params);
10931
11002
  }
10932
11003
 
10933
11004
  case 7:
@@ -17814,11 +17885,11 @@ function ItemNameInput$1(props) {
17814
17885
  taxCategoryData = _context.sent;
17815
17886
 
17816
17887
  if (taxCategoryData && taxCategoryData[0]) {
17817
- params = _objectSpread2(_objectSpread2({}, props.editGood), {}, {
17888
+ params = {
17818
17889
  taxClassificationCode: taxCategoryData[0].taxCategoryCode,
17819
17890
  shorthand: taxCategoryData[0].shorthand
17820
- });
17821
- controller.importGoodsDrawer(params);
17891
+ };
17892
+ controller.itemNameBlur(params);
17822
17893
  }
17823
17894
 
17824
17895
  case 7:
package/dist/index.js CHANGED
@@ -9413,6 +9413,76 @@ var getPriceExcludeTax = function getPriceExcludeTax(s, record, calculatingDigit
9413
9413
  return format15(evaluate("".concat(record.priceIncludeTax, " / (1+").concat(s.taxRate, "/100)")), calculatingDigits);
9414
9414
  };
9415
9415
 
9416
+ /**
9417
+ * 项目名称智能赋码
9418
+ */
9419
+
9420
+ var itemBlur = /*#__PURE__*/(function () {
9421
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s, record, controller) {
9422
+ var between, editGood;
9423
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9424
+ while (1) {
9425
+ switch (_context.prev = _context.next) {
9426
+ case 0:
9427
+ Object.keys(record).filter(function (e) {
9428
+ return !record[e] && record[e] !== 0;
9429
+ }).forEach(function (e) {
9430
+ delete record[e];
9431
+ }); // 没用 被编辑的货物 和 form 就退出
9432
+
9433
+ if (!(!s.goodsListState.editGood || !s.goodsListState.form)) {
9434
+ _context.next = 3;
9435
+ break;
9436
+ }
9437
+
9438
+ return _context.abrupt("return");
9439
+
9440
+ case 3:
9441
+ // 中间数据
9442
+ between = _objectSpread2({}, record);
9443
+ between.taxClassificationCode = record.taxClassificationCode;
9444
+ between.shorthand = record.shorthand; // 设置编辑货物
9445
+
9446
+ editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between); // 导入FORM里
9447
+
9448
+ if (s.goodsListState.isMyShow) {
9449
+ s.goodsListState.form.setFieldsValue(_objectSpread2(_objectSpread2({}, editGood), {}, {
9450
+ itemName: editGood.itemNameSelf,
9451
+ itemModelName: editGood.itemModelNameSelf
9452
+ }));
9453
+ } else {
9454
+ s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
9455
+ }
9456
+
9457
+ if (!s.goodsListState.isTaxIncluded) {
9458
+ _context.next = 13;
9459
+ break;
9460
+ }
9461
+
9462
+ _context.next = 11;
9463
+ return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
9464
+
9465
+ case 11:
9466
+ _context.next = 15;
9467
+ break;
9468
+
9469
+ case 13:
9470
+ _context.next = 15;
9471
+ return updateUnitPriceTax(controller, s.goodsListState.form, record);
9472
+
9473
+ case 15:
9474
+ case "end":
9475
+ return _context.stop();
9476
+ }
9477
+ }
9478
+ }, _callee);
9479
+ }));
9480
+
9481
+ return function (_x, _x2, _x3) {
9482
+ return _ref.apply(this, arguments);
9483
+ };
9484
+ })();
9485
+
9416
9486
  var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
9417
9487
  _inherits(InvoiceController, _InvoiceControllerFor);
9418
9488
 
@@ -9438,6 +9508,7 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
9438
9508
  _this.addGoodDiscount = _this.pipeline(addGoodDiscount);
9439
9509
  _this.addGoodDiscountV2 = _this.pipeline(addGoodDiscountV2);
9440
9510
  _this.importGoodsDrawer = _this.pipeline(importGoodsDrawer);
9511
+ _this.itemNameBlur = _this.pipeline(itemBlur);
9441
9512
  _this.getGoodsList = void 0;
9442
9513
  _this.getTaxCategoryCodeList = void 0;
9443
9514
  _this.getGoodsSearch = getGoodsSearch;
@@ -10933,11 +11004,11 @@ function ItemNameInput(props) {
10933
11004
  taxCategoryData = _context.sent;
10934
11005
 
10935
11006
  if (taxCategoryData && taxCategoryData[0]) {
10936
- params = _objectSpread2(_objectSpread2({}, props.editGood), {}, {
11007
+ params = {
10937
11008
  taxClassificationCode: taxCategoryData[0].taxCategoryCode,
10938
11009
  shorthand: taxCategoryData[0].shorthand
10939
- });
10940
- controller.importGoodsDrawer(params);
11010
+ };
11011
+ controller.itemNameBlur(params);
10941
11012
  }
10942
11013
 
10943
11014
  case 7:
@@ -17824,11 +17895,11 @@ function ItemNameInput$1(props) {
17824
17895
  taxCategoryData = _context.sent;
17825
17896
 
17826
17897
  if (taxCategoryData && taxCategoryData[0]) {
17827
- params = _objectSpread2(_objectSpread2({}, props.editGood), {}, {
17898
+ params = {
17828
17899
  taxClassificationCode: taxCategoryData[0].taxCategoryCode,
17829
17900
  shorthand: taxCategoryData[0].shorthand
17830
- });
17831
- controller.importGoodsDrawer(params);
17901
+ };
17902
+ controller.itemNameBlur(params);
17832
17903
  }
17833
17904
 
17834
17905
  case 7:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.106",
3
+ "version": "3.2.107",
4
4
  "scripts": {
5
5
  "dev": "dumi dev",
6
6
  "start": "dumi dev",
@@ -0,0 +1,40 @@
1
+ import { updateUnitPriceExcludingTax, updateUnitPriceTax } from '../../ui/default/GoodsList/hook/useColumns/autoFillFn';
2
+ import { InvoiceControllerState, IGood } from '../';
3
+
4
+ /**
5
+ * 项目名称智能赋码
6
+ */
7
+ export default async (s: InvoiceControllerState, record: any, controller:any) => {
8
+ Object.keys(record).filter(e => !record[e] && record[e] !== 0).forEach(e => { delete record[e] });
9
+
10
+ // 没用 被编辑的货物 和 form 就退出
11
+ if (!s.goodsListState.editGood || !s.goodsListState.form) return;
12
+
13
+ // 中间数据
14
+ const between: any = {...record };
15
+
16
+ between.taxClassificationCode = record.taxClassificationCode;
17
+ between.shorthand = record.shorthand;
18
+
19
+ // 设置编辑货物
20
+ const editGood: IGood = s.goodsListState.editGood = { ...s.goodsListState.editGood, ...between };
21
+
22
+ // 导入FORM里
23
+ if (s.goodsListState.isMyShow) {
24
+ s.goodsListState.form.setFieldsValue({
25
+ ...editGood,
26
+ itemName: editGood.itemNameSelf,
27
+ itemModelName: editGood.itemModelNameSelf,
28
+ });
29
+ } else {
30
+ s.goodsListState.form.setFieldsValue({
31
+ ...editGood,
32
+ });
33
+ }
34
+
35
+ s.goodsListState.isTaxIncluded
36
+ ? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
37
+ : await updateUnitPriceTax(controller, s.goodsListState.form, record)
38
+ }
39
+
40
+
@@ -14,6 +14,7 @@ import getGoodsSearch from './fns/getGoodsSearch';
14
14
  import mergeDetails from './fns/mergeDetails';
15
15
  import mergeDiscount from './fns/mergeDiscount';
16
16
  import importGoodsDrawer from './fns/importGoodsDrawer';
17
+ import itemBlur from './fns/itemBlur';
17
18
  0
18
19
  export { default as InvoiceControllerState } from './InvoiceControllerState';
19
20
  export { default as IGood } from './InvoiceControllerState/GoodsListState/IGood';
@@ -66,6 +67,9 @@ export default class InvoiceController extends InvoiceControllerForm {
66
67
  /** 导入商品 */
67
68
  importGoodsDrawer = this.pipeline(importGoodsDrawer);
68
69
 
70
+ /** 项目名称智能赋码 */
71
+ itemNameBlur = this.pipeline(itemBlur);
72
+
69
73
  /** 获取 商品 列表 */
70
74
  getGoodsList?: (option?: IGetGoodsListOption | undefined) => Promise<any>;
71
75
 
@@ -30,11 +30,10 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
30
30
  const taxCategoryData: any = await autoComplete.onItemNameBlur(searchText);
31
31
  if (taxCategoryData && taxCategoryData[0]) {
32
32
  const params = {
33
- ...props.editGood,
34
33
  taxClassificationCode: taxCategoryData[0].taxCategoryCode,
35
34
  shorthand: taxCategoryData[0].shorthand
36
35
  }
37
- controller.importGoodsDrawer(params);
36
+ controller.itemNameBlur(params);
38
37
  }
39
38
  }
40
39
  setSelectLine(null);
@@ -32,11 +32,10 @@ export default function ItemNameInput(props: {
32
32
  const taxCategoryData: any = await autoComplete.onItemNameBlur(searchText);
33
33
  if (taxCategoryData && taxCategoryData[0]) {
34
34
  const params = {
35
- ...props.editGood,
36
35
  taxClassificationCode: taxCategoryData[0].taxCategoryCode,
37
36
  shorthand: taxCategoryData[0].shorthand
38
37
  }
39
- controller.importGoodsDrawer(params);
38
+ controller.itemNameBlur(params);
40
39
  }
41
40
  }
42
41
  setSelectLine(null);