@etsoo/smarterp-crm 1.0.10 → 1.0.12

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.
@@ -19,6 +19,11 @@ export type OrderQueryData = {
19
19
  * 标题
20
20
  */
21
21
  title: string;
22
+ /**
23
+ * Description
24
+ * 描述
25
+ */
26
+ description?: string;
22
27
  /**
23
28
  * Customer id
24
29
  * 客户编号
@@ -14,6 +14,11 @@ export type OrderLineQueryData = {
14
14
  * 标题
15
15
  */
16
16
  title: string;
17
+ /**
18
+ * Description
19
+ * 描述
20
+ */
21
+ description?: string;
17
22
  /**
18
23
  * Price
19
24
  * 价格
@@ -64,4 +69,9 @@ export type OrderLineQueryData = {
64
69
  * BOM行编号
65
70
  */
66
71
  bomId?: number;
72
+ /**
73
+ * JSON data
74
+ * JSON 数据
75
+ */
76
+ data?: Record<string, unknown>;
67
77
  };
@@ -19,6 +19,11 @@ export type POQueryData = {
19
19
  * 标题
20
20
  */
21
21
  title: string;
22
+ /**
23
+ * Description
24
+ * 描述
25
+ */
26
+ description?: string;
22
27
  /**
23
28
  * Supplier id
24
29
  * 供应商编号
@@ -14,6 +14,11 @@ export type POLineQueryData = {
14
14
  * 标题
15
15
  */
16
16
  title: string;
17
+ /**
18
+ * Description
19
+ * 描述
20
+ */
21
+ description?: string;
17
22
  /**
18
23
  * Price
19
24
  * 价格
@@ -64,4 +69,9 @@ export type POLineQueryData = {
64
69
  * BOM行编号
65
70
  */
66
71
  bomId?: number;
72
+ /**
73
+ * JSON data
74
+ * JSON 数据
75
+ */
76
+ data?: Record<string, unknown>;
67
77
  };
@@ -53,6 +53,18 @@ export declare class Order {
53
53
  * 获取订单类型
54
54
  */
55
55
  getKinds(): import("@etsoo/shared").ListType[];
56
+ /**
57
+ * Get modifiers
58
+ * 获取定制选项
59
+ * @param data Modifiers data
60
+ */
61
+ getModifiers(data?: Record<string, unknown>): string | undefined;
62
+ /**
63
+ * Get modifier SN
64
+ * 获取定制选项中的唯一编号
65
+ * @param data Modifiers data
66
+ */
67
+ getModifierSn(data?: Record<string, unknown>): string | undefined;
56
68
  /**
57
69
  * Get order payment kind label
58
70
  * 获取订单付款方式标签
@@ -118,6 +118,44 @@ class Order {
118
118
  getKinds() {
119
119
  return this.crm.app.getEnumList(OrderKind_1.OrderKind, "orderKind");
120
120
  }
121
+ /**
122
+ * Get modifiers
123
+ * 获取定制选项
124
+ * @param data Modifiers data
125
+ */
126
+ getModifiers(data) {
127
+ if (data == null ||
128
+ data.modifiers == null ||
129
+ typeof data.modifiers !== "object")
130
+ return;
131
+ const modifiers = data.modifiers;
132
+ return Object.values(modifiers)
133
+ .reduce((acc, val) => {
134
+ if (typeof val === "string" && !!val)
135
+ acc.push(val);
136
+ return acc;
137
+ }, [])
138
+ .join(", ");
139
+ }
140
+ /**
141
+ * Get modifier SN
142
+ * 获取定制选项中的唯一编号
143
+ * @param data Modifiers data
144
+ */
145
+ getModifierSn(data) {
146
+ if (data == null ||
147
+ data.modifiers == null ||
148
+ typeof data.modifiers !== "object")
149
+ return;
150
+ const m = data.modifiers;
151
+ const snItem = [m.sn, m.Sn, m.SN, m.domain, m.Domain].find((d) => typeof d === "string" && !!d);
152
+ if (snItem) {
153
+ const url = URL.parse(snItem);
154
+ if (url != null)
155
+ return url.hostname;
156
+ }
157
+ return snItem;
158
+ }
121
159
  /**
122
160
  * Get order payment kind label
123
161
  * 获取订单付款方式标签
@@ -19,6 +19,11 @@ export type OrderQueryData = {
19
19
  * 标题
20
20
  */
21
21
  title: string;
22
+ /**
23
+ * Description
24
+ * 描述
25
+ */
26
+ description?: string;
22
27
  /**
23
28
  * Customer id
24
29
  * 客户编号
@@ -14,6 +14,11 @@ export type OrderLineQueryData = {
14
14
  * 标题
15
15
  */
16
16
  title: string;
17
+ /**
18
+ * Description
19
+ * 描述
20
+ */
21
+ description?: string;
17
22
  /**
18
23
  * Price
19
24
  * 价格
@@ -64,4 +69,9 @@ export type OrderLineQueryData = {
64
69
  * BOM行编号
65
70
  */
66
71
  bomId?: number;
72
+ /**
73
+ * JSON data
74
+ * JSON 数据
75
+ */
76
+ data?: Record<string, unknown>;
67
77
  };
@@ -19,6 +19,11 @@ export type POQueryData = {
19
19
  * 标题
20
20
  */
21
21
  title: string;
22
+ /**
23
+ * Description
24
+ * 描述
25
+ */
26
+ description?: string;
22
27
  /**
23
28
  * Supplier id
24
29
  * 供应商编号
@@ -14,6 +14,11 @@ export type POLineQueryData = {
14
14
  * 标题
15
15
  */
16
16
  title: string;
17
+ /**
18
+ * Description
19
+ * 描述
20
+ */
21
+ description?: string;
17
22
  /**
18
23
  * Price
19
24
  * 价格
@@ -64,4 +69,9 @@ export type POLineQueryData = {
64
69
  * BOM行编号
65
70
  */
66
71
  bomId?: number;
72
+ /**
73
+ * JSON data
74
+ * JSON 数据
75
+ */
76
+ data?: Record<string, unknown>;
67
77
  };
@@ -53,6 +53,18 @@ export declare class Order {
53
53
  * 获取订单类型
54
54
  */
55
55
  getKinds(): import("@etsoo/shared").ListType[];
56
+ /**
57
+ * Get modifiers
58
+ * 获取定制选项
59
+ * @param data Modifiers data
60
+ */
61
+ getModifiers(data?: Record<string, unknown>): string | undefined;
62
+ /**
63
+ * Get modifier SN
64
+ * 获取定制选项中的唯一编号
65
+ * @param data Modifiers data
66
+ */
67
+ getModifierSn(data?: Record<string, unknown>): string | undefined;
56
68
  /**
57
69
  * Get order payment kind label
58
70
  * 获取订单付款方式标签
@@ -115,6 +115,44 @@ export class Order {
115
115
  getKinds() {
116
116
  return this.crm.app.getEnumList(OrderKind, "orderKind");
117
117
  }
118
+ /**
119
+ * Get modifiers
120
+ * 获取定制选项
121
+ * @param data Modifiers data
122
+ */
123
+ getModifiers(data) {
124
+ if (data == null ||
125
+ data.modifiers == null ||
126
+ typeof data.modifiers !== "object")
127
+ return;
128
+ const modifiers = data.modifiers;
129
+ return Object.values(modifiers)
130
+ .reduce((acc, val) => {
131
+ if (typeof val === "string" && !!val)
132
+ acc.push(val);
133
+ return acc;
134
+ }, [])
135
+ .join(", ");
136
+ }
137
+ /**
138
+ * Get modifier SN
139
+ * 获取定制选项中的唯一编号
140
+ * @param data Modifiers data
141
+ */
142
+ getModifierSn(data) {
143
+ if (data == null ||
144
+ data.modifiers == null ||
145
+ typeof data.modifiers !== "object")
146
+ return;
147
+ const m = data.modifiers;
148
+ const snItem = [m.sn, m.Sn, m.SN, m.domain, m.Domain].find((d) => typeof d === "string" && !!d);
149
+ if (snItem) {
150
+ const url = URL.parse(snItem);
151
+ if (url != null)
152
+ return url.hostname;
153
+ }
154
+ return snItem;
155
+ }
118
156
  /**
119
157
  * Get order payment kind label
120
158
  * 获取订单付款方式标签
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/smarterp-crm",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "TypeScript APIs for SmartERP Customer Relationship Management (CRM)",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -43,7 +43,7 @@
43
43
  "@types/react": "^19.3.0",
44
44
  "@types/react-dom": "^19.3.0",
45
45
  "@vitejs/plugin-react": "^6.1.1",
46
- "baseline-browser-mapping": "^2.11.23",
46
+ "baseline-browser-mapping": "^2.11.24",
47
47
  "jsdom": "^30.0.1",
48
48
  "typescript": "^7.0.2",
49
49
  "vitest": "^5.0.1"
@@ -23,6 +23,12 @@ export type OrderQueryData = {
23
23
  */
24
24
  title: string;
25
25
 
26
+ /**
27
+ * Description
28
+ * 描述
29
+ */
30
+ description?: string;
31
+
26
32
  /**
27
33
  * Customer id
28
34
  * 客户编号
@@ -17,6 +17,12 @@ export type OrderLineQueryData = {
17
17
  */
18
18
  title: string;
19
19
 
20
+ /**
21
+ * Description
22
+ * 描述
23
+ */
24
+ description?: string;
25
+
20
26
  /**
21
27
  * Price
22
28
  * 价格
@@ -76,4 +82,10 @@ export type OrderLineQueryData = {
76
82
  * BOM行编号
77
83
  */
78
84
  bomId?: number;
85
+
86
+ /**
87
+ * JSON data
88
+ * JSON 数据
89
+ */
90
+ data?: Record<string, unknown>;
79
91
  };
@@ -23,6 +23,12 @@ export type POQueryData = {
23
23
  */
24
24
  title: string;
25
25
 
26
+ /**
27
+ * Description
28
+ * 描述
29
+ */
30
+ description?: string;
31
+
26
32
  /**
27
33
  * Supplier id
28
34
  * 供应商编号
@@ -17,6 +17,12 @@ export type POLineQueryData = {
17
17
  */
18
18
  title: string;
19
19
 
20
+ /**
21
+ * Description
22
+ * 描述
23
+ */
24
+ description?: string;
25
+
20
26
  /**
21
27
  * Price
22
28
  * 价格
@@ -76,4 +82,10 @@ export type POLineQueryData = {
76
82
  * BOM行编号
77
83
  */
78
84
  bomId?: number;
85
+
86
+ /**
87
+ * JSON data
88
+ * JSON 数据
89
+ */
90
+ data?: Record<string, unknown>;
79
91
  };
@@ -143,6 +143,56 @@ export class Order {
143
143
  return this.crm.app.getEnumList(OrderKind, "orderKind");
144
144
  }
145
145
 
146
+ /**
147
+ * Get modifiers
148
+ * 获取定制选项
149
+ * @param data Modifiers data
150
+ */
151
+ getModifiers(data?: Record<string, unknown>) {
152
+ if (
153
+ data == null ||
154
+ data.modifiers == null ||
155
+ typeof data.modifiers !== "object"
156
+ )
157
+ return;
158
+
159
+ const modifiers = data.modifiers as Record<string, unknown>;
160
+
161
+ return Object.values(modifiers)
162
+ .reduce<string[]>((acc, val) => {
163
+ if (typeof val === "string" && !!val) acc.push(val);
164
+ return acc;
165
+ }, [])
166
+ .join(", ");
167
+ }
168
+
169
+ /**
170
+ * Get modifier SN
171
+ * 获取定制选项中的唯一编号
172
+ * @param data Modifiers data
173
+ */
174
+ getModifierSn(data?: Record<string, unknown>) {
175
+ if (
176
+ data == null ||
177
+ data.modifiers == null ||
178
+ typeof data.modifiers !== "object"
179
+ )
180
+ return;
181
+
182
+ const m = data.modifiers as Record<string, unknown>;
183
+
184
+ const snItem = [m.sn, m.Sn, m.SN, m.domain, m.Domain].find(
185
+ (d) => typeof d === "string" && !!d
186
+ ) as string | undefined;
187
+
188
+ if (snItem) {
189
+ const url = URL.parse(snItem);
190
+ if (url != null) return url.hostname;
191
+ }
192
+
193
+ return snItem;
194
+ }
195
+
146
196
  /**
147
197
  * Get order payment kind label
148
198
  * 获取订单付款方式标签