kts-component-invoice-operate 3.2.32 → 3.2.34

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.
@@ -1,5 +1,7 @@
1
1
  /** 商品拖拽数据 */
2
2
  export default class Drag {
3
+ /** 是否启用拖拽 */
4
+ isStart: boolean;
3
5
  /** 当前拖动中的货品索引 */
4
6
  current?: string;
5
7
  /** 准备插入的货物索引 */
package/dist/index.esm.js CHANGED
@@ -990,6 +990,7 @@ var ProductComparison = /*#__PURE__*/_createClass(function ProductComparison() {
990
990
  var Drag = /*#__PURE__*/_createClass(function Drag() {
991
991
  _classCallCheck(this, Drag);
992
992
 
993
+ this.isStart = false;
993
994
  this.current = void 0;
994
995
  this.container = void 0;
995
996
  });
@@ -10619,7 +10620,7 @@ function ItemNameInput(props) {
10619
10620
  }
10620
10621
  }, "*", props.shorthand, "*"), React.createElement(AutoComplete$1, {
10621
10622
  onSearch: onSearch,
10622
- defaultValue: props.value,
10623
+ value: props.value,
10623
10624
  options: options.map(function (e) {
10624
10625
  return {
10625
10626
  value: e.itemName
@@ -10631,7 +10632,6 @@ function ItemNameInput(props) {
10631
10632
  height: '100%',
10632
10633
  border: 'none'
10633
10634
  },
10634
- value: props.value,
10635
10635
  onChange: onChange
10636
10636
  })));
10637
10637
  } // function removeNullUndefined(obj: Record<string, any>): Record<string, any> {
@@ -12257,6 +12257,11 @@ var useColumns = (function (form) {
12257
12257
  var model = controller.useMemo(function (e) {
12258
12258
  return e.model;
12259
12259
  }, []);
12260
+ /** 是否启用拖拽 */
12261
+
12262
+ var isStart = controller.useMemo(function (e) {
12263
+ return e.goodsListState.drag.isStart;
12264
+ }, []);
12260
12265
  /** 是否显示我方 */
12261
12266
 
12262
12267
  var isMyShow = controller.useMemo(function (e) {
@@ -13110,6 +13115,9 @@ var useColumns = (function (form) {
13110
13115
  } else {
13111
13116
  return !(e.key === 'priceIncludeTax' || e.key === 'lineAmountIncludeTax');
13112
13117
  }
13118
+ }) // 是否启动拖拽
13119
+ .filter(function (e) {
13120
+ return e.key !== 'drag' || isStart;
13113
13121
  }) // 只读
13114
13122
  .filter(function (e) {
13115
13123
  if (model === 'readOnly') {
@@ -13122,7 +13130,7 @@ var useColumns = (function (form) {
13122
13130
  ellipsis: true
13123
13131
  });
13124
13132
  });
13125
- }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide]);
13133
+ }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide, isStart]);
13126
13134
  return columns;
13127
13135
  });
13128
13136
  /** 字段 */
@@ -16827,6 +16835,7 @@ function ItemNameInput$1(props) {
16827
16835
  }
16828
16836
  }, "*", props.shorthand, "*"), React.createElement(AutoComplete$1, {
16829
16837
  onSearch: onSearch,
16838
+ value: props.value,
16830
16839
  options: options.map(function (e) {
16831
16840
  return {
16832
16841
  value: e.itemName
@@ -16837,7 +16846,6 @@ function ItemNameInput$1(props) {
16837
16846
  style: {
16838
16847
  height: '100%'
16839
16848
  },
16840
- value: props.value,
16841
16849
  onChange: onChange,
16842
16850
  suffix: props.suffix
16843
16851
  })));
@@ -18255,6 +18263,11 @@ var useColumns$1 = (function (form) {
18255
18263
  var editGood = controller.useMemo(function (e) {
18256
18264
  return e.goodsListState.editGood;
18257
18265
  }, []);
18266
+ /** 是否启用拖拽 */
18267
+
18268
+ var isStart = controller.useMemo(function (e) {
18269
+ return e.goodsListState.drag.isStart;
18270
+ }, []);
18258
18271
  /** 搜索条件 */
18259
18272
 
18260
18273
  var searchValue = controller.useMemo(function (e) {
@@ -19049,6 +19062,9 @@ var useColumns$1 = (function (form) {
19049
19062
  } else {
19050
19063
  return !(e.key === 'priceIncludeTax' || e.key === 'lineAmountIncludeTax');
19051
19064
  }
19065
+ }) // 是否启动拖拽
19066
+ .filter(function (e) {
19067
+ return e.key !== 'drag' || isStart;
19052
19068
  }) // 只读
19053
19069
  .filter(function (e) {
19054
19070
  if (model === 'readOnly') {
@@ -19061,7 +19077,7 @@ var useColumns$1 = (function (form) {
19061
19077
  ellipsis: true
19062
19078
  });
19063
19079
  });
19064
- }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish]); // React.useEffect(() => {
19080
+ }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, isStart]); // React.useEffect(() => {
19065
19081
  // clearTimeout(t)
19066
19082
  // const t = setTimeout(() => { setChangeField('') }, 1000);
19067
19083
  // return () => { clearTimeout(t) }
@@ -21246,14 +21262,17 @@ var DrawerBody$2 = function DrawerBody() {
21246
21262
  } // 导入FORM里
21247
21263
 
21248
21264
 
21249
- if (s.goodsListState.isMyShow) {
21250
- s.goodsListState.form.setFieldsValue(_objectSpread2(_objectSpread2({}, editGood), {}, {
21251
- itemName: editGood.itemNameSelf,
21252
- itemModelName: editGood.itemModelNameSelf
21253
- }));
21254
- } else {
21255
- s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
21256
- }
21265
+ s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood)); // if (s.goodsListState.isMyShow) {
21266
+ // s.goodsListState.form.setFieldsValue({
21267
+ // ...editGood,
21268
+ // itemName: editGood.itemNameSelf,
21269
+ // itemModelName: editGood.itemModelNameSelf,
21270
+ // });
21271
+ // } else {
21272
+ // s.goodsListState.form.setFieldsValue({
21273
+ // ...editGood,
21274
+ // });
21275
+ // }
21257
21276
 
21258
21277
  s.goodsListState.importGoods.isVisibleDrawer = false;
21259
21278
 
package/dist/index.js CHANGED
@@ -1000,6 +1000,7 @@ var ProductComparison = /*#__PURE__*/_createClass(function ProductComparison() {
1000
1000
  var Drag = /*#__PURE__*/_createClass(function Drag() {
1001
1001
  _classCallCheck(this, Drag);
1002
1002
 
1003
+ this.isStart = false;
1003
1004
  this.current = void 0;
1004
1005
  this.container = void 0;
1005
1006
  });
@@ -10629,7 +10630,7 @@ function ItemNameInput(props) {
10629
10630
  }
10630
10631
  }, "*", props.shorthand, "*"), React__default['default'].createElement(ktsXui.AutoComplete, {
10631
10632
  onSearch: onSearch,
10632
- defaultValue: props.value,
10633
+ value: props.value,
10633
10634
  options: options.map(function (e) {
10634
10635
  return {
10635
10636
  value: e.itemName
@@ -10641,7 +10642,6 @@ function ItemNameInput(props) {
10641
10642
  height: '100%',
10642
10643
  border: 'none'
10643
10644
  },
10644
- value: props.value,
10645
10645
  onChange: onChange
10646
10646
  })));
10647
10647
  } // function removeNullUndefined(obj: Record<string, any>): Record<string, any> {
@@ -12267,6 +12267,11 @@ var useColumns = (function (form) {
12267
12267
  var model = controller.useMemo(function (e) {
12268
12268
  return e.model;
12269
12269
  }, []);
12270
+ /** 是否启用拖拽 */
12271
+
12272
+ var isStart = controller.useMemo(function (e) {
12273
+ return e.goodsListState.drag.isStart;
12274
+ }, []);
12270
12275
  /** 是否显示我方 */
12271
12276
 
12272
12277
  var isMyShow = controller.useMemo(function (e) {
@@ -13120,6 +13125,9 @@ var useColumns = (function (form) {
13120
13125
  } else {
13121
13126
  return !(e.key === 'priceIncludeTax' || e.key === 'lineAmountIncludeTax');
13122
13127
  }
13128
+ }) // 是否启动拖拽
13129
+ .filter(function (e) {
13130
+ return e.key !== 'drag' || isStart;
13123
13131
  }) // 只读
13124
13132
  .filter(function (e) {
13125
13133
  if (model === 'readOnly') {
@@ -13132,7 +13140,7 @@ var useColumns = (function (form) {
13132
13140
  ellipsis: true
13133
13141
  });
13134
13142
  });
13135
- }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide]);
13143
+ }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide, isStart]);
13136
13144
  return columns;
13137
13145
  });
13138
13146
  /** 字段 */
@@ -16837,6 +16845,7 @@ function ItemNameInput$1(props) {
16837
16845
  }
16838
16846
  }, "*", props.shorthand, "*"), React__default['default'].createElement(ktsXui.AutoComplete, {
16839
16847
  onSearch: onSearch,
16848
+ value: props.value,
16840
16849
  options: options.map(function (e) {
16841
16850
  return {
16842
16851
  value: e.itemName
@@ -16847,7 +16856,6 @@ function ItemNameInput$1(props) {
16847
16856
  style: {
16848
16857
  height: '100%'
16849
16858
  },
16850
- value: props.value,
16851
16859
  onChange: onChange,
16852
16860
  suffix: props.suffix
16853
16861
  })));
@@ -18265,6 +18273,11 @@ var useColumns$1 = (function (form) {
18265
18273
  var editGood = controller.useMemo(function (e) {
18266
18274
  return e.goodsListState.editGood;
18267
18275
  }, []);
18276
+ /** 是否启用拖拽 */
18277
+
18278
+ var isStart = controller.useMemo(function (e) {
18279
+ return e.goodsListState.drag.isStart;
18280
+ }, []);
18268
18281
  /** 搜索条件 */
18269
18282
 
18270
18283
  var searchValue = controller.useMemo(function (e) {
@@ -19059,6 +19072,9 @@ var useColumns$1 = (function (form) {
19059
19072
  } else {
19060
19073
  return !(e.key === 'priceIncludeTax' || e.key === 'lineAmountIncludeTax');
19061
19074
  }
19075
+ }) // 是否启动拖拽
19076
+ .filter(function (e) {
19077
+ return e.key !== 'drag' || isStart;
19062
19078
  }) // 只读
19063
19079
  .filter(function (e) {
19064
19080
  if (model === 'readOnly') {
@@ -19071,7 +19087,7 @@ var useColumns$1 = (function (form) {
19071
19087
  ellipsis: true
19072
19088
  });
19073
19089
  });
19074
- }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish]); // React.useEffect(() => {
19090
+ }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, isStart]); // React.useEffect(() => {
19075
19091
  // clearTimeout(t)
19076
19092
  // const t = setTimeout(() => { setChangeField('') }, 1000);
19077
19093
  // return () => { clearTimeout(t) }
@@ -21256,14 +21272,17 @@ var DrawerBody$2 = function DrawerBody() {
21256
21272
  } // 导入FORM里
21257
21273
 
21258
21274
 
21259
- if (s.goodsListState.isMyShow) {
21260
- s.goodsListState.form.setFieldsValue(_objectSpread2(_objectSpread2({}, editGood), {}, {
21261
- itemName: editGood.itemNameSelf,
21262
- itemModelName: editGood.itemModelNameSelf
21263
- }));
21264
- } else {
21265
- s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
21266
- }
21275
+ s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood)); // if (s.goodsListState.isMyShow) {
21276
+ // s.goodsListState.form.setFieldsValue({
21277
+ // ...editGood,
21278
+ // itemName: editGood.itemNameSelf,
21279
+ // itemModelName: editGood.itemModelNameSelf,
21280
+ // });
21281
+ // } else {
21282
+ // s.goodsListState.form.setFieldsValue({
21283
+ // ...editGood,
21284
+ // });
21285
+ // }
21267
21286
 
21268
21287
  s.goodsListState.importGoods.isVisibleDrawer = false;
21269
21288
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.32",
3
+ "version": "3.2.34",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -2,6 +2,9 @@
2
2
  /** 商品拖拽数据 */
3
3
  export default class Drag {
4
4
 
5
+ /** 是否启用拖拽 */
6
+ isStart: boolean = false;
7
+
5
8
  /** 当前拖动中的货品索引 */
6
9
  current?: string;
7
10
 
@@ -65,6 +65,7 @@ class MyController1 extends Invoice.InvoiceController {
65
65
  super()
66
66
  this.state.model = 'default'
67
67
  this.state.goodsListState.isMergeDetails = true;
68
+ this.state.goodsListState.drag.isStart = true;
68
69
  }
69
70
 
70
71
  getTaxCategoryCodeList = this.pipeline(async (s) => {
@@ -90,6 +91,7 @@ class MyController2 extends Invoice.InvoiceController {
90
91
  super()
91
92
  this.state.model = 'prefab'
92
93
  this.state.goodsListState.isMergeDetails = true;
94
+ this.state.goodsListState.drag.isStart = true;
93
95
  }
94
96
 
95
97
  getTaxCategoryCodeList = this.pipeline(async (s) => {
@@ -1,7 +1,7 @@
1
1
 
2
2
  import React from 'react';
3
3
  import { Button } from 'kts-components-antd-x3/lib/radio';
4
- import { Invoice, IGood } from '../../../..';
4
+ import { Invoice, IGood } from '../../../../src';
5
5
  import { IGetBuyerListOption } from '../../../Invoice/InvoiceController/InvoiceControllerState/BuyerState';
6
6
 
7
7
  const InvoiceController = Invoice.InvoiceController
@@ -32,6 +32,9 @@ export default (form: WrappedFormUtils) => {
32
32
  /** 组件模式 */
33
33
  const model = controller.useMemo(e => e.model, []);
34
34
 
35
+ /** 是否启用拖拽 */
36
+ const isStart = controller.useMemo((e) => e.goodsListState.drag.isStart, []);
37
+
35
38
  /** 是否显示我方 */
36
39
  const isMyShow = controller.useMemo(e => e.goodsListState.isMyShow, []);
37
40
 
@@ -548,6 +551,8 @@ export default (form: WrappedFormUtils) => {
548
551
  return !(e.key === 'priceIncludeTax' || e.key === 'lineAmountIncludeTax');
549
552
  }
550
553
  })
554
+ // 是否启动拖拽
555
+ .filter(e => e.key !=='drag' || isStart)
551
556
  // 只读
552
557
  .filter(e => {
553
558
  if (model === 'readOnly') {
@@ -562,7 +567,7 @@ export default (form: WrappedFormUtils) => {
562
567
  ellipsis: true,
563
568
  };
564
569
  }) as any[];
565
- }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide]);
570
+ }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, columnshide, isStart]);
566
571
  return columns;
567
572
  };
568
573
 
@@ -99,8 +99,8 @@ export default function ItemNameInput(props: { onChange?: (e: ChangeEvent<HTMLIn
99
99
  return (
100
100
  <div className='kts-invoice-operate-goods-list-itemName-input'>
101
101
  {props.shorthand && <span style={{ alignSelf: 'center', fontSize: 12 }} >*{props.shorthand}*</span>}
102
- <AutoComplete onSearch={onSearch} defaultValue={props.value} options={options.map(e => ({ value: e.itemName }))} onChange={onChangeAutoComplete} >
103
- <Input style={{ height: '100%', border: 'none' }} value={props.value} onChange={onChange} />
102
+ <AutoComplete onSearch={onSearch} value={props.value} options={options.map(e => ({ value: e.itemName }))} onChange={onChangeAutoComplete} >
103
+ <Input style={{ height: '100%', border: 'none' }} onChange={onChange} />
104
104
  </AutoComplete>
105
105
  </div>
106
106
  )
@@ -27,10 +27,12 @@ export default () => {
27
27
  onClose={onClose}
28
28
  visible={visible}
29
29
  >
30
- {topExpand &&
30
+ {
31
+ topExpand &&
31
32
  <div style={{ marginBottom: 10 }} >
32
33
  {topExpand}
33
- </div>}
34
+ </div>
35
+ }
34
36
  <DrawerBody />
35
37
  </Drawer>
36
38
  );
@@ -98,17 +100,20 @@ const DrawerBody = () => {
98
100
  }
99
101
 
100
102
  // 导入FORM里
101
- if (s.goodsListState.isMyShow) {
102
- s.goodsListState.form.setFieldsValue({
103
- ...editGood,
104
- itemName: editGood.itemNameSelf,
105
- itemModelName: editGood.itemModelNameSelf,
106
- });
107
- } else {
108
- s.goodsListState.form.setFieldsValue({
109
- ...editGood,
110
- });
111
- }
103
+ s.goodsListState.form.setFieldsValue({
104
+ ...editGood,
105
+ });
106
+ // if (s.goodsListState.isMyShow) {
107
+ // s.goodsListState.form.setFieldsValue({
108
+ // ...editGood,
109
+ // itemName: editGood.itemNameSelf,
110
+ // itemModelName: editGood.itemModelNameSelf,
111
+ // });
112
+ // } else {
113
+ // s.goodsListState.form.setFieldsValue({
114
+ // ...editGood,
115
+ // });
116
+ // }
112
117
 
113
118
  s.goodsListState.importGoods.isVisibleDrawer = false;
114
119
  s.goodsListState.isTaxIncluded
@@ -165,6 +170,5 @@ const getItemNameOther = (record: any, editGood: IGood) => {
165
170
  // if (shorthand) {
166
171
  // return `*${shorthand}*${record.itemNameSelf}`;
167
172
  // }
168
-
169
173
  return record.itemName;
170
174
  }
@@ -38,6 +38,9 @@ export default (form: WrappedFormUtils) => {
38
38
  /** 正在编辑的货物 */
39
39
  const editGood = controller.useMemo((e) => e.goodsListState.editGood, []);
40
40
 
41
+ /** 是否启用拖拽 */
42
+ const isStart = controller.useMemo((e) => e.goodsListState.drag.isStart, []);
43
+
41
44
  /** 搜索条件 */
42
45
  const searchValue = controller.useMemo((e) => e.goodsListState.searchValue, []);
43
46
 
@@ -528,6 +531,8 @@ export default (form: WrappedFormUtils) => {
528
531
  return !(e.key === 'priceIncludeTax' || e.key === 'lineAmountIncludeTax');
529
532
  }
530
533
  })
534
+ // 是否启动拖拽
535
+ .filter(e => e.key !=='drag' || isStart)
531
536
  // 只读
532
537
  .filter(e => {
533
538
  if (model === 'readOnly') {
@@ -542,7 +547,7 @@ export default (form: WrappedFormUtils) => {
542
547
  ellipsis: true,
543
548
  };
544
549
  }) as any[];
545
- }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish]);
550
+ }, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue, model, columnsReplenish, isStart]);
546
551
 
547
552
  // React.useEffect(() => {
548
553
  // clearTimeout(t)
@@ -42,8 +42,8 @@ export default function ItemNameInput(props: {
42
42
  return (
43
43
  <div className='kts-invoice-operate-goods-list-itemName-input'>
44
44
  {props.shorthand && <span style={{ alignSelf: 'center', fontSize: 12 }} >*{props.shorthand}*</span>}
45
- <AutoComplete onSearch={onSearch} options={options.map(e => ({ value: e.itemName }))} onChange={onChangeAutoComplete} >
46
- <Input style={{ height: '100%' }} value={props.value} onChange={onChange} suffix={props.suffix} />
45
+ <AutoComplete onSearch={onSearch} value={props.value} options={options.map(e => ({ value: e.itemName }))} onChange={onChangeAutoComplete} >
46
+ <Input style={{ height: '100%' }} onChange={onChange} suffix={props.suffix} />
47
47
  </AutoComplete>
48
48
  </div>
49
49
  )