@cpzxrobot/sdk 1.3.69 → 1.3.71
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/company_gateway.ts +3 -2
- package/device_filter.ts +4 -4
- package/device_gateway.ts +12 -2
- package/device_types/feedtower.ts +5 -5
- package/dist/camera_gateway.js +61 -42
- package/dist/car_gateway.js +54 -31
- package/dist/chickenfarm_gateway.js +11 -2
- package/dist/company_gateway.js +120 -94
- package/dist/device_gateway.js +210 -181
- package/dist/device_types/feedtower.js +130 -101
- package/dist/energy_gateway.js +33 -20
- package/dist/factory_gateway.js +129 -90
- package/dist/index.js +1 -1
- package/dist/mobile_platform.js +70 -43
- package/dist/pigfarm_gateway.js +51 -42
- package/dist/production_gateway.js +31 -18
- package/dist/project_gateway.js +12 -3
- package/dist/purchase_gateway.js +73 -38
- package/dist/sensor_datas.js +23 -11
- package/dist/sparepart_gateway.js +27 -18
- package/dist/test_strict.js +18 -0
- package/dist/user_gateway.js +131 -100
- package/dist/warehouse_gateway.js +34 -15
- package/dist/web_platform.js +213 -194
- package/dist/windows_platform.js +15 -5
- package/factory_gateway.ts +2 -2
- package/index.ts +3 -3
- package/mobile_platform.ts +3 -3
- package/news_gateway.ts +1 -1
- package/package.json +1 -1
- package/sensor_datas.ts +27 -16
- package/test_strict.ts +22 -0
- package/tsconfig.json +19 -19
- package/types.d.ts +12 -49
- package/web_platform.ts +15 -15
- package/windows_platform.ts +3 -3
package/dist/mobile_platform.js
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.MobilePlatform = void 0;
|
|
4
13
|
class MobilePlatform {
|
|
14
|
+
// private port: MessagePort | null = null;
|
|
5
15
|
constructor() {
|
|
6
16
|
this.sseCallbacks = {};
|
|
7
17
|
this.token = "";
|
|
8
18
|
this.appCode = "";
|
|
9
19
|
this.baseURL = "";
|
|
10
|
-
this.port = null;
|
|
11
20
|
// @ts-ignore
|
|
12
21
|
this.platform = window.flutter_inappwebview;
|
|
13
22
|
}
|
|
@@ -20,9 +29,9 @@ class MobilePlatform {
|
|
|
20
29
|
getToken() {
|
|
21
30
|
return "";
|
|
22
31
|
}
|
|
23
|
-
setToken(
|
|
32
|
+
setToken(_token) {
|
|
24
33
|
}
|
|
25
|
-
setSelectedFarm(
|
|
34
|
+
setSelectedFarm(_farm) {
|
|
26
35
|
throw new Error("Method not implemented.");
|
|
27
36
|
}
|
|
28
37
|
setSelectedUnit(unit) {
|
|
@@ -83,65 +92,83 @@ class MobilePlatform {
|
|
|
83
92
|
upload: function (url, option) {
|
|
84
93
|
return that.platform.callHandler("axios_upload", url, option);
|
|
85
94
|
},
|
|
86
|
-
getAsSse:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
getAsSse: function (url, fn, config) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
var randomId = Math.random().toString(36).substring(2);
|
|
98
|
+
that.sseCallbacks[randomId] = fn;
|
|
99
|
+
console.log("getAsSse", url, fn, randomId);
|
|
100
|
+
yield that.platform.callHandler("axios_getAsSse", url, config, randomId);
|
|
101
|
+
delete that.sseCallbacks[randomId];
|
|
102
|
+
});
|
|
92
103
|
},
|
|
93
104
|
};
|
|
94
105
|
}
|
|
95
|
-
|
|
96
|
-
return this
|
|
106
|
+
getSelectedFarmFromMiniApp() {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
return this.platform.callHandler("getSelectedFarmFromMiniApp");
|
|
109
|
+
});
|
|
97
110
|
}
|
|
98
|
-
|
|
99
|
-
return this
|
|
111
|
+
getSelectedUnitFromMiniApp() {
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
return this.platform.callHandler("getSelectedUnitFromMiniApp");
|
|
114
|
+
});
|
|
100
115
|
}
|
|
101
|
-
|
|
102
|
-
return this
|
|
116
|
+
jumpToMiniApp(url) {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
return this.platform.callHandler("app.openMiniapp", url);
|
|
119
|
+
});
|
|
103
120
|
}
|
|
104
|
-
|
|
105
|
-
return this
|
|
121
|
+
scanQrcode() {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
return this.platform.callHandler("app.scanQrcode");
|
|
124
|
+
});
|
|
106
125
|
}
|
|
107
126
|
setTitle(title) {
|
|
108
127
|
this.platform.callHandler("app.setTitle", title);
|
|
109
128
|
}
|
|
110
|
-
|
|
111
|
-
return this
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
reader
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
saveBase64(base64, filename) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
return this.platform.callHandler("app.saveBase64", base64, filename);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
saveBlob(blob, filename) {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
const reader = new FileReader();
|
|
137
|
+
return new Promise((resolve, reject) => {
|
|
138
|
+
reader.readAsDataURL(blob);
|
|
139
|
+
reader.onloadend = () => __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
const base64 = reader.result;
|
|
141
|
+
yield this.saveBase64(base64, filename);
|
|
142
|
+
resolve();
|
|
143
|
+
});
|
|
144
|
+
reader.onerror = (err) => {
|
|
145
|
+
reject(err);
|
|
146
|
+
};
|
|
147
|
+
});
|
|
125
148
|
});
|
|
126
149
|
}
|
|
127
150
|
vibrate(time) {
|
|
128
151
|
this.platform.callHandler("app.vibrate", time);
|
|
129
152
|
}
|
|
130
|
-
|
|
131
|
-
return this
|
|
153
|
+
showInDeviceManager(deviceId, type) {
|
|
154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
return this.platform.callHandler("app.showInDeviceManager", deviceId, type);
|
|
156
|
+
});
|
|
132
157
|
}
|
|
133
158
|
reloadGroup(group) {
|
|
134
159
|
this.platform.callHandler("app.reloadGroup", group);
|
|
135
160
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
161
|
+
getGeo() {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
const result = yield this.platform.callHandler("app.getGeo");
|
|
164
|
+
if (result.error) {
|
|
165
|
+
throw result.error;
|
|
166
|
+
}
|
|
167
|
+
return {
|
|
168
|
+
lat: result.lat,
|
|
169
|
+
lng: result.lng
|
|
170
|
+
};
|
|
171
|
+
});
|
|
145
172
|
}
|
|
146
173
|
setResult(name, value) {
|
|
147
174
|
this.platform.callHandler("app.setResult", name, value);
|
package/dist/pigfarm_gateway.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.PigfarmGateway = void 0;
|
|
4
13
|
class PigfarmGateway extends Object {
|
|
@@ -194,16 +203,16 @@ class PigfarmGateway extends Object {
|
|
|
194
203
|
return axios.post(`/api/v1/pigfarm/heatLamp/config/add`, Object.assign(Object.assign({}, data), { unitId: unit.id }));
|
|
195
204
|
});
|
|
196
205
|
},
|
|
197
|
-
configList:
|
|
198
|
-
var axios =
|
|
206
|
+
configList: (unit) => __awaiter(this, void 0, void 0, function* () {
|
|
207
|
+
var axios = yield this.context.ready;
|
|
199
208
|
return axios.post(`/api/v1/pigfarm/heatLamp/config/list?unitId=${unit.id}`);
|
|
200
|
-
},
|
|
209
|
+
}),
|
|
201
210
|
template: {
|
|
202
211
|
//获取配置模版列表
|
|
203
|
-
list:
|
|
204
|
-
var axios =
|
|
212
|
+
list: (factory) => __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
var axios = yield this.context.ready;
|
|
205
214
|
return axios.get(`/api/v1/pigfarm/heatLamp/config/template/list/${factory.id}`);
|
|
206
|
-
},
|
|
215
|
+
}),
|
|
207
216
|
//增加模板
|
|
208
217
|
add: (factory, name, data) => {
|
|
209
218
|
return this.context.ready.then((axios) => {
|
|
@@ -217,27 +226,27 @@ class PigfarmGateway extends Object {
|
|
|
217
226
|
});
|
|
218
227
|
}
|
|
219
228
|
},
|
|
220
|
-
list:
|
|
221
|
-
var axios =
|
|
229
|
+
list: (unit) => __awaiter(this, void 0, void 0, function* () {
|
|
230
|
+
var axios = yield this.context.ready;
|
|
222
231
|
return axios.post(`/api/v1/pigfarm/heatLamp/list/${unit.id}`);
|
|
223
|
-
},
|
|
232
|
+
}),
|
|
224
233
|
//返回物联网相关的字段
|
|
225
|
-
iotFields:
|
|
226
|
-
var axios =
|
|
234
|
+
iotFields: (lamp) => __awaiter(this, void 0, void 0, function* () {
|
|
235
|
+
var axios = yield this.context.ready;
|
|
227
236
|
return axios.post(`/api/v1/pigfarm/heatLamp/iotFields/${lamp.id}`);
|
|
228
|
-
},
|
|
237
|
+
}),
|
|
229
238
|
//开关,传入id或对象,action为on或off
|
|
230
|
-
switch:
|
|
231
|
-
var axios =
|
|
239
|
+
switch: (lamp, action) => __awaiter(this, void 0, void 0, function* () {
|
|
240
|
+
var axios = yield this.context.ready;
|
|
232
241
|
var id = typeof lamp === "number" ? lamp : lamp.id;
|
|
233
242
|
return axios.post(`/api/v1/pigfarm/heatLamp/switch`, {
|
|
234
243
|
id,
|
|
235
244
|
action,
|
|
236
245
|
});
|
|
237
|
-
},
|
|
246
|
+
}),
|
|
238
247
|
//设置,传入id或对象,action为dayage时需要传回设置的天数
|
|
239
|
-
set:
|
|
240
|
-
var axios =
|
|
248
|
+
set: (lamp, action, arg) => __awaiter(this, void 0, void 0, function* () {
|
|
249
|
+
var axios = yield this.context.ready;
|
|
241
250
|
var url = action === "dayage"
|
|
242
251
|
? "/api/v1/pigfarm/heatLamp/syncDayage"
|
|
243
252
|
: `/api/v1/pigfarm/heatLamp/config/set`;
|
|
@@ -250,30 +259,30 @@ class PigfarmGateway extends Object {
|
|
|
250
259
|
body["days"] = arg;
|
|
251
260
|
}
|
|
252
261
|
return axios.post(url, body);
|
|
253
|
-
},
|
|
254
|
-
get:
|
|
255
|
-
var axios =
|
|
262
|
+
}),
|
|
263
|
+
get: (id) => __awaiter(this, void 0, void 0, function* () {
|
|
264
|
+
var axios = yield this.context.ready;
|
|
256
265
|
return axios.get(`/api/v1/pigfarm/heatLamp/config/${id}`);
|
|
257
|
-
},
|
|
258
|
-
update:
|
|
259
|
-
var axios =
|
|
266
|
+
}),
|
|
267
|
+
update: (lamp) => __awaiter(this, void 0, void 0, function* () {
|
|
268
|
+
var axios = yield this.context.ready;
|
|
260
269
|
return axios.post(`/api/v1/pigfarm/heatLamp/config/update`, lamp);
|
|
261
|
-
},
|
|
270
|
+
}),
|
|
262
271
|
//用于设置保温灯分组,TODO : 应该有更直观的命名
|
|
263
|
-
updateByUnit:
|
|
264
|
-
var axios =
|
|
272
|
+
updateByUnit: (unit_1, lamp_1, ...args_1) => __awaiter(this, [unit_1, lamp_1, ...args_1], void 0, function* (unit, lamp, ids = null) {
|
|
273
|
+
var axios = yield this.context.ready;
|
|
265
274
|
return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/update`, Object.assign(Object.assign({}, lamp), { ids }));
|
|
266
|
-
},
|
|
267
|
-
getGroup:
|
|
268
|
-
var axios =
|
|
275
|
+
}),
|
|
276
|
+
getGroup: (unit) => __awaiter(this, void 0, void 0, function* () {
|
|
277
|
+
var axios = yield this.context.ready;
|
|
269
278
|
return axios.get(`/api/v1/pigfarm/heatLamp/group?unitId=${unit.id}`);
|
|
270
|
-
},
|
|
271
|
-
deleteGroup:
|
|
272
|
-
var axios =
|
|
279
|
+
}),
|
|
280
|
+
deleteGroup: (id) => __awaiter(this, void 0, void 0, function* () {
|
|
281
|
+
var axios = yield this.context.ready;
|
|
273
282
|
return axios.post(`/api/v1/pigfarm/heatLamp/deleteGroup?id=${id}`);
|
|
274
|
-
},
|
|
275
|
-
switchByUnit:
|
|
276
|
-
var axios =
|
|
283
|
+
}),
|
|
284
|
+
switchByUnit: (unit_1, action_1, ...args_1) => __awaiter(this, [unit_1, action_1, ...args_1], void 0, function* (unit, action, ids = null) {
|
|
285
|
+
var axios = yield this.context.ready;
|
|
277
286
|
var args = {
|
|
278
287
|
action,
|
|
279
288
|
};
|
|
@@ -281,19 +290,19 @@ class PigfarmGateway extends Object {
|
|
|
281
290
|
args["ids"] = ids;
|
|
282
291
|
}
|
|
283
292
|
return axios.post(`/api/v1/pigfarm/heatLamp/config/${unit.id}/switch`, args);
|
|
284
|
-
},
|
|
285
|
-
taskStatus:
|
|
286
|
-
var axios =
|
|
293
|
+
}),
|
|
294
|
+
taskStatus: (args) => __awaiter(this, void 0, void 0, function* () {
|
|
295
|
+
var axios = yield this.context.ready;
|
|
287
296
|
return axios.post(`/api/v1/pigfarm/heatLamp/task`, args);
|
|
288
|
-
},
|
|
289
|
-
control:
|
|
290
|
-
var axios =
|
|
297
|
+
}),
|
|
298
|
+
control: (lamp, action) => __awaiter(this, void 0, void 0, function* () {
|
|
299
|
+
var axios = yield this.context.ready;
|
|
291
300
|
var id = typeof lamp === "number" ? lamp : lamp.id;
|
|
292
301
|
return axios.post(`/api/v1/pigfarm/heatLamp/control`, {
|
|
293
302
|
id,
|
|
294
303
|
action,
|
|
295
304
|
});
|
|
296
|
-
},
|
|
305
|
+
}),
|
|
297
306
|
};
|
|
298
307
|
}
|
|
299
308
|
}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.ProductionGateway = void 0;
|
|
4
13
|
// 产量统计网关,管理工厂产量数据
|
|
@@ -11,44 +20,48 @@ class ProductionGateway extends Object {
|
|
|
11
20
|
* 添加产品类型
|
|
12
21
|
* @param productName 产品名称
|
|
13
22
|
*/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
add(productName) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const axios = yield this.context.ready;
|
|
26
|
+
const factory = yield this.context.user.getSelectedFarm();
|
|
27
|
+
return axios.post('/api/v3/production/add', {
|
|
28
|
+
product_name: productName,
|
|
29
|
+
factory_id: factory.id
|
|
30
|
+
});
|
|
20
31
|
});
|
|
21
32
|
}
|
|
22
33
|
/**
|
|
23
34
|
* 获取所有产品类型列表
|
|
24
35
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
list() {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const axios = yield this.context.ready;
|
|
39
|
+
const factory = yield this.context.user.getSelectedFarm();
|
|
40
|
+
return axios.get(`/api/v3/production/list/${factory.id}`);
|
|
41
|
+
});
|
|
29
42
|
}
|
|
30
43
|
get stat() {
|
|
31
44
|
return {
|
|
32
|
-
get:
|
|
45
|
+
get: (type, period, factoryId) => __awaiter(this, void 0, void 0, function* () {
|
|
33
46
|
if (!factoryId) {
|
|
34
|
-
const factory =
|
|
47
|
+
const factory = yield this.context.user.getSelectedFarm();
|
|
35
48
|
factoryId = factory.id;
|
|
36
49
|
}
|
|
37
|
-
const axios =
|
|
50
|
+
const axios = yield this.context.ready;
|
|
38
51
|
return axios.get(`/api/v3/production/stat/${type}/${period}`, {
|
|
39
52
|
params: {
|
|
40
53
|
factory_id: factoryId
|
|
41
54
|
}
|
|
42
55
|
});
|
|
43
|
-
},
|
|
44
|
-
create:
|
|
56
|
+
}),
|
|
57
|
+
create: (request) => __awaiter(this, void 0, void 0, function* () {
|
|
45
58
|
if (!request.factory_id) {
|
|
46
|
-
const factory =
|
|
59
|
+
const factory = yield this.context.user.getSelectedFarm();
|
|
47
60
|
request.factory_id = factory.id;
|
|
48
61
|
}
|
|
49
|
-
const axios =
|
|
62
|
+
const axios = yield this.context.ready;
|
|
50
63
|
return axios.post('/api/v3/production/stat', request);
|
|
51
|
-
}
|
|
64
|
+
})
|
|
52
65
|
};
|
|
53
66
|
}
|
|
54
67
|
}
|
package/dist/project_gateway.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.ProjectGateway = void 0;
|
|
4
13
|
class ProjectGateway extends Object {
|
|
@@ -70,10 +79,10 @@ class ProjectGateway extends Object {
|
|
|
70
79
|
get attendance() {
|
|
71
80
|
return {
|
|
72
81
|
// 获取考勤列表
|
|
73
|
-
list:
|
|
74
|
-
var axios =
|
|
82
|
+
list: (projectId) => __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
var axios = yield this.context.ready;
|
|
75
84
|
return axios.get(`/api/v2/coremde-sale/project/attendance/get?id=${projectId}`);
|
|
76
|
-
},
|
|
85
|
+
}),
|
|
77
86
|
};
|
|
78
87
|
}
|
|
79
88
|
get constructionTeam() {
|
package/dist/purchase_gateway.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.PurchaseGateway = void 0;
|
|
4
13
|
class PurchaseGateway {
|
|
@@ -12,99 +21,125 @@ class PurchaseGateway {
|
|
|
12
21
|
* 技术部创建采购单
|
|
13
22
|
* @param params 采购单参数
|
|
14
23
|
*/
|
|
15
|
-
|
|
16
|
-
return this
|
|
24
|
+
create(params) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
return this.axios.post("/api/v2/coremde-sale/purchase/order/create", params);
|
|
27
|
+
});
|
|
17
28
|
}
|
|
18
29
|
/**
|
|
19
30
|
* 商务部审核采购单
|
|
20
31
|
* @param params 审核参数
|
|
21
32
|
*/
|
|
22
|
-
|
|
23
|
-
return this
|
|
33
|
+
approve(params) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
return this.axios.post("/api/v2/coremde-sale/purchase/order/approve", params);
|
|
36
|
+
});
|
|
24
37
|
}
|
|
25
38
|
/**
|
|
26
39
|
* 技术部更新采购单
|
|
27
40
|
* @param params 更新参数
|
|
28
41
|
*/
|
|
29
|
-
|
|
30
|
-
return this
|
|
42
|
+
update(params) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
return this.axios.post("/api/v2/coremde-sale/purchase/order/update", params);
|
|
45
|
+
});
|
|
31
46
|
}
|
|
32
47
|
/**
|
|
33
48
|
* 获取采购单列表
|
|
34
49
|
* @param params 查询参数
|
|
35
50
|
*/
|
|
36
|
-
|
|
37
|
-
return this
|
|
51
|
+
list(params) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
return this.axios.post("/api/v2/coremde-sale/purchase/order/list", params);
|
|
54
|
+
});
|
|
38
55
|
}
|
|
39
56
|
/**
|
|
40
57
|
* 获取采购单详情
|
|
41
58
|
* @param id 采购单ID
|
|
42
59
|
*/
|
|
43
|
-
|
|
44
|
-
return this
|
|
45
|
-
|
|
60
|
+
get(id) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
return this.axios.get("/api/v2/coremde-sale/purchase/order/get", {
|
|
63
|
+
params: { id }
|
|
64
|
+
});
|
|
46
65
|
});
|
|
47
66
|
}
|
|
48
67
|
/**
|
|
49
68
|
* 创建采购配置单
|
|
50
69
|
* @param params 配置单参数
|
|
51
70
|
*/
|
|
52
|
-
|
|
53
|
-
return this
|
|
71
|
+
createBomConfig(params) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/create", params);
|
|
74
|
+
});
|
|
54
75
|
}
|
|
55
76
|
/**
|
|
56
77
|
* 获取采购配置单列表
|
|
57
78
|
* @param params 查询参数
|
|
58
79
|
*/
|
|
59
|
-
|
|
60
|
-
return this
|
|
80
|
+
listBomConfig(params) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/list", params);
|
|
83
|
+
});
|
|
61
84
|
}
|
|
62
85
|
/**
|
|
63
86
|
* 获取采购配置单详情
|
|
64
87
|
* @param id 配置单ID
|
|
65
88
|
*/
|
|
66
|
-
|
|
67
|
-
return this
|
|
68
|
-
|
|
89
|
+
getBomConfig(id) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
return this.axios.get("/api/v2/coremde-sale/purchase/bom-config/get", {
|
|
92
|
+
params: { id }
|
|
93
|
+
});
|
|
69
94
|
});
|
|
70
95
|
}
|
|
71
96
|
/**
|
|
72
97
|
* 提交采购配置单变更申请
|
|
73
98
|
* @param params 变更参数
|
|
74
99
|
*/
|
|
75
|
-
|
|
76
|
-
return this
|
|
100
|
+
applyBomConfigAdjust(params) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/adjust/apply", params);
|
|
103
|
+
});
|
|
77
104
|
}
|
|
78
105
|
/**
|
|
79
106
|
* 审核采购配置单变更申请
|
|
80
107
|
* @param params 审核参数
|
|
81
108
|
*/
|
|
82
|
-
|
|
83
|
-
return this
|
|
109
|
+
approveBomConfigAdjust(params) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/adjust/apply/approve", params);
|
|
112
|
+
});
|
|
84
113
|
}
|
|
85
114
|
/**
|
|
86
115
|
* 获取采购配置单变更记录列表
|
|
87
116
|
* @param params 查询参数
|
|
88
117
|
*/
|
|
89
|
-
|
|
90
|
-
return this
|
|
118
|
+
listBomConfigAdjust(params) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/adjust/apply/list", params);
|
|
121
|
+
});
|
|
91
122
|
}
|
|
92
123
|
/**
|
|
93
124
|
* 获取采购配置单变更记录详情
|
|
94
125
|
* @param id 变更记录ID
|
|
95
126
|
*/
|
|
96
|
-
|
|
97
|
-
return this
|
|
98
|
-
|
|
127
|
+
getBomConfigAdjust(id) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
return this.axios.get("/api/v2/coremde-sale/purchase/bom-config/adjust/apply/get", {
|
|
130
|
+
params: { id }
|
|
131
|
+
});
|
|
99
132
|
});
|
|
100
133
|
}
|
|
101
134
|
/**
|
|
102
135
|
* 获取项目采购汇总清单
|
|
103
136
|
* @param id 项目ID
|
|
104
137
|
*/
|
|
105
|
-
|
|
106
|
-
return this
|
|
107
|
-
|
|
138
|
+
getBomConfigSummary(id) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
return this.axios.get("/api/v2/coremde-sale/purchase/bom-config/summary", {
|
|
141
|
+
params: { id }
|
|
142
|
+
});
|
|
108
143
|
});
|
|
109
144
|
}
|
|
110
145
|
/**
|
|
@@ -116,32 +151,32 @@ class PurchaseGateway {
|
|
|
116
151
|
* 获取采购变更单列表
|
|
117
152
|
* @param params 查询参数
|
|
118
153
|
*/
|
|
119
|
-
list:
|
|
154
|
+
list: (params) => __awaiter(this, void 0, void 0, function* () {
|
|
120
155
|
return this.axios.post("/api/v2/coremde-sale/purchase/adjust/list", params);
|
|
121
|
-
},
|
|
156
|
+
}),
|
|
122
157
|
/**
|
|
123
158
|
* 获取采购变更单详情
|
|
124
159
|
* @param id 变更单ID
|
|
125
160
|
*/
|
|
126
|
-
get:
|
|
161
|
+
get: (id) => __awaiter(this, void 0, void 0, function* () {
|
|
127
162
|
return this.axios.get("/api/v2/coremde-sale/purchase/adjust/get", {
|
|
128
163
|
params: { id }
|
|
129
164
|
});
|
|
130
|
-
},
|
|
165
|
+
}),
|
|
131
166
|
/**
|
|
132
167
|
* 提交采购变更申请
|
|
133
168
|
* @param params 变更申请参数
|
|
134
169
|
*/
|
|
135
|
-
apply:
|
|
170
|
+
apply: (params) => __awaiter(this, void 0, void 0, function* () {
|
|
136
171
|
return this.axios.post("/api/v2/coremde-sale/purchase/adjust/apply", params);
|
|
137
|
-
},
|
|
172
|
+
}),
|
|
138
173
|
/**
|
|
139
174
|
* 更新采购变更单
|
|
140
175
|
* @param params 更新参数
|
|
141
176
|
*/
|
|
142
|
-
update:
|
|
177
|
+
update: (params) => __awaiter(this, void 0, void 0, function* () {
|
|
143
178
|
return this.axios.post("/api/v2/coremde-sale/purchase/adjust/update", params);
|
|
144
|
-
}
|
|
179
|
+
})
|
|
145
180
|
};
|
|
146
181
|
}
|
|
147
182
|
}
|