kts-component-invoice-operate 3.2.248 → 3.2.250

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.
package/dist/index.esm.js CHANGED
@@ -10294,7 +10294,8 @@ var importGoodsDrawer = /*#__PURE__*/(function () {
10294
10294
  between.lineAmountIncludeTax = record.lineAmountIncludeTax;
10295
10295
  between.lineAmountExcludeTax = record.lineAmountExcludeTax;
10296
10296
  between.taxRate = record.taxRate;
10297
- between.taxAmount = record.taxAmount; // 设置编辑货物
10297
+ between.taxAmount = record.taxAmount;
10298
+ between.mtzlDm = undefined; // 设置编辑货物
10298
10299
 
10299
10300
  editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
10300
10301
 
@@ -10325,22 +10326,41 @@ var importGoodsDrawer = /*#__PURE__*/(function () {
10325
10326
 
10326
10327
 
10327
10328
  if (!s.goodsListState.isTaxIncluded) {
10328
- _context.next = 29;
10329
+ _context.next = 30;
10329
10330
  break;
10330
10331
  }
10331
10332
 
10332
- _context.next = 27;
10333
+ _context.next = 28;
10333
10334
  return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
10334
10335
 
10335
- case 27:
10336
- _context.next = 31;
10336
+ case 28:
10337
+ _context.next = 32;
10337
10338
  break;
10338
10339
 
10339
- case 29:
10340
- _context.next = 31;
10340
+ case 30:
10341
+ _context.next = 32;
10341
10342
  return updateUnitPriceTax(controller, s.goodsListState.form, record);
10342
10343
 
10343
- case 31:
10344
+ case 32:
10345
+ if (!s.goodsListState.isValidateMeiTan) {
10346
+ _context.next = 38;
10347
+ break;
10348
+ }
10349
+
10350
+ _context.next = 35;
10351
+ return s.goodsListState.verifyMeiTanFn(record);
10352
+
10353
+ case 35:
10354
+ _context.t0 = _context.sent;
10355
+
10356
+ if (!(_context.t0 === true)) {
10357
+ _context.next = 38;
10358
+ break;
10359
+ }
10360
+
10361
+ s.goodsListState.meiTanGoodIndex = [editGood.$index];
10362
+
10363
+ case 38:
10344
10364
  case "end":
10345
10365
  return _context.stop();
10346
10366
  }
@@ -10388,7 +10408,8 @@ var itemBlur = /*#__PURE__*/(function () {
10388
10408
  // 中间数据
10389
10409
  between = _objectSpread2({}, record);
10390
10410
  between.taxClassificationCode = record.taxClassificationCode;
10391
- between.shorthand = record.shorthand; // 设置编辑货物
10411
+ between.shorthand = record.shorthand;
10412
+ between.mtzlDm = undefined; // 设置编辑货物
10392
10413
 
10393
10414
  editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between); // 导入FORM里
10394
10415
 
@@ -10402,22 +10423,41 @@ var itemBlur = /*#__PURE__*/(function () {
10402
10423
  }
10403
10424
 
10404
10425
  if (!s.goodsListState.isTaxIncluded) {
10405
- _context.next = 13;
10426
+ _context.next = 14;
10406
10427
  break;
10407
10428
  }
10408
10429
 
10409
- _context.next = 11;
10430
+ _context.next = 12;
10410
10431
  return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
10411
10432
 
10412
- case 11:
10413
- _context.next = 15;
10433
+ case 12:
10434
+ _context.next = 16;
10414
10435
  break;
10415
10436
 
10416
- case 13:
10417
- _context.next = 15;
10437
+ case 14:
10438
+ _context.next = 16;
10418
10439
  return updateUnitPriceTax(controller, s.goodsListState.form, record);
10419
10440
 
10420
- case 15:
10441
+ case 16:
10442
+ if (!s.goodsListState.isValidateMeiTan) {
10443
+ _context.next = 22;
10444
+ break;
10445
+ }
10446
+
10447
+ _context.next = 19;
10448
+ return s.goodsListState.verifyMeiTanFn(record);
10449
+
10450
+ case 19:
10451
+ _context.t0 = _context.sent;
10452
+
10453
+ if (!(_context.t0 === true)) {
10454
+ _context.next = 22;
10455
+ break;
10456
+ }
10457
+
10458
+ s.goodsListState.meiTanGoodIndex = [editGood.$index];
10459
+
10460
+ case 22:
10421
10461
  case "end":
10422
10462
  return _context.stop();
10423
10463
  }
@@ -31279,7 +31319,12 @@ var MeiTanModal = (function () {
31279
31319
  var _React$useState = React.useState(null),
31280
31320
  _React$useState2 = _slicedToArray(_React$useState, 2),
31281
31321
  mainOption = _React$useState2[0],
31282
- setMainOption = _React$useState2[1]; // 监听煤炭种类变化
31322
+ setMainOption = _React$useState2[1];
31323
+
31324
+ var _React$useState3 = React.useState(null),
31325
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
31326
+ subOption = _React$useState4[0],
31327
+ setSubOption = _React$useState4[1]; // 监听煤炭种类变化
31283
31328
 
31284
31329
 
31285
31330
  var mtzlDm = Form$2.useWatch('mtzlDm', form);
@@ -31298,8 +31343,9 @@ var MeiTanModal = (function () {
31298
31343
  mtzlDm: undefined
31299
31344
  });
31300
31345
  setMainOption(null);
31346
+ setSubOption(null);
31301
31347
 
31302
- case 3:
31348
+ case 4:
31303
31349
  case "end":
31304
31350
  return _context.stop();
31305
31351
  }
@@ -31319,7 +31365,7 @@ var MeiTanModal = (function () {
31319
31365
 
31320
31366
 
31321
31367
  var onFinish = function onFinish(values) {
31322
- console.log('煤炭种类:', values);
31368
+ // console.log('煤炭种类:', values);
31323
31369
  controller.pipeline( /*#__PURE__*/function () {
31324
31370
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
31325
31371
  var _s$goodsListState$mei;
@@ -31329,7 +31375,9 @@ var MeiTanModal = (function () {
31329
31375
  while (1) {
31330
31376
  switch (_context2.prev = _context2.next) {
31331
31377
  case 0:
31332
- mtzl = values.mtzlDm;
31378
+ mtzl = subOption || mainOption || undefined; //values.mtzlDm;
31379
+
31380
+ console.log('煤炭种类', mtzl);
31333
31381
  goods = ((_s$goodsListState$mei = s.goodsListState.meiTanGoodIndex) === null || _s$goodsListState$mei === void 0 ? void 0 : _s$goodsListState$mei.map(function (e) {
31334
31382
  return s.goodsListState.goodsMap.get(e);
31335
31383
  })) || [];
@@ -31350,7 +31398,7 @@ var MeiTanModal = (function () {
31350
31398
  s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
31351
31399
  onClose();
31352
31400
 
31353
- case 7:
31401
+ case 8:
31354
31402
  case "end":
31355
31403
  return _context2.stop();
31356
31404
  }
@@ -31372,7 +31420,7 @@ var MeiTanModal = (function () {
31372
31420
  return Promise.reject(new Error('请选择选项')); // callback('请选择选项');
31373
31421
  }
31374
31422
 
31375
- if (value === '0200') {
31423
+ if (value === '0200' && !subOption) {
31376
31424
  return Promise.reject(new Error('请选择长协煤的子选项'));
31377
31425
  }
31378
31426
 
@@ -31383,17 +31431,18 @@ var MeiTanModal = (function () {
31383
31431
  var value = e.target.value;
31384
31432
  setMainOption(value);
31385
31433
 
31386
- if (value === 'A' || value === 'C') {
31387
- form.setFieldsValue({
31388
- mtzlDm: value
31389
- });
31390
- } else if (value === 'B') {
31391
- form.setFieldsValue({
31392
- mtzlDm: undefined
31393
- }); // 清空option,等待选择子选项
31434
+ if (value === '0100' || value === '0300') {
31435
+ //form.setFieldsValue({ mtzlDm: value });
31436
+ setSubOption(null);
31394
31437
  }
31395
31438
  };
31396
31439
 
31440
+ var handleSubOptionChange = function handleSubOptionChange(e) {
31441
+ var value = e.target.value;
31442
+ setSubOption(value);
31443
+ form.validateFields();
31444
+ };
31445
+
31397
31446
  return /*#__PURE__*/React.createElement(Modal$2, {
31398
31447
  title: "\u6E29\u99A8\u63D0\u793A",
31399
31448
  destroyOnClose: true,
@@ -31457,12 +31506,8 @@ var MeiTanModal = (function () {
31457
31506
  color: 'red'
31458
31507
  }
31459
31508
  }, "*"), "\u8BF7\u9009\u62E9\u534F\u8BAE\u671F\u9650\uFF1A"), /*#__PURE__*/React.createElement(Radio$1.Group, {
31460
- value: mtzlDm,
31461
- onChange: function onChange(e) {
31462
- return form.setFieldsValue({
31463
- mtzlDm: e.target.value
31464
- });
31465
- }
31509
+ value: subOption,
31510
+ onChange: handleSubOptionChange
31466
31511
  }, /*#__PURE__*/React.createElement(Space$1, {
31467
31512
  direction: "vertical"
31468
31513
  }, /*#__PURE__*/React.createElement(Radio$1, {
package/dist/index.js CHANGED
@@ -10304,7 +10304,8 @@ var importGoodsDrawer = /*#__PURE__*/(function () {
10304
10304
  between.lineAmountIncludeTax = record.lineAmountIncludeTax;
10305
10305
  between.lineAmountExcludeTax = record.lineAmountExcludeTax;
10306
10306
  between.taxRate = record.taxRate;
10307
- between.taxAmount = record.taxAmount; // 设置编辑货物
10307
+ between.taxAmount = record.taxAmount;
10308
+ between.mtzlDm = undefined; // 设置编辑货物
10308
10309
 
10309
10310
  editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
10310
10311
 
@@ -10335,22 +10336,41 @@ var importGoodsDrawer = /*#__PURE__*/(function () {
10335
10336
 
10336
10337
 
10337
10338
  if (!s.goodsListState.isTaxIncluded) {
10338
- _context.next = 29;
10339
+ _context.next = 30;
10339
10340
  break;
10340
10341
  }
10341
10342
 
10342
- _context.next = 27;
10343
+ _context.next = 28;
10343
10344
  return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
10344
10345
 
10345
- case 27:
10346
- _context.next = 31;
10346
+ case 28:
10347
+ _context.next = 32;
10347
10348
  break;
10348
10349
 
10349
- case 29:
10350
- _context.next = 31;
10350
+ case 30:
10351
+ _context.next = 32;
10351
10352
  return updateUnitPriceTax(controller, s.goodsListState.form, record);
10352
10353
 
10353
- case 31:
10354
+ case 32:
10355
+ if (!s.goodsListState.isValidateMeiTan) {
10356
+ _context.next = 38;
10357
+ break;
10358
+ }
10359
+
10360
+ _context.next = 35;
10361
+ return s.goodsListState.verifyMeiTanFn(record);
10362
+
10363
+ case 35:
10364
+ _context.t0 = _context.sent;
10365
+
10366
+ if (!(_context.t0 === true)) {
10367
+ _context.next = 38;
10368
+ break;
10369
+ }
10370
+
10371
+ s.goodsListState.meiTanGoodIndex = [editGood.$index];
10372
+
10373
+ case 38:
10354
10374
  case "end":
10355
10375
  return _context.stop();
10356
10376
  }
@@ -10398,7 +10418,8 @@ var itemBlur = /*#__PURE__*/(function () {
10398
10418
  // 中间数据
10399
10419
  between = _objectSpread2({}, record);
10400
10420
  between.taxClassificationCode = record.taxClassificationCode;
10401
- between.shorthand = record.shorthand; // 设置编辑货物
10421
+ between.shorthand = record.shorthand;
10422
+ between.mtzlDm = undefined; // 设置编辑货物
10402
10423
 
10403
10424
  editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between); // 导入FORM里
10404
10425
 
@@ -10412,22 +10433,41 @@ var itemBlur = /*#__PURE__*/(function () {
10412
10433
  }
10413
10434
 
10414
10435
  if (!s.goodsListState.isTaxIncluded) {
10415
- _context.next = 13;
10436
+ _context.next = 14;
10416
10437
  break;
10417
10438
  }
10418
10439
 
10419
- _context.next = 11;
10440
+ _context.next = 12;
10420
10441
  return updateUnitPriceExcludingTax(controller, s.goodsListState.form, record);
10421
10442
 
10422
- case 11:
10423
- _context.next = 15;
10443
+ case 12:
10444
+ _context.next = 16;
10424
10445
  break;
10425
10446
 
10426
- case 13:
10427
- _context.next = 15;
10447
+ case 14:
10448
+ _context.next = 16;
10428
10449
  return updateUnitPriceTax(controller, s.goodsListState.form, record);
10429
10450
 
10430
- case 15:
10451
+ case 16:
10452
+ if (!s.goodsListState.isValidateMeiTan) {
10453
+ _context.next = 22;
10454
+ break;
10455
+ }
10456
+
10457
+ _context.next = 19;
10458
+ return s.goodsListState.verifyMeiTanFn(record);
10459
+
10460
+ case 19:
10461
+ _context.t0 = _context.sent;
10462
+
10463
+ if (!(_context.t0 === true)) {
10464
+ _context.next = 22;
10465
+ break;
10466
+ }
10467
+
10468
+ s.goodsListState.meiTanGoodIndex = [editGood.$index];
10469
+
10470
+ case 22:
10431
10471
  case "end":
10432
10472
  return _context.stop();
10433
10473
  }
@@ -31289,7 +31329,12 @@ var MeiTanModal = (function () {
31289
31329
  var _React$useState = React__default['default'].useState(null),
31290
31330
  _React$useState2 = _slicedToArray(_React$useState, 2),
31291
31331
  mainOption = _React$useState2[0],
31292
- setMainOption = _React$useState2[1]; // 监听煤炭种类变化
31332
+ setMainOption = _React$useState2[1];
31333
+
31334
+ var _React$useState3 = React__default['default'].useState(null),
31335
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
31336
+ subOption = _React$useState4[0],
31337
+ setSubOption = _React$useState4[1]; // 监听煤炭种类变化
31293
31338
 
31294
31339
 
31295
31340
  var mtzlDm = ktsComponentsAntdX4.Form.useWatch('mtzlDm', form);
@@ -31308,8 +31353,9 @@ var MeiTanModal = (function () {
31308
31353
  mtzlDm: undefined
31309
31354
  });
31310
31355
  setMainOption(null);
31356
+ setSubOption(null);
31311
31357
 
31312
- case 3:
31358
+ case 4:
31313
31359
  case "end":
31314
31360
  return _context.stop();
31315
31361
  }
@@ -31329,7 +31375,7 @@ var MeiTanModal = (function () {
31329
31375
 
31330
31376
 
31331
31377
  var onFinish = function onFinish(values) {
31332
- console.log('煤炭种类:', values);
31378
+ // console.log('煤炭种类:', values);
31333
31379
  controller.pipeline( /*#__PURE__*/function () {
31334
31380
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
31335
31381
  var _s$goodsListState$mei;
@@ -31339,7 +31385,9 @@ var MeiTanModal = (function () {
31339
31385
  while (1) {
31340
31386
  switch (_context2.prev = _context2.next) {
31341
31387
  case 0:
31342
- mtzl = values.mtzlDm;
31388
+ mtzl = subOption || mainOption || undefined; //values.mtzlDm;
31389
+
31390
+ console.log('煤炭种类', mtzl);
31343
31391
  goods = ((_s$goodsListState$mei = s.goodsListState.meiTanGoodIndex) === null || _s$goodsListState$mei === void 0 ? void 0 : _s$goodsListState$mei.map(function (e) {
31344
31392
  return s.goodsListState.goodsMap.get(e);
31345
31393
  })) || [];
@@ -31360,7 +31408,7 @@ var MeiTanModal = (function () {
31360
31408
  s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
31361
31409
  onClose();
31362
31410
 
31363
- case 7:
31411
+ case 8:
31364
31412
  case "end":
31365
31413
  return _context2.stop();
31366
31414
  }
@@ -31382,7 +31430,7 @@ var MeiTanModal = (function () {
31382
31430
  return Promise.reject(new Error('请选择选项')); // callback('请选择选项');
31383
31431
  }
31384
31432
 
31385
- if (value === '0200') {
31433
+ if (value === '0200' && !subOption) {
31386
31434
  return Promise.reject(new Error('请选择长协煤的子选项'));
31387
31435
  }
31388
31436
 
@@ -31393,17 +31441,18 @@ var MeiTanModal = (function () {
31393
31441
  var value = e.target.value;
31394
31442
  setMainOption(value);
31395
31443
 
31396
- if (value === 'A' || value === 'C') {
31397
- form.setFieldsValue({
31398
- mtzlDm: value
31399
- });
31400
- } else if (value === 'B') {
31401
- form.setFieldsValue({
31402
- mtzlDm: undefined
31403
- }); // 清空option,等待选择子选项
31444
+ if (value === '0100' || value === '0300') {
31445
+ //form.setFieldsValue({ mtzlDm: value });
31446
+ setSubOption(null);
31404
31447
  }
31405
31448
  };
31406
31449
 
31450
+ var handleSubOptionChange = function handleSubOptionChange(e) {
31451
+ var value = e.target.value;
31452
+ setSubOption(value);
31453
+ form.validateFields();
31454
+ };
31455
+
31407
31456
  return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Modal, {
31408
31457
  title: "\u6E29\u99A8\u63D0\u793A",
31409
31458
  destroyOnClose: true,
@@ -31467,12 +31516,8 @@ var MeiTanModal = (function () {
31467
31516
  color: 'red'
31468
31517
  }
31469
31518
  }, "*"), "\u8BF7\u9009\u62E9\u534F\u8BAE\u671F\u9650\uFF1A"), /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Radio.Group, {
31470
- value: mtzlDm,
31471
- onChange: function onChange(e) {
31472
- return form.setFieldsValue({
31473
- mtzlDm: e.target.value
31474
- });
31475
- }
31519
+ value: subOption,
31520
+ onChange: handleSubOptionChange
31476
31521
  }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Space, {
31477
31522
  direction: "vertical"
31478
31523
  }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Radio, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.248",
3
+ "version": "3.2.250",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -40,42 +40,139 @@ class MyInvoiceController extends InvoiceController {
40
40
  console.log(value, 'onBuyerNameBlur - Blur');
41
41
 
42
42
  return [
43
+ // {
44
+ // "taxCategoryCode": "1030206030000000000",
45
+ // "productName": "醋及醋代用品",
46
+ // "shorthand": "调味品",
47
+ // "id": null,
48
+ // "specification": null,
49
+ // "createTime": null,
50
+ // "status": 1,
51
+ // "versionCode": "48.0",
52
+ // "version": "32.0",
53
+ // "startTime": "20190401",
54
+ // "endTime": null,
55
+ // "cargo": null,
56
+ // "desc": null,
57
+ // "taxRate": "13%",
58
+ // "keyword": "食醋、米醋、酒醋、啤酒醋、麦芽醋、酒精醋、水果醋、醋精",
59
+ // "summarizedItem": "N",
60
+ // "countCode": null,
61
+ // "customsItem": null,
62
+ // "updateTime": null,
63
+ // "hzx": null,
64
+ // "children": null,
65
+ // "vatspecialManagement": "",
66
+ // "pid": "1030206000000000000",
67
+ // "vatpolicyBasis": null,
68
+ // "vatspecialManagementCode": "",
69
+ // "gstpolicyBasisCode": null,
70
+ // "gstspecialManagement": null,
71
+ // "gstpolicyBasis": null
72
+ // },
43
73
  {
44
- "taxCategoryCode": "1030206030000000000",
45
- "productName": "醋及醋代用品",
46
- "shorthand": "调味品",
47
- "id": null,
74
+ "attributeVOList": null,
75
+ "productName": '原煤',
76
+ "name": null,
77
+ "productCode": "0003",
78
+ "shorthand": "小型起重设备",
79
+ "id": "10881474649024102400167947617243",
48
80
  "specification": null,
49
- "createTime": null,
81
+ "categoryId": "10688389540499947520167487266471",
82
+ "categoryName": "水果",
83
+ "internalNumber": null,
84
+ "taxCategoryName": "轻小型起重设备配套件",
85
+ "referenceAmount": null,
86
+ "priceAmount": 200.000,
87
+ "taxId": null,
88
+ "taxRate": null,
89
+ "brandName": null,
90
+ "buyGroupCode": null,
91
+ "buyGroupId": null,
92
+ "buyGroupName": null,
93
+ "categoryId": 2073,
94
+ "categoryName": "通用",
95
+ "companyId": "41daec4c-baa2-451f-b756-e26067b8657c",
96
+ "createTime": "2021-09-10 15:45:43.0",
97
+ "enjoyPreferentialPolicies": 0,
98
+ "factoryCode": null,
99
+ "factoryId": null,
100
+ "factoryName": null,
101
+ "id": 146200,
102
+ "internalNumber": "发动机盖",
103
+ "isUalityInspection": null,
104
+ "name": "原煤",
105
+ "preferentialPoliciesType": null,
106
+ "priceAmount": 50,
107
+ "procurementCycle": 0,
108
+ "shorthand": "煤炭",
109
+ "specification": "abc",
110
+ "spuCode": "6000001738252675",
50
111
  "status": 1,
51
- "versionCode": "48.0",
52
- "version": "32.0",
53
- "startTime": "20190401",
54
- "endTime": null,
55
- "cargo": null,
56
- "desc": null,
57
- "taxRate": "13%",
58
- "keyword": "食醋、米醋、酒醋、啤酒醋、麦芽醋、酒精醋、水果醋、醋精",
59
- "summarizedItem": "N",
60
- "countCode": null,
61
- "customsItem": null,
62
- "updateTime": null,
63
- "hzx": null,
64
- "children": null,
65
- "vatspecialManagement": "",
66
- "pid": "1030206000000000000",
67
- "vatpolicyBasis": null,
68
- "vatspecialManagementCode": "",
69
- "gstpolicyBasisCode": null,
70
- "gstspecialManagement": null,
71
- "gstpolicyBasis": null
72
- }
112
+ "taxCategoryCode": "1020101000000000000",
113
+ "taxExemptionType": "",
114
+ "taxId": 11,
115
+ "taxRate": null,
116
+ "unitId": 30,
117
+ "unitName": "件",
118
+ "itemType": "通用",
119
+ "itemNo": "6000001738252675",
120
+ "itemName": "原煤",
121
+ "itemCode": "123123",
122
+ "itemModelName": "abc",
123
+ "unit": "件",
124
+ "priceIncludeTax": 50,
125
+ "priceExcludeTax": 50,
126
+ "taxClassificationCode": "1020101000000000000"
127
+ },
73
128
  ]
74
129
  };
75
130
 
76
131
  this.state.autoComplete.onItemNameSearch = async (value: any) => {
77
132
  console.log('===> onItemNameSearch')
78
133
  const data = [
134
+ {
135
+ "attributeVOList": null,
136
+ "productName": '原煤',
137
+ "brandName": null,
138
+ "buyGroupCode": null,
139
+ "buyGroupId": null,
140
+ "buyGroupName": null,
141
+ "categoryId": 2073,
142
+ "categoryName": "通用",
143
+ "companyId": "41daec4c-baa2-451f-b756-e26067b8657c",
144
+ "createTime": "2021-09-10 15:45:43.0",
145
+ "enjoyPreferentialPolicies": 0,
146
+ "factoryCode": null,
147
+ "factoryId": null,
148
+ "factoryName": null,
149
+ "id": 146200,
150
+ "internalNumber": "发动机盖",
151
+ "isUalityInspection": null,
152
+ "name": "原煤",
153
+ "preferentialPoliciesType": null,
154
+ "priceAmount": 50,
155
+ "procurementCycle": 0,
156
+ "shorthand": "发动机",
157
+ "specification": "abc",
158
+ "spuCode": "6000001738252675",
159
+ "status": 1,
160
+ "taxCategoryCode": "1020101000000000000",
161
+ "taxExemptionType": "",
162
+ "taxId": 11,
163
+ "taxRate": null,
164
+ "unitId": 30,
165
+ "unitName": "件",
166
+ "itemType": "通用",
167
+ "itemNo": "6000001738252675",
168
+ "itemName": "原煤",
169
+ "itemCode": "123123",
170
+ "itemModelName": "abc",
171
+ "unit": "件",
172
+ "priceIncludeTax": 50,
173
+ "priceExcludeTax": 50,
174
+ "taxClassificationCode": "1020101000000000000"
175
+ },
79
176
  {
80
177
  "taxCategoryCode": "1090111090000000000",
81
178
  "productName": "uuuuuu",
@@ -6,7 +6,7 @@ import { countAmountIncludeTax } from '../../tools/calculate';
6
6
  /**
7
7
  * 删除一个货物
8
8
  */
9
- export default async (s: InvoiceControllerState, record: any, controller:any) => {
9
+ export default async (s: InvoiceControllerState, record: any, controller: any) => {
10
10
  Object.keys(record).filter(e => !record[e] && record[e] !== 0).forEach(e => { delete record[e] });
11
11
 
12
12
  // 没用 被编辑的货物 和 form 就退出
@@ -18,7 +18,7 @@ export default async (s: InvoiceControllerState, record: any, controller:any) =>
18
18
  record.lineAmountIncludeTax = undefined;
19
19
 
20
20
  // 中间数据
21
- const between: any = {...record };
21
+ const between: any = { ...record };
22
22
 
23
23
  between.itemCode = record.itemCode;
24
24
  between.shorthand = record.shorthand;
@@ -32,6 +32,7 @@ export default async (s: InvoiceControllerState, record: any, controller:any) =>
32
32
  between.lineAmountExcludeTax = record.lineAmountExcludeTax;
33
33
  between.taxRate = record.taxRate;
34
34
  between.taxAmount = record.taxAmount;
35
+ between.mtzlDm = undefined;
35
36
 
36
37
  // 设置编辑货物
37
38
  const editGood: IGood = s.goodsListState.editGood = { ...s.goodsListState.editGood, ...between };
@@ -68,6 +69,12 @@ export default async (s: InvoiceControllerState, record: any, controller:any) =>
68
69
  s.goodsListState.isTaxIncluded
69
70
  ? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
70
71
  : await updateUnitPriceTax(controller, s.goodsListState.form, record)
72
+
73
+ if (s.goodsListState.isValidateMeiTan) {
74
+ if (await s.goodsListState.verifyMeiTanFn(record) === true) {
75
+ s.goodsListState.meiTanGoodIndex = [editGood.$index];
76
+ }
77
+ }
71
78
  }
72
79
 
73
80
  /** 货物单价,不含税 */
@@ -4,17 +4,18 @@ import { InvoiceControllerState, IGood } from '../';
4
4
  /**
5
5
  * 项目名称智能赋码
6
6
  */
7
- export default async (s: InvoiceControllerState, record: any, controller:any) => {
7
+ export default async (s: InvoiceControllerState, record: any, controller: any) => {
8
8
  Object.keys(record).filter(e => !record[e] && record[e] !== 0).forEach(e => { delete record[e] });
9
9
 
10
10
  // 没用 被编辑的货物 和 form 就退出
11
11
  if (!s.goodsListState.editGood || !s.goodsListState.form) return;
12
12
 
13
13
  // 中间数据
14
- const between: any = {...record };
14
+ const between: any = { ...record };
15
15
 
16
16
  between.taxClassificationCode = record.taxClassificationCode;
17
17
  between.shorthand = record.shorthand;
18
+ between.mtzlDm = undefined;
18
19
 
19
20
  // 设置编辑货物
20
21
  const editGood: IGood = s.goodsListState.editGood = { ...s.goodsListState.editGood, ...between };
@@ -35,6 +36,12 @@ export default async (s: InvoiceControllerState, record: any, controller:any) =>
35
36
  s.goodsListState.isTaxIncluded
36
37
  ? await updateUnitPriceExcludingTax(controller, s.goodsListState.form, record)
37
38
  : await updateUnitPriceTax(controller, s.goodsListState.form, record)
39
+
40
+ if (s.goodsListState.isValidateMeiTan) {
41
+ if (await s.goodsListState.verifyMeiTanFn(record) === true) {
42
+ s.goodsListState.meiTanGoodIndex = [editGood.$index];
43
+ }
44
+ }
38
45
  }
39
46
 
40
47
 
@@ -28,39 +28,94 @@ class MyInvoiceController extends InvoiceController {
28
28
  this.state.autoComplete.onItemNameBlur = async (value: any) => {
29
29
  console.log(value, 'onBuyerNameBlur - Blur');
30
30
 
31
- return new Promise((resolve, reject)=> {
32
- resolve([
33
- {
34
- "taxCategoryCode": "1030206030000000000",
35
- "productName": "醋及醋代用品",
36
- "shorthand": "调味品",
37
- "id": null,
38
- "specification": null,
39
- "createTime": null,
40
- "status": 1,
41
- "versionCode": "48.0",
42
- "version": "32.0",
43
- "startTime": "20190401",
44
- "endTime": null,
45
- "cargo": null,
46
- "desc": null,
47
- "taxRate": "13%",
48
- "keyword": "食醋、米醋、酒醋、啤酒醋、麦芽醋、酒精醋、水果醋、醋精",
49
- "summarizedItem": "N",
50
- "countCode": null,
51
- "customsItem": null,
52
- "updateTime": null,
53
- "hzx": null,
54
- "children": null,
55
- "vatspecialManagement": "",
56
- "pid": "1030206000000000000",
57
- "vatpolicyBasis": null,
58
- "vatspecialManagementCode": "",
59
- "gstpolicyBasisCode": null,
60
- "gstspecialManagement": null,
61
- "gstpolicyBasis": null
62
- }
63
- ]);
31
+ return new Promise((resolve, reject) => {
32
+ resolve([
33
+ // {
34
+ // "taxCategoryCode": "1030206030000000000",
35
+ // "productName": "醋及醋代用品",
36
+ // "shorthand": "调味品",
37
+ // "id": null,
38
+ // "specification": null,
39
+ // "createTime": null,
40
+ // "status": 1,
41
+ // "versionCode": "48.0",
42
+ // "version": "32.0",
43
+ // "startTime": "20190401",
44
+ // "endTime": null,
45
+ // "cargo": null,
46
+ // "desc": null,
47
+ // "taxRate": "13%",
48
+ // "keyword": "食醋、米醋、酒醋、啤酒醋、麦芽醋、酒精醋、水果醋、醋精",
49
+ // "summarizedItem": "N",
50
+ // "countCode": null,
51
+ // "customsItem": null,
52
+ // "updateTime": null,
53
+ // "hzx": null,
54
+ // "children": null,
55
+ // "vatspecialManagement": "",
56
+ // "pid": "1030206000000000000",
57
+ // "vatpolicyBasis": null,
58
+ // "vatspecialManagementCode": "",
59
+ // "gstpolicyBasisCode": null,
60
+ // "gstspecialManagement": null,
61
+ // "gstpolicyBasis": null
62
+ // },
63
+ {
64
+ "attributeVOList": null,
65
+ "productName": '原煤',
66
+ "name": null,
67
+ "productCode": "0003",
68
+ "shorthand": "小型起重设备",
69
+ "id": "10881474649024102400167947617243",
70
+ "specification": null,
71
+ "categoryId": "10688389540499947520167487266471",
72
+ "categoryName": "水果",
73
+ "internalNumber": null,
74
+ "taxCategoryName": "轻小型起重设备配套件",
75
+ "referenceAmount": null,
76
+ "priceAmount": 200.000,
77
+ "taxId": null,
78
+ "taxRate": null,
79
+ "brandName": null,
80
+ "buyGroupCode": null,
81
+ "buyGroupId": null,
82
+ "buyGroupName": null,
83
+ "categoryId": 2073,
84
+ "categoryName": "通用",
85
+ "companyId": "41daec4c-baa2-451f-b756-e26067b8657c",
86
+ "createTime": "2021-09-10 15:45:43.0",
87
+ "enjoyPreferentialPolicies": 0,
88
+ "factoryCode": null,
89
+ "factoryId": null,
90
+ "factoryName": null,
91
+ "id": 146200,
92
+ "internalNumber": "发动机盖",
93
+ "isUalityInspection": null,
94
+ "name": "原煤",
95
+ "preferentialPoliciesType": null,
96
+ "priceAmount": 50,
97
+ "procurementCycle": 0,
98
+ "shorthand": "煤炭",
99
+ "specification": "abc",
100
+ "spuCode": "6000001738252675",
101
+ "status": 1,
102
+ "taxCategoryCode": "1020101000000000000",
103
+ "taxExemptionType": "",
104
+ "taxId": 11,
105
+ "taxRate": null,
106
+ "unitId": 30,
107
+ "unitName": "件",
108
+ "itemType": "通用",
109
+ "itemNo": "6000001738252675",
110
+ "itemName": "原煤",
111
+ "itemCode": "123123",
112
+ "itemModelName": "abc",
113
+ "unit": "件",
114
+ "priceIncludeTax": 50,
115
+ "priceExcludeTax": 50,
116
+ "taxClassificationCode": "1020101000000000000"
117
+ },
118
+ ]);
64
119
 
65
120
  });
66
121
  //
@@ -127,19 +182,74 @@ class MyInvoiceController extends InvoiceController {
127
182
  "specialGoodsMark": "",
128
183
  "createTime": "2023-03-22 17:09:32",
129
184
  "updateTime": "2023-03-22 17:09:32"
130
- }
185
+ },
186
+ {
187
+ "attributeVOList": null,
188
+ "productName": '原煤',
189
+ "name": null,
190
+ "productCode": "0003",
191
+ "shorthand": "小型起重设备",
192
+ "id": "10881474649024102400167947617243",
193
+ "specification": null,
194
+ "categoryId": "10688389540499947520167487266471",
195
+ "categoryName": "水果",
196
+ "internalNumber": null,
197
+ "taxCategoryName": "轻小型起重设备配套件",
198
+ "referenceAmount": null,
199
+ "priceAmount": 200.000,
200
+ "taxId": null,
201
+ "taxRate": null,
202
+ "brandName": null,
203
+ "buyGroupCode": null,
204
+ "buyGroupId": null,
205
+ "buyGroupName": null,
206
+ "categoryId": 2073,
207
+ "categoryName": "通用",
208
+ "companyId": "41daec4c-baa2-451f-b756-e26067b8657c",
209
+ "createTime": "2021-09-10 15:45:43.0",
210
+ "enjoyPreferentialPolicies": 0,
211
+ "factoryCode": null,
212
+ "factoryId": null,
213
+ "factoryName": null,
214
+ "id": 146200,
215
+ "internalNumber": "发动机盖",
216
+ "isUalityInspection": null,
217
+ "name": "原煤",
218
+ "preferentialPoliciesType": null,
219
+ "priceAmount": 50,
220
+ "procurementCycle": 0,
221
+ "shorthand": "煤炭",
222
+ "specification": "abc",
223
+ "spuCode": "6000001738252675",
224
+ "status": 1,
225
+ "taxCategoryCode": "1020101000000000000",
226
+ "taxExemptionType": "",
227
+ "taxId": 11,
228
+ "taxRate": null,
229
+ "unitId": 30,
230
+ "unitName": "件",
231
+ "itemType": "通用",
232
+ "itemNo": "6000001738252675",
233
+ "itemName": "原煤",
234
+ "itemCode": "123123",
235
+ "itemModelName": "abc",
236
+ "unit": "件",
237
+ "priceIncludeTax": 50,
238
+ "priceExcludeTax": 50,
239
+ "taxClassificationCode": "1020101000000000000"
240
+ },
131
241
  ];
132
242
 
133
- return data.map((item: any) =>{
243
+ return data.map((item: any) => {
134
244
  return {
135
245
  ...data,
136
- itemName:item.productName,
137
- taxClassificationCode:item.taxCategoryCode,
138
- itemModelName:item.specification,
139
- shorthand:item.shorthand,
140
- priceIncludeTax:item.priceAmount,
141
- unit:item.unitName,
142
- taxRate:item.taxRate,
246
+ itemName: item.productName,
247
+ taxClassificationCode: item.taxCategoryCode,
248
+ itemModelName: item.specification,
249
+ shorthand: item.shorthand,
250
+ priceIncludeTax: item.priceAmount,
251
+ unit: item.unitName,
252
+ taxRate: item.taxRate,
143
253
  }
144
254
  })
145
255
  };
@@ -147,7 +257,7 @@ class MyInvoiceController extends InvoiceController {
147
257
  this.state.goodsListState.endowCode.onSearchTaxClassificationCode = async (value: any) => {
148
258
  console.log(value, 'value-onSearchTaxClassificationCode');
149
259
 
150
- if(value === '1020199000000000000') {
260
+ if (value === '1020199000000000000') {
151
261
  return [
152
262
  {
153
263
  "taxCategoryCode": "1020199000000000000",
@@ -217,7 +327,7 @@ class MyInvoiceController extends InvoiceController {
217
327
 
218
328
  this.state.goodsListState.endowCode.onLoadTaxClassificationCode = async (value: any) => {
219
329
  console.log(value, 'value-onSearchTaxClassificationCode');
220
- if(value === '1020199000000000000') {
330
+ if (value === '1020199000000000000') {
221
331
  return [
222
332
  {
223
333
  "taxCategoryCode": "1020199000000000000",
@@ -251,7 +361,7 @@ class MyInvoiceController extends InvoiceController {
251
361
  },
252
362
  ]
253
363
  }
254
- if(value === '3000000000000000000') {
364
+ if (value === '3000000000000000000') {
255
365
  return [
256
366
  {
257
367
  "taxCategoryCode": "3060000000000000000",
@@ -464,7 +574,7 @@ class MyInvoiceController extends InvoiceController {
464
574
  "gstpolicyBasis": null
465
575
  }
466
576
  ]
467
- } else if(value === '3060000000000000000') {
577
+ } else if (value === '3060000000000000000') {
468
578
  return [
469
579
  {
470
580
  "taxCategoryCode": "3060100000000000000",
@@ -587,7 +697,7 @@ class MyInvoiceController extends InvoiceController {
587
697
  "gstpolicyBasis": null
588
698
  }
589
699
  ]
590
- }else {
700
+ } else {
591
701
  return [
592
702
  {
593
703
  "taxCategoryCode": "3000000000000000000",
@@ -929,7 +1039,7 @@ const getMok = async (current: number = 1) => {
929
1039
  "taxCategoryCode": "1010301010000000000",
930
1040
  "taxExemptionType": "1",
931
1041
  "taxId": 1,
932
- "taxRate":null,
1042
+ "taxRate": null,
933
1043
  "unitId": null,
934
1044
  "unitName": null,
935
1045
  "itemType": "通用",
@@ -969,7 +1079,7 @@ const getMok = async (current: number = 1) => {
969
1079
  "taxCategoryCode": null,
970
1080
  "taxExemptionType": null,
971
1081
  "taxId": null,
972
- "taxRate":null,
1082
+ "taxRate": null,
973
1083
  "unitId": 362,
974
1084
  "unitName": "年",
975
1085
  "itemType": "分类cc>1",
@@ -1009,7 +1119,7 @@ const getMok = async (current: number = 1) => {
1009
1119
  "taxCategoryCode": "1060301020100000000",
1010
1120
  "taxExemptionType": null,
1011
1121
  "taxId": null,
1012
- "taxRate":null,
1122
+ "taxRate": null,
1013
1123
  "unitId": null,
1014
1124
  "unitName": null,
1015
1125
  "itemType": "通用",
@@ -1049,7 +1159,7 @@ const getMok = async (current: number = 1) => {
1049
1159
  "taxCategoryCode": "1010107010000000000",
1050
1160
  "taxExemptionType": "3",
1051
1161
  "taxId": 1,
1052
- "taxRate":null,
1162
+ "taxRate": null,
1053
1163
  "unitId": 32,
1054
1164
  "unitName": "把",
1055
1165
  "itemType": "通用",
@@ -1089,7 +1199,7 @@ const getMok = async (current: number = 1) => {
1089
1199
  "taxCategoryCode": "1000000000000000000",
1090
1200
  "taxExemptionType": null,
1091
1201
  "taxId": null,
1092
- "taxRate":null,
1202
+ "taxRate": null,
1093
1203
  "unitId": 11,
1094
1204
  "unitName": "包",
1095
1205
  "itemType": "通用",
@@ -1129,7 +1239,7 @@ const getMok = async (current: number = 1) => {
1129
1239
  "taxCategoryCode": "233WD5FG00911",
1130
1240
  "taxExemptionType": null,
1131
1241
  "taxId": null,
1132
- "taxRate":null,
1242
+ "taxRate": null,
1133
1243
  "unitId": 11,
1134
1244
  "unitName": "包",
1135
1245
  "itemType": "通用",
@@ -1169,7 +1279,7 @@ const getMok = async (current: number = 1) => {
1169
1279
  "taxCategoryCode": "233WD5FG00911",
1170
1280
  "taxExemptionType": null,
1171
1281
  "taxId": null,
1172
- "taxRate":null,
1282
+ "taxRate": null,
1173
1283
  "unitId": 11,
1174
1284
  "unitName": "包",
1175
1285
  "itemType": "通用",
@@ -1209,7 +1319,7 @@ const getMok = async (current: number = 1) => {
1209
1319
  "taxCategoryCode": "233WD5FG00911",
1210
1320
  "taxExemptionType": null,
1211
1321
  "taxId": null,
1212
- "taxRate":null,
1322
+ "taxRate": null,
1213
1323
  "unitId": 11,
1214
1324
  "unitName": "包",
1215
1325
  "itemType": "通用",
@@ -12,6 +12,7 @@ export default () => {
12
12
  const [form] = Form.useForm();
13
13
 
14
14
  const [mainOption, setMainOption] = React.useState(null);
15
+ const [subOption, setSubOption] = React.useState(null);
15
16
  // 监听煤炭种类变化
16
17
  const mtzlDm = Form.useWatch('mtzlDm', form);
17
18
 
@@ -22,6 +23,7 @@ export default () => {
22
23
  s.goodsListState.meiTanGoodIndex = [];
23
24
  form.setFieldsValue({ mtzlDm: undefined });
24
25
  setMainOption(null);
26
+ setSubOption(null);
25
27
  })();
26
28
  }, [controller]);
27
29
 
@@ -32,10 +34,11 @@ export default () => {
32
34
 
33
35
  // 表单
34
36
  const onFinish = (values: any) => {
35
- console.log('煤炭种类:', values);
37
+ // console.log('煤炭种类:', values);
36
38
 
37
39
  controller.pipeline(async (s) => {
38
- const mtzl = values.mtzlDm;
40
+ const mtzl = subOption || mainOption || undefined; //values.mtzlDm;
41
+ console.log('煤炭种类', mtzl)
39
42
  const goods = s.goodsListState.meiTanGoodIndex?.map(e => s.goodsListState.goodsMap.get(e)) || [];
40
43
  const editGood = s.goodsListState.editGood;
41
44
  const editGoodIndex = editGood?.$index;
@@ -55,14 +58,14 @@ export default () => {
55
58
  };
56
59
 
57
60
  // 自定义校验规则
58
- const validateOption = (_:any, value: any, callback: any) => {
61
+ const validateOption = (_: any, value: any, callback: any) => {
59
62
  console.log('自定义校验规则:', value);
60
63
  if (!value) {
61
64
  return Promise.reject(new Error('请选择选项'));
62
65
  // callback('请选择选项');
63
66
  }
64
67
 
65
- if (value === '0200') {
68
+ if (value === '0200' && !subOption) {
66
69
  return Promise.reject(new Error('请选择长协煤的子选项'));
67
70
  }
68
71
 
@@ -72,13 +75,21 @@ export default () => {
72
75
  const handleMainOptionChange = (e: any) => {
73
76
  const value = e.target.value;
74
77
  setMainOption(value);
75
- if (value === 'A' || value === 'C') {
76
- form.setFieldsValue({ mtzlDm: value });
77
- } else if (value === 'B') {
78
- form.setFieldsValue({ mtzlDm: undefined }); // 清空option,等待选择子选项
78
+ if (value === '0100' || value === '0300') {
79
+ //form.setFieldsValue({ mtzlDm: value });
80
+ setSubOption(null);
81
+ } else if (value === '0200') {
82
+ //form.setFieldsValue({ mtzlDm: undefined }); // 清空option,等待选择子选项
83
+ // setSubOption(null);
79
84
  }
80
85
  };
81
86
 
87
+ const handleSubOptionChange = (e: any) => {
88
+ const value = e.target.value;
89
+ setSubOption(value);
90
+ form.validateFields();
91
+ };
92
+
82
93
  return (
83
94
  <Modal
84
95
  title="温馨提示"
@@ -132,7 +143,7 @@ export default () => {
132
143
  <div style={{ marginBottom: 8, color: '#666', fontSize: 14 }}>
133
144
  <span style={{ color: 'red' }}>*</span>请选择协议期限:
134
145
  </div>
135
- <Radio.Group value={mtzlDm} onChange={(e) => form.setFieldsValue({ mtzlDm: e.target.value })}>
146
+ <Radio.Group value={subOption} onChange={handleSubOptionChange}>
136
147
  <Space direction="vertical">
137
148
  <Radio value="0201">协议期不足半年</Radio>
138
149
  <Radio value="0202">协议期在半年至一年之间</Radio>