@cpzxrobot/sdk 1.3.30 → 1.3.32

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/dist/index.js CHANGED
@@ -74,7 +74,6 @@ class Cpzxrobot {
74
74
  this.construction = new construction_gateway_1.ConstructionGateway(this);
75
75
  this.system = new system_gateway_1.SystemGateway(this);
76
76
  this.production = new production_gateway_1.ProductionGateway(this);
77
- this.purchase = new purchase_gateway_1.PurchaseGateway(this);
78
77
  this.sseCallbacks = {};
79
78
  //获取当前浏览器的域名
80
79
  this.ready = new Promise((resolve, reject) => {
@@ -91,6 +90,7 @@ class Cpzxrobot {
91
90
  this.assistant = new assistant_gateway_1.AssistantGateway(this);
92
91
  this.energy = new energy_gateway_1.EnergyGateway(this);
93
92
  this.camera = new camera_gateway_1.CameraGateway(this);
93
+ this.purchase = new purchase_gateway_1.PurchaseGateway(this);
94
94
  }
95
95
  exit() {
96
96
  if (this.mode === "miniapp_in_app") {
@@ -45,5 +45,58 @@ class PurchaseGateway {
45
45
  params: { id }
46
46
  });
47
47
  }
48
+ /**
49
+ * 创建采购配置单
50
+ * @param params 配置单参数
51
+ */
52
+ async createBomConfig(params) {
53
+ return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/create", params);
54
+ }
55
+ /**
56
+ * 获取采购配置单列表
57
+ * @param params 查询参数
58
+ */
59
+ async listBomConfig(params) {
60
+ return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/list", params);
61
+ }
62
+ /**
63
+ * 获取采购配置单详情
64
+ * @param id 配置单ID
65
+ */
66
+ async getBomConfig(id) {
67
+ return this.axios.get("/api/v2/coremde-sale/purchase/bom-config/get", {
68
+ params: { id }
69
+ });
70
+ }
71
+ /**
72
+ * 提交采购配置单变更申请
73
+ * @param params 变更参数
74
+ */
75
+ async applyBomConfigAdjust(params) {
76
+ return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/adjust/apply", params);
77
+ }
78
+ /**
79
+ * 审核采购配置单变更申请
80
+ * @param params 审核参数
81
+ */
82
+ async approveBomConfigAdjust(params) {
83
+ return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/adjust/apply/approve", params);
84
+ }
85
+ /**
86
+ * 获取采购配置单变更记录列表
87
+ * @param params 查询参数
88
+ */
89
+ async listBomConfigAdjust(params) {
90
+ return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/adjust/apply/list", params);
91
+ }
92
+ /**
93
+ * 获取采购配置单变更记录详情
94
+ * @param id 变更记录ID
95
+ */
96
+ async getBomConfigAdjust(id) {
97
+ return this.axios.get("/api/v2/coremde-sale/purchase/bom-config/adjust/apply/get", {
98
+ params: { id }
99
+ });
100
+ }
48
101
  }
49
102
  exports.PurchaseGateway = PurchaseGateway;
package/index.ts CHANGED
@@ -69,7 +69,7 @@ export class Cpzxrobot {
69
69
  construction: ConstructionGateway = new ConstructionGateway(this);
70
70
  system: SystemGateway = new SystemGateway(this);
71
71
  production: ProductionGateway = new ProductionGateway(this);
72
- purchase: PurchaseGateway = new PurchaseGateway(this);
72
+ purchase!: PurchaseGateway;
73
73
  sseCallbacks: {
74
74
  [key: string]: (data: any) => void;
75
75
  } = {};
@@ -91,6 +91,7 @@ export class Cpzxrobot {
91
91
  this.assistant = new AssistantGateway(this);
92
92
  this.energy = new EnergyGateway(this);
93
93
  this.camera = new CameraGateway(this);
94
+ this.purchase = new PurchaseGateway(this);
94
95
  }
95
96
 
96
97
  exit() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.30",
3
+ "version": "1.3.32",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -32,7 +32,7 @@ export class PurchaseGateway {
32
32
  }) {
33
33
  return this.axios.post("/api/v2/coremde-sale/purchase/order/create", params);
34
34
  }
35
-
35
+
36
36
  /**
37
37
  * 商务部审核采购单
38
38
  * @param params 审核参数
@@ -87,4 +87,104 @@ export class PurchaseGateway {
87
87
  params: { id }
88
88
  });
89
89
  }
90
+
91
+ /**
92
+ * 创建采购配置单
93
+ * @param params 配置单参数
94
+ */
95
+ async createBomConfig(params: {
96
+ taskId: number;
97
+ projectId: number;
98
+ quotationBomConfigId?: number;
99
+ contractId?: number;
100
+ productsInfo: Array<{
101
+ productId: number;
102
+ name: string;
103
+ model: string;
104
+ materialCode: string;
105
+ price: number;
106
+ qty: number;
107
+ unit: string;
108
+ remark?: string;
109
+ }>;
110
+ }) {
111
+ return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/create", params);
112
+ }
113
+
114
+ /**
115
+ * 获取采购配置单列表
116
+ * @param params 查询参数
117
+ */
118
+ async listBomConfig(params: {
119
+ projectId?: number;
120
+ createTimeStart?: string;
121
+ createTimeEnd?: string;
122
+ pageNo?: number;
123
+ pageSize?: number;
124
+ }) {
125
+ return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/list", params);
126
+ }
127
+
128
+ /**
129
+ * 获取采购配置单详情
130
+ * @param id 配置单ID
131
+ */
132
+ async getBomConfig(id: number) {
133
+ return this.axios.get("/api/v2/coremde-sale/purchase/bom-config/get", {
134
+ params: { id }
135
+ });
136
+ }
137
+
138
+ /**
139
+ * 提交采购配置单变更申请
140
+ * @param params 变更参数
141
+ */
142
+ async applyBomConfigAdjust(params: {
143
+ id: number;
144
+ productsInfo: Array<{
145
+ productId: number;
146
+ name: string;
147
+ model: string;
148
+ materialCode: string;
149
+ qty: number;
150
+ unit: string;
151
+ remark?: string;
152
+ }>;
153
+ }) {
154
+ return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/adjust/apply", params);
155
+ }
156
+
157
+ /**
158
+ * 审核采购配置单变更申请
159
+ * @param params 审核参数
160
+ */
161
+ async approveBomConfigAdjust(params: {
162
+ id: number;
163
+ approveResult: number;
164
+ approveNotes?: string;
165
+ }) {
166
+ return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/adjust/apply/approve", params);
167
+ }
168
+
169
+ /**
170
+ * 获取采购配置单变更记录列表
171
+ * @param params 查询参数
172
+ */
173
+ async listBomConfigAdjust(params: {
174
+ id: number;
175
+ pageNo?: number;
176
+ pageSize?: number;
177
+ }) {
178
+ return this.axios.post("/api/v2/coremde-sale/purchase/bom-config/adjust/apply/list", params);
179
+ }
180
+
181
+ /**
182
+ * 获取采购配置单变更记录详情
183
+ * @param id 变更记录ID
184
+ */
185
+ async getBomConfigAdjust(id: number) {
186
+ return this.axios.get("/api/v2/coremde-sale/purchase/bom-config/adjust/apply/get", {
187
+ params: { id }
188
+ });
189
+ }
90
190
  }