@cpzxrobot/sdk 1.3.50 → 1.3.51

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.
@@ -102,6 +102,27 @@ 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 file 上传的Excel文件
108
+ * @returns Promise
109
+ */
110
+ import(file) {
111
+ return this.context.ready.then((axios) => {
112
+ return axios.upload(`/api/v2/coremde-sale/product/import`);
113
+ });
114
+ }
115
+ get template() {
116
+ return {
117
+ download: () => {
118
+ return this.context.ready.then((axios) => {
119
+ return axios.getAndSave(`/api/v2/coremde-sale/product/template/download`, {
120
+ fileName: "产品导入模板.xlsx"
121
+ });
122
+ });
123
+ }
124
+ };
125
+ }
105
126
  /**
106
127
  * 获取产品单位列表
107
128
  * @param args 分页参数
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpzxrobot/sdk",
3
- "version": "1.3.50",
3
+ "version": "1.3.51",
4
4
  "description": "提供给上海正芯数智APP第三方H5应用使用的SDK",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -181,6 +181,29 @@ export class ProductGateway extends Object {
181
181
  });
182
182
  }
183
183
 
184
+ /**
185
+ * 导入产品信息
186
+ * @param file 上传的Excel文件
187
+ * @returns Promise
188
+ */
189
+ import(file: File) {
190
+ return this.context.ready.then((axios) => {
191
+ return axios.upload(`/api/v2/coremde-sale/product/import`);
192
+ });
193
+ }
194
+
195
+ get template(){
196
+ return {
197
+ download: () => {
198
+ return this.context.ready.then((axios) => {
199
+ return axios.getAndSave(`/api/v2/coremde-sale/product/template/download`, {
200
+ fileName: "产品导入模板.xlsx"
201
+ });
202
+ });
203
+ }
204
+ }
205
+ }
206
+
184
207
  /**
185
208
  * 获取产品单位列表
186
209
  * @param args 分页参数
@@ -188,7 +211,7 @@ export class ProductGateway extends Object {
188
211
  */
189
212
  get units() {
190
213
  return {
191
- list: (args: {pageNo: number, pageSize: number}) => {
214
+ list: (args: { pageNo: number, pageSize: number }) => {
192
215
  return this.context.ready.then((axios) => {
193
216
  return axios.post(
194
217
  `/api/v2/coremde-sale/product/unit/list`,