@cpzxrobot/sdk 1.1.50 → 1.1.52

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.
@@ -43,7 +43,7 @@ export class ContractGateway extends Object {
43
43
 
44
44
  approval(contractId: number, agree: 1 | 0, audit_info: string) {
45
45
  return this.context.ready.then((axios) => {
46
- return axios.post(`/api/v2/coremde-sale/contract/approval`, {
46
+ return axios.post(`/api/v2/coremde-sale/contract/approve`, {
47
47
  contractId,
48
48
  agree,
49
49
  audit_info,
@@ -30,5 +30,14 @@ class ContractGateway extends Object {
30
30
  }, filename);
31
31
  });
32
32
  }
33
+ approval(contractId, agree, audit_info) {
34
+ return this.context.ready.then((axios) => {
35
+ return axios.post(`/api/v2/coremde-sale/contract/approve`, {
36
+ contractId,
37
+ agree,
38
+ audit_info,
39
+ });
40
+ });
41
+ }
33
42
  }
34
43
  exports.ContractGateway = ContractGateway;
@@ -117,6 +117,11 @@ class UserGateway extends Object {
117
117
  return axios.get(`/api/v2/coremde-sale/user/city/get?area_code=${area_code}`);
118
118
  });
119
119
  }
120
+ listByRole(companyId, role) {
121
+ return this.context.ready.then((axios) => {
122
+ return axios.get(`/api/v2/company/${companyId}/users?roleCode=${role}`);
123
+ });
124
+ }
120
125
  async mypermission() {
121
126
  var axios = await this.context.ready;
122
127
  return axios.get("/api/v2/user/role/mypermission");
@@ -146,6 +151,11 @@ class UserGateway extends Object {
146
151
  userId: id
147
152
  });
148
153
  });
154
+ },
155
+ submits: (id) => {
156
+ return this.context.ready.then((axios) => {
157
+ return axios.get(`/api/v2/coremde-sale/approval/submit/list?userId=${id}`);
158
+ });
149
159
  }
150
160
  };
151
161
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.1.50",
3
+ "version": "1.1.52",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -144,6 +144,7 @@ baseURL: "/"
144
144
  | cpzxrobot().user.update | 更新用户 |
145
145
  | cpzxrobot().user.list | 列出用户(传入工厂) |
146
146
  | cpzxrobot().user.info | 获取用户信息,传入userId参数 |
147
+ | cpzxrobot().user.listByRole | 列出用户(传入公司和角色) |
147
148
  | cpzxrobot().user.approval.list | 获取用户审批列表,传入userId和status参数 |
148
149
  | cpzxrobot().user.approval.count | 获取用户审批列表的数量,传入userId和status参数 |
149
150
  | cpzxrobot().user.checkin.add | 添加用户签到记录,传入userId和address参数 |
package/user_gateway.ts CHANGED
@@ -129,6 +129,12 @@ export class UserGateway extends Object {
129
129
  });
130
130
  }
131
131
 
132
+ listByRole(companyId: number,role: string) {
133
+ return this.context.ready.then((axios) => {
134
+ return axios.get(`/api/v2/company/${companyId}/users?roleCode=${role}`);
135
+ });
136
+ }
137
+
132
138
  async mypermission() {
133
139
  var axios = await this.context.ready;
134
140
  return axios.get("/api/v2/user/role/mypermission");