@cpzxrobot/sdk 1.3.23 → 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.
- package/device_gateway.ts +43 -4
- package/dist/device_gateway.js +40 -4
- package/dist/project_gateway.js +52 -22
- package/dist/user_gateway.js +43 -37
- package/package.json +1 -1
- package/platform_interface.ts +1 -1
- package/production_gateway.ts +2 -1
- package/project_gateway.ts +373 -268
- package/user_gateway.ts +185 -157
package/project_gateway.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { Cpzxrobot } from
|
|
1
|
+
import { Cpzxrobot } from './types'
|
|
2
2
|
|
|
3
3
|
export class ProjectGateway extends Object {
|
|
4
|
-
context: Cpzxrobot
|
|
4
|
+
context: Cpzxrobot
|
|
5
5
|
|
|
6
6
|
constructor(context: Cpzxrobot) {
|
|
7
|
-
super()
|
|
8
|
-
this.context = context
|
|
7
|
+
super()
|
|
8
|
+
this.context = context
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
list(args: {
|
|
12
|
-
pageNo: number
|
|
13
|
-
pageSize: number
|
|
14
|
-
name: string
|
|
15
|
-
companyId: number
|
|
16
|
-
projectProgress?: string
|
|
17
|
-
customerId?: number
|
|
18
|
-
groupId?: string
|
|
19
|
-
userId?: number
|
|
20
|
-
status?: string
|
|
12
|
+
pageNo: number
|
|
13
|
+
pageSize: number
|
|
14
|
+
name: string
|
|
15
|
+
companyId: number
|
|
16
|
+
projectProgress?: string
|
|
17
|
+
customerId?: number
|
|
18
|
+
groupId?: string
|
|
19
|
+
userId?: number
|
|
20
|
+
status?: string
|
|
21
21
|
}) {
|
|
22
22
|
return this.context.ready.then((axios) => {
|
|
23
|
-
return axios.post(`/api/v2/coremde-sale/project/list`, args)
|
|
24
|
-
})
|
|
23
|
+
return axios.post(`/api/v2/coremde-sale/project/list`, args)
|
|
24
|
+
})
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
get(id: number) {
|
|
28
28
|
return this.context.ready.then((axios) => {
|
|
29
|
-
return axios.get(`/api/v2/coremde-sale/project/get?id=${id}`)
|
|
30
|
-
})
|
|
29
|
+
return axios.get(`/api/v2/coremde-sale/project/get?id=${id}`)
|
|
30
|
+
})
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
get feedback() {
|
|
@@ -36,77 +36,88 @@ export class ProjectGateway extends Object {
|
|
|
36
36
|
return this.context.ready.then((axios) => {
|
|
37
37
|
return axios.post(`/api/v2/coremde-sale/project/feedback/add`, {
|
|
38
38
|
projectId,
|
|
39
|
-
content
|
|
40
|
-
})
|
|
41
|
-
})
|
|
39
|
+
content,
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
42
|
},
|
|
43
43
|
// 获取反馈列表
|
|
44
44
|
list: (args: {
|
|
45
|
-
pageNo: number
|
|
46
|
-
pageSize: number
|
|
47
|
-
projectId: number
|
|
48
|
-
companyId: number
|
|
45
|
+
pageNo: number
|
|
46
|
+
pageSize: number
|
|
47
|
+
projectId: number
|
|
48
|
+
companyId: number
|
|
49
49
|
}) => {
|
|
50
50
|
return this.context.ready.then((axios) => {
|
|
51
|
-
return axios.post(`/api/v2/coremde-sale/project/feedback/list`, args)
|
|
52
|
-
})
|
|
51
|
+
return axios.post(`/api/v2/coremde-sale/project/feedback/list`, args)
|
|
52
|
+
})
|
|
53
53
|
},
|
|
54
54
|
reply: (args: {
|
|
55
|
-
id: number
|
|
56
|
-
status: number
|
|
57
|
-
reply: string
|
|
58
|
-
companyId: number
|
|
59
|
-
medias: any[]
|
|
55
|
+
id: number
|
|
56
|
+
status: number
|
|
57
|
+
reply: string
|
|
58
|
+
companyId: number
|
|
59
|
+
medias: any[]
|
|
60
60
|
}) => {
|
|
61
61
|
return this.context.ready.then((axios) => {
|
|
62
|
-
return axios.post(`/api/v2/coremde-sale/project/feedback/reply`, args)
|
|
63
|
-
})
|
|
62
|
+
return axios.post(`/api/v2/coremde-sale/project/feedback/reply`, args)
|
|
63
|
+
})
|
|
64
64
|
},
|
|
65
65
|
media: {
|
|
66
66
|
add: () => {
|
|
67
67
|
return this.context.ready.then((axios) => {
|
|
68
|
-
return axios.upload(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
return axios.upload(
|
|
69
|
+
`/api/v2/coremde-sale/project/feedback/media/upload`,
|
|
70
|
+
{
|
|
71
|
+
title: '请选择上传文件',
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
})
|
|
72
75
|
},
|
|
73
76
|
cancel: (id: number) => {
|
|
74
77
|
return this.context.ready.then((axios) => {
|
|
75
|
-
return axios.get(
|
|
76
|
-
|
|
78
|
+
return axios.get(
|
|
79
|
+
`/api/v2/coremde-sale/project/feedback/media/cancel?id=${id}`
|
|
80
|
+
)
|
|
81
|
+
})
|
|
77
82
|
},
|
|
78
|
-
download: (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
download: (
|
|
84
|
+
id: number,
|
|
85
|
+
config: {
|
|
86
|
+
fileName?: string
|
|
87
|
+
preview?: boolean
|
|
88
|
+
params?: any
|
|
89
|
+
}
|
|
90
|
+
) => {
|
|
83
91
|
return this.context.ready.then((axios) => {
|
|
84
|
-
return axios.getAndPreview(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
return axios.getAndPreview(
|
|
93
|
+
`/api/v2/coremde-sale/project/feedback/media/download?id=${id}`,
|
|
94
|
+
config
|
|
95
|
+
)
|
|
96
|
+
})
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
}
|
|
89
100
|
}
|
|
90
101
|
|
|
91
102
|
get stat() {
|
|
92
103
|
return {
|
|
93
104
|
china: () => {
|
|
94
105
|
return this.context.ready.then((axios) => {
|
|
95
|
-
return axios.get(`/api/v2/coremde-sale/project/stat/china`)
|
|
96
|
-
})
|
|
106
|
+
return axios.get(`/api/v2/coremde-sale/project/stat/china`)
|
|
107
|
+
})
|
|
97
108
|
},
|
|
98
109
|
}
|
|
99
110
|
}
|
|
100
111
|
|
|
101
|
-
|
|
102
|
-
|
|
103
112
|
get attendance() {
|
|
104
113
|
return {
|
|
105
114
|
// 获取考勤列表
|
|
106
115
|
list: async (projectId: number) => {
|
|
107
|
-
var axios = await this.context.ready
|
|
108
|
-
return axios.get(
|
|
109
|
-
|
|
116
|
+
var axios = await this.context.ready
|
|
117
|
+
return axios.get(
|
|
118
|
+
`/api/v2/coremde-sale/project/attendance/get?id=${projectId}`
|
|
119
|
+
)
|
|
120
|
+
},
|
|
110
121
|
}
|
|
111
122
|
}
|
|
112
123
|
|
|
@@ -115,204 +126,228 @@ export class ProjectGateway extends Object {
|
|
|
115
126
|
// 获取施工队列表
|
|
116
127
|
list: (projectId: number) => {
|
|
117
128
|
return this.context.ready.then((axios) => {
|
|
118
|
-
return axios.get(
|
|
119
|
-
|
|
129
|
+
return axios.get(
|
|
130
|
+
`/api/v2/coremde-sale/project/construction/team/get?id=${projectId}`
|
|
131
|
+
)
|
|
132
|
+
})
|
|
120
133
|
},
|
|
121
|
-
}
|
|
134
|
+
}
|
|
122
135
|
}
|
|
123
136
|
|
|
124
137
|
get document() {
|
|
125
138
|
return {
|
|
126
139
|
// 获取文档列表
|
|
127
|
-
list: (args: {
|
|
128
|
-
pageNo: number;
|
|
129
|
-
pageSize: number;
|
|
130
|
-
projectId: number;
|
|
131
|
-
}) => {
|
|
140
|
+
list: (args: { pageNo: number; pageSize: number; projectId: number }) => {
|
|
132
141
|
return this.context.ready.then((axios) => {
|
|
133
|
-
return axios.post(`/api/v2/coremde-sale/project/document/list`, args)
|
|
134
|
-
})
|
|
142
|
+
return axios.post(`/api/v2/coremde-sale/project/document/list`, args)
|
|
143
|
+
})
|
|
135
144
|
},
|
|
136
|
-
export: (id: number, fileName: string =
|
|
145
|
+
export: (id: number, fileName: string = '项目文档.pdf') => {
|
|
137
146
|
return this.context.ready.then((axios) => {
|
|
138
|
-
return axios.getAndSave(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
147
|
+
return axios.getAndSave(
|
|
148
|
+
`/api/v2/coremde-sale/project/document/export`,
|
|
149
|
+
{
|
|
150
|
+
params: {
|
|
151
|
+
id,
|
|
152
|
+
},
|
|
153
|
+
fileName,
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
})
|
|
145
157
|
},
|
|
146
158
|
// 上传项目文档
|
|
147
159
|
upload: (args: {
|
|
148
|
-
projectId: number
|
|
149
|
-
files: any[]
|
|
150
|
-
groupId: number
|
|
151
|
-
fileType:
|
|
160
|
+
projectId: number
|
|
161
|
+
files: any[]
|
|
162
|
+
groupId: number
|
|
163
|
+
fileType: 'base-info' | 'inquiry' | 'contract'
|
|
152
164
|
}) => {
|
|
153
165
|
return this.context.ready.then((axios) => {
|
|
154
|
-
return axios.upload(
|
|
155
|
-
|
|
166
|
+
return axios.upload(
|
|
167
|
+
`/api/v2/coremde-sale/project/document/upload`,
|
|
168
|
+
args
|
|
169
|
+
)
|
|
170
|
+
})
|
|
156
171
|
},
|
|
157
172
|
// 预览项目文档
|
|
158
173
|
view: (args: { documentId: number }) => {
|
|
159
174
|
return this.context.ready.then((axios) => {
|
|
160
175
|
return axios.get(`/api/v2/coremde-sale/project/document/view`, {
|
|
161
|
-
params: args
|
|
162
|
-
})
|
|
163
|
-
})
|
|
176
|
+
params: args,
|
|
177
|
+
})
|
|
178
|
+
})
|
|
164
179
|
},
|
|
165
180
|
// 下载项目文档
|
|
166
|
-
download: (args: {
|
|
181
|
+
download: (args: {
|
|
182
|
+
documentId: number
|
|
183
|
+
fileName?: string
|
|
184
|
+
preview?: boolean
|
|
185
|
+
}) => {
|
|
167
186
|
return this.context.ready.then((axios) => {
|
|
168
|
-
return axios.getAndPreview(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
187
|
+
return axios.getAndPreview(
|
|
188
|
+
`/api/v2/coremde-sale/project/document/download`,
|
|
189
|
+
{
|
|
190
|
+
params: args,
|
|
191
|
+
fileName: args.fileName || '项目文档',
|
|
192
|
+
}
|
|
193
|
+
)
|
|
194
|
+
})
|
|
195
|
+
},
|
|
196
|
+
}
|
|
175
197
|
}
|
|
176
198
|
|
|
177
|
-
|
|
178
199
|
get material() {
|
|
179
200
|
return {
|
|
180
201
|
// 获取材料列表
|
|
181
202
|
list: (args: {
|
|
182
|
-
pageNo: number
|
|
183
|
-
pageSize: number
|
|
184
|
-
companyId: number
|
|
185
|
-
materialCode?: string
|
|
186
|
-
materialName?: string
|
|
203
|
+
pageNo: number
|
|
204
|
+
pageSize: number
|
|
205
|
+
companyId: number
|
|
206
|
+
materialCode?: string
|
|
207
|
+
materialName?: string
|
|
187
208
|
}) => {
|
|
188
209
|
return this.context.ready.then((axios) => {
|
|
189
|
-
return axios.post(`/api/v2/coremde-sale/project/material/list`, args)
|
|
190
|
-
})
|
|
210
|
+
return axios.post(`/api/v2/coremde-sale/project/material/list`, args)
|
|
211
|
+
})
|
|
191
212
|
},
|
|
192
213
|
// 获取材料详情
|
|
193
214
|
get: (id: number) => {
|
|
194
215
|
return this.context.ready.then((axios) => {
|
|
195
|
-
return axios.get(`/api/v2/coremde-sale/project/material/${id}`)
|
|
196
|
-
})
|
|
216
|
+
return axios.get(`/api/v2/coremde-sale/project/material/${id}`)
|
|
217
|
+
})
|
|
197
218
|
},
|
|
198
219
|
// 新增材料
|
|
199
220
|
add: (args: {
|
|
200
|
-
materialName: string
|
|
201
|
-
materialCode: string
|
|
202
|
-
depotQty: string
|
|
203
|
-
companyId: number
|
|
204
|
-
[key: string]: any
|
|
221
|
+
materialName: string
|
|
222
|
+
materialCode: string
|
|
223
|
+
depotQty: string
|
|
224
|
+
companyId: number
|
|
225
|
+
[key: string]: any
|
|
205
226
|
}) => {
|
|
206
227
|
return this.context.ready.then((axios) => {
|
|
207
|
-
return axios.post(`/api/v2/coremde-sale/project/material/add`, args)
|
|
208
|
-
})
|
|
228
|
+
return axios.post(`/api/v2/coremde-sale/project/material/add`, args)
|
|
229
|
+
})
|
|
209
230
|
},
|
|
210
231
|
// 修改材料
|
|
211
232
|
update: (args: {
|
|
212
|
-
id: number
|
|
213
|
-
materialName: string
|
|
214
|
-
materialCode: string
|
|
215
|
-
depotQty: string
|
|
216
|
-
companyId: number
|
|
217
|
-
[key: string]: any
|
|
233
|
+
id: number
|
|
234
|
+
materialName: string
|
|
235
|
+
materialCode: string
|
|
236
|
+
depotQty: string
|
|
237
|
+
companyId: number
|
|
238
|
+
[key: string]: any
|
|
218
239
|
}) => {
|
|
219
240
|
return this.context.ready.then((axios) => {
|
|
220
|
-
return axios.post(
|
|
221
|
-
|
|
241
|
+
return axios.post(
|
|
242
|
+
`/api/v2/coremde-sale/project/material/update`,
|
|
243
|
+
args
|
|
244
|
+
)
|
|
245
|
+
})
|
|
222
246
|
},
|
|
223
247
|
// 删除材料
|
|
224
248
|
delete: (id: number) => {
|
|
225
249
|
return this.context.ready.then((axios) => {
|
|
226
|
-
return axios.get(`/api/v2/coremde-sale/project/material/delete/${id}`)
|
|
227
|
-
})
|
|
228
|
-
}
|
|
250
|
+
return axios.get(`/api/v2/coremde-sale/project/material/delete/${id}`)
|
|
251
|
+
})
|
|
252
|
+
},
|
|
229
253
|
}
|
|
230
254
|
}
|
|
231
255
|
|
|
232
256
|
//根据省份获取项目
|
|
233
257
|
listByProvince(area_code: string) {
|
|
234
258
|
return this.context.ready.then((axios) => {
|
|
235
|
-
return axios.get(
|
|
236
|
-
|
|
259
|
+
return axios.get(
|
|
260
|
+
`/api/v2/coremde-sale/project/province/get?area_code=${area_code}`
|
|
261
|
+
)
|
|
262
|
+
})
|
|
237
263
|
}
|
|
238
264
|
|
|
239
265
|
// 新增项目
|
|
240
266
|
add(projectData: any) {
|
|
241
267
|
return this.context.ready.then((axios) => {
|
|
242
|
-
return axios.post(`/api/v2/coremde-sale/project/add`, projectData)
|
|
243
|
-
})
|
|
268
|
+
return axios.post(`/api/v2/coremde-sale/project/add`, projectData)
|
|
269
|
+
})
|
|
244
270
|
}
|
|
245
271
|
|
|
246
272
|
// 更新项目
|
|
247
273
|
update(projectData: any) {
|
|
248
274
|
// 等待context的ready状态完成
|
|
249
275
|
return this.context.ready.then((axios) => {
|
|
250
|
-
return axios.post(`/api/v2/coremde-sale/project/update`, projectData)
|
|
276
|
+
return axios.post(`/api/v2/coremde-sale/project/update`, projectData)
|
|
251
277
|
// 使用axios发送POST请求到/api/v2/coremde-sale/project/update接口,并传递projectData作为参数
|
|
252
|
-
return axios.post(`/api/v2/coremde-sale/project/update`, projectData)
|
|
253
|
-
})
|
|
278
|
+
return axios.post(`/api/v2/coremde-sale/project/update`, projectData)
|
|
279
|
+
})
|
|
254
280
|
}
|
|
255
281
|
|
|
256
282
|
// 删除项目
|
|
257
283
|
delete(id: number) {
|
|
258
284
|
return this.context.ready.then((axios) => {
|
|
259
|
-
return axios.get(`/api/v2/coremde-sale/project/delete?id=${id}`)
|
|
260
|
-
})
|
|
285
|
+
return axios.get(`/api/v2/coremde-sale/project/delete?id=${id}`)
|
|
286
|
+
})
|
|
261
287
|
}
|
|
262
288
|
|
|
263
289
|
get inquiry() {
|
|
264
290
|
return {
|
|
265
291
|
// 获取询价列表
|
|
266
292
|
list: (args: {
|
|
267
|
-
pageNo: number
|
|
268
|
-
pageSize: number
|
|
269
|
-
name: string
|
|
270
|
-
companyId: number
|
|
293
|
+
pageNo: number
|
|
294
|
+
pageSize: number
|
|
295
|
+
name: string
|
|
296
|
+
companyId: number
|
|
271
297
|
}) => {
|
|
272
298
|
return this.context.ready.then((axios) => {
|
|
273
|
-
return axios.post(`/api/v2/coremde-sale/project/inquiry/list`, args)
|
|
274
|
-
})
|
|
299
|
+
return axios.post(`/api/v2/coremde-sale/project/inquiry/list`, args)
|
|
300
|
+
})
|
|
275
301
|
},
|
|
276
302
|
// 获取询价详情
|
|
277
303
|
get: (id: number) => {
|
|
278
304
|
return this.context.ready.then((axios) => {
|
|
279
|
-
return axios.get(`/api/v2/coremde-sale/project/inquiry/get?id=${id}`)
|
|
280
|
-
})
|
|
305
|
+
return axios.get(`/api/v2/coremde-sale/project/inquiry/get?id=${id}`)
|
|
306
|
+
})
|
|
281
307
|
},
|
|
282
308
|
//申请报价单
|
|
283
309
|
add: (args: any) => {
|
|
284
310
|
return this.context.ready.then((axios) => {
|
|
285
|
-
return axios.post(`/api/v2/coremde-sale/project/inquiry/apply`, args)
|
|
286
|
-
})
|
|
311
|
+
return axios.post(`/api/v2/coremde-sale/project/inquiry/apply`, args)
|
|
312
|
+
})
|
|
287
313
|
},
|
|
288
314
|
//重新提交询价审核流程
|
|
289
315
|
restart: (args: any) => {
|
|
290
316
|
return this.context.ready.then((axios) => {
|
|
291
|
-
return axios.post(
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
317
|
+
return axios.post(
|
|
318
|
+
`/api/v2/coremde-sale/project/inquiry/restart`,
|
|
319
|
+
args
|
|
320
|
+
)
|
|
321
|
+
})
|
|
322
|
+
},
|
|
323
|
+
export: (id: number, fileName: string = '询价.pdf') => {
|
|
324
|
+
return this.context.ready.then((axios) => {
|
|
325
|
+
return axios.getAndSave(
|
|
326
|
+
`/api/v2/coremde-sale/project/inquiry/export`,
|
|
327
|
+
{
|
|
328
|
+
params: {
|
|
329
|
+
id,
|
|
330
|
+
fileName,
|
|
331
|
+
},
|
|
332
|
+
fileName,
|
|
333
|
+
}
|
|
334
|
+
)
|
|
335
|
+
})
|
|
304
336
|
},
|
|
305
337
|
approval: (args: any) => {
|
|
306
338
|
return this.context.ready.then((axios) => {
|
|
307
|
-
return axios.post(
|
|
308
|
-
|
|
339
|
+
return axios.post(
|
|
340
|
+
`/api/v2/coremde-sale/project/inquiry/approve`,
|
|
341
|
+
args
|
|
342
|
+
)
|
|
343
|
+
})
|
|
309
344
|
},
|
|
310
345
|
documents: (args: any) => {
|
|
311
346
|
return this.context.ready.then((axios) => {
|
|
312
347
|
return axios.get(`/api/v2/coremde-sale/project/inquiry/documents`, {
|
|
313
|
-
params: args
|
|
314
|
-
})
|
|
315
|
-
})
|
|
348
|
+
params: args,
|
|
349
|
+
})
|
|
350
|
+
})
|
|
316
351
|
},
|
|
317
352
|
/**
|
|
318
353
|
* 商务部响应报价申请,制作报价单
|
|
@@ -320,65 +355,88 @@ export class ProjectGateway extends Object {
|
|
|
320
355
|
* @returns Promise
|
|
321
356
|
*/
|
|
322
357
|
answer: (args: {
|
|
323
|
-
projectId: number
|
|
324
|
-
projectStageRecordId: number
|
|
325
|
-
quotationContent: string
|
|
326
|
-
amount: number
|
|
327
|
-
quotationCost: number
|
|
328
|
-
quotationGrossProfit: number
|
|
329
|
-
tax: number
|
|
330
|
-
taxRatio: number
|
|
331
|
-
validDay: number
|
|
332
|
-
projectStageId: number
|
|
333
|
-
groupId: number
|
|
334
|
-
materialInfo: string
|
|
358
|
+
projectId: number
|
|
359
|
+
projectStageRecordId: number
|
|
360
|
+
quotationContent: string
|
|
361
|
+
amount: number
|
|
362
|
+
quotationCost: number
|
|
363
|
+
quotationGrossProfit: number
|
|
364
|
+
tax: number
|
|
365
|
+
taxRatio: number
|
|
366
|
+
validDay: number
|
|
367
|
+
projectStageId: number
|
|
368
|
+
groupId: number
|
|
369
|
+
materialInfo: string
|
|
335
370
|
}) => {
|
|
336
371
|
return this.context.ready.then((axios) => {
|
|
337
|
-
return axios.post(`/api/v2/coremde-sale/project/inquiry/answer`, args)
|
|
338
|
-
})
|
|
339
|
-
}
|
|
340
|
-
}
|
|
372
|
+
return axios.post(`/api/v2/coremde-sale/project/inquiry/answer`, args)
|
|
373
|
+
})
|
|
374
|
+
},
|
|
375
|
+
}
|
|
341
376
|
}
|
|
342
377
|
|
|
343
378
|
get codePrefix() {
|
|
344
379
|
return {
|
|
345
380
|
// 添加code前缀
|
|
346
|
-
add: (args: {
|
|
381
|
+
add: (args: {
|
|
382
|
+
codePrefix: string
|
|
383
|
+
description: string
|
|
384
|
+
groupId?: number
|
|
385
|
+
projectTypeld?: number
|
|
386
|
+
}) => {
|
|
347
387
|
return this.context.ready.then((axios) => {
|
|
348
|
-
return axios.post(
|
|
349
|
-
|
|
388
|
+
return axios.post(
|
|
389
|
+
`/api/v2/coremde-sale/project/code-prefix/add`,
|
|
390
|
+
args
|
|
391
|
+
)
|
|
392
|
+
})
|
|
350
393
|
},
|
|
351
394
|
// 获取code前缀列表
|
|
352
395
|
list: (args: {
|
|
353
|
-
pageNo: number
|
|
354
|
-
pageSize: number
|
|
355
|
-
projectCode?: string
|
|
356
|
-
description?: string
|
|
357
|
-
groupId?: number
|
|
396
|
+
pageNo: number
|
|
397
|
+
pageSize: number
|
|
398
|
+
projectCode?: string
|
|
399
|
+
description?: string
|
|
400
|
+
groupId?: number
|
|
358
401
|
}) => {
|
|
359
402
|
return this.context.ready.then((axios) => {
|
|
360
|
-
return axios.post(
|
|
361
|
-
|
|
403
|
+
return axios.post(
|
|
404
|
+
`/api/v2/coremde-sale/project/code-prefix/list`,
|
|
405
|
+
args
|
|
406
|
+
)
|
|
407
|
+
})
|
|
362
408
|
},
|
|
363
409
|
// 获取单个code前缀详情
|
|
364
410
|
get: (id: number) => {
|
|
365
411
|
return this.context.ready.then((axios) => {
|
|
366
|
-
return axios.get(
|
|
367
|
-
|
|
412
|
+
return axios.get(
|
|
413
|
+
`/api/v2/coremde-sale/project/code-prefix/get?id=${id}`
|
|
414
|
+
)
|
|
415
|
+
})
|
|
368
416
|
},
|
|
369
417
|
// 更新code前缀
|
|
370
|
-
update: (args: {
|
|
418
|
+
update: (args: {
|
|
419
|
+
codePrefix: string
|
|
420
|
+
description: string
|
|
421
|
+
id: number
|
|
422
|
+
projectTypeld?: number
|
|
423
|
+
}) => {
|
|
371
424
|
return this.context.ready.then((axios) => {
|
|
372
|
-
return axios.post(
|
|
373
|
-
|
|
425
|
+
return axios.post(
|
|
426
|
+
`/api/v2/coremde-sale/project/code-prefix/update`,
|
|
427
|
+
args
|
|
428
|
+
)
|
|
429
|
+
})
|
|
374
430
|
},
|
|
375
431
|
// 删除code前缀
|
|
376
432
|
delete: (id: number) => {
|
|
377
433
|
return this.context.ready.then((axios) => {
|
|
378
|
-
return axios.get(
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
434
|
+
return axios.get(
|
|
435
|
+
`/api/v2/coremde-sale/project/code-prefix/delete?id=${id}`
|
|
436
|
+
)
|
|
437
|
+
})
|
|
438
|
+
},
|
|
439
|
+
}
|
|
382
440
|
}
|
|
383
441
|
|
|
384
442
|
get stage() {
|
|
@@ -387,27 +445,42 @@ export class ProjectGateway extends Object {
|
|
|
387
445
|
selectList: (groupId: number) => {
|
|
388
446
|
return this.context.ready.then((axios) => {
|
|
389
447
|
return axios.get(`/api/v2/coremde-sale/project/stage/select-list`, {
|
|
390
|
-
params: { groupId }
|
|
391
|
-
})
|
|
392
|
-
})
|
|
448
|
+
params: { groupId },
|
|
449
|
+
})
|
|
450
|
+
})
|
|
393
451
|
},
|
|
394
452
|
details: (projectId: number) => {
|
|
395
453
|
return this.context.ready.then((axios) => {
|
|
396
|
-
return axios.get(
|
|
397
|
-
|
|
454
|
+
return axios.get(
|
|
455
|
+
`/api/v2/coremde-sale/project/stage/details?projectId=${projectId}`
|
|
456
|
+
)
|
|
457
|
+
})
|
|
398
458
|
},
|
|
399
459
|
// 根据项目ID获取阶段模板
|
|
400
460
|
type: (projectId: number) => {
|
|
401
461
|
return this.context.ready.then((axios) => {
|
|
402
|
-
return axios.get(
|
|
403
|
-
|
|
462
|
+
return axios.get(
|
|
463
|
+
`/api/v2/coremde-sale/project/stage/type/${projectId}`
|
|
464
|
+
)
|
|
465
|
+
})
|
|
404
466
|
},
|
|
405
467
|
// 批量保存项目阶段
|
|
406
468
|
batchAdd: (stages: any[]) => {
|
|
407
469
|
return this.context.ready.then((axios) => {
|
|
408
|
-
return axios.post(
|
|
409
|
-
|
|
410
|
-
|
|
470
|
+
return axios.post(
|
|
471
|
+
`/api/v2/coremde-sale/project/stage/batchAdd`,
|
|
472
|
+
stages
|
|
473
|
+
)
|
|
474
|
+
})
|
|
475
|
+
},
|
|
476
|
+
// 获取公司下的所有阶段-ljk
|
|
477
|
+
companyStages: (companyId: any) => {
|
|
478
|
+
return this.context.ready.then((axios) => {
|
|
479
|
+
return axios.get(
|
|
480
|
+
`/api/v2/coremde-sale/project/stage/list/${companyId}`
|
|
481
|
+
)
|
|
482
|
+
})
|
|
483
|
+
},
|
|
411
484
|
}
|
|
412
485
|
}
|
|
413
486
|
|
|
@@ -419,13 +492,12 @@ export class ProjectGateway extends Object {
|
|
|
419
492
|
* @returns Promise
|
|
420
493
|
*/
|
|
421
494
|
add: (args: {
|
|
422
|
-
projectId: number
|
|
423
|
-
projectStageRecordId: number
|
|
424
|
-
projectStageId: number
|
|
425
|
-
materialInfo: string
|
|
426
|
-
groupId: number
|
|
495
|
+
projectId: number
|
|
496
|
+
projectStageRecordId: number
|
|
497
|
+
projectStageId: number
|
|
498
|
+
materialInfo: string
|
|
499
|
+
groupId: number
|
|
427
500
|
}) => {
|
|
428
|
-
|
|
429
501
|
// 等待context准备好
|
|
430
502
|
/**
|
|
431
503
|
* @param args BOM配置参数
|
|
@@ -433,116 +505,149 @@ export class ProjectGateway extends Object {
|
|
|
433
505
|
*/
|
|
434
506
|
return this.context.ready.then((axios) => {
|
|
435
507
|
// 发送POST请求创建BOM配置
|
|
436
|
-
return axios.post(
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
508
|
+
return axios.post(
|
|
509
|
+
`/api/v2/coremde-sale/project/bom-config/create`,
|
|
510
|
+
args
|
|
511
|
+
)
|
|
512
|
+
})
|
|
513
|
+
},
|
|
514
|
+
}
|
|
440
515
|
}
|
|
441
516
|
|
|
442
517
|
get plan() {
|
|
443
518
|
return {
|
|
444
519
|
// 创建计划
|
|
445
520
|
add: (args: {
|
|
446
|
-
projectId: number
|
|
447
|
-
planStartDate: string
|
|
448
|
-
planEndDate: string
|
|
449
|
-
departmentId: number
|
|
450
|
-
projectNodeId: number
|
|
451
|
-
projectManager: string
|
|
452
|
-
groupId: number
|
|
521
|
+
projectId: number
|
|
522
|
+
planStartDate: string
|
|
523
|
+
planEndDate: string
|
|
524
|
+
departmentId: number
|
|
525
|
+
projectNodeId: number
|
|
526
|
+
projectManager: string
|
|
527
|
+
groupId: number
|
|
453
528
|
}) => {
|
|
454
529
|
return this.context.ready.then((axios) => {
|
|
455
|
-
return axios.post(`/api/v2/coremde-sale/project/plan/add`, args)
|
|
456
|
-
})
|
|
530
|
+
return axios.post(`/api/v2/coremde-sale/project/plan/add`, args)
|
|
531
|
+
})
|
|
457
532
|
},
|
|
458
533
|
// 分页获取计划列表
|
|
459
534
|
list: (args: {
|
|
460
|
-
pageNo: number
|
|
461
|
-
pageSize: number
|
|
462
|
-
projectId?: number
|
|
463
|
-
projectNodeId?: number
|
|
464
|
-
planStartDate?: string
|
|
465
|
-
planEndDate?: string
|
|
535
|
+
pageNo: number
|
|
536
|
+
pageSize: number
|
|
537
|
+
projectId?: number
|
|
538
|
+
projectNodeId?: number
|
|
539
|
+
planStartDate?: string
|
|
540
|
+
planEndDate?: string
|
|
466
541
|
}) => {
|
|
467
542
|
return this.context.ready.then((axios) => {
|
|
468
|
-
return axios.post(`/api/v2/coremde-sale/project/plan/list`, args)
|
|
469
|
-
})
|
|
543
|
+
return axios.post(`/api/v2/coremde-sale/project/plan/list`, args)
|
|
544
|
+
})
|
|
470
545
|
},
|
|
471
546
|
// 获取单个计划详情
|
|
472
547
|
get: (id: number) => {
|
|
473
548
|
return this.context.ready.then((axios) => {
|
|
474
|
-
return axios.get(`/api/v2/coremde-sale/project/plan/get?id=${id}`)
|
|
475
|
-
})
|
|
549
|
+
return axios.get(`/api/v2/coremde-sale/project/plan/get?id=${id}`)
|
|
550
|
+
})
|
|
476
551
|
},
|
|
477
552
|
// 更新计划
|
|
478
553
|
update: (args: {
|
|
479
|
-
planStartDate: string
|
|
480
|
-
planEndDate: string
|
|
481
|
-
departmentId: number
|
|
482
|
-
projectNodeId: number
|
|
483
|
-
projectManager: string
|
|
484
|
-
id: number
|
|
554
|
+
planStartDate: string
|
|
555
|
+
planEndDate: string
|
|
556
|
+
departmentId: number
|
|
557
|
+
projectNodeId: number
|
|
558
|
+
projectManager: string
|
|
559
|
+
id: number
|
|
485
560
|
}) => {
|
|
486
561
|
return this.context.ready.then((axios) => {
|
|
487
|
-
return axios.post(`/api/v2/coremde-sale/project/plan/update`, args)
|
|
488
|
-
})
|
|
562
|
+
return axios.post(`/api/v2/coremde-sale/project/plan/update`, args)
|
|
563
|
+
})
|
|
489
564
|
},
|
|
490
565
|
// 删除计划
|
|
491
566
|
delete: (id: number) => {
|
|
492
567
|
return this.context.ready.then((axios) => {
|
|
493
|
-
return axios.get(`/api/v2/coremde-sale/project/plan/delete?id=${id}`)
|
|
494
|
-
})
|
|
495
|
-
}
|
|
496
|
-
}
|
|
568
|
+
return axios.get(`/api/v2/coremde-sale/project/plan/delete?id=${id}`)
|
|
569
|
+
})
|
|
570
|
+
},
|
|
571
|
+
}
|
|
497
572
|
}
|
|
498
573
|
|
|
499
574
|
get type() {
|
|
500
575
|
return {
|
|
501
576
|
// 获取类型列表
|
|
502
|
-
list: (args: {
|
|
503
|
-
pageNo: number;
|
|
504
|
-
pageSize: number;
|
|
505
|
-
CompanyId: number;
|
|
506
|
-
}) => {
|
|
577
|
+
list: (args: { pageNo: number; pageSize: number; CompanyId: number }) => {
|
|
507
578
|
return this.context.ready.then((axios) => {
|
|
508
|
-
return axios.post(`/api/v2/coremde-sale/project/type/list`, args)
|
|
509
|
-
})
|
|
579
|
+
return axios.post(`/api/v2/coremde-sale/project/type/list`, args)
|
|
580
|
+
})
|
|
510
581
|
},
|
|
511
582
|
// 获取类型详情
|
|
512
583
|
get: (id: number) => {
|
|
513
584
|
return this.context.ready.then((axios) => {
|
|
514
|
-
return axios.get(`/api/v2/coremde-sale/project/type/get/${id}`)
|
|
515
|
-
})
|
|
585
|
+
return axios.get(`/api/v2/coremde-sale/project/type/get/${id}`)
|
|
586
|
+
})
|
|
516
587
|
},
|
|
517
588
|
// 新增项目类型
|
|
518
589
|
add: (args: {
|
|
519
|
-
typeName: string
|
|
520
|
-
CompanyId: number
|
|
521
|
-
codePrefix: string
|
|
522
|
-
remark?: string
|
|
590
|
+
typeName: string
|
|
591
|
+
CompanyId: number
|
|
592
|
+
codePrefix: string
|
|
593
|
+
remark?: string
|
|
523
594
|
}) => {
|
|
524
595
|
return this.context.ready.then((axios) => {
|
|
525
|
-
return axios.post(`/api/v2/coremde-sale/project/type/add`, args)
|
|
526
|
-
})
|
|
596
|
+
return axios.post(`/api/v2/coremde-sale/project/type/add`, args)
|
|
597
|
+
})
|
|
527
598
|
},
|
|
528
599
|
// 修改项目类型
|
|
529
600
|
update: (args: {
|
|
530
|
-
id: number
|
|
531
|
-
typeName: string
|
|
532
|
-
CompanyId: number
|
|
533
|
-
codePrefix: string
|
|
534
|
-
remark?: string
|
|
601
|
+
id: number
|
|
602
|
+
typeName: string
|
|
603
|
+
CompanyId: number
|
|
604
|
+
codePrefix: string
|
|
605
|
+
remark?: string
|
|
535
606
|
}) => {
|
|
536
607
|
return this.context.ready.then((axios) => {
|
|
537
|
-
return axios.post(`/api/v2/coremde-sale/project/type/update`, args)
|
|
538
|
-
})
|
|
608
|
+
return axios.post(`/api/v2/coremde-sale/project/type/update`, args)
|
|
609
|
+
})
|
|
539
610
|
},
|
|
540
611
|
// 删除项目类型
|
|
541
612
|
delete: (id: number) => {
|
|
542
613
|
return this.context.ready.then((axios) => {
|
|
543
|
-
return axios.get(`/api/v2/coremde-sale/project/type/delete/${id}`)
|
|
544
|
-
})
|
|
545
|
-
}
|
|
546
|
-
|
|
614
|
+
return axios.get(`/api/v2/coremde-sale/project/type/delete/${id}`)
|
|
615
|
+
})
|
|
616
|
+
},
|
|
617
|
+
// 根据项目类型获取配置的阶段-ljk
|
|
618
|
+
stagesByTypeId: (projectTypeId: number) => {
|
|
619
|
+
return this.context.ready.then((axios) => {
|
|
620
|
+
return axios.get(
|
|
621
|
+
`/api/v2/coremde-sale/project/type/template/${projectTypeId}`
|
|
622
|
+
)
|
|
623
|
+
})
|
|
624
|
+
},
|
|
625
|
+
// 批量新增项目类型中的阶段-ljk
|
|
626
|
+
stagesAdd: (args: any) => {
|
|
627
|
+
return this.context.ready.then((axios) => {
|
|
628
|
+
return axios.post(
|
|
629
|
+
`/api/v2/coremde-sale/project/type/template/batchAdd`,
|
|
630
|
+
args
|
|
631
|
+
)
|
|
632
|
+
})
|
|
633
|
+
},
|
|
634
|
+
// 批量修改项目类型中的阶段-ljk
|
|
635
|
+
stagesUpdate: (args: any) => {
|
|
636
|
+
return this.context.ready.then((axios) => {
|
|
637
|
+
return axios.post(
|
|
638
|
+
`/api/v2/coremde-sale/project/type/template/batchUpdate`,
|
|
639
|
+
args
|
|
640
|
+
)
|
|
641
|
+
})
|
|
642
|
+
},
|
|
643
|
+
// 删除项目类型下的所有阶段-ljk
|
|
644
|
+
stagesDeleteAll: (projectTypeId: number) => {
|
|
645
|
+
return this.context.ready.then((axios) => {
|
|
646
|
+
return axios.get(
|
|
647
|
+
`/api/v2/coremde-sale/project/type/template/deleteAll/${projectTypeId}`
|
|
648
|
+
)
|
|
649
|
+
})
|
|
650
|
+
},
|
|
651
|
+
}
|
|
547
652
|
}
|
|
548
653
|
}
|