feat(wms): 新增发货单明细组件并优化发货单主界面
refactor(waybill): 重构发货单主界面布局,增加发货计划树形选择 fix(MemoInput): 修正自定义事件名称从select改为input
This commit is contained in:
@@ -106,7 +106,7 @@ export default {
|
||||
this.cacheInputValue(item.value);
|
||||
this.inputValue = item.value;
|
||||
// 触发自定义事件,通知父组件选中结果
|
||||
this.$emit('select', item.value);
|
||||
this.$emit('input', item.value);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
343
klp-ui/src/views/wms/delivery/componnets/detailTable.vue
Normal file
343
klp-ui/src/views/wms/delivery/componnets/detailTable.vue
Normal file
@@ -0,0 +1,343 @@
|
||||
<template>
|
||||
<div v-loading="loading" >
|
||||
<div v-if="waybillId">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="2" style="font-weight: 900;">发货单明细</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-refresh" size="mini" @click="getList">刷新</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="deliveryWaybillDetailList">
|
||||
<!-- <el-table-column label="关联钢卷表ID" align="center" prop="coilId" /> -->
|
||||
<el-table-column label="品名" align="center" prop="productName" />
|
||||
<el-table-column label="切边" align="center" prop="edgeType" />
|
||||
<el-table-column label="包装" align="center" prop="packaging" />
|
||||
<el-table-column label="结算方式" align="center" prop="settlementType" />
|
||||
<el-table-column label="原料厂家" align="center" prop="rawMaterialFactory" />
|
||||
<el-table-column label="卷号" align="center" prop="coilNo" />
|
||||
<el-table-column label="规格" align="center" prop="specification" />
|
||||
<el-table-column label="材质" align="center" prop="material" />
|
||||
<el-table-column label="数量" align="center" prop="quantity" />
|
||||
<el-table-column label="重量" align="center" prop="weight" />
|
||||
<el-table-column label="单价" align="center" prop="unitPrice" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-empty description="请选择发货单查看明细" />
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 添加或修改发货单明细对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="关联发货单主表ID" prop="waybillId">
|
||||
<el-input v-model="form.waybillId" placeholder="请输入关联发货单主表ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="关联钢卷表ID" prop="coilId">
|
||||
<el-input v-model="form.coilId" placeholder="请输入关联钢卷表ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品名" prop="productName">
|
||||
<el-input v-model="form.productName" placeholder="请输入品名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="包装" prop="packaging">
|
||||
<el-input v-model="form.packaging" placeholder="请输入包装" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原料厂家" prop="rawMaterialFactory">
|
||||
<el-input v-model="form.rawMaterialFactory" placeholder="请输入原料厂家" />
|
||||
</el-form-item>
|
||||
<el-form-item label="卷号" prop="coilNo">
|
||||
<el-input v-model="form.coilNo" placeholder="请输入卷号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格" prop="specification">
|
||||
<el-input v-model="form.specification" placeholder="请输入规格" />
|
||||
</el-form-item>
|
||||
<el-form-item label="材质" prop="material">
|
||||
<el-input v-model="form.material" placeholder="请输入材质" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="quantity">
|
||||
<el-input v-model="form.quantity" placeholder="请输入数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="重量" prop="weight">
|
||||
<el-input v-model="form.weight" placeholder="请输入重量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单价" prop="unitPrice">
|
||||
<el-input v-model="form.unitPrice" placeholder="请输入单价" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listDeliveryWaybillDetail, getDeliveryWaybillDetail, delDeliveryWaybillDetail, addDeliveryWaybillDetail, updateDeliveryWaybillDetail } from "@/api/wms/deliveryWaybillDetail";
|
||||
|
||||
export default {
|
||||
name: "DeliveryWaybillDetail",
|
||||
props: {
|
||||
waybillId: {
|
||||
type: String,
|
||||
default: '',
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
waybillId: {
|
||||
handler(newVal, oldVal) {
|
||||
if (newVal) {
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 发货单明细表格数据
|
||||
deliveryWaybillDetailList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
waybillId: this.waybillId,
|
||||
coilId: undefined,
|
||||
productName: undefined,
|
||||
edgeType: undefined,
|
||||
packaging: undefined,
|
||||
settlementType: undefined,
|
||||
rawMaterialFactory: undefined,
|
||||
coilNo: undefined,
|
||||
specification: undefined,
|
||||
material: undefined,
|
||||
quantity: undefined,
|
||||
weight: undefined,
|
||||
unitPrice: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
detailId: [
|
||||
{ required: true, message: "明细唯一ID不能为空", trigger: "blur" }
|
||||
],
|
||||
waybillId: [
|
||||
{ required: true, message: "关联发货单主表ID不能为空", trigger: "blur" }
|
||||
],
|
||||
coilId: [
|
||||
{ required: true, message: "关联钢卷表ID不能为空", trigger: "blur" }
|
||||
],
|
||||
productName: [
|
||||
{ required: true, message: "品名不能为空", trigger: "blur" }
|
||||
],
|
||||
edgeType: [
|
||||
{ required: true, message: "切边不能为空", trigger: "change" }
|
||||
],
|
||||
packaging: [
|
||||
{ required: true, message: "包装不能为空", trigger: "blur" }
|
||||
],
|
||||
settlementType: [
|
||||
{ required: true, message: "结算方式不能为空", trigger: "change" }
|
||||
],
|
||||
rawMaterialFactory: [
|
||||
{ required: true, message: "原料厂家不能为空", trigger: "blur" }
|
||||
],
|
||||
coilNo: [
|
||||
{ required: true, message: "卷号不能为空", trigger: "blur" }
|
||||
],
|
||||
specification: [
|
||||
{ required: true, message: "规格不能为空", trigger: "blur" }
|
||||
],
|
||||
material: [
|
||||
{ required: true, message: "材质不能为空", trigger: "blur" }
|
||||
],
|
||||
quantity: [
|
||||
{ required: true, message: "数量不能为空", trigger: "blur" }
|
||||
],
|
||||
weight: [
|
||||
{ required: true, message: "重量不能为空", trigger: "blur" }
|
||||
],
|
||||
unitPrice: [
|
||||
{ required: true, message: "单价不能为空", trigger: "blur" }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: "备注不能为空", trigger: "blur" }
|
||||
],
|
||||
delFlag: [
|
||||
{ required: true, message: "删除标志不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: "更新时间不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询发货单明细列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listDeliveryWaybillDetail(this.queryParams).then(response => {
|
||||
this.deliveryWaybillDetailList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
detailId: undefined,
|
||||
waybillId: this.waybillId,
|
||||
coilId: undefined,
|
||||
productName: undefined,
|
||||
edgeType: undefined,
|
||||
packaging: undefined,
|
||||
settlementType: undefined,
|
||||
rawMaterialFactory: undefined,
|
||||
coilNo: undefined,
|
||||
specification: undefined,
|
||||
material: undefined,
|
||||
quantity: undefined,
|
||||
weight: undefined,
|
||||
unitPrice: undefined,
|
||||
remark: undefined,
|
||||
delFlag: undefined,
|
||||
createTime: undefined,
|
||||
createBy: undefined,
|
||||
updateTime: undefined,
|
||||
updateBy: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.detailId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加发货单明细";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.reset();
|
||||
const detailId = row.detailId || this.ids
|
||||
getDeliveryWaybillDetail(detailId).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改发货单明细";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.detailId != null) {
|
||||
updateDeliveryWaybillDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addDeliveryWaybillDetail(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const detailIds = row.detailId || this.ids;
|
||||
this.$modal.confirm('是否确认删除发货单明细编号为"' + detailIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delDeliveryWaybillDetail(detailIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wms/deliveryWaybillDetail/export', {
|
||||
...this.queryParams
|
||||
}, `deliveryWaybillDetail_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -1,131 +1,93 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="发货单编号" prop="waybillNo">
|
||||
<el-input
|
||||
v-model="queryParams.waybillNo"
|
||||
placeholder="请输入发货单编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发货单名称" prop="waybillName">
|
||||
<el-input
|
||||
v-model="queryParams.waybillName"
|
||||
placeholder="请输入发货单名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="收货单位" prop="consigneeUnit">
|
||||
<el-input
|
||||
v-model="queryParams.consigneeUnit"
|
||||
placeholder="请输入收货单位"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="4">
|
||||
<div class="plan-container">
|
||||
<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"/>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
<el-col :span="20">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||
label-width="68px">
|
||||
<el-form-item label="发货单名称" prop="waybillName">
|
||||
<el-input v-model="queryParams.waybillName" placeholder="请输入发货单名称" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收货单位" prop="consigneeUnit">
|
||||
<el-input v-model="queryParams.consigneeUnit" placeholder="请输入收货单位" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" :disabled="!selectedPlan"
|
||||
title="请先选择发货计划">新增</el-button>
|
||||
<el-button type="success" plain icon="el-icon-refresh" size="mini" @click="handleQuery">刷新</el-button>
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" border :data="deliveryWaybillList" highlight-current-row @row-click="handleRowClick">
|
||||
<el-table-column label="发货单唯一ID" align="center" prop="waybillId" v-if="false" />
|
||||
<el-table-column label="发货单名称" align="center" prop="waybillName" />
|
||||
<el-table-column label="车牌" align="center" prop="licensePlate" width="100" />
|
||||
<el-table-column label="发货单位" align="center" prop="senderUnit" />
|
||||
<el-table-column label="发货时间" align="center" prop="deliveryTime" width="100">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.deliveryTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="负责人" align="center" prop="principal" />
|
||||
<el-table-column label="负责人电话" align="center" prop="principalPhone" width="100" />
|
||||
<el-table-column label="完成状态" align="center" prop="status" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.status" placeholder="请选择完成状态" @change="handleStatusChange(scope.row)">
|
||||
<el-option label="已发货" :value="1" />
|
||||
<el-option label="未发货" :value="0" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<el-divider style="margin: 20px 0;" />
|
||||
|
||||
<DeliveryWaybillDetail ref="detailTable" :waybillId="waybillId" />
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="deliveryWaybillList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="发货单唯一ID" align="center" prop="waybillId" v-if="false"/>
|
||||
<el-table-column label="发货单编号" align="center" prop="waybillNo" />
|
||||
<el-table-column label="发货单名称" align="center" prop="waybillName" />
|
||||
<el-table-column label="车牌" align="center" prop="licensePlate" />
|
||||
<el-table-column label="发货单位" align="center" prop="senderUnit" />
|
||||
<el-table-column label="发货时间" align="center" prop="deliveryTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.deliveryTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="负责人" align="center" prop="principal" />
|
||||
<el-table-column label="负责人电话" align="center" prop="principalPhone" />
|
||||
<el-table-column label="完成状态" align="center" prop="status" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" align="center" prop="updateBy" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改发货单主对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="发货单编号" prop="waybillNo">
|
||||
<el-input v-model="form.waybillNo" placeholder="请输入发货单编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发货单名称" prop="waybillName">
|
||||
<el-input v-model="form.waybillName" placeholder="请输入发货单名称" />
|
||||
</el-form-item>
|
||||
@@ -139,10 +101,7 @@
|
||||
<el-input v-model="form.senderUnit" placeholder="请输入发货单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发货时间" prop="deliveryTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.deliveryTime"
|
||||
type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
<el-date-picker clearable v-model="form.deliveryTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择发货时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
@@ -172,12 +131,15 @@
|
||||
|
||||
<script>
|
||||
import { listDeliveryWaybill, getDeliveryWaybill, delDeliveryWaybill, addDeliveryWaybill, updateDeliveryWaybill } from "@/api/wms/deliveryWaybill";
|
||||
import { listDeliveryPlan } from "@/api/wms/deliveryPlan"; // 导入发货计划API
|
||||
import MemoInput from "@/components/MemoInput";
|
||||
import DeliveryWaybillDetail from "../componnets/detailTable.vue";
|
||||
|
||||
export default {
|
||||
name: "DeliveryWaybill",
|
||||
components: {
|
||||
MemoInput
|
||||
MemoInput,
|
||||
DeliveryWaybillDetail,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -197,6 +159,7 @@ export default {
|
||||
total: 0,
|
||||
// 发货单主表格数据
|
||||
deliveryWaybillList: [],
|
||||
waybillId: null,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
@@ -216,27 +179,57 @@ export default {
|
||||
principal: undefined,
|
||||
principalPhone: undefined,
|
||||
status: undefined,
|
||||
planId: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
rules: {},
|
||||
// 发货计划相关数据
|
||||
planList: [],
|
||||
planTreeData: [],
|
||||
planTreeProps: {
|
||||
label: 'planName',
|
||||
children: 'children'
|
||||
},
|
||||
planTotal: 0,
|
||||
planLoading: false,
|
||||
selectedPlan: null,
|
||||
planQueryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 100, // 增大分页大小以确保树形结构显示足够数据
|
||||
planName: undefined
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getPlanList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询发货单主列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listDeliveryWaybill(this.queryParams).then(response => {
|
||||
// 确保查询参数包含planId
|
||||
const params = {
|
||||
...this.queryParams,
|
||||
// 如果选中了计划,传递planId,否则不传递该参数
|
||||
planId: this.selectedPlan ? this.selectedPlan.planId : undefined
|
||||
};
|
||||
listDeliveryWaybill(params).then(response => {
|
||||
this.deliveryWaybillList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 完成状态改变时的处理 */
|
||||
handleStatusChange(row) {
|
||||
// 确保在更新状态时包含waybillId
|
||||
updateDeliveryWaybill(row).then(() => {
|
||||
this.$modal.msgSuccess("状态更新成功");
|
||||
this.getList(); // 刷新列表
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
@@ -246,12 +239,12 @@ export default {
|
||||
reset() {
|
||||
this.form = {
|
||||
waybillId: undefined,
|
||||
waybillNo: undefined,
|
||||
waybillNo: new Date().getTime(),
|
||||
waybillName: undefined,
|
||||
planId: undefined,
|
||||
licensePlate: undefined,
|
||||
consigneeUnit: undefined,
|
||||
senderUnit: undefined,
|
||||
senderUnit: '科伦普',
|
||||
deliveryTime: undefined,
|
||||
weighbridge: undefined,
|
||||
salesPerson: undefined,
|
||||
@@ -275,17 +268,56 @@ export default {
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
// 重置查询时保留planId
|
||||
if (this.selectedPlan) {
|
||||
this.queryParams.planId = this.selectedPlan.planId;
|
||||
}
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.waybillId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
// 获取发货计划列表
|
||||
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;
|
||||
// 更新查询参数,根据选中的planId筛选发货单
|
||||
this.queryParams.planId = row.planId;
|
||||
this.waybillId = null;
|
||||
this.getList();
|
||||
},
|
||||
handleRowClick(row) {
|
||||
this.waybillId = row.waybillId;
|
||||
},
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
// 自动填入选中的planId
|
||||
if (this.selectedPlan) {
|
||||
this.form.planId = this.selectedPlan.planId;
|
||||
// 可以根据需要填充其他相关字段
|
||||
if (this.selectedPlan.planName) {
|
||||
this.form.waybillName = `发货单_${this.selectedPlan.planName}`;
|
||||
}
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "添加发货单主";
|
||||
},
|
||||
@@ -350,3 +382,17 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.plan-container {
|
||||
padding: 10px;
|
||||
height: 100%;
|
||||
border-right: 1px solid #ebeef5;
|
||||
}
|
||||
.plan-container h3 {
|
||||
margin: 0 0 10px 0;
|
||||
padding: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user