@cpzxrobot/sdk 1.2.43 → 1.2.45
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 +6 -2
- package/dist/device_gateway.js +6 -2
- package/dist/product_gateway.js +15 -0
- package/package.json +1 -1
- package/product_gateway.ts +45 -0
package/device_gateway.ts
CHANGED
|
@@ -345,9 +345,13 @@ export class DeviceGateway extends Object {
|
|
|
345
345
|
}
|
|
346
346
|
|
|
347
347
|
// 设备生产商 GET /api/v2/device/manufacturers
|
|
348
|
-
manufacturers(): Promise<any> {
|
|
348
|
+
manufacturers(category: string|undefined = undefined): Promise<any> {
|
|
349
349
|
return this.context.ready.then(() => {
|
|
350
|
-
return this.context.axios.get("/api/v2/device/manufacturers"
|
|
350
|
+
return this.context.axios.get("/api/v2/device/manufacturers",{
|
|
351
|
+
params: {
|
|
352
|
+
category
|
|
353
|
+
}
|
|
354
|
+
})
|
|
351
355
|
.then((res) => {
|
|
352
356
|
if (res.data.code != 200) {
|
|
353
357
|
throw res.data.message;
|
package/dist/device_gateway.js
CHANGED
|
@@ -253,9 +253,13 @@ class DeviceGateway extends Object {
|
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
255
|
// 设备生产商 GET /api/v2/device/manufacturers
|
|
256
|
-
manufacturers() {
|
|
256
|
+
manufacturers(category = undefined) {
|
|
257
257
|
return this.context.ready.then(() => {
|
|
258
|
-
return this.context.axios.get("/api/v2/device/manufacturers"
|
|
258
|
+
return this.context.axios.get("/api/v2/device/manufacturers", {
|
|
259
|
+
params: {
|
|
260
|
+
category
|
|
261
|
+
}
|
|
262
|
+
})
|
|
259
263
|
.then((res) => {
|
|
260
264
|
if (res.data.code != 200) {
|
|
261
265
|
throw res.data.message;
|
package/dist/product_gateway.js
CHANGED
|
@@ -87,5 +87,20 @@ class ProductGateway extends Object {
|
|
|
87
87
|
},
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
+
add(args) {
|
|
91
|
+
return this.context.ready.then((axios) => {
|
|
92
|
+
return axios.post(`/api/v2/coremde-sale/product/add`, args);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
update(args) {
|
|
96
|
+
return this.context.ready.then((axios) => {
|
|
97
|
+
return axios.post(`/api/v2/coremde-sale/product/update`, args);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
deleteProduct(id) {
|
|
101
|
+
return this.context.ready.then((axios) => {
|
|
102
|
+
return axios.get(`/api/v2/coremde-sale/product/delete?id=${id}`);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
90
105
|
}
|
|
91
106
|
exports.ProductGateway = ProductGateway;
|
package/package.json
CHANGED
package/product_gateway.ts
CHANGED
|
@@ -137,4 +137,49 @@ export class ProductGateway extends Object {
|
|
|
137
137
|
},
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
|
+
|
|
141
|
+
add(args: {
|
|
142
|
+
name: string;
|
|
143
|
+
unit: string;
|
|
144
|
+
cost: number;
|
|
145
|
+
price: number;
|
|
146
|
+
factoryId: number;
|
|
147
|
+
productTypeId: number;
|
|
148
|
+
deliveryDate: number;
|
|
149
|
+
depotQty: number;
|
|
150
|
+
model: string;
|
|
151
|
+
materialCode: string;
|
|
152
|
+
remark: string;
|
|
153
|
+
groupId: number;
|
|
154
|
+
}) {
|
|
155
|
+
return this.context.ready.then((axios) => {
|
|
156
|
+
return axios.post(`/api/v2/coremde-sale/product/add`, args);
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
update(args: {
|
|
161
|
+
id: number;
|
|
162
|
+
name: string;
|
|
163
|
+
unit: string;
|
|
164
|
+
cost: number;
|
|
165
|
+
price: number;
|
|
166
|
+
factoryId: number;
|
|
167
|
+
productTypeId: number;
|
|
168
|
+
deliveryDate: number;
|
|
169
|
+
depotQty: number;
|
|
170
|
+
model: string;
|
|
171
|
+
materialCode: string;
|
|
172
|
+
remark: string;
|
|
173
|
+
groupId: number;
|
|
174
|
+
}) {
|
|
175
|
+
return this.context.ready.then((axios) => {
|
|
176
|
+
return axios.post(`/api/v2/coremde-sale/product/update`, args);
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
deleteProduct(id: number) {
|
|
181
|
+
return this.context.ready.then((axios) => {
|
|
182
|
+
return axios.get(`/api/v2/coremde-sale/product/delete?id=${id}`);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
140
185
|
}
|