kts-component-invoice-operate 3.2.219-chinaship → 3.2.220-chinaship

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
@@ -1994,7 +1994,7 @@ var saveEditGood = /*#__PURE__*/(function () {
1994
1994
  switch (_context.prev = _context.next) {
1995
1995
  case 0:
1996
1996
  editGood = state.goodsListState.editGood;
1997
- form = state.goodsListState.form;
1997
+ form = state.goodsListState.form; // const isValidateGood = state.goodsListState.isValidateGood
1998
1998
 
1999
1999
  if (!(!editGood || !form || state.goodsListState.importGoods.isVisibleDrawer || state.calculatingField)) {
2000
2000
  _context.next = 4;
@@ -18278,7 +18278,7 @@ var StakeFarmerholder = decorator(Form.create())(function (props) {
18278
18278
  placeholder: "\u8BF7\u8F93\u5165\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801/\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7",
18279
18279
  autoComplete: "off"
18280
18280
  })))), /*#__PURE__*/React.createElement(Col, {
18281
- span: 10 + riskspanW,
18281
+ span: 10 + leqispanW,
18282
18282
  style: {
18283
18283
  display: isExpand ? undefined : 'none'
18284
18284
  }
@@ -18295,7 +18295,7 @@ var StakeFarmerholder = decorator(Form.create())(function (props) {
18295
18295
  placeholder: "\u8BF7\u8F93\u5165\u9500\u552E\u65B9\u5730\u5740",
18296
18296
  autoComplete: "off"
18297
18297
  })))), /*#__PURE__*/React.createElement(Col, {
18298
- span: 10 + riskspanW,
18298
+ span: 10 + leqispanW,
18299
18299
  style: {
18300
18300
  display: isExpand ? undefined : 'none'
18301
18301
  }
@@ -18323,7 +18323,22 @@ var StakeFarmerholder = decorator(Form.create())(function (props) {
18323
18323
  readOnly: isReadOnly('sellerBank'),
18324
18324
  placeholder: "\u8BF7\u8F93\u5165\u9500\u552E\u65B9\u5F00\u6237\u94F6\u884C",
18325
18325
  autoComplete: "off"
18326
- })))), /*#__PURE__*/React.createElement(Col, {
18326
+ })))), props.leqi && /*#__PURE__*/React.createElement(Col, {
18327
+ span: 4,
18328
+ style: {
18329
+ display: isExpand ? undefined : 'none'
18330
+ }
18331
+ }, /*#__PURE__*/React.createElement(Form.Item, {
18332
+ colon: false
18333
+ }, getFieldDecorator('sellerAddressPhoneFlag', {
18334
+ valuePropName: 'checked'
18335
+ })( /*#__PURE__*/React.createElement(Checkbox$1, {
18336
+ onChange: props === null || props === void 0 ? void 0 : props.invoiceMarkCallback,
18337
+ disabled: isReadOnly('sellerAddressPhoneFlag'),
18338
+ style: {
18339
+ whiteSpace: 'nowrap'
18340
+ }
18341
+ }, "\u662F\u5426\u5C55\u793A")))), /*#__PURE__*/React.createElement(Col, {
18327
18342
  span: 10 + leqispanW,
18328
18343
  style: {
18329
18344
  display: isExpand ? undefined : 'none'
@@ -18418,7 +18433,7 @@ var StakeFarmerholder = decorator(Form.create())(function (props) {
18418
18433
  placeholder: "\u8BF7\u8F93\u5165\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801/\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7",
18419
18434
  autoComplete: "off"
18420
18435
  })))), /*#__PURE__*/React.createElement(Col, {
18421
- span: 10 + riskspanW,
18436
+ span: 10 + leqispanW,
18422
18437
  style: {
18423
18438
  display: isExpand ? undefined : 'none'
18424
18439
  }
@@ -18435,7 +18450,7 @@ var StakeFarmerholder = decorator(Form.create())(function (props) {
18435
18450
  placeholder: "\u8BF7\u8F93\u5165\u8D2D\u4E70\u65B9\u5730\u5740",
18436
18451
  autoComplete: "off"
18437
18452
  })))), /*#__PURE__*/React.createElement(Col, {
18438
- span: 10 + riskspanW,
18453
+ span: 10 + leqispanW,
18439
18454
  style: {
18440
18455
  display: isExpand ? undefined : 'none'
18441
18456
  }
@@ -18468,6 +18483,20 @@ var StakeFarmerholder = decorator(Form.create())(function (props) {
18468
18483
  style: {
18469
18484
  display: isExpand ? undefined : 'none'
18470
18485
  }
18486
+ }, /*#__PURE__*/React.createElement(Form.Item, {
18487
+ label: "\u8D2D\u4E70\u65B9\u5F00\u6237\u94F6\u884C",
18488
+ colon: false
18489
+ }, getFieldDecorator('buyerBank', {
18490
+ rules: getRules('buyerBank', RULES$1.bankName('购买方开户银行'))
18491
+ })( /*#__PURE__*/React.createElement(MyInput$2, {
18492
+ readOnly: isReadOnly('buyerBank'),
18493
+ placeholder: "\u8BF7\u8F93\u5165\u8D2D\u4E70\u65B9\u5F00\u6237\u94F6\u884C",
18494
+ autoComplete: "off"
18495
+ })))), /*#__PURE__*/React.createElement(Col, {
18496
+ span: 10 + leqispanW,
18497
+ style: {
18498
+ display: isExpand ? undefined : 'none'
18499
+ }
18471
18500
  }, /*#__PURE__*/React.createElement(Form.Item, {
18472
18501
  label: "\u94F6\u884C\u8D26\u53F7",
18473
18502
  colon: false
@@ -18842,7 +18871,7 @@ var css_248z$j = ".kts-invoice-operate-goods-table-virtual .ktsAntX-table-body {
18842
18871
  styleInject(css_248z$j);
18843
18872
 
18844
18873
  function TableVirtual$1 (props) {
18845
- var _props$dataSource2;
18874
+ var _props$dataSource4, _props$dataSource5;
18846
18875
 
18847
18876
  var _React$useState = React.useState(null),
18848
18877
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -18884,8 +18913,10 @@ function TableVirtual$1 (props) {
18884
18913
  }, [self, tableBody]); // 设置占位dom的搞
18885
18914
 
18886
18915
  var placeholderHeight = React.useMemo(function () {
18887
- if (!self || !rowHeight || !props.dataSource || !placeholder) return;
18888
- var placeholderHeight = rowHeight * props.dataSource.length;
18916
+ var _props$dataSource = props.dataSource,
18917
+ dataSource = _props$dataSource === void 0 ? [] : _props$dataSource;
18918
+ if (!self || !rowHeight || !dataSource || !placeholder) return;
18919
+ var placeholderHeight = rowHeight * dataSource.length;
18889
18920
  placeholder.style.height = "".concat(placeholderHeight, "px");
18890
18921
  return placeholderHeight;
18891
18922
  }, [self, rowHeight, props.dataSource, placeholder]);
@@ -18897,12 +18928,12 @@ function TableVirtual$1 (props) {
18897
18928
  }, [tableBody, rowHeight, placeholderHeight]); // 计算渲染的行
18898
18929
 
18899
18930
  var dataSource = React.useMemo(function () {
18900
- var _props$dataSource;
18931
+ var _props$dataSource2;
18901
18932
 
18902
18933
  if (!props.dataSource) return [];
18903
18934
  if (props.dataSource.length < 10) return props.dataSource;
18904
18935
  if (!rowSize) return [props.dataSource[0]];
18905
- return (_props$dataSource = props.dataSource) === null || _props$dataSource === void 0 ? void 0 : _props$dataSource.slice(pointer, pointer + 2 * rowSize);
18936
+ return (_props$dataSource2 = props.dataSource) === null || _props$dataSource2 === void 0 ? void 0 : _props$dataSource2.slice(pointer, pointer + 2 * rowSize);
18906
18937
  }, [props.dataSource, pointer, rowSize]); // 监听滚动
18907
18938
 
18908
18939
  React.useEffect(function () {
@@ -18921,17 +18952,24 @@ function TableVirtual$1 (props) {
18921
18952
  }, [self, placeholder, props.dataSource, rowHeight, rowSize]); // 移动列表
18922
18953
 
18923
18954
  React.useEffect(function () {
18955
+ var _props$dataSource3;
18956
+
18924
18957
  if (!self) return;
18925
18958
  var table = self.querySelector('.ktsAntX-table .ktsAntX-table-body>table');
18926
18959
  if (!table) return;
18927
- table.style.top = "".concat(pointer * rowHeight, "px");
18928
- }, [pointer, self, rowHeight]);
18960
+
18961
+ if ((((_props$dataSource3 = props.dataSource) === null || _props$dataSource3 === void 0 ? void 0 : _props$dataSource3.length) || 0) < 10) {
18962
+ table.style.top = '0px';
18963
+ } else {
18964
+ table.style.top = "".concat(pointer * rowHeight, "px");
18965
+ }
18966
+ }, [pointer, self, rowHeight, (_props$dataSource4 = props.dataSource) === null || _props$dataSource4 === void 0 ? void 0 : _props$dataSource4.length]);
18929
18967
  React.useEffect(function () {
18930
18968
  if (!self) return;
18931
18969
  var cont = self.querySelector('.kts-invoice-operate-goods-table-virtual .ktsAntX-table-body');
18932
18970
  if (!cont) return;
18933
18971
  cont.scrollTop = 0;
18934
- }, [(_props$dataSource2 = props.dataSource) === null || _props$dataSource2 === void 0 ? void 0 : _props$dataSource2.length]);
18972
+ }, [(_props$dataSource5 = props.dataSource) === null || _props$dataSource5 === void 0 ? void 0 : _props$dataSource5.length]);
18935
18973
  return /*#__PURE__*/React.createElement("span", {
18936
18974
  className: "kts-invoice-operate-goods-table-virtual",
18937
18975
  ref: function ref(e) {
@@ -19190,18 +19228,30 @@ function _addGood$1() {
19190
19228
  _context4.next = 6;
19191
19229
  return controller.run( /*#__PURE__*/function () {
19192
19230
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
19193
- var _controller$state$goo;
19231
+ var isValidateGood, _controller$state$goo;
19194
19232
 
19195
19233
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
19196
19234
  while (1) {
19197
19235
  switch (_context3.prev = _context3.next) {
19198
19236
  case 0:
19199
19237
  if (!s.goodsListState.editGood) {
19200
- _context3.next = 3;
19238
+ _context3.next = 5;
19201
19239
  break;
19202
19240
  }
19203
19241
 
19204
- _context3.next = 3;
19242
+ // message.error({
19243
+ // content: '你正在编辑一个货物',
19244
+ // key: '你正在编辑一个货物',
19245
+ // });
19246
+ // return;
19247
+ isValidateGood = controller.state.goodsListState.isValidateGood;
19248
+
19249
+ if (!isValidateGood) {
19250
+ _context3.next = 5;
19251
+ break;
19252
+ }
19253
+
19254
+ _context3.next = 5;
19205
19255
  return (_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.validateFields( /*#__PURE__*/function () {
19206
19256
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
19207
19257
  var firstError;
@@ -19234,17 +19284,17 @@ function _addGood$1() {
19234
19284
  };
19235
19285
  }());
19236
19286
 
19237
- case 3:
19238
- _context3.next = 5;
19287
+ case 5:
19288
+ _context3.next = 7;
19239
19289
  return controller.addGood({
19240
19290
  taxRate: s.goodsListState.defaultRate,
19241
19291
  lineAttribute: LineAttributeType$1.正常
19242
19292
  });
19243
19293
 
19244
- case 5:
19294
+ case 7:
19245
19295
  s.goodsListState.editGood = _context3.sent;
19246
19296
 
19247
- case 6:
19297
+ case 8:
19248
19298
  case "end":
19249
19299
  return _context3.stop();
19250
19300
  }
package/dist/index.js CHANGED
@@ -2004,7 +2004,7 @@ var saveEditGood = /*#__PURE__*/(function () {
2004
2004
  switch (_context.prev = _context.next) {
2005
2005
  case 0:
2006
2006
  editGood = state.goodsListState.editGood;
2007
- form = state.goodsListState.form;
2007
+ form = state.goodsListState.form; // const isValidateGood = state.goodsListState.isValidateGood
2008
2008
 
2009
2009
  if (!(!editGood || !form || state.goodsListState.importGoods.isVisibleDrawer || state.calculatingField)) {
2010
2010
  _context.next = 4;
@@ -18288,7 +18288,7 @@ var StakeFarmerholder = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create()
18288
18288
  placeholder: "\u8BF7\u8F93\u5165\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801/\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7",
18289
18289
  autoComplete: "off"
18290
18290
  })))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
18291
- span: 10 + riskspanW,
18291
+ span: 10 + leqispanW,
18292
18292
  style: {
18293
18293
  display: isExpand ? undefined : 'none'
18294
18294
  }
@@ -18305,7 +18305,7 @@ var StakeFarmerholder = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create()
18305
18305
  placeholder: "\u8BF7\u8F93\u5165\u9500\u552E\u65B9\u5730\u5740",
18306
18306
  autoComplete: "off"
18307
18307
  })))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
18308
- span: 10 + riskspanW,
18308
+ span: 10 + leqispanW,
18309
18309
  style: {
18310
18310
  display: isExpand ? undefined : 'none'
18311
18311
  }
@@ -18333,7 +18333,22 @@ var StakeFarmerholder = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create()
18333
18333
  readOnly: isReadOnly('sellerBank'),
18334
18334
  placeholder: "\u8BF7\u8F93\u5165\u9500\u552E\u65B9\u5F00\u6237\u94F6\u884C",
18335
18335
  autoComplete: "off"
18336
- })))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
18336
+ })))), props.leqi && /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
18337
+ span: 4,
18338
+ style: {
18339
+ display: isExpand ? undefined : 'none'
18340
+ }
18341
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
18342
+ colon: false
18343
+ }, getFieldDecorator('sellerAddressPhoneFlag', {
18344
+ valuePropName: 'checked'
18345
+ })( /*#__PURE__*/React__default['default'].createElement(ktsXui.Checkbox, {
18346
+ onChange: props === null || props === void 0 ? void 0 : props.invoiceMarkCallback,
18347
+ disabled: isReadOnly('sellerAddressPhoneFlag'),
18348
+ style: {
18349
+ whiteSpace: 'nowrap'
18350
+ }
18351
+ }, "\u662F\u5426\u5C55\u793A")))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
18337
18352
  span: 10 + leqispanW,
18338
18353
  style: {
18339
18354
  display: isExpand ? undefined : 'none'
@@ -18428,7 +18443,7 @@ var StakeFarmerholder = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create()
18428
18443
  placeholder: "\u8BF7\u8F93\u5165\u7EDF\u4E00\u793E\u4F1A\u4FE1\u7528\u4EE3\u7801/\u7EB3\u7A0E\u4EBA\u8BC6\u522B\u53F7",
18429
18444
  autoComplete: "off"
18430
18445
  })))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
18431
- span: 10 + riskspanW,
18446
+ span: 10 + leqispanW,
18432
18447
  style: {
18433
18448
  display: isExpand ? undefined : 'none'
18434
18449
  }
@@ -18445,7 +18460,7 @@ var StakeFarmerholder = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create()
18445
18460
  placeholder: "\u8BF7\u8F93\u5165\u8D2D\u4E70\u65B9\u5730\u5740",
18446
18461
  autoComplete: "off"
18447
18462
  })))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
18448
- span: 10 + riskspanW,
18463
+ span: 10 + leqispanW,
18449
18464
  style: {
18450
18465
  display: isExpand ? undefined : 'none'
18451
18466
  }
@@ -18478,6 +18493,20 @@ var StakeFarmerholder = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create()
18478
18493
  style: {
18479
18494
  display: isExpand ? undefined : 'none'
18480
18495
  }
18496
+ }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
18497
+ label: "\u8D2D\u4E70\u65B9\u5F00\u6237\u94F6\u884C",
18498
+ colon: false
18499
+ }, getFieldDecorator('buyerBank', {
18500
+ rules: getRules('buyerBank', RULES$1.bankName('购买方开户银行'))
18501
+ })( /*#__PURE__*/React__default['default'].createElement(MyInput$2, {
18502
+ readOnly: isReadOnly('buyerBank'),
18503
+ placeholder: "\u8BF7\u8F93\u5165\u8D2D\u4E70\u65B9\u5F00\u6237\u94F6\u884C",
18504
+ autoComplete: "off"
18505
+ })))), /*#__PURE__*/React__default['default'].createElement(ktsXui.Col, {
18506
+ span: 10 + leqispanW,
18507
+ style: {
18508
+ display: isExpand ? undefined : 'none'
18509
+ }
18481
18510
  }, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
18482
18511
  label: "\u94F6\u884C\u8D26\u53F7",
18483
18512
  colon: false
@@ -18852,7 +18881,7 @@ var css_248z$j = ".kts-invoice-operate-goods-table-virtual .ktsAntX-table-body {
18852
18881
  styleInject(css_248z$j);
18853
18882
 
18854
18883
  function TableVirtual$1 (props) {
18855
- var _props$dataSource2;
18884
+ var _props$dataSource4, _props$dataSource5;
18856
18885
 
18857
18886
  var _React$useState = React__default['default'].useState(null),
18858
18887
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -18894,8 +18923,10 @@ function TableVirtual$1 (props) {
18894
18923
  }, [self, tableBody]); // 设置占位dom的搞
18895
18924
 
18896
18925
  var placeholderHeight = React__default['default'].useMemo(function () {
18897
- if (!self || !rowHeight || !props.dataSource || !placeholder) return;
18898
- var placeholderHeight = rowHeight * props.dataSource.length;
18926
+ var _props$dataSource = props.dataSource,
18927
+ dataSource = _props$dataSource === void 0 ? [] : _props$dataSource;
18928
+ if (!self || !rowHeight || !dataSource || !placeholder) return;
18929
+ var placeholderHeight = rowHeight * dataSource.length;
18899
18930
  placeholder.style.height = "".concat(placeholderHeight, "px");
18900
18931
  return placeholderHeight;
18901
18932
  }, [self, rowHeight, props.dataSource, placeholder]);
@@ -18907,12 +18938,12 @@ function TableVirtual$1 (props) {
18907
18938
  }, [tableBody, rowHeight, placeholderHeight]); // 计算渲染的行
18908
18939
 
18909
18940
  var dataSource = React__default['default'].useMemo(function () {
18910
- var _props$dataSource;
18941
+ var _props$dataSource2;
18911
18942
 
18912
18943
  if (!props.dataSource) return [];
18913
18944
  if (props.dataSource.length < 10) return props.dataSource;
18914
18945
  if (!rowSize) return [props.dataSource[0]];
18915
- return (_props$dataSource = props.dataSource) === null || _props$dataSource === void 0 ? void 0 : _props$dataSource.slice(pointer, pointer + 2 * rowSize);
18946
+ return (_props$dataSource2 = props.dataSource) === null || _props$dataSource2 === void 0 ? void 0 : _props$dataSource2.slice(pointer, pointer + 2 * rowSize);
18916
18947
  }, [props.dataSource, pointer, rowSize]); // 监听滚动
18917
18948
 
18918
18949
  React__default['default'].useEffect(function () {
@@ -18931,17 +18962,24 @@ function TableVirtual$1 (props) {
18931
18962
  }, [self, placeholder, props.dataSource, rowHeight, rowSize]); // 移动列表
18932
18963
 
18933
18964
  React__default['default'].useEffect(function () {
18965
+ var _props$dataSource3;
18966
+
18934
18967
  if (!self) return;
18935
18968
  var table = self.querySelector('.ktsAntX-table .ktsAntX-table-body>table');
18936
18969
  if (!table) return;
18937
- table.style.top = "".concat(pointer * rowHeight, "px");
18938
- }, [pointer, self, rowHeight]);
18970
+
18971
+ if ((((_props$dataSource3 = props.dataSource) === null || _props$dataSource3 === void 0 ? void 0 : _props$dataSource3.length) || 0) < 10) {
18972
+ table.style.top = '0px';
18973
+ } else {
18974
+ table.style.top = "".concat(pointer * rowHeight, "px");
18975
+ }
18976
+ }, [pointer, self, rowHeight, (_props$dataSource4 = props.dataSource) === null || _props$dataSource4 === void 0 ? void 0 : _props$dataSource4.length]);
18939
18977
  React__default['default'].useEffect(function () {
18940
18978
  if (!self) return;
18941
18979
  var cont = self.querySelector('.kts-invoice-operate-goods-table-virtual .ktsAntX-table-body');
18942
18980
  if (!cont) return;
18943
18981
  cont.scrollTop = 0;
18944
- }, [(_props$dataSource2 = props.dataSource) === null || _props$dataSource2 === void 0 ? void 0 : _props$dataSource2.length]);
18982
+ }, [(_props$dataSource5 = props.dataSource) === null || _props$dataSource5 === void 0 ? void 0 : _props$dataSource5.length]);
18945
18983
  return /*#__PURE__*/React__default['default'].createElement("span", {
18946
18984
  className: "kts-invoice-operate-goods-table-virtual",
18947
18985
  ref: function ref(e) {
@@ -19200,18 +19238,30 @@ function _addGood$1() {
19200
19238
  _context4.next = 6;
19201
19239
  return controller.run( /*#__PURE__*/function () {
19202
19240
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
19203
- var _controller$state$goo;
19241
+ var isValidateGood, _controller$state$goo;
19204
19242
 
19205
19243
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
19206
19244
  while (1) {
19207
19245
  switch (_context3.prev = _context3.next) {
19208
19246
  case 0:
19209
19247
  if (!s.goodsListState.editGood) {
19210
- _context3.next = 3;
19248
+ _context3.next = 5;
19211
19249
  break;
19212
19250
  }
19213
19251
 
19214
- _context3.next = 3;
19252
+ // message.error({
19253
+ // content: '你正在编辑一个货物',
19254
+ // key: '你正在编辑一个货物',
19255
+ // });
19256
+ // return;
19257
+ isValidateGood = controller.state.goodsListState.isValidateGood;
19258
+
19259
+ if (!isValidateGood) {
19260
+ _context3.next = 5;
19261
+ break;
19262
+ }
19263
+
19264
+ _context3.next = 5;
19215
19265
  return (_controller$state$goo = controller.state.goodsListState.form) === null || _controller$state$goo === void 0 ? void 0 : _controller$state$goo.validateFields( /*#__PURE__*/function () {
19216
19266
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
19217
19267
  var firstError;
@@ -19244,17 +19294,17 @@ function _addGood$1() {
19244
19294
  };
19245
19295
  }());
19246
19296
 
19247
- case 3:
19248
- _context3.next = 5;
19297
+ case 5:
19298
+ _context3.next = 7;
19249
19299
  return controller.addGood({
19250
19300
  taxRate: s.goodsListState.defaultRate,
19251
19301
  lineAttribute: LineAttributeType$1.正常
19252
19302
  });
19253
19303
 
19254
- case 5:
19304
+ case 7:
19255
19305
  s.goodsListState.editGood = _context3.sent;
19256
19306
 
19257
- case 6:
19307
+ case 8:
19258
19308
  case "end":
19259
19309
  return _context3.stop();
19260
19310
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.219-chinaship",
3
+ "version": "3.2.220-chinaship",
4
4
  "scripts": {
5
5
  "dev": "dumi dev --max-old-space-size=6096",
6
6
  "start": "dumi dev",
@@ -3,8 +3,8 @@
3
3
  ## 简单用法
4
4
  <code src="./_test/easiest/index.tsx"></code>
5
5
 
6
- ## 建筑服务
7
- <code src="./_test/architecture/index.tsx"></code>
6
+ <!-- ## 建筑服务
7
+ <code src="./_test/architecture/index.tsx"></code> -->
8
8
 
9
9
  <!-- ## 只读模式
10
10
  <code src="./_test/readOnly/index.tsx"></code> -->
@@ -38,5 +38,5 @@
38
38
 
39
39
  -->
40
40
 
41
- ## 货物运输服务
42
- <code src="./_test/freight/index.tsx"></code>
41
+ <!-- ## 货物运输服务
42
+ <code src="./_test/freight/index.tsx"></code> -->
@@ -4,10 +4,10 @@ import { InvoiceControllerState } from '../';
4
4
  * 保存正在编辑的货物
5
5
  */
6
6
  export default async (state: InvoiceControllerState) => {
7
-
7
+
8
8
  const editGood = state.goodsListState.editGood;
9
9
  const form = state.goodsListState.form;
10
-
10
+ // const isValidateGood = state.goodsListState.isValidateGood
11
11
  if (!editGood || !form || state.goodsListState.importGoods.isVisibleDrawer || state.calculatingField) return;
12
12
  if ((await validateFields(form)).err) return;
13
13
 
@@ -1,6 +1,6 @@
1
1
  # 默认
2
2
 
3
- ## 简单用法
3
+ <!-- ## 简单用法
4
4
  <code src="./_test/easiest/index.tsx"></code>
5
5
 
6
6
  ## 设置为草稿,设置默认参数 扩展按钮
@@ -53,4 +53,4 @@
53
53
  <API name="GoodsList 商品列表 API" exports='["default"]' src="./ui/default/GoodsList/index.tsx"></API>
54
54
  <API name="Buyer 购买方 API" exports='["default"]' src="./ui/default/Buyer/index.tsx"></API>
55
55
  <API name="Seller 销售方 API" exports='["default"]' src="./ui/default/Seller/index.tsx"></API>
56
- <API name="Sign 落款 API" exports='["default"]' src="./ui/default/Sign/index.tsx"></API>
56
+ <API name="Sign 落款 API" exports='["default"]' src="./ui/default/Sign/index.tsx"></API> -->
@@ -257,6 +257,7 @@ export default (form: WrappedFormUtils) => {
257
257
  { pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/, message: '数量必须为数字' },
258
258
  {
259
259
  validator: async (_, value, callback) => {
260
+
260
261
  if (isValidateGood) {
261
262
  await controller.wait();
262
263
  const isvalue = !!value || value === 0;
@@ -54,16 +54,19 @@ async function addGood(controller: InvoiceController) {
54
54
  // key: '你正在编辑一个货物',
55
55
  // });
56
56
  // return;
57
- await controller.state.goodsListState.form?.validateFields(async (err: any, values: any) => {
58
- if (err) {
59
- const firstError: any = Object.values(err)[0];
60
- message.error({
61
- content: firstError.errors[0].message,
62
- key: '你正在编辑一个货物',
63
- });
64
- return;
65
- }
66
- });
57
+ const isValidateGood = controller.state.goodsListState.isValidateGood;
58
+ if (isValidateGood) {
59
+ await controller.state.goodsListState.form?.validateFields(async (err: any, values: any) => {
60
+ if (err) {
61
+ const firstError: any = Object.values(err)[0];
62
+ message.error({
63
+ content: firstError.errors[0].message,
64
+ key: '你正在编辑一个货物',
65
+ });
66
+ return;
67
+ }
68
+ });
69
+ }
67
70
  }
68
71
  s.goodsListState.editGood = await controller.addGood({ taxRate: s.goodsListState.defaultRate, lineAttribute: LineAttributeType.正常 });
69
72
  });
@@ -40,8 +40,9 @@ export default function <T extends object = any>(props: TableProps<T>) {
40
40
 
41
41
  // 设置占位dom的搞
42
42
  const placeholderHeight = React.useMemo(() => {
43
- if (!self || !rowHeight || !props.dataSource || !placeholder) return;
44
- const placeholderHeight = rowHeight * props.dataSource.length;
43
+ const { dataSource = [] } = props
44
+ if (!self || !rowHeight || !dataSource || !placeholder) return;
45
+ const placeholderHeight = rowHeight * dataSource.length;
45
46
  placeholder.style.height = `${placeholderHeight}px`;
46
47
  return placeholderHeight;
47
48
  }, [self, rowHeight, props.dataSource, placeholder]);
@@ -80,19 +81,23 @@ export default function <T extends object = any>(props: TableProps<T>) {
80
81
 
81
82
  // 移动列表
82
83
  React.useEffect(() => {
83
- if (!self) return;
84
+ if (!self) return
84
85
 
85
86
  const table = self.querySelector('.ktsAntX-table .ktsAntX-table-body>table') as HTMLDivElement;
87
+
86
88
  if (!table) return;
89
+ if ((props.dataSource?.length || 0) < 10) {
90
+ table.style.top = '0px';
91
+ } else {
92
+ table.style.top = `${pointer * rowHeight}px`;
93
+ }
87
94
 
88
- table.style.top = `${pointer * rowHeight}px`;
89
- }, [pointer, self, rowHeight]);
95
+ }, [pointer, self, rowHeight, props.dataSource?.length]);
90
96
 
91
97
  React.useEffect(() => {
92
98
  if (!self) return;
93
99
  const cont = self.querySelector('.kts-invoice-operate-goods-table-virtual .ktsAntX-table-body');
94
100
  if (!cont) return;
95
-
96
101
  cont.scrollTop = 0;
97
102
  }, [props.dataSource?.length])
98
103
 
@@ -30,7 +30,7 @@ const RULES = {
30
30
  { pattern: /^[0-9\s\-\+]+$/g, message: `${label}仅能数字、空格、-、+` }
31
31
  ],
32
32
  sellerTelPhone: (label: string) => [
33
-
33
+
34
34
  { max: 100, message: `${label}内容超长` },
35
35
  { pattern: /^[0-9\s\-\+]+$/g, message: `${label}仅能数字、空格、-、+` }
36
36
  ],
@@ -206,7 +206,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
206
206
  </Form.Item>
207
207
  </Col>
208
208
 
209
- <Col span={10+riskspanW} style={{ display: isExpand ? undefined : 'none' }} >
209
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
210
210
  <Form.Item label='销售方地址' colon={false}>
211
211
  {getFieldDecorator('sellerAddress', {
212
212
  rules: getRules('sellerAddress', [{ max: 300, message: '销售方地址内容超长' }])
@@ -214,7 +214,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
214
214
  </Form.Item>
215
215
  </Col>
216
216
 
217
- <Col span={10+riskspanW} style={{ display: isExpand ? undefined : 'none' }} >
217
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
218
218
  <Form.Item label='电话' colon={false} className='telephone' >
219
219
  {getFieldDecorator('sellerPhone', {
220
220
  rules: getRules('sellerPhone', RULES.sellerTelPhone('销售方电话'))
@@ -229,7 +229,15 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
229
229
  })(<MyInput readOnly={isReadOnly('sellerBank')} placeholder="请输入销售方开户银行" autoComplete="off" />)}
230
230
  </Form.Item>
231
231
  </Col>
232
-
232
+ {(props.leqi) &&
233
+ <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
234
+ <Form.Item colon={false}>
235
+ {getFieldDecorator('sellerAddressPhoneFlag', {
236
+ valuePropName: 'checked',
237
+ })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('sellerAddressPhoneFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
238
+ </Form.Item>
239
+ </Col>
240
+ }
233
241
  <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
234
242
  <Form.Item label='银行账号' colon={false}>
235
243
  {getFieldDecorator('sellerAccount', {
@@ -241,8 +249,8 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
241
249
  <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
242
250
  <Form.Item colon={false}>
243
251
  {getFieldDecorator('sellerBankAccountFlag', {
244
- valuePropName: 'checked',
245
- })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('sellerBankAccountFlag')} style={{whiteSpace:'nowrap'}}>是否展示</Checkbox>)}
252
+ valuePropName: 'checked',
253
+ })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('sellerBankAccountFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
246
254
  </Form.Item>
247
255
  </Col>
248
256
  }
@@ -313,7 +321,7 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
313
321
  </Form.Item>
314
322
  </Col>
315
323
 
316
- <Col span={10+riskspanW} style={{ display: isExpand ? undefined : 'none' }} >
324
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
317
325
  <Form.Item label='购买方地址' colon={false}>
318
326
  {getFieldDecorator('buyerAddress', {
319
327
  rules: getRules('buyerAddress', [{ max: 100, message: '购买方地址内容超长' }])
@@ -321,14 +329,20 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
321
329
  </Form.Item>
322
330
  </Col>
323
331
 
324
- <Col span={10+riskspanW} style={{ display: isExpand ? undefined : 'none' }} >
332
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
325
333
  <Form.Item label='电话' colon={false} className='telephone'>
326
334
  {getFieldDecorator('buyerPhone', {
327
335
  rules: getRules('buyerPhone', RULES.buyerTelPhone('购买方电话'))
328
336
  })(<MyInput readOnly={isReadOnly('buyerPhone')} placeholder="请输入电话" autoComplete="off" />)}
329
337
  </Form.Item>
330
338
  </Col>
331
-
339
+ <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
340
+ <Form.Item label='购买方开户银行' colon={false}>
341
+ {getFieldDecorator('buyerBank', {
342
+ rules: getRules('buyerBank', RULES.bankName('购买方开户银行'))
343
+ })(<MyInput readOnly={isReadOnly('buyerBank')} placeholder="请输入购买方开户银行" autoComplete="off" />)}
344
+ </Form.Item>
345
+ </Col>
332
346
  <Col span={10 + leqispanW} style={{ display: isExpand ? undefined : 'none' }} >
333
347
  <Form.Item label='购买方开户银行' colon={false}>
334
348
  {getFieldDecorator('buyerBank', {
@@ -346,10 +360,10 @@ export default decorator<IStakeholder, IStakeholder & FormComponentProps>(Form.c
346
360
  </Col>
347
361
  {(props.leqi || props.riskData?.code === 'success') &&
348
362
  <Col span={4} style={{ display: isExpand ? undefined : 'none' }}>
349
- <Form.Item colon={false}>
363
+ <Form.Item colon={false}>
350
364
  {getFieldDecorator('buyerBankAccountFlag', {
351
365
  valuePropName: 'checked',
352
- })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('buyerBankAccountFlag')} style={{whiteSpace:'nowrap'}}>是否展示</Checkbox>)}
366
+ })(<Checkbox onChange={props?.invoiceMarkCallback} disabled={isReadOnly('buyerBankAccountFlag')} style={{ whiteSpace: 'nowrap' }}>是否展示</Checkbox>)}
353
367
  </Form.Item>
354
368
  </Col>
355
369
  }
@@ -414,19 +428,19 @@ function BuyerNameInput(props: InputProps & { fieldName: string; myform: Wrapped
414
428
  const onSearch = React.useCallback(async (searchText: string) => {
415
429
  await Discontinue.start();
416
430
  try {
417
- if (fieldName === 'buyerName' ) {
431
+ if (fieldName === 'buyerName') {
418
432
  if (autoComplete.onBuyerNameSearch) {
419
433
  setOptions(await autoComplete.onBuyerNameSearch(searchText));
420
434
  }
421
- } else if (fieldName === 'buyerTaxId' ) {
435
+ } else if (fieldName === 'buyerTaxId') {
422
436
  if (autoComplete.onBuyerTaxIdSearch) {
423
437
  setOptions(await autoComplete.onBuyerTaxIdSearch(searchText));
424
438
  }
425
- }else if(fieldName === 'supplierName'){
439
+ } else if (fieldName === 'supplierName') {
426
440
  if (autoComplete.onSupplierNameSearch) {
427
441
  setOptions(await autoComplete.onSupplierNameSearch(searchText));
428
442
  }
429
- }else if(fieldName === 'supplierTaxId'){
443
+ } else if (fieldName === 'supplierTaxId') {
430
444
  if (autoComplete.onSupplierTaxIdSearch) {
431
445
  setOptions(await autoComplete.onSupplierTaxIdSearch(searchText));
432
446
  }