@cpzxrobot/sdk 1.3.48 → 1.3.50

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 CHANGED
@@ -725,62 +725,6 @@ export class DeviceGateway extends Object {
725
725
  };
726
726
  }
727
727
 
728
- get troubleLevel() {
729
- return {
730
- list: async (): Promise<any> => {
731
- var axios = await this.context.ready;
732
- return axios.get('/api/v3/device/trouble-level');
733
- },
734
-
735
- create: async (data: {
736
- name: string;
737
- code?: string;
738
- color?: string;
739
- description?: string;
740
- }): Promise<any> => {
741
- var axios = await this.context.ready;
742
- return axios.post('/api/v3/device/trouble-level', data);
743
- }
744
- }
745
- }
746
-
747
- get troubleReason() {
748
- return {
749
- list: async (): Promise<any> => {
750
- var axios = await this.context.ready;
751
- return axios.get('/api/v3/device/trouble-reason');
752
- },
753
-
754
- create: async (data: {
755
- name: string;
756
- code?: string;
757
- color?: string;
758
- description?: string;
759
- }): Promise<any> => {
760
- var axios = await this.context.ready;
761
- return axios.post('/api/v3/device/trouble-reason', data);
762
- }
763
- }
764
- }
765
-
766
- get troubleEmergency() {
767
- return {
768
- list: async (): Promise<any> => {
769
- var axios = await this.context.ready;
770
- return axios.get('/api/v3/device/trouble-emergency');
771
- },
772
-
773
- create: async (data: {
774
- name: string;
775
- code?: string;
776
- color?: string;
777
- description?: string;
778
- }): Promise<any> => {
779
- var axios = await this.context.ready;
780
- return axios.post('/api/v3/device/trouble-emergency', data);
781
- }
782
- }
783
- }
784
728
 
785
729
  get troubleType() {
786
730
  return {
@@ -942,6 +886,15 @@ export class DeviceGateway extends Object {
942
886
  //故障来源
943
887
  public troubleDetectSource = this.generateFunctionsForDict('trouble-detect-source');
944
888
 
889
+ public troubleLevel = this.generateFunctionsForDict('trouble-level');
890
+
891
+ public troubleReason = this.generateFunctionsForDict('trouble-reason');
892
+
893
+ public troubleEmergency = this.generateFunctionsForDict('trouble-emergency');
894
+
895
+ //备件计量单位
896
+ public maintenanceSparePartUnit = this.generateFunctionsForDict('maintenance-spare-part-unit');
897
+
945
898
  get usage() {
946
899
  return {
947
900
  /**
@@ -149,6 +149,11 @@ class DeviceGateway extends Object {
149
149
  this.maintenanceOutsourceStatus = this.generateFunctionsForDict('maintenance-outsource-status');
150
150
  //故障来源
151
151
  this.troubleDetectSource = this.generateFunctionsForDict('trouble-detect-source');
152
+ this.troubleLevel = this.generateFunctionsForDict('trouble-level');
153
+ this.troubleReason = this.generateFunctionsForDict('trouble-reason');
154
+ this.troubleEmergency = this.generateFunctionsForDict('trouble-emergency');
155
+ //备件计量单位
156
+ this.maintenanceSparePartUnit = this.generateFunctionsForDict('maintenance-spare-part-unit');
152
157
  this.context = context;
153
158
  // this.devices = []
154
159
  this.type = new device_type_gateway_1.DeviceTypeGateway(context);
@@ -571,42 +576,6 @@ class DeviceGateway extends Object {
571
576
  },
572
577
  };
573
578
  }
574
- get troubleLevel() {
575
- return {
576
- list: async () => {
577
- var axios = await this.context.ready;
578
- return axios.get('/api/v3/device/trouble-level');
579
- },
580
- create: async (data) => {
581
- var axios = await this.context.ready;
582
- return axios.post('/api/v3/device/trouble-level', data);
583
- }
584
- };
585
- }
586
- get troubleReason() {
587
- return {
588
- list: async () => {
589
- var axios = await this.context.ready;
590
- return axios.get('/api/v3/device/trouble-reason');
591
- },
592
- create: async (data) => {
593
- var axios = await this.context.ready;
594
- return axios.post('/api/v3/device/trouble-reason', data);
595
- }
596
- };
597
- }
598
- get troubleEmergency() {
599
- return {
600
- list: async () => {
601
- var axios = await this.context.ready;
602
- return axios.get('/api/v3/device/trouble-emergency');
603
- },
604
- create: async (data) => {
605
- var axios = await this.context.ready;
606
- return axios.post('/api/v3/device/trouble-emergency', data);
607
- }
608
- };
609
- }
610
579
  get troubleType() {
611
580
  return {
612
581
  // 获取根节点(原list方法)
@@ -102,5 +102,19 @@ class ProductGateway extends Object {
102
102
  return axios.get(`/api/v2/coremde-sale/product/delete?id=${id}`);
103
103
  });
104
104
  }
105
+ /**
106
+ * 获取产品单位列表
107
+ * @param args 分页参数
108
+ * @returns Promise
109
+ */
110
+ get units() {
111
+ return {
112
+ list: (args) => {
113
+ return this.context.ready.then((axios) => {
114
+ return axios.post(`/api/v2/coremde-sale/product/unit/list`, args);
115
+ });
116
+ }
117
+ };
118
+ }
105
119
  }
106
120
  exports.ProductGateway = ProductGateway;
@@ -422,6 +422,17 @@ class ProjectGateway extends Object {
422
422
  return axios.get(`/api/v2/coremde-sale/project/bom-config/history-detail?id=${id}`);
423
423
  });
424
424
  },
425
+ /**
426
+ * 比较两个报价配置单明细
427
+ * @param id 配置单ID
428
+ * @param compareId 对比配置单ID
429
+ * @returns Promise
430
+ */
431
+ compare: (params) => {
432
+ return this.context.ready.then((axios) => {
433
+ return axios.post(`/api/v2/coremde-sale/project/bom-config/compare`, params);
434
+ });
435
+ },
425
436
  };
426
437
  }
427
438
  get plan() {
@@ -134,6 +134,13 @@ class PurchaseGateway {
134
134
  */
135
135
  apply: async (params) => {
136
136
  return this.axios.post("/api/v2/coremde-sale/purchase/adjust/apply", params);
137
+ },
138
+ /**
139
+ * 更新采购变更单
140
+ * @param params 更新参数
141
+ */
142
+ update: async (params) => {
143
+ return this.axios.post("/api/v2/coremde-sale/purchase/adjust/update", params);
137
144
  }
138
145
  };
139
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.48",
3
+ "version": "1.3.50",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -180,4 +180,22 @@ export class ProductGateway extends Object {
180
180
  return axios.get(`/api/v2/coremde-sale/product/delete?id=${id}`);
181
181
  });
182
182
  }
183
+
184
+ /**
185
+ * 获取产品单位列表
186
+ * @param args 分页参数
187
+ * @returns Promise
188
+ */
189
+ get units() {
190
+ return {
191
+ list: (args: {pageNo: number, pageSize: number}) => {
192
+ return this.context.ready.then((axios) => {
193
+ return axios.post(
194
+ `/api/v2/coremde-sale/product/unit/list`,
195
+ args
196
+ );
197
+ });
198
+ }
199
+ };
200
+ }
183
201
  }
@@ -491,13 +491,7 @@ export class ProjectGateway extends Object {
491
491
  * @param args 收货单位参数
492
492
  * @returns Promise
493
493
  */
494
- add: (args: {
495
- name: string
496
- contactPeople: string
497
- contactPhone: string
498
- contactAddress: string
499
- projectId: number
500
- }) => {
494
+ add: (args: any) => {
501
495
  return this.context.ready.then((axios) => {
502
496
  return axios.post(`/api/v2/coremde-sale/project/consignee/add`, args)
503
497
  })
@@ -507,13 +501,7 @@ export class ProjectGateway extends Object {
507
501
  * @param args 收货单位参数
508
502
  * @returns Promise
509
503
  */
510
- update: (args: {
511
- id: number
512
- name: string
513
- contactPeople: string
514
- contactPhone: string
515
- contactAddress: string
516
- }) => {
504
+ update: (args: any) => {
517
505
  return this.context.ready.then((axios) => {
518
506
  return axios.post(`/api/v2/coremde-sale/project/consignee/update`, args)
519
507
  })
@@ -628,6 +616,20 @@ export class ProjectGateway extends Object {
628
616
  )
629
617
  })
630
618
  },
619
+ /**
620
+ * 比较两个报价配置单明细
621
+ * @param id 配置单ID
622
+ * @param compareId 对比配置单ID
623
+ * @returns Promise
624
+ */
625
+ compare: (params: {id: number, compareId: number}) => {
626
+ return this.context.ready.then((axios) => {
627
+ return axios.post(
628
+ `/api/v2/coremde-sale/project/bom-config/compare`,
629
+ params
630
+ )
631
+ })
632
+ },
631
633
 
632
634
  }
633
635
  }
@@ -249,6 +249,37 @@ export class PurchaseGateway {
249
249
  }>;
250
250
  }) => {
251
251
  return this.axios.post("/api/v2/coremde-sale/purchase/adjust/apply", params);
252
+ },
253
+
254
+ /**
255
+ * 更新采购变更单
256
+ * @param params 更新参数
257
+ */
258
+ update: async (params: {
259
+ projectId: number;
260
+ contractId?: number;
261
+ purchaseOrderProjectId: number;
262
+ id: number;
263
+ taskId: number;
264
+ deptId: number;
265
+ approveUserId: number;
266
+ adjustReason: string;
267
+ purchaseAdjustDetailList: Array<{
268
+ productId: number;
269
+ productName: string;
270
+ qtyBefore: number;
271
+ qtyAfter: number;
272
+ model: string;
273
+ materialCode: string;
274
+ unit: string;
275
+ price: string;
276
+ cost: string;
277
+ taxRate: string;
278
+ disinfection: string;
279
+ remark?: string;
280
+ }>;
281
+ }) => {
282
+ return this.axios.post("/api/v2/coremde-sale/purchase/adjust/update", params);
252
283
  }
253
284
  };
254
285
  }