@cpzxrobot/sdk 1.3.24 → 1.3.25

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.
@@ -22,7 +22,7 @@ class ProjectGateway extends Object {
22
22
  return this.context.ready.then((axios) => {
23
23
  return axios.post(`/api/v2/coremde-sale/project/feedback/add`, {
24
24
  projectId,
25
- content
25
+ content,
26
26
  });
27
27
  });
28
28
  },
@@ -41,7 +41,7 @@ class ProjectGateway extends Object {
41
41
  add: () => {
42
42
  return this.context.ready.then((axios) => {
43
43
  return axios.upload(`/api/v2/coremde-sale/project/feedback/media/upload`, {
44
- title: "请选择上传文件"
44
+ title: '请选择上传文件',
45
45
  });
46
46
  });
47
47
  },
@@ -54,8 +54,8 @@ class ProjectGateway extends Object {
54
54
  return this.context.ready.then((axios) => {
55
55
  return axios.getAndPreview(`/api/v2/coremde-sale/project/feedback/media/download?id=${id}`, config);
56
56
  });
57
- }
58
- }
57
+ },
58
+ },
59
59
  };
60
60
  }
61
61
  get stat() {
@@ -73,7 +73,7 @@ class ProjectGateway extends Object {
73
73
  list: async (projectId) => {
74
74
  var axios = await this.context.ready;
75
75
  return axios.get(`/api/v2/coremde-sale/project/attendance/get?id=${projectId}`);
76
- }
76
+ },
77
77
  };
78
78
  }
79
79
  get constructionTeam() {
@@ -94,13 +94,13 @@ class ProjectGateway extends Object {
94
94
  return axios.post(`/api/v2/coremde-sale/project/document/list`, args);
95
95
  });
96
96
  },
97
- export: (id, fileName = "项目文档.pdf") => {
97
+ export: (id, fileName = '项目文档.pdf') => {
98
98
  return this.context.ready.then((axios) => {
99
99
  return axios.getAndSave(`/api/v2/coremde-sale/project/document/export`, {
100
100
  params: {
101
101
  id,
102
102
  },
103
- fileName
103
+ fileName,
104
104
  });
105
105
  });
106
106
  },
@@ -114,7 +114,7 @@ class ProjectGateway extends Object {
114
114
  view: (args) => {
115
115
  return this.context.ready.then((axios) => {
116
116
  return axios.get(`/api/v2/coremde-sale/project/document/view`, {
117
- params: args
117
+ params: args,
118
118
  });
119
119
  });
120
120
  },
@@ -123,10 +123,10 @@ class ProjectGateway extends Object {
123
123
  return this.context.ready.then((axios) => {
124
124
  return axios.getAndPreview(`/api/v2/coremde-sale/project/document/download`, {
125
125
  params: args,
126
- fileName: args.fileName || "项目文档",
126
+ fileName: args.fileName || '项目文档',
127
127
  });
128
128
  });
129
- }
129
+ },
130
130
  };
131
131
  }
132
132
  get material() {
@@ -160,7 +160,7 @@ class ProjectGateway extends Object {
160
160
  return this.context.ready.then((axios) => {
161
161
  return axios.get(`/api/v2/coremde-sale/project/material/delete/${id}`);
162
162
  });
163
- }
163
+ },
164
164
  };
165
165
  }
166
166
  //根据省份获取项目
@@ -216,14 +216,14 @@ class ProjectGateway extends Object {
216
216
  return axios.post(`/api/v2/coremde-sale/project/inquiry/restart`, args);
217
217
  });
218
218
  },
219
- export: (id, fileName = "询价.pdf") => {
219
+ export: (id, fileName = '询价.pdf') => {
220
220
  return this.context.ready.then((axios) => {
221
221
  return axios.getAndSave(`/api/v2/coremde-sale/project/inquiry/export`, {
222
222
  params: {
223
223
  id,
224
- fileName
224
+ fileName,
225
225
  },
226
- fileName
226
+ fileName,
227
227
  });
228
228
  });
229
229
  },
@@ -235,7 +235,7 @@ class ProjectGateway extends Object {
235
235
  documents: (args) => {
236
236
  return this.context.ready.then((axios) => {
237
237
  return axios.get(`/api/v2/coremde-sale/project/inquiry/documents`, {
238
- params: args
238
+ params: args,
239
239
  });
240
240
  });
241
241
  },
@@ -248,7 +248,7 @@ class ProjectGateway extends Object {
248
248
  return this.context.ready.then((axios) => {
249
249
  return axios.post(`/api/v2/coremde-sale/project/inquiry/answer`, args);
250
250
  });
251
- }
251
+ },
252
252
  };
253
253
  }
254
254
  get codePrefix() {
@@ -282,7 +282,7 @@ class ProjectGateway extends Object {
282
282
  return this.context.ready.then((axios) => {
283
283
  return axios.get(`/api/v2/coremde-sale/project/code-prefix/delete?id=${id}`);
284
284
  });
285
- }
285
+ },
286
286
  };
287
287
  }
288
288
  get stage() {
@@ -291,7 +291,7 @@ class ProjectGateway extends Object {
291
291
  selectList: (groupId) => {
292
292
  return this.context.ready.then((axios) => {
293
293
  return axios.get(`/api/v2/coremde-sale/project/stage/select-list`, {
294
- params: { groupId }
294
+ params: { groupId },
295
295
  });
296
296
  });
297
297
  },
@@ -311,7 +311,13 @@ class ProjectGateway extends Object {
311
311
  return this.context.ready.then((axios) => {
312
312
  return axios.post(`/api/v2/coremde-sale/project/stage/batchAdd`, stages);
313
313
  });
314
- }
314
+ },
315
+ // 获取公司下的所有阶段-ljk
316
+ companyStages: (companyId) => {
317
+ return this.context.ready.then((axios) => {
318
+ return axios.get(`/api/v2/coremde-sale/project/stage/list/${companyId}`);
319
+ });
320
+ },
315
321
  };
316
322
  }
317
323
  get bom() {
@@ -331,7 +337,7 @@ class ProjectGateway extends Object {
331
337
  // 发送POST请求创建BOM配置
332
338
  return axios.post(`/api/v2/coremde-sale/project/bom-config/create`, args);
333
339
  });
334
- }
340
+ },
335
341
  };
336
342
  }
337
343
  get plan() {
@@ -365,7 +371,7 @@ class ProjectGateway extends Object {
365
371
  return this.context.ready.then((axios) => {
366
372
  return axios.get(`/api/v2/coremde-sale/project/plan/delete?id=${id}`);
367
373
  });
368
- }
374
+ },
369
375
  };
370
376
  }
371
377
  get type() {
@@ -399,7 +405,31 @@ class ProjectGateway extends Object {
399
405
  return this.context.ready.then((axios) => {
400
406
  return axios.get(`/api/v2/coremde-sale/project/type/delete/${id}`);
401
407
  });
402
- }
408
+ },
409
+ // 根据项目类型获取配置的阶段-ljk
410
+ stagesByTypeId: (projectTypeId) => {
411
+ return this.context.ready.then((axios) => {
412
+ return axios.get(`/api/v2/coremde-sale/project/type/template/${projectTypeId}`);
413
+ });
414
+ },
415
+ // 批量新增项目类型中的阶段-ljk
416
+ stagesAdd: (args) => {
417
+ return this.context.ready.then((axios) => {
418
+ return axios.post(`/api/v2/coremde-sale/project/type/template/batchAdd`, args);
419
+ });
420
+ },
421
+ // 批量修改项目类型中的阶段-ljk
422
+ stagesUpdate: (args) => {
423
+ return this.context.ready.then((axios) => {
424
+ return axios.post(`/api/v2/coremde-sale/project/type/template/batchUpdate`, args);
425
+ });
426
+ },
427
+ // 删除项目类型下的所有阶段-ljk
428
+ stagesDeleteAll: (projectTypeId) => {
429
+ return this.context.ready.then((axios) => {
430
+ return axios.get(`/api/v2/coremde-sale/project/type/template/deleteAll/${projectTypeId}`);
431
+ });
432
+ },
403
433
  };
404
434
  }
405
435
  }
@@ -11,7 +11,7 @@ class UserGateway extends Object {
11
11
  return this.context.platform.getSelectedFarmFromMiniApp();
12
12
  }
13
13
  async selectUnit(unit) {
14
- if ((typeof unit === "string") || (typeof unit === "number")) {
14
+ if (typeof unit === 'string' || typeof unit === 'number') {
15
15
  var resp = await this.context.unit.get(unit);
16
16
  this.context.platform.setSelectedUnit(resp.data);
17
17
  }
@@ -31,15 +31,15 @@ class UserGateway extends Object {
31
31
  }
32
32
  async add(user) {
33
33
  var axios = await this.context.ready;
34
- return axios.post("/api/v2/user", user);
34
+ return axios.post('/api/v2/user', user);
35
35
  }
36
36
  async update(user) {
37
37
  var axios = await this.context.ready;
38
- return axios.post("/api/v2/user", user);
38
+ return axios.post('/api/v2/user', user);
39
39
  }
40
40
  async list(factory) {
41
41
  var axios = await this.context.ready;
42
- return axios.get("/api/v2/" + factory.id + "/users");
42
+ return axios.get('/api/v2/' + factory.id + '/users');
43
43
  }
44
44
  listByProvince(area_code) {
45
45
  return this.context.ready.then((axios) => {
@@ -53,9 +53,9 @@ class UserGateway extends Object {
53
53
  }
54
54
  async listByRole(role) {
55
55
  var args = {};
56
- if (typeof role === "string") {
56
+ if (typeof role === 'string') {
57
57
  args = {
58
- roleCode: role
58
+ roleCode: role,
59
59
  };
60
60
  }
61
61
  else {
@@ -65,7 +65,7 @@ class UserGateway extends Object {
65
65
  var factory = await this.context.user.getSelectedFarm();
66
66
  //当前如果打开的是公司,则说明该应用支持在公司级别打开,则要求该应用应该有对应的公司级别的角色配置,所以并不需要查找公司下属工厂或工厂的对应公司,再去查找用户
67
67
  return axios.get(`/api/v2/company/${factory.id}/users`, {
68
- params: args
68
+ params: args,
69
69
  });
70
70
  }
71
71
  async mypermission(params = undefined) {
@@ -78,29 +78,29 @@ class UserGateway extends Object {
78
78
  }
79
79
  else {
80
80
  args = {
81
- factoryId: (_a = factory.id) !== null && _a !== void 0 ? _a : 0
81
+ factoryId: (_a = factory.id) !== null && _a !== void 0 ? _a : 0,
82
82
  };
83
83
  }
84
- return axios.get("/api/v2/user/role/mypermission", {
85
- args
84
+ return axios.get('/api/v2/user/role/mypermission', {
85
+ args,
86
86
  });
87
87
  }
88
88
  async delete(id) {
89
89
  var axios = await this.context.ready;
90
- return axios.post("/api/v2/user/delete?id=" + id);
90
+ return axios.post('/api/v2/user/delete?id=' + id);
91
91
  }
92
92
  get avatar() {
93
93
  return {
94
94
  add: async (id) => {
95
95
  var axios = await this.context.ready;
96
96
  return axios.upload(`/api/v2/user/${id}/avatar/add`, {
97
- title: "请选择上传头像文件"
97
+ title: '请选择上传头像文件',
98
98
  });
99
99
  },
100
100
  get: async (id) => {
101
101
  var axios = await this.context.ready;
102
102
  return axios.get(`/api/v2/user/${id}/avatar`);
103
- }
103
+ },
104
104
  };
105
105
  }
106
106
  get sign() {
@@ -112,7 +112,7 @@ class UserGateway extends Object {
112
112
  get: async (id) => {
113
113
  var axios = await this.context.ready;
114
114
  return axios.get(`/api/v2/user/${id}/sign`);
115
- }
115
+ },
116
116
  };
117
117
  }
118
118
  get approval() {
@@ -121,7 +121,7 @@ class UserGateway extends Object {
121
121
  return this.context.ready.then((axios) => {
122
122
  return axios.post(`/api/v2/coremde-sale/approval/count`, {
123
123
  status,
124
- userId: id
124
+ userId: id,
125
125
  });
126
126
  });
127
127
  },
@@ -131,7 +131,7 @@ class UserGateway extends Object {
131
131
  status,
132
132
  userId: id,
133
133
  pageNo,
134
- pageSize
134
+ pageSize,
135
135
  });
136
136
  });
137
137
  },
@@ -141,11 +141,11 @@ class UserGateway extends Object {
141
141
  params: {
142
142
  userId: id,
143
143
  pageNo,
144
- pageSize
145
- }
144
+ pageSize,
145
+ },
146
146
  });
147
147
  });
148
- }
148
+ },
149
149
  };
150
150
  }
151
151
  get checkin() {
@@ -168,7 +168,7 @@ class UserGateway extends Object {
168
168
  return this.context.ready.then((axios) => {
169
169
  return axios.post(`/api/v2/coremde-sale/checkin/list`, {
170
170
  userId,
171
- yearMonth
171
+ yearMonth,
172
172
  });
173
173
  });
174
174
  },
@@ -177,7 +177,7 @@ class UserGateway extends Object {
177
177
  return this.context.ready.then((axios) => {
178
178
  return axios.get(`/api/v2/coremde-sale/checkin/get?id=${id}`);
179
179
  });
180
- }
180
+ },
181
181
  };
182
182
  }
183
183
  get searchHistory() {
@@ -185,7 +185,7 @@ class UserGateway extends Object {
185
185
  list: (type) => {
186
186
  return this.context.ready.then((axios) => {
187
187
  return axios.post(`/api/v2/coremde-sale/search/list`, {
188
- type
188
+ type,
189
189
  });
190
190
  });
191
191
  },
@@ -194,17 +194,17 @@ class UserGateway extends Object {
194
194
  return this.context.ready.then((axios) => {
195
195
  return axios.post(`/api/v2/coremde-sale/search/add`, {
196
196
  name: keyword,
197
- type
197
+ type,
198
198
  });
199
199
  });
200
200
  },
201
201
  delete: (ids) => {
202
202
  return this.context.ready.then((axios) => {
203
203
  return axios.post(`/api/v2/coremde-sale/search/delete`, {
204
- ids
204
+ ids,
205
205
  });
206
206
  });
207
- }
207
+ },
208
208
  };
209
209
  }
210
210
  //日报相关
@@ -234,7 +234,7 @@ class UserGateway extends Object {
234
234
  return this.context.ready.then((axios) => {
235
235
  return axios.get(`/api/v2/coremde-sale/user/work-report/delete?id=${id}`);
236
236
  });
237
- }
237
+ },
238
238
  };
239
239
  }
240
240
  get stat() {
@@ -251,8 +251,8 @@ class UserGateway extends Object {
251
251
  var factory = await this.context.user.getSelectedFarm();
252
252
  return axios.get(`/api/v1/user/info`, {
253
253
  params: {
254
- selected_factory: factory
255
- }
254
+ selected_factory: factory,
255
+ },
256
256
  });
257
257
  }
258
258
  async detail(userId) {
@@ -272,17 +272,17 @@ class UserGateway extends Object {
272
272
  return axios.post('/api/v2/coremde-sale/task/assign', {
273
273
  taskId,
274
274
  deptId,
275
- handleUserId
275
+ handleUserId,
276
276
  });
277
277
  });
278
278
  },
279
279
  // 任务催单功能
280
- remind: (taskId, handleUserId = 0, remindNotes = "") => {
280
+ remind: (taskId, handleUserId = 0, remindNotes = '') => {
281
281
  return this.context.ready.then((axios) => {
282
282
  return axios.post('/api/v2/coremde-sale/task/remind', {
283
283
  taskId,
284
284
  handleUserId,
285
- remindNotes
285
+ remindNotes,
286
286
  });
287
287
  });
288
288
  },
@@ -291,8 +291,8 @@ class UserGateway extends Object {
291
291
  return this.context.ready.then((axios) => {
292
292
  return axios.get('/api/v2/coremde-sale/task/accept', {
293
293
  params: {
294
- taskId
295
- }
294
+ taskId,
295
+ },
296
296
  });
297
297
  });
298
298
  },
@@ -301,7 +301,13 @@ class UserGateway extends Object {
301
301
  return this.context.ready.then((axios) => {
302
302
  return axios.post('/api/v2/coremde-sale/task/approve', params);
303
303
  });
304
- }
304
+ },
305
+ // 创建任务-ljk
306
+ create: (params) => {
307
+ return this.context.ready.then((axios) => {
308
+ return axios.post('/api/v2/coremde-sale/task/create', params);
309
+ });
310
+ },
305
311
  };
306
312
  }
307
313
  //根据组织机构id获得该组织机构下所有人员
@@ -321,8 +327,8 @@ class UserGateway extends Object {
321
327
  return this.context.ready.then((axios) => {
322
328
  return axios.get(`/api/v2/user/info/team`, {
323
329
  params: {
324
- name: searchName
325
- }
330
+ name: searchName,
331
+ },
326
332
  });
327
333
  });
328
334
  },
@@ -337,7 +343,7 @@ class UserGateway extends Object {
337
343
  return this.context.ready.then((axios) => {
338
344
  return axios.get(`/api/v2/user/info/dept/${deptName}`);
339
345
  });
340
- }
346
+ },
341
347
  };
342
348
  }
343
349
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.24",
3
+ "version": "1.3.25",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {