feat(wms): 新增应收货物计划批量删除和清空功能,优化表格配置
1. 后端添加批量删除应收计划接口 2. 前端新增批量删除、清空按钮和多选功能 3. 优化表格高度和字段文案,调整分页查询大小
This commit is contained in:
@@ -51,3 +51,14 @@ export function checkReceivePlan(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大批量删除应收货物计划明细
|
||||||
|
*/
|
||||||
|
export function delReceivePlanBatch(receiveIdList) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/receivePlan/batchDelete',
|
||||||
|
method: 'delete',
|
||||||
|
data: receiveIdList || []
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -101,8 +101,20 @@
|
|||||||
<el-button type="primary" plain icon="el-icon-plus" size="mini"
|
<el-button type="primary" plain icon="el-icon-plus" size="mini"
|
||||||
@click="openDetailAddDialog">新增</el-button>
|
@click="openDetailAddDialog">新增</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="detailMultiple"
|
||||||
|
@click="handleDetailBatchDelete">批量删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="el-icon-delete" size="mini"
|
||||||
|
@click="handleDetailClear">清空</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="default" plain icon="el-icon-refresh" size="mini"
|
||||||
|
@click="getDetailList">刷新</el-button>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table v-loading="detailLoading" :data="detailList" border>
|
<el-table v-loading="detailLoading" :data="detailList" border @selection-change="handleDetailSelectionChange">
|
||||||
<el-table-column type="selection" width="55" />
|
<el-table-column type="selection" width="55" />
|
||||||
<el-table-column prop="warehouseArea" label="逻辑库区" width="120" />
|
<el-table-column prop="warehouseArea" label="逻辑库区" width="120" />
|
||||||
<el-table-column prop="lotNo" label="入场卷号" width="120" />
|
<el-table-column prop="lotNo" label="入场卷号" width="120" />
|
||||||
@@ -145,7 +157,7 @@
|
|||||||
:limit.sync="detailQueryParams.pageSize" @pagination="getDetailList" />
|
:limit.sync="detailQueryParams.pageSize" @pagination="getDetailList" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="实际入库表格" name="actual">
|
<el-tab-pane label="实际入库表格" name="actual">
|
||||||
<el-table v-loading="actualLoading" :data="actualList" border>
|
<el-table v-loading="actualLoading" :data="actualList" border height="400">
|
||||||
<el-table-column prop="enterCoilNo" label="入场卷号" />
|
<el-table-column prop="enterCoilNo" label="入场卷号" />
|
||||||
<el-table-column prop="currentCoilNo" label="成品卷号" />
|
<el-table-column prop="currentCoilNo" label="成品卷号" />
|
||||||
<el-table-column prop="itemName" label="名称" width="120" />
|
<el-table-column prop="itemName" label="名称" width="120" />
|
||||||
@@ -153,7 +165,7 @@
|
|||||||
<el-table-column prop="materialType" label="材质" width="100" />
|
<el-table-column prop="materialType" label="材质" width="100" />
|
||||||
<el-table-column prop="netWeight" label="重量(kg)" width="100" />
|
<el-table-column prop="netWeight" label="重量(kg)" width="100" />
|
||||||
<el-table-column prop="manufacturer" label="生产厂家" width="120" />
|
<el-table-column prop="manufacturer" label="生产厂家" width="120" />
|
||||||
<el-table-column prop="zincLayer" label="锌层" width="80" />
|
<el-table-column prop="zincLayer" label="镀层质量" width="80" />
|
||||||
<el-table-column prop="warehouseName" label="库区" width="100" />
|
<el-table-column prop="warehouseName" label="库区" width="100" />
|
||||||
<el-table-column prop="qualityStatus" label="质量状态" width="100" />
|
<el-table-column prop="qualityStatus" label="质量状态" width="100" />
|
||||||
<el-table-column prop="createTime" label="入库时间">
|
<el-table-column prop="createTime" label="入库时间">
|
||||||
@@ -389,7 +401,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import * as XLSX from 'xlsx';
|
import * as XLSX from 'xlsx';
|
||||||
import { listDeliveryPlan, getDeliveryPlan, delDeliveryPlan, addDeliveryPlan, updateDeliveryPlan } from "@/api/wms/deliveryPlan";
|
import { listDeliveryPlan, getDeliveryPlan, delDeliveryPlan, addDeliveryPlan, updateDeliveryPlan } from "@/api/wms/deliveryPlan";
|
||||||
import { listReceivePlan, getReceivePlan, delReceivePlan, addReceivePlan, updateReceivePlan, checkReceivePlan } from "@/api/wms/receivePlan";
|
import { listReceivePlan, getReceivePlan, delReceivePlan, addReceivePlan, updateReceivePlan, checkReceivePlan, delReceivePlanBatch } from "@/api/wms/receivePlan";
|
||||||
import { listCoilWithIds } from "@/api/wms/coil";
|
import { listCoilWithIds } from "@/api/wms/coil";
|
||||||
import { listPendingAction } from "@/api/wms/pendingAction";
|
import { listPendingAction } from "@/api/wms/pendingAction";
|
||||||
|
|
||||||
@@ -460,6 +472,9 @@ export default {
|
|||||||
detailFormOpen: false,
|
detailFormOpen: false,
|
||||||
detailFormTitle: '',
|
detailFormTitle: '',
|
||||||
detailButtonLoading: false,
|
detailButtonLoading: false,
|
||||||
|
detailIds: [],
|
||||||
|
detailSingle: true,
|
||||||
|
detailMultiple: true,
|
||||||
detailForm: {},
|
detailForm: {},
|
||||||
detailRules: {
|
detailRules: {
|
||||||
lotNo: [{ required: true, message: '入场卷号不能为空', trigger: 'blur' }]
|
lotNo: [{ required: true, message: '入场卷号不能为空', trigger: 'blur' }]
|
||||||
@@ -645,7 +660,7 @@ export default {
|
|||||||
calculateDiff() {
|
calculateDiff() {
|
||||||
this.diffLoading = true;
|
this.diffLoading = true;
|
||||||
Promise.all([
|
Promise.all([
|
||||||
listReceivePlan({ pageNum: 1, pageSize: 1000, planId: this.currentPlanId }),
|
listReceivePlan({ pageNum: 1, pageSize: 99999, planId: this.currentPlanId }),
|
||||||
listPendingAction({
|
listPendingAction({
|
||||||
warehouseId: this.currentPlanId,
|
warehouseId: this.currentPlanId,
|
||||||
actionType: 401,
|
actionType: 401,
|
||||||
@@ -729,6 +744,9 @@ export default {
|
|||||||
},
|
},
|
||||||
getDetailList() {
|
getDetailList() {
|
||||||
this.detailLoading = true;
|
this.detailLoading = true;
|
||||||
|
this.detailIds = [];
|
||||||
|
this.detailSingle = true;
|
||||||
|
this.detailMultiple = true;
|
||||||
listReceivePlan(this.detailQueryParams).then(response => {
|
listReceivePlan(this.detailQueryParams).then(response => {
|
||||||
this.detailList = response.rows;
|
this.detailList = response.rows;
|
||||||
this.detailTotal = response.total;
|
this.detailTotal = response.total;
|
||||||
@@ -789,6 +807,41 @@ export default {
|
|||||||
this.$modal.msgSuccess("删除成功");
|
this.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
|
handleDetailSelectionChange(selection) {
|
||||||
|
this.detailIds = selection.map(item => item.receiveId);
|
||||||
|
this.detailSingle = this.detailIds.length !== 1;
|
||||||
|
this.detailMultiple = !this.detailIds.length;
|
||||||
|
},
|
||||||
|
handleDetailBatchDelete() {
|
||||||
|
const receiveIds = this.detailIds.join(',');
|
||||||
|
this.$modal.confirm('是否确认删除选中的' + this.detailIds.length + '条待收货明细?').then(() => {
|
||||||
|
this.detailLoading = true;
|
||||||
|
return delReceivePlan(receiveIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getDetailList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => { }).finally(() => {
|
||||||
|
this.detailLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleDetailClear() {
|
||||||
|
this.$modal.confirm('是否确认清空当前收货计划下的所有待收货明细?此操作不可恢复!').then(() => {
|
||||||
|
this.detailLoading = true;
|
||||||
|
return listReceivePlan({ pageNum: 1, pageSize: 99999, planId: this.currentPlanId });
|
||||||
|
}).then(response => {
|
||||||
|
const allIds = response.rows.map(item => item.receiveId);
|
||||||
|
if (allIds.length === 0) {
|
||||||
|
this.$modal.msgInfo('暂无数据可清空');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return delReceivePlanBatch(allIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getDetailList();
|
||||||
|
this.$modal.msgSuccess("清空成功");
|
||||||
|
}).catch(() => { }).finally(() => {
|
||||||
|
this.detailLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
openImportDialog(row) {
|
openImportDialog(row) {
|
||||||
this.currentPlanId = row.planId;
|
this.currentPlanId = row.planId;
|
||||||
@@ -1019,7 +1072,7 @@ export default {
|
|||||||
downloadTemplate() {
|
downloadTemplate() {
|
||||||
const templateData = [
|
const templateData = [
|
||||||
TEMPLATE_HEADERS,
|
TEMPLATE_HEADERS,
|
||||||
['A库区', 'LOT001', 'SUP001', 'PROD001', '2024-01-01', 1000.50, '钢板', '1.0*1000', 2000, 'Q235', '宝钢', '镀锌', '80', '甲班', '1.5', 'GI', '原材料', '示例备注']
|
['A库区', 'LOT001', 'SUP001', 'PROD001', '2024-01-01', 1000.50, '钢板', '1.0*1000', 2000, 'Q235', '宝钢', '镀锌', '80', '甲班', '1.5', 'GI', '原料', '示例备注']
|
||||||
];
|
];
|
||||||
const wb = XLSX.utils.book_new();
|
const wb = XLSX.utils.book_new();
|
||||||
const ws = XLSX.utils.aoa_to_sheet(templateData);
|
const ws = XLSX.utils.aoa_to_sheet(templateData);
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.klp.controller;
|
package com.klp.controller;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@@ -87,6 +88,15 @@ public class WmsReceivePlanController extends BaseController {
|
|||||||
return toAjax(iWmsReceivePlanService.updateByBo(bo));
|
return toAjax(iWmsReceivePlanService.updateByBo(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大批量删除应收货物计划
|
||||||
|
*/
|
||||||
|
@Log(title = "应收货物计划", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/batchDelete")
|
||||||
|
public R<Void> remove(@RequestBody ArrayList<Long> receiveIds) {
|
||||||
|
return toAjax(iWmsReceivePlanService.deleteWithValidByIds(receiveIds, true));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除应收货物计划
|
* 删除应收货物计划
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user