@cpzxrobot/sdk 1.3.67 → 1.3.69

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.
@@ -37,6 +37,21 @@ export class CompanyGateway extends Object {
37
37
  return axios.get(`/api/v2/company/delete?id=${id}`);
38
38
  }
39
39
 
40
+ get data() {
41
+ return {
42
+ export: async (companyId: string, supplier?: string, startDate?: string, endDate?: string) => {
43
+ var axios = await this.context.ready;
44
+ return axios.getAndSave(`/api/v2/company/${companyId}/data/export`, {
45
+ params: {
46
+ supplier,
47
+ startDate,
48
+ endDate
49
+ }
50
+ });
51
+ }
52
+ }
53
+ }
54
+
40
55
  get rank() {
41
56
  return {
42
57
  byRevenue: async () => {
@@ -30,6 +30,20 @@ class CompanyGateway extends Object {
30
30
  var axios = await this.context.ready;
31
31
  return axios.get(`/api/v2/company/delete?id=${id}`);
32
32
  }
33
+ get data() {
34
+ return {
35
+ export: async (companyId, supplier, startDate, endDate) => {
36
+ var axios = await this.context.ready;
37
+ return axios.getAndSave(`/api/v2/company/${companyId}/data/export`, {
38
+ params: {
39
+ supplier,
40
+ startDate,
41
+ endDate
42
+ }
43
+ });
44
+ }
45
+ };
46
+ }
33
47
  get rank() {
34
48
  return {
35
49
  byRevenue: async () => {
@@ -19,11 +19,12 @@ class UserGateway extends Object {
19
19
  this.context.platform.setSelectedUnit(unit);
20
20
  }
21
21
  }
22
- async factories() {
22
+ async factories(userId = 0) {
23
23
  var selectedFarm = await this.context.user.getSelectedFarm();
24
24
  var axios = await this.context.ready;
25
25
  return axios.post('/api/v1/user/factories', {
26
- selected_factory: selectedFarm
26
+ selected_factory: selectedFarm,
27
+ user_id: userId,
27
28
  });
28
29
  }
29
30
  //获得当前用户选择的单元
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.67",
3
+ "version": "1.3.69",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/types.d.ts CHANGED
@@ -95,6 +95,7 @@ type Factory = {
95
95
  kind?: string;
96
96
  pid?: number;
97
97
  business_kind?: string;
98
+ path?: string;
98
99
  };
99
100
  type Unit = {
100
101
  name?: string;
package/user_gateway.ts CHANGED
@@ -22,11 +22,13 @@ export class UserGateway extends Object {
22
22
  }
23
23
  }
24
24
 
25
- public async factories() {
25
+ public async factories(userId: number = 0) {
26
26
  var selectedFarm = await this.context.user.getSelectedFarm()
27
27
  var axios = await this.context.ready;
28
+
28
29
  return axios.post('/api/v1/user/factories', {
29
- selected_factory: selectedFarm
30
+ selected_factory: selectedFarm,
31
+ user_id: userId,
30
32
  })
31
33
  }
32
34