kts-component-invoice-operate 2.0.1 → 2.0.2
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/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.d.ts +10 -12
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ProductComparison/index.d.ts +0 -2
- package/dist/Invoice/_test/buyerNameSearch/index.d.ts +1 -0
- package/dist/Invoice/_test/deduction/index.d.ts +1 -0
- package/dist/Invoice/_test/draft/index.d.ts +1 -0
- package/dist/Invoice/_test/easiest/index.d.ts +1 -0
- package/dist/Invoice/_test/endowCode/index.d.ts +1 -0
- package/dist/Invoice/_test/goodsMenuExpand/index.d.ts +1 -0
- package/dist/Invoice/_test/importBuyer/index.d.ts +1 -0
- package/dist/Invoice/_test/importGoods/index.d.ts +1 -0
- package/dist/Invoice/_test/invoiceType/index.d.ts +1 -0
- package/dist/Invoice/_test/isInvoiceNo/index.d.ts +1 -0
- package/dist/Invoice/_test/replaceHead/index.d.ts +1 -0
- package/dist/Invoice/_test/retrieveData/index.d.ts +1 -0
- package/dist/Invoice/_test/seller/index.d.ts +1 -0
- package/dist/Invoice/_test/setDataSource/index.d.ts +1 -0
- package/dist/Invoice/_test/unit/index.d.ts +1 -0
- package/dist/Invoice/ui/AddComparisonDrawer/index.d.ts +2 -3
- package/dist/Invoice/ui/Buyer/ui/BuyerNameInput/index.d.ts +1 -0
- package/dist/Invoice/ui/Buyer/ui/ImportBuyerButton/index.d.ts +1 -0
- package/dist/Invoice/ui/EndowCodeDrawer/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowEditButton/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddComparison/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowSaveButton/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/hook/useRowSelection/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/AddRowButton/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/BulkMenu/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/DescribeSwitch/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/Search/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/Statistics/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/TableRow/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/TableVirtual/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/TaxIncludedSwitch/index.d.ts +1 -0
- package/dist/Invoice/ui/ImportBuyerDrawer/index.d.ts +1 -0
- package/dist/Invoice/ui/ImportGoodsDrawer/index.d.ts +1 -0
- package/dist/index.esm.js +135 -167
- package/dist/index.js +135 -167
- package/docs-dist/404.html +33 -0
- package/docs-dist/index.html +33 -0
- package/docs-dist/static/auto.a6cd905c.svg +1 -0
- package/docs-dist/static/magnifier.2b26be6e.svg +1 -0
- package/docs-dist/static/spot.42e620e1.svg +1 -0
- package/docs-dist/umi.css +21 -0
- package/docs-dist/umi.js +1 -0
- package/package.json +3 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +10 -13
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ProductComparison/index.ts +1 -1
- package/src/Invoice/ui/AddComparisonDrawer/index.tsx +73 -113
- package/src/Invoice/ui/EndowCodeDrawer/index.tsx +1 -1
- package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +5 -4
- package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +36 -16
- package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +7 -12
- package/src/Invoice/ui/ImportGoodsDrawer/index.tsx +10 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kts-component-invoice-operate",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "dumi dev",
|
|
6
6
|
"docs:build": "dumi build",
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
"classnames": "^2.3.1",
|
|
31
31
|
"grey-react-box": "^0.2.20",
|
|
32
32
|
"kts-components-antd-x3": "^3.26.20-5",
|
|
33
|
+
"kts-components-antd-x4": "^4.0.3",
|
|
34
|
+
"kts-xui": "^1.0.30",
|
|
33
35
|
"mathjs": "^9.4.2",
|
|
34
36
|
"next": "^11.0.1",
|
|
35
37
|
"nzh": "^1.0.4",
|
|
@@ -10,29 +10,26 @@ export default interface IGood {
|
|
|
10
10
|
/** 发票ID */
|
|
11
11
|
id?: string;
|
|
12
12
|
|
|
13
|
-
/** 商品编码(
|
|
13
|
+
/** 商品编码(对方-销售) */
|
|
14
14
|
itemCode?: string;
|
|
15
15
|
|
|
16
|
-
/** 货物名称(
|
|
16
|
+
/** 货物名称(对方-销售) */
|
|
17
17
|
itemName?: string;
|
|
18
18
|
|
|
19
|
-
/** 单位(
|
|
19
|
+
/** 单位(对方-销售) */
|
|
20
20
|
unit?: string;
|
|
21
21
|
|
|
22
|
-
/** 货物规格型号(
|
|
22
|
+
/** 货物规格型号(对方-销售) */
|
|
23
23
|
itemModelName?: string;
|
|
24
24
|
|
|
25
|
-
/** 商品编码(
|
|
26
|
-
|
|
25
|
+
/** 商品编码(我方-购买) */
|
|
26
|
+
itemCodeSelf?: string;
|
|
27
27
|
|
|
28
|
-
/** 货物名称(
|
|
29
|
-
|
|
28
|
+
/** 货物名称(我方-购买) */
|
|
29
|
+
itemNameSelf?: string;
|
|
30
30
|
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
/** 货物规格型号(对方) */
|
|
35
|
-
itemModelNameOther?: string;
|
|
31
|
+
/** 货物规格型号(我方-购买) */
|
|
32
|
+
itemModelNameSelf?: string;
|
|
36
33
|
|
|
37
34
|
/** 数量 */
|
|
38
35
|
quantity?: number;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Row, Col, Input,
|
|
4
|
-
import {
|
|
5
|
-
import { FormComponentProps } from "kts-components-antd-x3/lib/form";
|
|
6
|
-
import { decorator } from "grey-react-box";
|
|
3
|
+
import { Row, Col, Input, Button } from "kts-components-antd-x3";
|
|
4
|
+
import { Form, Drawer } from "kts-xui";
|
|
7
5
|
import { Invoice } from "../../../";
|
|
8
6
|
import { getSN } from "../../tools/itemName";
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
Form.create()
|
|
12
|
-
)(props => {
|
|
8
|
+
export default function AddComparisonDrawer() {
|
|
13
9
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const { getFieldDecorator } = form;
|
|
10
|
+
const [form] = Form.useForm();
|
|
17
11
|
|
|
18
12
|
/** 控制器 */
|
|
19
13
|
const controller = Invoice.useInvoiceController();
|
|
@@ -35,24 +29,21 @@ const AddComparisonDrawer = decorator<{}, FormComponentProps>(
|
|
|
35
29
|
controller.run(async s => {
|
|
36
30
|
if (!good) return
|
|
37
31
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (s.goodsListState?.productComparison?.onUpdateComparisonTable && values.isUpdate) {
|
|
54
|
-
debugger
|
|
55
|
-
await s.goodsListState.productComparison.onUpdateComparisonTable(good, values);
|
|
32
|
+
try {
|
|
33
|
+
const values = await form.validateFields()
|
|
34
|
+
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;
|
|
42
|
+
|
|
43
|
+
s.goodsListState.addComparisonIndex = undefined;
|
|
44
|
+
s.goodsListState.goodsList = [...s.goodsListState.goodsList];
|
|
45
|
+
} catch (error) {
|
|
46
|
+
|
|
56
47
|
}
|
|
57
48
|
})
|
|
58
49
|
}, [form, good])
|
|
@@ -63,7 +54,7 @@ const AddComparisonDrawer = decorator<{}, FormComponentProps>(
|
|
|
63
54
|
form.setFieldsValue({
|
|
64
55
|
...good,
|
|
65
56
|
itemName: getSN(good.itemName)?.full,
|
|
66
|
-
|
|
57
|
+
itemNameSelf: getSN(good.itemNameSelf)?.full,
|
|
67
58
|
})
|
|
68
59
|
}
|
|
69
60
|
}, [good])
|
|
@@ -74,102 +65,71 @@ const AddComparisonDrawer = decorator<{}, FormComponentProps>(
|
|
|
74
65
|
onClose={onClose}
|
|
75
66
|
placement="right"
|
|
76
67
|
title="添加商品对照"
|
|
77
|
-
visible={!!
|
|
78
|
-
|
|
79
|
-
|
|
68
|
+
visible={!!good}
|
|
69
|
+
footer={
|
|
70
|
+
<div style={{ display: 'flex', justifyContent: 'flex-end', gap: 10 }} >
|
|
71
|
+
<Button type="primary" onClick={onSubmit} >提交</Button>
|
|
72
|
+
<Button onClick={onClose} >取消</Button>
|
|
73
|
+
</div>
|
|
74
|
+
}
|
|
80
75
|
>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
{
|
|
77
|
+
!!good &&
|
|
78
|
+
<Form layout="vertical" style={{ flex: 1 }} form={form} >
|
|
79
|
+
<Row gutter={[8, 8]} >
|
|
80
|
+
<Col span={12}>
|
|
81
|
+
<Form.Item
|
|
82
|
+
name="itemCodeSelf"
|
|
83
|
+
label="我方商品编码"
|
|
84
|
+
>
|
|
86
85
|
<Input />
|
|
87
86
|
</Form.Item>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
</Col>
|
|
88
|
+
<Col span={12} >
|
|
89
|
+
<Form.Item
|
|
90
|
+
name="itemCode"
|
|
91
|
+
label="对方商品编码"
|
|
92
|
+
>
|
|
94
93
|
<Input />
|
|
95
94
|
</Form.Item>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
<Form.Item label="我方商品名称" >
|
|
95
|
+
</Col>
|
|
96
|
+
<Col span={12} >
|
|
97
|
+
<Form.Item
|
|
98
|
+
name="itemNameSelf"
|
|
99
|
+
label="我方商品名称"
|
|
100
|
+
>
|
|
103
101
|
<Input />
|
|
104
102
|
</Form.Item>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
})(
|
|
112
|
-
<Form.Item label="对方商品名称">
|
|
103
|
+
</Col>
|
|
104
|
+
<Col span={12} >
|
|
105
|
+
<Form.Item
|
|
106
|
+
name="itemName"
|
|
107
|
+
label="对方商品名称"
|
|
108
|
+
>
|
|
113
109
|
<Input />
|
|
114
110
|
</Form.Item>
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
<Form.Item label="我方规格型号">
|
|
119
|
-
<Input />
|
|
120
|
-
</Form.Item>
|
|
121
|
-
</Col>
|
|
122
|
-
<Col span={12} >
|
|
123
|
-
{getFieldDecorator('itemModelNameOther', {
|
|
124
|
-
rules: [{ required: true, message: "请输入对方规格型号" }]
|
|
125
|
-
})(
|
|
126
|
-
<Form.Item label="对方规格型号">
|
|
111
|
+
</Col>
|
|
112
|
+
<Col span={12} >
|
|
113
|
+
<Form.Item name='itemModelNameSelf' label="我方规格型号">
|
|
127
114
|
<Input />
|
|
128
115
|
</Form.Item>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
{getFieldDecorator('unit', {
|
|
133
|
-
rules: [{ required: true, message: "请输入对方规格型号" }]
|
|
134
|
-
})(
|
|
135
|
-
<Form.Item label="我方计量单位" >
|
|
116
|
+
</Col>
|
|
117
|
+
<Col span={12} >
|
|
118
|
+
<Form.Item name="itemModelName" label="对方规格型号">
|
|
136
119
|
<Input />
|
|
137
120
|
</Form.Item>
|
|
138
|
-
|
|
139
|
-
</
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
rules: [{ required: true, message: "请输入对方计量单位" }]
|
|
143
|
-
})(
|
|
144
|
-
<Form.Item label="对方计量单位" >
|
|
145
|
-
<Input />
|
|
146
|
-
</Form.Item>
|
|
147
|
-
)}
|
|
148
|
-
</Col>
|
|
149
|
-
<Col span={24} >
|
|
150
|
-
{getFieldDecorator('isUpdate', {
|
|
151
|
-
})(
|
|
152
|
-
<Form.Item >
|
|
153
|
-
<Checkbox>更新到商品对照表中</Checkbox>
|
|
154
|
-
</Form.Item>
|
|
155
|
-
)}
|
|
156
|
-
</Col>
|
|
157
|
-
</Row>
|
|
158
|
-
</Form>
|
|
159
|
-
<div style={{ display: 'flex', justifyContent: 'flex-end', gap: 10 }} >
|
|
160
|
-
<Button type="primary" onClick={onSubmit} >提交</Button>
|
|
161
|
-
<Button onClick={onClose} >取消</Button>
|
|
162
|
-
</div>
|
|
121
|
+
</Col>
|
|
122
|
+
</Row>
|
|
123
|
+
</Form>
|
|
124
|
+
}
|
|
163
125
|
</Drawer>
|
|
164
126
|
)
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
})
|
|
175
|
-
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// function validateFields(form: WrappedFormUtils<any>) {
|
|
130
|
+
// return new Promise<{ err: any, values: any }>(resolve => {
|
|
131
|
+
// form.validateFields((err, values) => {
|
|
132
|
+
// resolve({ err, values })
|
|
133
|
+
// })
|
|
134
|
+
// })
|
|
135
|
+
// }
|
|
@@ -291,7 +291,7 @@ const DrawerBody = (props: { defaultValue: IGood }) => {
|
|
|
291
291
|
if (!good) return;
|
|
292
292
|
|
|
293
293
|
good.itemName = setShorthand(good.itemName, values.shorthand);
|
|
294
|
-
good.
|
|
294
|
+
good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand);
|
|
295
295
|
|
|
296
296
|
// const name = getItemName(good.itemName, values.shorthand);
|
|
297
297
|
// good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
|
|
@@ -452,12 +452,13 @@ export const onChangeItemName = async (controller: InvoiceController, form: Wrap
|
|
|
452
452
|
controller.run(async s => {
|
|
453
453
|
const value = form.getFieldsValue().itemName;
|
|
454
454
|
const shorthand = getSN(value)?.shorthand ?? '';
|
|
455
|
+
|
|
455
456
|
if (s.goodsListState.isMyShow) {
|
|
456
|
-
await controller.setEditGood({
|
|
457
|
-
record.itemNameOther && await controller.setEditGood({ itemNameOther: setShorthand(record.itemNameOther, shorthand) });
|
|
458
|
-
} else {
|
|
459
|
-
await controller.setEditGood({ itemNameOther: value });
|
|
457
|
+
await controller.setEditGood({ itemNameSelf: value });
|
|
460
458
|
record.itemName && await controller.setEditGood({ itemName: setShorthand(record.itemName, shorthand) });
|
|
459
|
+
} else {
|
|
460
|
+
await controller.setEditGood({ itemName: value });
|
|
461
|
+
record.itemNameSelf && await controller.setEditGood({ itemNameSelf: setShorthand(record.itemNameSelf, shorthand) });
|
|
461
462
|
}
|
|
462
463
|
})
|
|
463
464
|
}
|
|
@@ -64,12 +64,12 @@ export default (form: WrappedFormUtils) => {
|
|
|
64
64
|
<Form.Item>
|
|
65
65
|
<div style={{ display: 'flex' }} >
|
|
66
66
|
{getFieldDecorator('itemName', {
|
|
67
|
-
initialValue: isMyShow ? record.
|
|
67
|
+
initialValue: isMyShow ? record.itemNameSelf : record.itemName,
|
|
68
68
|
rules: [{
|
|
69
69
|
validator: async (_, __, callback) => {
|
|
70
70
|
await controller.wait();
|
|
71
71
|
const value = controller.state.goodsListState.editGood;
|
|
72
|
-
if (!value?.itemName && !value?.
|
|
72
|
+
if (!value?.itemName && !value?.itemNameSelf) {
|
|
73
73
|
callback('货物名称不能为空');
|
|
74
74
|
} else {
|
|
75
75
|
return;
|
|
@@ -110,8 +110,8 @@ export default (form: WrappedFormUtils) => {
|
|
|
110
110
|
} else {
|
|
111
111
|
return (
|
|
112
112
|
<MyItemNameDiv
|
|
113
|
-
valueT={formatSearch(record.
|
|
114
|
-
valueF={record.
|
|
113
|
+
valueT={formatSearch(record.itemNameSelf, searchValue)}
|
|
114
|
+
valueF={formatSearch(record.itemName, searchValue)}
|
|
115
115
|
isMyShow={isMyShow}
|
|
116
116
|
/>
|
|
117
117
|
)
|
|
@@ -130,12 +130,12 @@ export default (form: WrappedFormUtils) => {
|
|
|
130
130
|
return (
|
|
131
131
|
<Form.Item>
|
|
132
132
|
{getFieldDecorator('itemModelName', {
|
|
133
|
-
initialValue: isMyShow ? editGood.
|
|
133
|
+
initialValue: isMyShow ? editGood.itemModelNameSelf : editGood.itemModelName,
|
|
134
134
|
})(
|
|
135
135
|
<MyInput
|
|
136
136
|
onChange={async () => {
|
|
137
137
|
await controller.wait()
|
|
138
|
-
const key = isMyShow ? '
|
|
138
|
+
const key = isMyShow ? 'itemModelNameSelf' : 'itemModelName';
|
|
139
139
|
const value = {} as any;
|
|
140
140
|
value[key] = form.getFieldsValue().itemModelName;
|
|
141
141
|
controller.setEditGood(value);
|
|
@@ -146,13 +146,12 @@ export default (form: WrappedFormUtils) => {
|
|
|
146
146
|
);
|
|
147
147
|
} else {
|
|
148
148
|
return (
|
|
149
|
-
<MyItemNameDiv
|
|
150
|
-
valueT={formatSearch(record.
|
|
151
|
-
valueF={formatSearch(record.
|
|
152
|
-
isMyShow={isMyShow}
|
|
149
|
+
<MyItemNameDiv
|
|
150
|
+
valueT={formatSearch(record.itemModelNameSelf, searchValue)}
|
|
151
|
+
valueF={formatSearch(record.itemModelName, searchValue)}
|
|
152
|
+
isMyShow={isMyShow}
|
|
153
153
|
/>
|
|
154
154
|
)
|
|
155
|
-
// return <span style={{ padding: '0 10px' }}>{formatSearch(value, searchValue)}</span>;
|
|
156
155
|
}
|
|
157
156
|
},
|
|
158
157
|
},
|
|
@@ -182,7 +181,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
182
181
|
</Form.Item>
|
|
183
182
|
);
|
|
184
183
|
} else {
|
|
185
|
-
return
|
|
184
|
+
return record.unit;
|
|
186
185
|
}
|
|
187
186
|
},
|
|
188
187
|
},
|
|
@@ -434,6 +433,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
434
433
|
showArrow={false}
|
|
435
434
|
style={{ width: '100%' }}
|
|
436
435
|
onChange={() => {
|
|
436
|
+
setChangeField('taxRate');
|
|
437
437
|
onChangeTaxRate(controller, form, record);
|
|
438
438
|
}}
|
|
439
439
|
>
|
|
@@ -463,7 +463,7 @@ export default (form: WrappedFormUtils) => {
|
|
|
463
463
|
if (editGood?.$index === record.$index) {
|
|
464
464
|
return getFieldDecorator('taxAmount', {
|
|
465
465
|
initialValue: editGood.taxAmount,
|
|
466
|
-
})(<MyDiv />);
|
|
466
|
+
})(<MyDiv loading={isCipher(changeField, 'taxAmount')} />);
|
|
467
467
|
} else {
|
|
468
468
|
return <span style={{ padding: '0 10px' }}>{parseFloat(value).toFixed(2)}</span>;
|
|
469
469
|
}
|
|
@@ -526,9 +526,18 @@ class MyInput extends React.Component<InputProps & { loading?: boolean }> {
|
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
528
|
|
|
529
|
-
class MyDiv extends React.Component<{ value?: any }> {
|
|
529
|
+
class MyDiv extends React.Component<{ value?: any, loading?: boolean }> {
|
|
530
|
+
|
|
530
531
|
render() {
|
|
531
|
-
|
|
532
|
+
if (this.props.loading) {
|
|
533
|
+
return (
|
|
534
|
+
<Spin size="small">
|
|
535
|
+
<span style={{ padding: '0 10px' }}>{this.props.value}</span>
|
|
536
|
+
</Spin>
|
|
537
|
+
)
|
|
538
|
+
} else {
|
|
539
|
+
return <span style={{ padding: '0 10px' }}>{this.props.value}</span>
|
|
540
|
+
}
|
|
532
541
|
}
|
|
533
542
|
}
|
|
534
543
|
|
|
@@ -560,10 +569,21 @@ class MyItemNameDiv extends React.Component<{ valueT?: React.ReactNode, valueF?:
|
|
|
560
569
|
}
|
|
561
570
|
}
|
|
562
571
|
}
|
|
572
|
+
|
|
563
573
|
/** 格式搜索结果 */
|
|
564
574
|
function formatSearch(value?: string, search?: string) {
|
|
565
575
|
if (!value || !search) return value;
|
|
566
576
|
|
|
567
|
-
const __html = value.split(new RegExp(search, 'g')).join(`<span class="kts-invoice-operate-goods-list-table-search-protrude" >${search}</span>`);
|
|
577
|
+
const __html = ucoding(value).split(new RegExp(ucoding(search), 'g')).map(e => dcoding(e)).join(`<span class="kts-invoice-operate-goods-list-table-search-protrude" >${search}</span>`);
|
|
568
578
|
return <span dangerouslySetInnerHTML={{ __html }} />
|
|
569
579
|
}
|
|
580
|
+
|
|
581
|
+
/** 编码 */
|
|
582
|
+
function ucoding(v: string): string {
|
|
583
|
+
return v.split('').map(e => `U${e.charCodeAt(0)}E`).join('');
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
/** 解码 */
|
|
587
|
+
function dcoding(v: string): string {
|
|
588
|
+
return v.split('U').map(e => e ? String.fromCharCode(parseInt(e.replace('E', ''))) : '').join('');
|
|
589
|
+
}
|
|
@@ -11,9 +11,7 @@ export default () => {
|
|
|
11
11
|
const { onComply } = controller.useMemo(s => s.goodsListState.productComparison, [])
|
|
12
12
|
|
|
13
13
|
/** 是否禁用 */
|
|
14
|
-
const disabled = controller.useMemo(
|
|
15
|
-
if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
|
|
16
|
-
}, []);
|
|
14
|
+
const disabled = controller.useMemo(s => s.goodsListState.selectedGoodIndex.length <= 0, []);
|
|
17
15
|
|
|
18
16
|
/** 点击了 */
|
|
19
17
|
const onClick = React.useCallback(async () => {
|
|
@@ -36,7 +34,7 @@ export default () => {
|
|
|
36
34
|
return {
|
|
37
35
|
...t,
|
|
38
36
|
itemName: getSN(t.itemName)?.full,
|
|
39
|
-
|
|
37
|
+
itemNameSelf: getSN(t.itemNameSelf)?.full,
|
|
40
38
|
} as IGood
|
|
41
39
|
}).filter(e => !!e) as IGood[]
|
|
42
40
|
|
|
@@ -49,16 +47,13 @@ export default () => {
|
|
|
49
47
|
if (!vt) return undefined;
|
|
50
48
|
|
|
51
49
|
vt.itemName = e.itemName ? setShorthand(e.itemName, getSN(vt.itemName)?.shorthand) : vt.itemName;
|
|
52
|
-
vt.
|
|
53
|
-
|
|
54
|
-
vt.unit = e.unit ? e.unit : vt.unit;
|
|
55
|
-
vt.unitOther = e.unitOther ? e.unitOther : vt.unitOther;
|
|
56
|
-
|
|
50
|
+
vt.itemNameSelf = e.itemNameSelf ? setShorthand(e.itemNameSelf, getSN(vt.itemNameSelf)?.shorthand) : vt.itemNameSelf;
|
|
51
|
+
|
|
57
52
|
vt.itemModelName = e.itemModelName ? e.itemModelName : vt.itemModelName;
|
|
58
|
-
vt.
|
|
53
|
+
vt.itemModelNameSelf = e.itemModelNameSelf ? e.itemModelNameSelf : vt.itemModelNameSelf;
|
|
59
54
|
|
|
60
55
|
vt.itemCode = e.itemCode ? e.itemCode : vt.itemCode;
|
|
61
|
-
vt.
|
|
56
|
+
vt.itemCodeSelf = e.itemCodeSelf ? e.itemCodeSelf : vt.itemCodeSelf;
|
|
62
57
|
})
|
|
63
58
|
})
|
|
64
59
|
}, [])
|
|
@@ -74,7 +69,7 @@ export default () => {
|
|
|
74
69
|
执行商品对照
|
|
75
70
|
</Menu.Item>
|
|
76
71
|
);
|
|
77
|
-
}, [])
|
|
72
|
+
}, [disabled, onClick, onComply])
|
|
78
73
|
|
|
79
74
|
return { menuItem }
|
|
80
75
|
};
|
|
@@ -107,17 +107,17 @@ const DrawerBody = () => {
|
|
|
107
107
|
|
|
108
108
|
// 导入FORM里
|
|
109
109
|
if (s.goodsListState.isMyShow) {
|
|
110
|
-
s.goodsListState.form.setFieldsValue(
|
|
110
|
+
s.goodsListState.form.setFieldsValue({
|
|
111
|
+
...editGood,
|
|
112
|
+
itemName: editGood.itemNameSelf,
|
|
113
|
+
itemModelName: editGood.itemModelNameSelf,
|
|
114
|
+
});
|
|
111
115
|
} else {
|
|
112
116
|
s.goodsListState.form.setFieldsValue({
|
|
113
117
|
...editGood,
|
|
114
|
-
itemName: editGood.itemNameOther,
|
|
115
|
-
unit: editGood.unitOther,
|
|
116
|
-
itemModelName: editGood.itemModelNameOther,
|
|
117
118
|
});
|
|
118
119
|
}
|
|
119
120
|
|
|
120
|
-
|
|
121
121
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
122
122
|
|
|
123
123
|
s.goodsListState.isTaxIncluded
|
|
@@ -157,9 +157,9 @@ const getItemName = (record: any, editGood: IGood) => {
|
|
|
157
157
|
return `*${shorthand}*${record.itemName}`;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
shorthand = getSN(editGood.
|
|
160
|
+
shorthand = getSN(editGood.itemName)?.shorthand;
|
|
161
161
|
if (shorthand) {
|
|
162
|
-
return `*${shorthand}*${record.
|
|
162
|
+
return `*${shorthand}*${record.itemNameSelf}`;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
return record.itemName;
|
|
@@ -167,14 +167,14 @@ const getItemName = (record: any, editGood: IGood) => {
|
|
|
167
167
|
|
|
168
168
|
// 获取他方名称
|
|
169
169
|
const getItemNameOther = (record: any, editGood: IGood) => {
|
|
170
|
-
if (!editGood.
|
|
170
|
+
if (!editGood.itemName) return editGood.itemName;
|
|
171
171
|
|
|
172
172
|
let shorthand;
|
|
173
173
|
|
|
174
174
|
shorthand = record.shorthand;
|
|
175
175
|
if (shorthand) {
|
|
176
|
-
return `*${shorthand}*${record.
|
|
176
|
+
return `*${shorthand}*${record.itemNameSelf}`;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
return record.
|
|
179
|
+
return record.itemName;
|
|
180
180
|
}
|