Commit 12c87364ed4067e3c9b623ac2d43816bc8a84052
1 parent
1b4783c1
入库/出库批量生成任务页面问题修改
Signed-off-by: TanYibin <5491541@qq.com>
Showing
2 changed files
with
47 additions
and
45 deletions
ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue
... | ... | @@ -345,39 +345,40 @@ export default { |
345 | 345 | this.$refs.modalForm4.edit(record); |
346 | 346 | this.$refs.modalForm4.title = "选择容器状态"; |
347 | 347 | }, |
348 | - createBatchTask(){ | |
349 | - if (this.selectedRowKeys.length <= 0) { | |
350 | - this.$message.warning('请选择一条记录!') | |
348 | + createBatchTask() { | |
349 | + if (this.selectedRowKeys.length <= 1) { | |
350 | + this.$message.warning('至少选择两条记录!') | |
351 | 351 | return |
352 | - }else{ | |
353 | - console.log("createBatchTask"); | |
354 | - var receiptContainerHeaderList =[]; | |
355 | - var receiptContainerHeader= null; | |
352 | + } else { | |
353 | + var receiptContainerHeaderList = [] | |
354 | + var receiptContainerHeader = null | |
356 | 355 | for (var a = 0; a < this.selectedRowKeys.length; a++) { |
357 | - if (this.selectionRows[a].status == 0) { | |
358 | - if (receiptContainerHeader == null) | |
359 | - { | |
360 | - receiptContainerHeader = this.selectionRows[a]; | |
356 | + if (this.selectionRows[a] != null && this.selectionRows[a].status == 0) { | |
357 | + if (receiptContainerHeader == null) { | |
358 | + receiptContainerHeader = this.selectionRows[a] | |
361 | 359 | } |
362 | - if (receiptContainerHeader.taskType == this.selectionRows[a].taskType) | |
363 | - { | |
364 | - receiptContainerHeaderList.push(this.selectionRows[a]); | |
360 | + if (receiptContainerHeader.taskType == this.selectionRows[a].taskType) { | |
361 | + receiptContainerHeaderList.push(this.selectionRows[a]) | |
365 | 362 | } |
366 | 363 | } |
367 | 364 | } |
368 | - if(receiptContainerHeader.taskType == 100) { | |
369 | - createReceiptBatchTask(receiptContainerHeaderList).then((res) => { | |
370 | - this.loading = false; | |
371 | - if (res.success) { | |
372 | - this.$message.success(res.message); | |
373 | - } else { | |
374 | - this.$message.error(res.message); | |
375 | - } | |
376 | - this.searchQuery(); | |
377 | - }); | |
365 | + if (receiptContainerHeaderList.length > 1) { | |
366 | + if (receiptContainerHeader.taskType == 100) { | |
367 | + createReceiptBatchTask(receiptContainerHeaderList).then(res => { | |
368 | + this.loading = false | |
369 | + if (res.success) { | |
370 | + this.$message.success(res.message) | |
371 | + } else { | |
372 | + this.$message.error(res.message) | |
373 | + } | |
374 | + this.searchQuery() | |
375 | + }) | |
376 | + } else { | |
377 | + this.$refs.modalForm2.batchEdit(receiptContainerHeaderList) | |
378 | + this.$refs.modalForm2.title = '选择出库口' | |
379 | + } | |
378 | 380 | } else { |
379 | - this.$refs.modalForm2.batchEdit(receiptContainerHeaderList); | |
380 | - this.$refs.modalForm2.title = "选择出库口"; | |
381 | + this.$message.error("至少选择两条符合条件的记录!") | |
381 | 382 | } |
382 | 383 | } |
383 | 384 | }, |
... | ... |
ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue
... | ... | @@ -296,28 +296,29 @@ export default { |
296 | 296 | this.$refs.modalForm2.edit(record); |
297 | 297 | this.$refs.modalForm2.title = "选择出库口"; |
298 | 298 | }, |
299 | - createBatchTask(){ | |
300 | - if (this.selectedRowKeys.length <= 0) { | |
301 | - this.$message.warning('请选择一条记录!') | |
299 | + createBatchTask() { | |
300 | + if (this.selectedRowKeys.length <= 1) { | |
301 | + this.$message.warning('至少选择两条记录!') | |
302 | 302 | return |
303 | - }else{ | |
304 | - console.log("createBatchTask"); | |
305 | - var shipmentContainerHeaderList =[]; | |
306 | - var shipmentContainerHeader= null; | |
303 | + } else { | |
304 | + var shipmentContainerHeaderList = [] | |
305 | + var shipmentContainerHeader = null | |
307 | 306 | for (var a = 0; a < this.selectedRowKeys.length; a++) { |
308 | - if (this.selectionRows[a].status == 0) { | |
309 | - if (shipmentContainerHeader == null) | |
310 | - { | |
311 | - shipmentContainerHeader = this.selectionRows[a]; | |
312 | - } | |
313 | - if (shipmentContainerHeader.taskType == this.selectionRows[a].taskType) | |
314 | - { | |
315 | - shipmentContainerHeaderList.push(this.selectionRows[a]); | |
316 | - } | |
317 | - } | |
307 | + if (this.selectionRows[a] != null && this.selectionRows[a].status == 0) { | |
308 | + if (shipmentContainerHeader == null) { | |
309 | + shipmentContainerHeader = this.selectionRows[a] | |
310 | + } | |
311 | + if (shipmentContainerHeader.taskType == this.selectionRows[a].taskType) { | |
312 | + shipmentContainerHeaderList.push(this.selectionRows[a]) | |
313 | + } | |
314 | + } | |
315 | + } | |
316 | + if (shipmentContainerHeaderList.length > 0) { | |
317 | + this.$refs.modalForm2.batchEdit(shipmentContainerHeaderList) | |
318 | + this.$refs.modalForm2.title = '选择出库口' | |
319 | + } else { | |
320 | + this.$message.error("至少选择两条符合条件的记录!") | |
318 | 321 | } |
319 | - this.$refs.modalForm2.batchEdit(shipmentContainerHeaderList); | |
320 | - this.$refs.modalForm2.title = "选择出库口"; | |
321 | 322 | } |
322 | 323 | }, |
323 | 324 | cancelBatchTask() { |
... | ... |