ci-plus 1.5.0 → 1.5.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ci-plus",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "ci组件库",
5
5
  "main": "./index.ts",
6
6
  "scripts": {
@@ -12,7 +12,7 @@
12
12
  "vue",
13
13
  "element-plus",
14
14
  "ui组件库二次封装",
15
- "utils中新增一个文件下载的工具函数2"
15
+ "标识卡模板中将下道工序改为显示名称"
16
16
  ],
17
17
  "type": "module",
18
18
  "author": {
@@ -59,13 +59,29 @@ const downFileFn = function (blob: Blob | BlobPart, fileName: string) {
59
59
 
60
60
  }
61
61
 
62
+ type Obj = {
63
+ [key: string]: any
64
+ }
62
65
  const ajaxBox = {
63
66
  downFile: function (blob: Blob | BlobPart, fileName: string) {
64
67
  downFileFn(blob, fileName);
65
68
  },
66
69
 
67
70
  // 下载文件
68
- downFileFetch: function (fillAddress, fileName, method, headers, params, cbpercentage) {
71
+ /**
72
+ * 下载文件函数
73
+ * @param fillAddress string 表示服务端接口url地址
74
+ * @param fileName string 下载后的文件名
75
+ * @param method string 如果不想写get呢,你就写个null,但是你得写进去
76
+ * @param headers Object 请求头
77
+ * @param params Object 请求参数
78
+ * 将给定的blob对象转换为文件,并提供一个下载链接以供用户下载。
79
+ * 如果blob对象是JSON格式,则尝试解析为JavaScript对象,并显示相应的错误消息。
80
+ * 如果解析失败,则直接以原始格式下载blob对象。
81
+ */
82
+
83
+
84
+ downFileFetch: function (fillAddress: string, fileName: string, method: string, headers: Obj, params: Obj, cbpercentage: Function) {
69
85
  let options = {
70
86
  method: method || 'GET',
71
87
  }
@@ -138,6 +154,7 @@ const ajaxBox = {
138
154
  readBlobInChunks()
139
155
  })
140
156
  }
157
+
141
158
  /*
142
159
  sendJSONP: function (url, callbackName, callback) {
143
160
  const script = document.createElement('script');
@@ -162,3 +179,30 @@ const ajaxBox = {
162
179
 
163
180
  }
164
181
  export default ajaxBox;
182
+
183
+
184
+ /**
185
+ * 使用下载示例
186
+ const exportFile = () => {
187
+ let rowData = InventoryTableRef.value!.getSelectionRows()
188
+
189
+ const url = storageModule + 'storage_standing_book_batch_export_get/'
190
+ const headers = {
191
+ 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
192
+ }
193
+ const params = {
194
+ ids: JSON.stringify(rowData.map((v: { id: any }) => v.id)),
195
+ state: 1,
196
+ org_id: UserData.orgId,
197
+ storage_type: 'CAILIAO',
198
+ }
199
+
200
+ CiPlus.Fn.ajaxBox.downFileFetch(
201
+ url,
202
+ '材料库_库存台账数据.xlsx',
203
+ 'GET',
204
+ headers,
205
+ params,
206
+ )
207
+ }
208
+ */
@@ -171,7 +171,7 @@ export const cardPrint = (
171
171
  r5c4: item.card_code, // 标识卡号
172
172
  r6c2: item.center_data[0]?.tail_reason, // 尾料原因
173
173
  r7c2: item.process_name, // 本工序
174
- r7c4: item.next_process_code, // 下工序
174
+ r7c4: item.next_process_name, // 下工序
175
175
  r8c2: item.current_inventory, // 本箱数量
176
176
  r8c4: item.opt_user_name, // 操作工/自检员
177
177
  r9c2: item.center_data[0]?.inspector, // 检验员
@@ -632,7 +632,7 @@ export const cardPrint = (
632
632
  r50c3: '本工序',
633
633
  r50c4: item.process_name,
634
634
  r51c1: '下工序',
635
- r51c2: item.next_process_code,
635
+ r51c2: item.next_process_name,
636
636
  r51c3: '本箱数量',
637
637
  r51c4: item.current_inventory,
638
638
  r52c1: '操作员',