kts-component-invoice-operate 3.2.8 → 3.2.10

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
@@ -14388,14 +14388,14 @@ var SignDigtal = decorator(Form.create())(function (props) {
14388
14388
  className: "kts-invoice-operate-sign-digtal-readOnly"
14389
14389
  }, React.createElement("div", {
14390
14390
  className: 'sign-digtal-readOnly-cont'
14391
- }, React.createElement("div", null, React.createElement("span", null, "\u5907"), React.createElement("span", null, "\u6CE8")), React.createElement("div", null, getFieldDecorator('remark', {
14391
+ }, React.createElement("div", null, React.createElement("span", null, "\u5907"), React.createElement("span", null, "\u6CE8")), React.createElement("div", null, getFieldDecorator('remarks', {
14392
14392
  initialValue: props.defaultRemark
14393
14393
  })(React.createElement(MyDiv$1, null)))), React.createElement(Form, {
14394
14394
  layout: 'inline',
14395
14395
  className: 'digtal-readOnly-form'
14396
14396
  }, React.createElement(Form.Item, {
14397
14397
  label: "\u5F00\u7968\u4EBA"
14398
- }, getFieldDecorator('issuer', {
14398
+ }, getFieldDecorator('drawer', {
14399
14399
  initialValue: props.defaultRemark
14400
14400
  })(React.createElement(MyDiv$1, null)))));
14401
14401
  } else {
@@ -17740,6 +17740,7 @@ var useAddDiscountRowButton$1 = (function () {
17740
17740
  while (1) {
17741
17741
  switch (_context.prev = _context.next) {
17742
17742
  case 0:
17743
+ // 不能给编辑状态的行增加折扣!
17743
17744
  isOk = s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0;
17744
17745
 
17745
17746
  if (!isOk) {
@@ -17772,6 +17773,7 @@ var useAddDiscountRowButton$1 = (function () {
17772
17773
  return _context.abrupt("return");
17773
17774
 
17774
17775
  case 7:
17776
+ // 不允许重复添加折扣
17775
17777
  isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
17776
17778
  var _s$goodsListState$goo2;
17777
17779
 
@@ -17790,43 +17792,61 @@ var useAddDiscountRowButton$1 = (function () {
17790
17792
  return _context.abrupt("return");
17791
17793
 
17792
17794
  case 11:
17795
+ if (!(areAllValuesEqual(s.goodsListState.selectedGoodIndex.map(function (e) {
17796
+ var _s$goodsListState$goo3;
17797
+
17798
+ return (_s$goodsListState$goo3 = s.goodsListState.goodsMap.get(e)) === null || _s$goodsListState$goo3 === void 0 ? void 0 : _s$goodsListState$goo3.taxRate;
17799
+ })) === false)) {
17800
+ _context.next = 14;
17801
+ break;
17802
+ }
17803
+
17804
+ message$1.error({
17805
+ content: '存在不同税率,不允许同时添加折扣',
17806
+ key: '存在不同税率,不允许同时添加折扣'
17807
+ });
17808
+ return _context.abrupt("return");
17809
+
17810
+ case 14:
17811
+ // 添加折扣时项目金额不能为空或零
17793
17812
  isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
17794
17813
  var good = s.goodsListState.goodsMap.get($index);
17795
- return !good || good.taxRate === 0 && s.goodsListState.endowCode.isTaxFreeTypeNeeded && !good.taxFreeType;
17814
+ return "".concat(good === null || good === void 0 ? void 0 : good.lineAmountIncludeTax) === '0';
17796
17815
  });
17797
17816
 
17798
17817
  if (!isOk) {
17799
- _context.next = 15;
17818
+ _context.next = 18;
17800
17819
  break;
17801
17820
  }
17802
17821
 
17803
17822
  message$1.error({
17804
- content: '零税率需要设置免税类型,请在赋码中设置!',
17805
- key: '零税率需要设置免税类型,请在赋码中设置!'
17823
+ content: '添加折扣时项目金额不能为空或零',
17824
+ key: '添加折扣时项目金额不能为空或零'
17806
17825
  });
17807
17826
  return _context.abrupt("return");
17808
17827
 
17809
- case 15:
17828
+ case 18:
17829
+ // 零税率需要设置免税类型,请在赋码中设置!
17810
17830
  isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
17811
17831
  var good = s.goodsListState.goodsMap.get($index);
17812
- return "".concat(good === null || good === void 0 ? void 0 : good.lineAmountIncludeTax) === '0';
17832
+ return !good || good.taxRate === 0 && s.goodsListState.endowCode.isTaxFreeTypeNeeded && !good.taxFreeType;
17813
17833
  });
17814
17834
 
17815
17835
  if (!isOk) {
17816
- _context.next = 19;
17836
+ _context.next = 22;
17817
17837
  break;
17818
17838
  }
17819
17839
 
17820
17840
  message$1.error({
17821
- content: '金额为0不能添加折扣行',
17822
- key: '金额为0不能添加折扣行'
17841
+ content: '零税率需要设置免税类型,请在赋码中设置!',
17842
+ key: '零税率需要设置免税类型,请在赋码中设置!'
17823
17843
  });
17824
17844
  return _context.abrupt("return");
17825
17845
 
17826
- case 19:
17846
+ case 22:
17827
17847
  s.goodsListState.discountGoodIndex = s.goodsListState.selectedGoodIndex.slice();
17828
17848
 
17829
- case 20:
17849
+ case 23:
17830
17850
  case "end":
17831
17851
  return _context.stop();
17832
17852
  }
@@ -18224,6 +18244,18 @@ function isContinuityNum(array) {
18224
18244
 
18225
18245
  return isContinuation;
18226
18246
  }
18247
+ /** 数组的值是否相等 */
18248
+
18249
+
18250
+ function areAllValuesEqual(arr) {
18251
+ for (var i = 1; i < arr.length; i++) {
18252
+ if (arr[i] !== arr[0]) {
18253
+ return false;
18254
+ }
18255
+ }
18256
+
18257
+ return true;
18258
+ }
18227
18259
 
18228
18260
  var useEndowCodeButton$1 = (function () {
18229
18261
  var controller = Invoice.useInvoiceController();
package/dist/index.js CHANGED
@@ -14398,14 +14398,14 @@ var SignDigtal = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(funct
14398
14398
  className: "kts-invoice-operate-sign-digtal-readOnly"
14399
14399
  }, React__default['default'].createElement("div", {
14400
14400
  className: 'sign-digtal-readOnly-cont'
14401
- }, React__default['default'].createElement("div", null, React__default['default'].createElement("span", null, "\u5907"), React__default['default'].createElement("span", null, "\u6CE8")), React__default['default'].createElement("div", null, getFieldDecorator('remark', {
14401
+ }, React__default['default'].createElement("div", null, React__default['default'].createElement("span", null, "\u5907"), React__default['default'].createElement("span", null, "\u6CE8")), React__default['default'].createElement("div", null, getFieldDecorator('remarks', {
14402
14402
  initialValue: props.defaultRemark
14403
14403
  })(React__default['default'].createElement(MyDiv$1, null)))), React__default['default'].createElement(ktsComponentsAntdX3.Form, {
14404
14404
  layout: 'inline',
14405
14405
  className: 'digtal-readOnly-form'
14406
14406
  }, React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
14407
14407
  label: "\u5F00\u7968\u4EBA"
14408
- }, getFieldDecorator('issuer', {
14408
+ }, getFieldDecorator('drawer', {
14409
14409
  initialValue: props.defaultRemark
14410
14410
  })(React__default['default'].createElement(MyDiv$1, null)))));
14411
14411
  } else {
@@ -17750,6 +17750,7 @@ var useAddDiscountRowButton$1 = (function () {
17750
17750
  while (1) {
17751
17751
  switch (_context.prev = _context.next) {
17752
17752
  case 0:
17753
+ // 不能给编辑状态的行增加折扣!
17753
17754
  isOk = s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0;
17754
17755
 
17755
17756
  if (!isOk) {
@@ -17782,6 +17783,7 @@ var useAddDiscountRowButton$1 = (function () {
17782
17783
  return _context.abrupt("return");
17783
17784
 
17784
17785
  case 7:
17786
+ // 不允许重复添加折扣
17785
17787
  isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
17786
17788
  var _s$goodsListState$goo2;
17787
17789
 
@@ -17800,43 +17802,61 @@ var useAddDiscountRowButton$1 = (function () {
17800
17802
  return _context.abrupt("return");
17801
17803
 
17802
17804
  case 11:
17805
+ if (!(areAllValuesEqual(s.goodsListState.selectedGoodIndex.map(function (e) {
17806
+ var _s$goodsListState$goo3;
17807
+
17808
+ return (_s$goodsListState$goo3 = s.goodsListState.goodsMap.get(e)) === null || _s$goodsListState$goo3 === void 0 ? void 0 : _s$goodsListState$goo3.taxRate;
17809
+ })) === false)) {
17810
+ _context.next = 14;
17811
+ break;
17812
+ }
17813
+
17814
+ ktsXui.message.error({
17815
+ content: '存在不同税率,不允许同时添加折扣',
17816
+ key: '存在不同税率,不允许同时添加折扣'
17817
+ });
17818
+ return _context.abrupt("return");
17819
+
17820
+ case 14:
17821
+ // 添加折扣时项目金额不能为空或零
17803
17822
  isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
17804
17823
  var good = s.goodsListState.goodsMap.get($index);
17805
- return !good || good.taxRate === 0 && s.goodsListState.endowCode.isTaxFreeTypeNeeded && !good.taxFreeType;
17824
+ return "".concat(good === null || good === void 0 ? void 0 : good.lineAmountIncludeTax) === '0';
17806
17825
  });
17807
17826
 
17808
17827
  if (!isOk) {
17809
- _context.next = 15;
17828
+ _context.next = 18;
17810
17829
  break;
17811
17830
  }
17812
17831
 
17813
17832
  ktsXui.message.error({
17814
- content: '零税率需要设置免税类型,请在赋码中设置!',
17815
- key: '零税率需要设置免税类型,请在赋码中设置!'
17833
+ content: '添加折扣时项目金额不能为空或零',
17834
+ key: '添加折扣时项目金额不能为空或零'
17816
17835
  });
17817
17836
  return _context.abrupt("return");
17818
17837
 
17819
- case 15:
17838
+ case 18:
17839
+ // 零税率需要设置免税类型,请在赋码中设置!
17820
17840
  isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
17821
17841
  var good = s.goodsListState.goodsMap.get($index);
17822
- return "".concat(good === null || good === void 0 ? void 0 : good.lineAmountIncludeTax) === '0';
17842
+ return !good || good.taxRate === 0 && s.goodsListState.endowCode.isTaxFreeTypeNeeded && !good.taxFreeType;
17823
17843
  });
17824
17844
 
17825
17845
  if (!isOk) {
17826
- _context.next = 19;
17846
+ _context.next = 22;
17827
17847
  break;
17828
17848
  }
17829
17849
 
17830
17850
  ktsXui.message.error({
17831
- content: '金额为0不能添加折扣行',
17832
- key: '金额为0不能添加折扣行'
17851
+ content: '零税率需要设置免税类型,请在赋码中设置!',
17852
+ key: '零税率需要设置免税类型,请在赋码中设置!'
17833
17853
  });
17834
17854
  return _context.abrupt("return");
17835
17855
 
17836
- case 19:
17856
+ case 22:
17837
17857
  s.goodsListState.discountGoodIndex = s.goodsListState.selectedGoodIndex.slice();
17838
17858
 
17839
- case 20:
17859
+ case 23:
17840
17860
  case "end":
17841
17861
  return _context.stop();
17842
17862
  }
@@ -18234,6 +18254,18 @@ function isContinuityNum(array) {
18234
18254
 
18235
18255
  return isContinuation;
18236
18256
  }
18257
+ /** 数组的值是否相等 */
18258
+
18259
+
18260
+ function areAllValuesEqual(arr) {
18261
+ for (var i = 1; i < arr.length; i++) {
18262
+ if (arr[i] !== arr[0]) {
18263
+ return false;
18264
+ }
18265
+ }
18266
+
18267
+ return true;
18268
+ }
18237
18269
 
18238
18270
  var useEndowCodeButton$1 = (function () {
18239
18271
  var controller = Invoice.useInvoiceController();
@@ -0,0 +1,12 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" viewBox="0 0 16 15">
2
+ <g clip-path="url(#clip0_715_360)">
3
+ <path d="M8 14.5312C4.11687 14.5312 0.96875 11.3831 0.96875 7.5C0.96875 3.61687 4.11687 0.46875 8 0.46875C11.8831 0.46875 15.0312 3.61687 15.0312 7.5C15.0312 11.3831 11.8831 14.5312 8 14.5312ZM8 13.5938C11.3656 13.5938 14.0938 10.8656 14.0938 7.5C14.0938 4.13438 11.3656 1.40625 8 1.40625C4.63438 1.40625 1.90625 4.13438 1.90625 7.5C1.90625 10.8656 4.63438 13.5938 8 13.5938Z"/>
4
+ <path d="M4.25 7.96875C4.12568 7.96875 4.00645 7.91936 3.91854 7.83146C3.83064 7.74355 3.78125 7.62432 3.78125 7.5C3.78125 7.37568 3.83064 7.25645 3.91854 7.16854C4.00645 7.08064 4.12568 7.03125 4.25 7.03125H11.75C11.8743 7.03125 11.9935 7.08064 12.0815 7.16854C12.1694 7.25645 12.2188 7.37568 12.2188 7.5C12.2188 7.62432 12.1694 7.74355 12.0815 7.83146C11.9935 7.91936 11.8743 7.96875 11.75 7.96875H4.25Z"/>
5
+ <path d="M7.53125 3.75C7.53125 3.62568 7.58064 3.50645 7.66854 3.41854C7.75645 3.33064 7.87568 3.28125 8 3.28125C8.12432 3.28125 8.24355 3.33064 8.33146 3.41854C8.41936 3.50645 8.46875 3.62568 8.46875 3.75V11.25C8.46875 11.3743 8.41936 11.4935 8.33146 11.5815C8.24355 11.6694 8.12432 11.7188 8 11.7188C7.87568 11.7188 7.75645 11.6694 7.66854 11.5815C7.58064 11.4935 7.53125 11.3743 7.53125 11.25V3.75Z"/>
6
+ </g>
7
+ <defs>
8
+ <clipPath id="clip0_715_360">
9
+ <rect width="15" height="15" transform="translate(0.5)"/>
10
+ </clipPath>
11
+ </defs>
12
+ </svg>