refactor(wms): 重构发货计划组件并优化单价输入
将发货计划树形列表提取为独立组件,增加右键菜单和操作功能 修改单价输入框类型为文本类型以支持更多格式 移除原料厂家和单价列的显示以简化表格
This commit is contained in:
@@ -1,26 +1,11 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="4">
|
||||
<el-card>
|
||||
<el-input v-model="planQueryParams.planName" placeholder="计划名称" clearable @change="handlePlanQuery"
|
||||
style="width: 100%;" />
|
||||
|
||||
<el-tree v-loading="planLoading" :data="planTreeData" :props="planTreeProps" @node-click="handlePlanSelect"
|
||||
default-expand-all style="margin-top: 10px; height: 550px; overflow: auto;">
|
||||
<template slot-scope="{ node, data }">
|
||||
<span class="plan-node">
|
||||
<span class="plan-name">{{ data.planName }}</span>
|
||||
</span>
|
||||
</template>
|
||||
</el-tree>
|
||||
<pagination v-show="planTotal > 0" :total="planTotal" :page.sync="planQueryParams.pageNum"
|
||||
:limit.sync="planQueryParams.pageSize" @pagination="getPlanList" style="margin-top: 10px;"
|
||||
layout="total, prev, jumper, next" />
|
||||
</el-card>
|
||||
<el-col :span="5">
|
||||
<PlanList ref="planList" @select="handlePlanSelect"/>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="20">
|
||||
<el-col :span="19">
|
||||
<el-card>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||
label-width="68px">
|
||||
@@ -80,8 +65,7 @@
|
||||
|
||||
<el-divider style="margin: 20px 0;" />
|
||||
|
||||
<DeliveryWaybillDetail v-if="canEdit" ref="detailTable" :waybillId="waybillId" :coilList="coilList"
|
||||
@add="refreshCoilList" @update="refreshCoilList" @delete="refreshCoilList" />
|
||||
<DeliveryWaybillDetail v-if="canEdit" ref="detailTable" :waybillId="waybillId" :coilList="coilList" />
|
||||
<el-empty v-else description="已发货,不可修改,点击打印查看详情" />
|
||||
</el-card>
|
||||
</el-col>
|
||||
@@ -138,13 +122,15 @@ import { listDeliveryWaybillDetail } from "@/api/wms/deliveryWaybillDetail";
|
||||
import MemoInput from "@/components/MemoInput";
|
||||
import DeliveryWaybillDetail from "../components/detailTable.vue";
|
||||
import WayBill from "../components/wayBill.vue";
|
||||
import PlanList from "../components/planList.vue";
|
||||
|
||||
export default {
|
||||
name: "DeliveryWaybill",
|
||||
components: {
|
||||
MemoInput,
|
||||
DeliveryWaybillDetail,
|
||||
WayBill
|
||||
WayBill,
|
||||
PlanList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -194,15 +180,6 @@ export default {
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
// 发货计划相关数据
|
||||
planList: [],
|
||||
planTreeData: [],
|
||||
planTreeProps: {
|
||||
label: 'planName',
|
||||
children: 'children'
|
||||
},
|
||||
planTotal: 0,
|
||||
planLoading: false,
|
||||
selectedPlan: null,
|
||||
planQueryParams: {
|
||||
pageNum: 1,
|
||||
@@ -294,31 +271,9 @@ export default {
|
||||
}
|
||||
this.handleQuery();
|
||||
},
|
||||
// 获取发货计划列表
|
||||
getPlanList() {
|
||||
this.planLoading = true;
|
||||
listDeliveryPlan(this.planQueryParams).then(response => {
|
||||
this.planList = response.rows;
|
||||
this.planTotal = response.total;
|
||||
// 转换为树形数据格式
|
||||
this.planTreeData = response.rows;
|
||||
this.planLoading = false;
|
||||
});
|
||||
},
|
||||
|
||||
// 发货计划搜索
|
||||
handlePlanQuery() {
|
||||
this.planQueryParams.pageNum = 1;
|
||||
this.getPlanList();
|
||||
},
|
||||
// 发货计划重置
|
||||
resetPlanQuery() {
|
||||
this.planQueryParams.planName = undefined;
|
||||
this.handlePlanQuery();
|
||||
},
|
||||
handlePlanSelect(row) {
|
||||
this.selectedPlan = row;
|
||||
this.refreshCoilList();
|
||||
// this.refreshCoilList();
|
||||
// 更新查询参数,根据选中的planId筛选发货单
|
||||
this.queryParams.planId = row.planId;
|
||||
this.waybillId = null;
|
||||
@@ -429,7 +384,8 @@ export default {
|
||||
material: item.material,
|
||||
quantity: item.quantity,
|
||||
weight: item.weight,
|
||||
unitPrice: item.unitPrice,
|
||||
unitPrice: item.unitPrice || '',
|
||||
// 单价为空时,显示为空字符串
|
||||
remark: item.remark
|
||||
}));
|
||||
const coils = this.currentWaybillDetails.map(item => item.coilId).join(',');
|
||||
|
||||
Reference in New Issue
Block a user