@cpzxrobot/sdk 1.1.46 → 1.1.47

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.
@@ -31,4 +31,14 @@ export class ContractGateway extends Object {
31
31
  });
32
32
  }
33
33
 
34
+ export(contractId: number, filename: string = "合同.pdf") {
35
+ return this.context.ready.then((axios) => {
36
+ return axios.getAndSave(`/api/v2/coremde-sale/contract/export`, {
37
+ params: {
38
+ contractId: contractId,
39
+ },
40
+ }, filename);
41
+ });
42
+ }
43
+
34
44
  }
@@ -43,10 +43,17 @@ export class CustomerGateway extends Object {
43
43
  });
44
44
  }
45
45
 
46
- accountManager(customerId: number) {
46
+ accountManager(customerId: number,pageNo:number|undefined= undefined,pageSize:number|undefined=undefined) {
47
47
  return this.context.ready.then((axios) => {
48
+ var params = {
49
+ customerId: customerId,
50
+ pageNo: pageNo,
51
+ pageSize: pageSize,
52
+ }
48
53
  return axios.get(
49
- `/api/v2/coremde-sale/customer/account-manager?customerId=${customerId}`,
54
+ `/api/v2/coremde-sale/customer/account-manager/list`,{
55
+ params: params,
56
+ }
50
57
  );
51
58
  });
52
59
  }
package/device_filter.ts CHANGED
@@ -350,6 +350,7 @@ export abstract class DeviceFilter<T extends { id: number }> {
350
350
  unit?: Number;
351
351
  detail?: boolean;
352
352
  type?: string;
353
+ excluded_types?: string[]; //排除的设备类型,比如['sensor']
353
354
  supplier?: string; //供应商,可用于过滤设备
354
355
  } = undefined
355
356
  ): Promise<T[]> {
@@ -377,6 +378,7 @@ export abstract class DeviceFilter<T extends { id: number }> {
377
378
  data: options?.data,
378
379
  status: options?.status,
379
380
  supplier: options?.supplier,
381
+ excluded_types: options?.excluded_types,
380
382
  },
381
383
  });
382
384
  })
@@ -21,5 +21,14 @@ class ContractGateway extends Object {
21
21
  return axios.post(`/api/v2/coremde-sale/contract/add`, args);
22
22
  });
23
23
  }
24
+ export(contractId, filename = "合同.pdf") {
25
+ return this.context.ready.then((axios) => {
26
+ return axios.getAndSave(`/api/v2/coremde-sale/contract/export`, {
27
+ params: {
28
+ contractId: contractId,
29
+ },
30
+ }, filename);
31
+ });
32
+ }
24
33
  }
25
34
  exports.ContractGateway = ContractGateway;
@@ -31,9 +31,16 @@ class CustomerGateway extends Object {
31
31
  return axios.post(`/api/v2/coremde-sale/customer/update`, args);
32
32
  });
33
33
  }
34
- accountManager(customerId) {
34
+ accountManager(customerId, pageNo = undefined, pageSize = undefined) {
35
35
  return this.context.ready.then((axios) => {
36
- return axios.get(`/api/v2/coremde-sale/customer/account-manager?customerId=${customerId}`);
36
+ var params = {
37
+ customerId: customerId,
38
+ pageNo: pageNo,
39
+ pageSize: pageSize,
40
+ };
41
+ return axios.get(`/api/v2/coremde-sale/customer/account-manager/list`, {
42
+ params: params,
43
+ });
37
44
  });
38
45
  }
39
46
  get visit() {
@@ -322,6 +322,7 @@ class DeviceFilter {
322
322
  data: options === null || options === void 0 ? void 0 : options.data,
323
323
  status: options === null || options === void 0 ? void 0 : options.status,
324
324
  supplier: options === null || options === void 0 ? void 0 : options.supplier,
325
+ excluded_types: options === null || options === void 0 ? void 0 : options.excluded_types,
325
326
  },
326
327
  });
327
328
  })
@@ -30,10 +30,13 @@ class ProductGateway extends Object {
30
30
  // },
31
31
  //下载报价单
32
32
  export: (args) => {
33
+ if (!args.fileName) {
34
+ args.fileName = "报价单.xlsx";
35
+ }
33
36
  return this.context.ready.then((axios) => {
34
37
  return axios.getAndSave(`/api/v2/coremde-sale/product/price/export`, {
35
38
  params: args,
36
- }, "报价单.xlsx");
39
+ }, args.fileName);
37
40
  });
38
41
  },
39
42
  add: (args) => {
@@ -117,6 +117,15 @@ class ProjectGateway extends Object {
117
117
  return axios.post(`/api/v2/coremde-sale/project/inquiry/add`, args);
118
118
  });
119
119
  },
120
+ export: (id, fileName = "询价.pdf") => {
121
+ return this.context.ready.then((axios) => {
122
+ return axios.getAndSave(`/api/v2/coremde-sale/project/inquiry/export`, {
123
+ params: {
124
+ id,
125
+ }
126
+ }, fileName);
127
+ });
128
+ }
120
129
  };
121
130
  }
122
131
  }
@@ -151,13 +151,9 @@ class UserGateway extends Object {
151
151
  }
152
152
  get checkin() {
153
153
  return {
154
- add: (userId, address, areaCode) => {
154
+ add: (args) => {
155
155
  return this.context.ready.then((axios) => {
156
- return axios.post(`/api/v2/coremde-sale/checkin/add`, {
157
- userId,
158
- address,
159
- areaCode
160
- });
156
+ return axios.post(`/api/v2/coremde-sale/checkin/add`, args);
161
157
  });
162
158
  },
163
159
  //date 传入格式为2019-8或者Date类型对象
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.46",
3
+ "version": "1.1.47",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -48,11 +48,15 @@ export class ProductGateway extends Object {
48
48
  export: (args: {
49
49
  pageNo: number;
50
50
  pageSize: number;
51
+ fileName?: string;
51
52
  }) => {
53
+ if (!args.fileName) {
54
+ args.fileName = "报价单.xlsx";
55
+ }
52
56
  return this.context.ready.then((axios) => {
53
57
  return axios.getAndSave(`/api/v2/coremde-sale/product/price/export`, {
54
58
  params: args,
55
- }, "报价单.xlsx");
59
+ }, args.fileName);
56
60
  });
57
61
  },
58
62
  add: (args: {
@@ -155,6 +155,15 @@ export class ProjectGateway extends Object {
155
155
  return axios.post(`/api/v2/coremde-sale/project/inquiry/add`, args);
156
156
  });
157
157
  },
158
+ export: (id: number,fileName: string = "询价.pdf") => {
159
+ return this.context.ready.then((axios) => {
160
+ return axios.getAndSave(`/api/v2/coremde-sale/project/inquiry/export`, {
161
+ params: {
162
+ id,
163
+ }
164
+ },fileName);
165
+ });
166
+ }
158
167
  };
159
168
  }
160
169
 
package/readme.md CHANGED
@@ -169,6 +169,7 @@ baseURL: "/"
169
169
  | cpzxrobot().project.inquiry.list | 获得项目询盘列表,传入project_id参数 |
170
170
  | cpzxrobot().project.inquiry.get | 获得项目询盘信息,传入id参数 |
171
171
  | cpzxrobot().project.inquiry.add | 添加项目询盘信息,传入project_id和询盘内容 |
172
+ | cpzxrobot().project.inquiry.export | 导出项目询盘信息,传入project_id参数,建议传入自定义文件名,否则默认文件名 |
172
173
  | cpzxrobot().project.document.list | 获得项目文档列表,传入project_id参数 |
173
174
  | cpzxrobot().project.material.list | 获得项目物料到货列表,传入project_id参数 |
174
175
  | cpzxrobot().project.attendance.list | 获得项目到岗列表,传入project_id参数 |
@@ -177,6 +178,7 @@ baseURL: "/"
177
178
  | cpzxrobot().contract.list | 获得合同列表,传入factory_id和必要的分页参数 |
178
179
  | cpzxrobot().contract.get | 获得合同信息,传入id参数 |
179
180
  | cpzxrobot().contract.add | 添加合同 |
181
+ | cpzxrobot().contract.export | 导出合同信息,建议传入自定义文件名,否则默认文件名 |
180
182
  | cpzxrobot().customer.list | 获得客户列表,传入factory_id和必要的分页参数 |
181
183
  | cpzxrobot().customer.get | 获得客户信息,传入id参数 |
182
184
  | cpzxrobot().customer.add | 添加客户 |
package/user_gateway.ts CHANGED
@@ -167,13 +167,15 @@ export class UserGateway extends Object {
167
167
 
168
168
  get checkin() {
169
169
  return {
170
- add: (userId: number, address: String, areaCode: String) => {
170
+ add: (args:{
171
+ userId: number,
172
+ address: string,
173
+ areaCode: string,
174
+ lat: number,
175
+ lng: number
176
+ }) => {
171
177
  return this.context.ready.then((axios) => {
172
- return axios.post(`/api/v2/coremde-sale/checkin/add`, {
173
- userId,
174
- address,
175
- areaCode
176
- });
178
+ return axios.post(`/api/v2/coremde-sale/checkin/add`, args);
177
179
  });
178
180
  },
179
181
  //date 传入格式为2019-8或者Date类型对象