@cpzxrobot/sdk 1.1.45 → 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.
- package/contract_gateway.ts +10 -0
- package/customer_gateway.ts +9 -2
- package/device_filter.ts +2 -0
- package/dist/contract_gateway.js +9 -0
- package/dist/customer_gateway.js +9 -2
- package/dist/device_filter.js +1 -0
- package/dist/product_gateway.js +4 -1
- package/dist/project_gateway.js +12 -2
- package/dist/user_gateway.js +2 -6
- package/package.json +1 -1
- package/product_gateway.ts +5 -1
- package/project_gateway.ts +13 -3
- package/readme.md +2 -0
- package/user_gateway.ts +8 -6
package/contract_gateway.ts
CHANGED
|
@@ -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
|
}
|
package/customer_gateway.ts
CHANGED
|
@@ -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
|
|
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
|
})
|
package/dist/contract_gateway.js
CHANGED
|
@@ -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;
|
package/dist/customer_gateway.js
CHANGED
|
@@ -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
|
-
|
|
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() {
|
package/dist/device_filter.js
CHANGED
|
@@ -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
|
})
|
package/dist/product_gateway.js
CHANGED
|
@@ -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
|
-
},
|
|
39
|
+
}, args.fileName);
|
|
37
40
|
});
|
|
38
41
|
},
|
|
39
42
|
add: (args) => {
|
package/dist/project_gateway.js
CHANGED
|
@@ -80,11 +80,12 @@ class ProjectGateway extends Object {
|
|
|
80
80
|
get material() {
|
|
81
81
|
return {
|
|
82
82
|
// 获取材料列表
|
|
83
|
-
list: (pageNo = undefined, pageSize = undefined) => {
|
|
83
|
+
list: (projectId, pageNo = undefined, pageSize = undefined) => {
|
|
84
84
|
return this.context.ready.then((axios) => {
|
|
85
85
|
var params = {
|
|
86
86
|
pageNo,
|
|
87
|
-
pageSize
|
|
87
|
+
pageSize,
|
|
88
|
+
projectId
|
|
88
89
|
};
|
|
89
90
|
return axios.post(`/api/v2/coremde-sale/project/material/list`, params);
|
|
90
91
|
});
|
|
@@ -116,6 +117,15 @@ class ProjectGateway extends Object {
|
|
|
116
117
|
return axios.post(`/api/v2/coremde-sale/project/inquiry/add`, args);
|
|
117
118
|
});
|
|
118
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
|
+
}
|
|
119
129
|
};
|
|
120
130
|
}
|
|
121
131
|
}
|
package/dist/user_gateway.js
CHANGED
|
@@ -151,13 +151,9 @@ class UserGateway extends Object {
|
|
|
151
151
|
}
|
|
152
152
|
get checkin() {
|
|
153
153
|
return {
|
|
154
|
-
add: (
|
|
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
package/product_gateway.ts
CHANGED
|
@@ -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
|
-
},
|
|
59
|
+
}, args.fileName);
|
|
56
60
|
});
|
|
57
61
|
},
|
|
58
62
|
add: (args: {
|
package/project_gateway.ts
CHANGED
|
@@ -112,13 +112,14 @@ export class ProjectGateway extends Object {
|
|
|
112
112
|
get material() {
|
|
113
113
|
return {
|
|
114
114
|
// 获取材料列表
|
|
115
|
-
list: (pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) => {
|
|
115
|
+
list: (projectId: number, pageNo: number | undefined = undefined, pageSize: number | undefined = undefined) => {
|
|
116
116
|
return this.context.ready.then((axios) => {
|
|
117
117
|
var params = {
|
|
118
118
|
pageNo,
|
|
119
|
-
pageSize
|
|
119
|
+
pageSize,
|
|
120
|
+
projectId
|
|
120
121
|
}
|
|
121
|
-
return axios.post(`/api/v2/coremde-sale/project/material/list`,params);
|
|
122
|
+
return axios.post(`/api/v2/coremde-sale/project/material/list`, params);
|
|
122
123
|
});
|
|
123
124
|
}
|
|
124
125
|
}
|
|
@@ -154,6 +155,15 @@ export class ProjectGateway extends Object {
|
|
|
154
155
|
return axios.post(`/api/v2/coremde-sale/project/inquiry/add`, args);
|
|
155
156
|
});
|
|
156
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
|
+
}
|
|
157
167
|
};
|
|
158
168
|
}
|
|
159
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: (
|
|
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类型对象
|