kts-component-invoice-operate 2.0.13 → 2.0.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "2.0.13",
3
+ "version": "2.0.16",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -2,8 +2,9 @@
2
2
  import React from "react";
3
3
  import { Row, Col, Input, Button, message } from "kts-components-antd-x3";
4
4
  import { Form, Drawer } from "kts-xui";
5
- import { Invoice } from "../../../";
5
+ import { Invoice, IGood } from "../../../";
6
6
  import { getSN } from "../../tools/itemName";
7
+ import { LineAttributeType } from "../../InvoiceController";
7
8
 
8
9
  export default function AddComparisonDrawer() {
9
10
 
@@ -32,13 +33,22 @@ export default function AddComparisonDrawer() {
32
33
  try {
33
34
  const values = await form.validateFields()
34
35
  const shorthand = s.goodsListState.isMyShow ? getSN(good.itemNameSelf)?.shorthand : getSN(good.itemName)?.shorthand;
35
-
36
- good.itemCode = values.itemCode;
37
- good.itemCodeSelf = values.itemCodeSelf;
38
- good.itemName = shorthand ? `*${shorthand}*${values.itemName}` : values.itemName;
39
- good.itemNameSelf = shorthand ? `*${shorthand}*${values.itemNameSelf}` : values.itemNameSelf;
40
- good.itemModelName = values.itemModelName;
41
- good.itemModelNameSelf = values.itemModelNameSelf;
36
+ const setGood = (good: IGood) => {
37
+ good.itemCode = values.itemCode;
38
+ good.itemCodeSelf = values.itemCodeSelf;
39
+ good.itemName = shorthand ? `*${shorthand}*${values.itemName}` : values.itemName;
40
+ good.itemNameSelf = shorthand ? `*${shorthand}*${values.itemNameSelf}` : values.itemNameSelf;
41
+ good.itemModelName = values.itemModelName;
42
+ good.itemModelNameSelf = values.itemModelNameSelf;
43
+ }
44
+
45
+ setGood(good);
46
+
47
+ if (good.lineAttribute !== LineAttributeType.正常) {
48
+ const c = good.lineAttribute === LineAttributeType.折扣行 ? -1 : good.lineAttribute === LineAttributeType.被折扣行 ? 1 : 0
49
+ const g = s.goodsListState.goodsList[s.goodsListState.goodsList.indexOf(good) + c]
50
+ setGood(g);
51
+ }
42
52
 
43
53
  s.goodsListState.addComparisonIndex = undefined;
44
54
  s.goodsListState.goodsList = [...s.goodsListState.goodsList];
@@ -329,26 +329,26 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
329
329
  });
330
330
 
331
331
  //截取名称
332
- if (endowCodeGood.some(e => bytesLnegth(e?.itemName || '') > 92)) {
333
- await (() => new Promise<void>(resolve => {
334
- confirm({
335
- title: '温馨提示',
336
- content: '商品名称长度过长,是否截取名称',
337
- okText: '确定',
338
- cancelText: '取消',
339
- onOk() {
340
- endowCodeGood.forEach(e => {
341
- if (e && e.itemName) { e.itemName = cutStr(e.itemName, 91) }
342
- })
343
- message.success('商品名称截取成功!')
344
- resolve()
345
- },
346
- onCancel() {
347
- resolve()
348
- },
349
- });
350
- }))()
351
- }
332
+ // if (endowCodeGood.some(e => bytesLnegth(e?.itemName || '') > 92)) {
333
+ // await (() => new Promise<void>(resolve => {
334
+ // confirm({
335
+ // title: '温馨提示',
336
+ // content: '商品名称长度过长,是否截取名称',
337
+ // okText: '确定',
338
+ // cancelText: '取消',
339
+ // onOk() {
340
+ // endowCodeGood.forEach(e => {
341
+ // if (e && e.itemName) { e.itemName = cutStr(e.itemName, 91) }
342
+ // })
343
+ // message.success('商品名称截取成功!')
344
+ // resolve()
345
+ // },
346
+ // onCancel() {
347
+ // resolve()
348
+ // },
349
+ // });
350
+ // }))()
351
+ // }
352
352
 
353
353
  s.goodsListState.goodsList = s.goodsListState.goodsList.slice();
354
354
  s.goodsListState.endowCode.endowcodeGoodIndex = [];
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { Form, AutoComplete, Select, Typography, Button, Input, Spin } from 'kts-components-antd-x3';
2
+ import { Form, AutoComplete, Select, Typography, Button, Input, Spin, Tooltip } from 'kts-components-antd-x3';
3
3
  import { InputProps } from 'kts-components-antd-x3/lib/input';
4
4
  import { WrappedFormUtils } from 'kts-components-antd-x3/lib/form/Form';
5
5
  import { IGood } from '../../../../InvoiceController';
@@ -174,7 +174,7 @@ export default (form: WrappedFormUtils) => {
174
174
  // const key = isMyShow ? 'unit' : 'unitOther';
175
175
  // const value = {} as any;
176
176
  // value[key] = form.getFieldsValue().unit;
177
- controller.setEditGood({unit: form.getFieldsValue().unit});
177
+ controller.setEditGood({ unit: form.getFieldsValue().unit });
178
178
  }}
179
179
  />,
180
180
  )}
@@ -549,21 +549,29 @@ class MyItemNameDiv extends React.Component<{ valueT?: React.ReactNode, valueF?:
549
549
  if (isMyShow) {
550
550
  if (valueT) {
551
551
  return (
552
- <span style={{ padding: '0 10px', color: '#0074ff' }}>{valueT}</span>
552
+ <Tooltip title={valueT}>
553
+ <span style={{ padding: '0 10px', color: '#0074ff' }}>{valueT}</span>
554
+ </Tooltip>
553
555
  )
554
556
  } else {
555
557
  return (
556
- <span style={{ padding: '0 10px' }}>{valueF}</span>
558
+ <Tooltip title={valueF}>
559
+ <span style={{ padding: '0 10px' }}>{valueF}</span>
560
+ </Tooltip>
557
561
  )
558
562
  }
559
563
  } else {
560
564
  if (valueF) {
561
565
  return (
562
- <span style={{ padding: '0 10px' }}>{valueF}</span>
566
+ <Tooltip title={valueF}>
567
+ <span style={{ padding: '0 10px' }}>{valueF}</span>
568
+ </Tooltip>
563
569
  )
564
570
  } else {
565
571
  return (
566
- <span style={{ padding: '0 10px', color: '#0074ff' }}>{valueT}</span>
572
+ <Tooltip title={valueT}>
573
+ <span style={{ padding: '0 10px', color: '#0074ff' }}>{valueT}</span>
574
+ </Tooltip>
567
575
  )
568
576
  }
569
577
  }