@cpzxrobot/sdk 1.2.19 → 1.2.21
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 +62 -12
- package/dist/contract_gateway.js +38 -10
- package/dist/factory_gateway.js +9 -0
- package/dist/index.js +1 -1
- package/dist/quotation_gateway.js +20 -0
- package/factory_gateway.ts +12 -0
- package/index.ts +1 -1
- package/package.json +1 -1
- package/quotation_gateway.ts +24 -0
- package/readme.md +89 -0
package/contract_gateway.ts
CHANGED
|
@@ -26,18 +26,6 @@ export class ContractGateway extends Object {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
addForProject(args: any) {
|
|
30
|
-
return this.context.ready.then((axios) => {
|
|
31
|
-
return axios.post(`/api/v2/coremde-sale/contract/project/add`, args);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
addForProduct(args: any) {
|
|
36
|
-
return this.context.ready.then((axios) => {
|
|
37
|
-
return axios.post(`/api/v2/coremde-sale/contract/product/add`, args);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
29
|
add(args: any) {
|
|
42
30
|
return this.context.ready.then((axios) => {
|
|
43
31
|
return axios.post(`/api/v2/coremde-sale/contract/add`, args);
|
|
@@ -72,4 +60,66 @@ export class ContractGateway extends Object {
|
|
|
72
60
|
});
|
|
73
61
|
}
|
|
74
62
|
|
|
63
|
+
get project() {
|
|
64
|
+
return {
|
|
65
|
+
addContract: (args: any) => {
|
|
66
|
+
return this.context.ready.then((axios) => {
|
|
67
|
+
return axios.post(`/api/v2/coremde-sale/contract/project/add`, args);
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
addPayment: (args: {
|
|
71
|
+
createTime: string;
|
|
72
|
+
createUserId: number;
|
|
73
|
+
updateTime: string;
|
|
74
|
+
updateUserId: number;
|
|
75
|
+
companyId: number;
|
|
76
|
+
contractId: number;
|
|
77
|
+
receivedPayments: number;
|
|
78
|
+
receivedPerson: string;
|
|
79
|
+
receiveDate: string;
|
|
80
|
+
remark: string;
|
|
81
|
+
}) => {
|
|
82
|
+
return this.context.ready.then((axios) => {
|
|
83
|
+
return axios.post(`/api/v2/coremde-sale/contract/project/payment/add`, args);
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
listPayments: (id: number) => {
|
|
87
|
+
return this.context.ready.then((axios) => {
|
|
88
|
+
return axios.get(`/api/v2/coremde-sale/contract/project/payment/list?id=${id}`);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
get product() {
|
|
95
|
+
return {
|
|
96
|
+
addContract: (args: any) => {
|
|
97
|
+
return this.context.ready.then((axios) => {
|
|
98
|
+
return axios.post(`/api/v2/coremde-sale/contract/product/add`, args);
|
|
99
|
+
});
|
|
100
|
+
},
|
|
101
|
+
addPayment: (args: {
|
|
102
|
+
createTime: string;
|
|
103
|
+
createUserId: number;
|
|
104
|
+
updateTime: string;
|
|
105
|
+
updateUserId: number;
|
|
106
|
+
companyId: number;
|
|
107
|
+
contractId: number;
|
|
108
|
+
receivedPayments: number;
|
|
109
|
+
receivedPerson: string;
|
|
110
|
+
receiveDate: string;
|
|
111
|
+
remark: string;
|
|
112
|
+
}) => {
|
|
113
|
+
return this.context.ready.then((axios) => {
|
|
114
|
+
return axios.post(`/api/v2/coremde-sale/contract/product/payment/add`, args);
|
|
115
|
+
});
|
|
116
|
+
},
|
|
117
|
+
listPayments: (id: number) => {
|
|
118
|
+
return this.context.ready.then((axios) => {
|
|
119
|
+
return axios.get(`/api/v2/coremde-sale/contract/product/payment/list?id=${id}`);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
75
125
|
}
|
package/dist/contract_gateway.js
CHANGED
|
@@ -16,16 +16,6 @@ class ContractGateway extends Object {
|
|
|
16
16
|
return axios.get(`/api/v2/coremde-sale/contract/get?id=${id}`);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
addForProject(args) {
|
|
20
|
-
return this.context.ready.then((axios) => {
|
|
21
|
-
return axios.post(`/api/v2/coremde-sale/contract/project/add`, args);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
addForProduct(args) {
|
|
25
|
-
return this.context.ready.then((axios) => {
|
|
26
|
-
return axios.post(`/api/v2/coremde-sale/contract/product/add`, args);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
19
|
add(args) {
|
|
30
20
|
return this.context.ready.then((axios) => {
|
|
31
21
|
return axios.post(`/api/v2/coremde-sale/contract/add`, args);
|
|
@@ -55,5 +45,43 @@ class ContractGateway extends Object {
|
|
|
55
45
|
return axios.get(`/api/v2/coremde-sale/contract/types`);
|
|
56
46
|
});
|
|
57
47
|
}
|
|
48
|
+
get project() {
|
|
49
|
+
return {
|
|
50
|
+
addContract: (args) => {
|
|
51
|
+
return this.context.ready.then((axios) => {
|
|
52
|
+
return axios.post(`/api/v2/coremde-sale/contract/project/add`, args);
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
addPayment: (args) => {
|
|
56
|
+
return this.context.ready.then((axios) => {
|
|
57
|
+
return axios.post(`/api/v2/coremde-sale/contract/project/payment/add`, args);
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
listPayments: (id) => {
|
|
61
|
+
return this.context.ready.then((axios) => {
|
|
62
|
+
return axios.get(`/api/v2/coremde-sale/contract/project/payment/list?id=${id}`);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
get product() {
|
|
68
|
+
return {
|
|
69
|
+
addContract: (args) => {
|
|
70
|
+
return this.context.ready.then((axios) => {
|
|
71
|
+
return axios.post(`/api/v2/coremde-sale/contract/product/add`, args);
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
addPayment: (args) => {
|
|
75
|
+
return this.context.ready.then((axios) => {
|
|
76
|
+
return axios.post(`/api/v2/coremde-sale/contract/product/payment/add`, args);
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
listPayments: (id) => {
|
|
80
|
+
return this.context.ready.then((axios) => {
|
|
81
|
+
return axios.get(`/api/v2/coremde-sale/contract/product/payment/list?id=${id}`);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
58
86
|
}
|
|
59
87
|
exports.ContractGateway = ContractGateway;
|
package/dist/factory_gateway.js
CHANGED
|
@@ -147,5 +147,14 @@ class FactoryGateway extends Object {
|
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
|
+
//获得工厂的设备报警信息
|
|
151
|
+
async alert(params) {
|
|
152
|
+
let axios = await this.context.ready;
|
|
153
|
+
const response = await axios.get(`/api/v1/device/alert`, {
|
|
154
|
+
params: params,
|
|
155
|
+
});
|
|
156
|
+
const json = response.data;
|
|
157
|
+
return json;
|
|
158
|
+
}
|
|
150
159
|
}
|
|
151
160
|
exports.FactoryGateway = FactoryGateway;
|
package/dist/index.js
CHANGED
|
@@ -364,7 +364,7 @@ class Cpzxrobot {
|
|
|
364
364
|
const token = localStorage.getItem("token");
|
|
365
365
|
if (token) {
|
|
366
366
|
this.token = token;
|
|
367
|
-
this.initAxios(
|
|
367
|
+
this.initAxios("https://www.cpzxrobot.com");
|
|
368
368
|
this.axios.get("/api/v1/user/auth").then((res) => {
|
|
369
369
|
if (res.data.Error) {
|
|
370
370
|
window.location.href = "/login.html?error=" + res.data.Error;
|
|
@@ -16,5 +16,25 @@ class QuotationGateway extends Object {
|
|
|
16
16
|
return axios.post(`/api/v2/coremde-sale/quotation/add`, args);
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
+
get(id) {
|
|
20
|
+
return this.context.ready.then((axios) => {
|
|
21
|
+
return axios.get(`/api/v2/coremde-sale/quotation/get?id=${id}`);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
update(args) {
|
|
25
|
+
return this.context.ready.then((axios) => {
|
|
26
|
+
return axios.post(`/api/v2/coremde-sale/quotation/update`, args);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
delete(id) {
|
|
30
|
+
return this.context.ready.then((axios) => {
|
|
31
|
+
return axios.get(`/api/v2/coremde-sale/quotation/delete?id=${id}`);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
transform(id) {
|
|
35
|
+
return this.context.ready.then((axios) => {
|
|
36
|
+
return axios.get(`/api/v2/coremde-sale/quotation/transform?id=${id}`);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
19
39
|
}
|
|
20
40
|
exports.QuotationGateway = QuotationGateway;
|
package/factory_gateway.ts
CHANGED
|
@@ -182,4 +182,16 @@ export class FactoryGateway extends Object {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
+
|
|
186
|
+
//获得工厂的设备报警信息
|
|
187
|
+
async alert(params:any): Promise<any> {
|
|
188
|
+
let axios = await this.context.ready;
|
|
189
|
+
const response = await axios.get(
|
|
190
|
+
`/api/v1/device/alert`,{
|
|
191
|
+
params: params,
|
|
192
|
+
}
|
|
193
|
+
);
|
|
194
|
+
const json = response.data;
|
|
195
|
+
return json;
|
|
196
|
+
}
|
|
185
197
|
}
|
package/index.ts
CHANGED
|
@@ -416,7 +416,7 @@ export class Cpzxrobot {
|
|
|
416
416
|
const token = localStorage.getItem("token");
|
|
417
417
|
if (token) {
|
|
418
418
|
this.token = token;
|
|
419
|
-
this.initAxios(
|
|
419
|
+
this.initAxios("https://www.cpzxrobot.com");
|
|
420
420
|
this.axios.get("/api/v1/user/auth").then((res) => {
|
|
421
421
|
if (res.data.Error) {
|
|
422
422
|
window.location.href = "/login.html?error=" + res.data.Error;
|
package/package.json
CHANGED
package/quotation_gateway.ts
CHANGED
|
@@ -25,4 +25,28 @@ export class QuotationGateway extends Object {
|
|
|
25
25
|
return axios.post(`/api/v2/coremde-sale/quotation/add`, args);
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
get(id: number) {
|
|
30
|
+
return this.context.ready.then((axios) => {
|
|
31
|
+
return axios.get(`/api/v2/coremde-sale/quotation/get?id=${id}`);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
update(args: any) {
|
|
36
|
+
return this.context.ready.then((axios) => {
|
|
37
|
+
return axios.post(`/api/v2/coremde-sale/quotation/update`, args);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
delete(id: number) {
|
|
42
|
+
return this.context.ready.then((axios) => {
|
|
43
|
+
return axios.get(`/api/v2/coremde-sale/quotation/delete?id=${id}`);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
transform(id: number) {
|
|
48
|
+
return this.context.ready.then((axios) => {
|
|
49
|
+
return axios.get(`/api/v2/coremde-sale/quotation/transform?id=${id}`);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
28
52
|
}
|
package/readme.md
CHANGED
|
@@ -549,6 +549,37 @@ cpzxrobot().quotation.list({
|
|
|
549
549
|
cpzxrobot().quotation.add({
|
|
550
550
|
// 报价单数据
|
|
551
551
|
})
|
|
552
|
+
|
|
553
|
+
// 获取报价单详情
|
|
554
|
+
cpzxrobot().quotation.get(id: number)
|
|
555
|
+
|
|
556
|
+
// 更新报价单信息
|
|
557
|
+
cpzxrobot().quotation.update({
|
|
558
|
+
quotationTypeId: number,
|
|
559
|
+
quotationTypeName: string,
|
|
560
|
+
customerId: number,
|
|
561
|
+
customerName: string,
|
|
562
|
+
quotationContent: string,
|
|
563
|
+
customerContactId: number,
|
|
564
|
+
customerContactName: string,
|
|
565
|
+
contactPhone: string,
|
|
566
|
+
salesman: string,
|
|
567
|
+
amount: number,
|
|
568
|
+
quotationCost: number,
|
|
569
|
+
quotationGrossProfit: number,
|
|
570
|
+
quotationDemandDate: string,
|
|
571
|
+
companyId: number,
|
|
572
|
+
tax: number,
|
|
573
|
+
projectId: number,
|
|
574
|
+
validDay: number,
|
|
575
|
+
quotationDate: string
|
|
576
|
+
})
|
|
577
|
+
|
|
578
|
+
// 删除报价单
|
|
579
|
+
cpzxrobot().quotation.delete(id: number)
|
|
580
|
+
|
|
581
|
+
// 将报价单转化为合同
|
|
582
|
+
cpzxrobot().quotation.transform(id: number)
|
|
552
583
|
```
|
|
553
584
|
|
|
554
585
|
### 合同管理
|
|
@@ -581,6 +612,55 @@ cpzxrobot().contract.export({
|
|
|
581
612
|
})
|
|
582
613
|
```
|
|
583
614
|
|
|
615
|
+
#### 合同分组接口
|
|
616
|
+
```javascript
|
|
617
|
+
// 项目相关合同接口
|
|
618
|
+
cpzxrobot().contract.project = {
|
|
619
|
+
// 添加项目合同 (替代原addForProject)
|
|
620
|
+
addContract: (args: any) => Promise<any>
|
|
621
|
+
|
|
622
|
+
// 添加项目回款信息
|
|
623
|
+
addPayment: (args: {
|
|
624
|
+
createTime: string;
|
|
625
|
+
createUserId: number;
|
|
626
|
+
updateTime: string;
|
|
627
|
+
updateUserId: number;
|
|
628
|
+
companyId: number;
|
|
629
|
+
contractId: number;
|
|
630
|
+
receivedPayments: number;
|
|
631
|
+
receivedPerson: string;
|
|
632
|
+
receiveDate: string;
|
|
633
|
+
remark: string;
|
|
634
|
+
}) => Promise<any>
|
|
635
|
+
|
|
636
|
+
// 查看项目回款记录
|
|
637
|
+
listPayments: (id: number) => Promise<any>
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// 产品相关合同接口
|
|
641
|
+
cpzxrobot().contract.product = {
|
|
642
|
+
// 添加产品合同 (替代原addForProduct)
|
|
643
|
+
addContract: (args: any) => Promise<any>
|
|
644
|
+
|
|
645
|
+
// 添加产品回款信息
|
|
646
|
+
addPayment: (args: {
|
|
647
|
+
createTime: string;
|
|
648
|
+
createUserId: number;
|
|
649
|
+
updateTime: string;
|
|
650
|
+
updateUserId: number;
|
|
651
|
+
companyId: number;
|
|
652
|
+
contractId: number;
|
|
653
|
+
receivedPayments: number;
|
|
654
|
+
receivedPerson: string;
|
|
655
|
+
receiveDate: string;
|
|
656
|
+
remark: string;
|
|
657
|
+
}) => Promise<any>
|
|
658
|
+
|
|
659
|
+
// 查看产品回款记录
|
|
660
|
+
listPayments: (id: number) => Promise<any>
|
|
661
|
+
}
|
|
662
|
+
```
|
|
663
|
+
|
|
584
664
|
#### 合同审批流程
|
|
585
665
|
```javascript
|
|
586
666
|
// 提交合同审批
|
|
@@ -599,6 +679,15 @@ cpzxrobot().contract.restart({
|
|
|
599
679
|
cpzxrobot().contract.types(factoryId)
|
|
600
680
|
```
|
|
601
681
|
|
|
682
|
+
#### Deprecated 接口
|
|
683
|
+
```javascript
|
|
684
|
+
// 已废弃 - 请使用contract.project.addContract
|
|
685
|
+
cpzxrobot().contract.addForProject(args: any)
|
|
686
|
+
|
|
687
|
+
// 已废弃 - 请使用contract.product.addContract
|
|
688
|
+
cpzxrobot().contract.addForProduct(args: any)
|
|
689
|
+
```
|
|
690
|
+
|
|
602
691
|
#### 合同关联信息
|
|
603
692
|
```javascript
|
|
604
693
|
// 获取客户列表
|