Commit 1605f447 authored by wh's avatar wh

发货管理

parent f41e2ad9
import request from '@/utils/request'
// 创建出货管理
export function createBox(data) {
return request({
url: '/ecw/box/create',
method: 'post',
data: data
})
}
// 更新出货管理
export function updateBox(data) {
return request({
url: '/ecw/box/update',
method: 'put',
data: data
})
}
// 删除出货管理
export function deleteBox(id) {
return request({
url: '/ecw/box/delete?id=' + id,
method: 'delete'
})
}
// 获得出货管理
export function getBox(id) {
return request({
url: '/ecw/box/get?id=' + id,
method: 'get'
})
}
// 获得出货管理分页
export function getBoxPage(query) {
return request({
url: '/ecw/box/page',
method: 'get',
params: query
})
}
// 导出出货管理 Excel
export function exportBoxExcel(query) {
return request({
url: '/ecw/box/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
<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="number">
<el-input v-model="queryParams.number" placeholder="请输入自编号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="柜型" prop="numbers">
<el-input v-model="queryParams.numbers" placeholder="请输入柜型" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="状态:0预装;1已装(封柜);2已开船;3已到港;4已清关;5已卸货" prop="statics">
<el-select v-model="queryParams.statics" placeholder="请选择状态:0预装;1已装(封柜);2已开船;3已到港;4已清关;5已卸货" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="起运港id" prop="qiyun">
<el-input v-model="queryParams.qiyun" placeholder="请输入起运港id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="起运港详情" prop="qiyuns">
<el-input v-model="queryParams.qiyuns" placeholder="请输入起运港详情" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="目前的港id" prop="mudi">
<el-input v-model="queryParams.mudi" placeholder="请输入目前的港id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="目的港详情" prop="mudis">
<el-input v-model="queryParams.mudis" placeholder="请输入目的港详情" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="预装时间">
<el-date-picker v-model="dateRangeYzDate" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item label="" prop="chuandong">
<el-input v-model="queryParams.chuandong" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="代理" prop="daili">
<el-input v-model="queryParams.daili" placeholder="请输入代理" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="柜类型" prop="gx">
<el-input v-model="queryParams.gx" placeholder="请输入柜类型" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="柜类型详情" prop="gxs">
<el-input v-model="queryParams.gxs" placeholder="请输入柜类型详情" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="装柜部分" prop="products">
<el-input v-model="queryParams.products" placeholder="请输入装柜部分" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="" prop="wenti">
<el-input v-model="queryParams.wenti" placeholder="请输入" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="0未提交;1审核中;2通过;3驳回" prop="pass">
<el-input v-model="queryParams.pass" placeholder="请输入0未提交;1审核中;2通过;3驳回" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="封柜时间">
<el-date-picker v-model="dateRangeFengtime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item label="出仓时间">
<el-date-picker v-model="dateRangeChutime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item label="到港时间">
<el-date-picker v-model="dateRangeDaotime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item label="清关时间">
<el-date-picker v-model="dateRangeQgtime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item label="0未锁定,1已锁定" prop="isSock">
<el-input v-model="queryParams.isSock" placeholder="请输入0未锁定,1已锁定" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="运输id" prop="transportId">
<el-input v-model="queryParams.transportId" placeholder="请输入运输id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="管理员id" prop="adminId">
<el-input v-model="queryParams.adminId" placeholder="请输入管理员id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['ecw:box:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['ecw:box:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="主键ID" align="center" prop="id" />
<el-table-column label="自编号" align="center" prop="number" />
<el-table-column label="柜型" align="center" prop="numbers" />
<el-table-column label="类型" align="center" prop="type" />
<el-table-column label="状态:0预装;1已装(封柜);2已开船;3已到港;4已清关;5已卸货" align="center" prop="statics" />
<el-table-column label="起运港id" align="center" prop="qiyun" />
<el-table-column label="起运港详情" align="center" prop="qiyuns" />
<el-table-column label="目前的港id" align="center" prop="mudi" />
<el-table-column label="目的港详情" align="center" prop="mudis" />
<el-table-column label="预装时间" align="center" prop="yzDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.yzDate) }}</span>
</template>
</el-table-column>
<el-table-column label="" align="center" prop="chuandong" />
<el-table-column label="代理" align="center" prop="daili" />
<el-table-column label="柜类型" align="center" prop="gx" />
<el-table-column label="柜类型详情" align="center" prop="gxs" />
<el-table-column label="装柜部分" align="center" prop="products" />
<el-table-column label="" align="center" prop="wenti" />
<el-table-column label="0未提交;1审核中;2通过;3驳回" align="center" prop="pass" />
<el-table-column label="封柜时间" align="center" prop="fengtime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.fengtime) }}</span>
</template>
</el-table-column>
<el-table-column label="出仓时间" align="center" prop="chutime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.chutime) }}</span>
</template>
</el-table-column>
<el-table-column label="到港时间" align="center" prop="daotime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.daotime) }}</span>
</template>
</el-table-column>
<el-table-column label="清关时间" align="center" prop="qgtime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.qgtime) }}</span>
</template>
</el-table-column>
<el-table-column label="0未锁定,1已锁定" align="center" prop="isSock" />
<el-table-column label="运输id" align="center" prop="transportId" />
<el-table-column label="管理员id" align="center" prop="adminId" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</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)"
v-hasPermi="['ecw:box:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ecw:box:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :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="number">
<el-input v-model="form.number" placeholder="请输入自编号" />
</el-form-item>
<el-form-item label="柜型" prop="numbers">
<el-input v-model="form.numbers" placeholder="请输入柜型" />
</el-form-item>
<el-form-item label="类型" prop="type">
<el-select v-model="form.type" placeholder="请选择类型">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="状态:0预装;1已装(封柜);2已开船;3已到港;4已清关;5已卸货" prop="statics">
<el-select v-model="form.statics" placeholder="请选择状态:0预装;1已装(封柜);2已开船;3已到港;4已清关;5已卸货">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="起运港id" prop="qiyun">
<el-input v-model="form.qiyun" placeholder="请输入起运港id" />
</el-form-item>
<el-form-item label="起运港详情" prop="qiyuns">
<el-input v-model="form.qiyuns" placeholder="请输入起运港详情" />
</el-form-item>
<el-form-item label="目前的港id" prop="mudi">
<el-input v-model="form.mudi" placeholder="请输入目前的港id" />
</el-form-item>
<el-form-item label="目的港详情" prop="mudis">
<el-input v-model="form.mudis" placeholder="请输入目的港详情" />
</el-form-item>
<el-form-item label="预装时间" prop="yzDate">
<el-date-picker clearable v-model="form.yzDate" type="date" value-format="yyyy-MM-dd" placeholder="选择预装时间" />
</el-form-item>
<el-form-item label="" prop="chuandong">
<el-input v-model="form.chuandong" placeholder="请输入" />
</el-form-item>
<el-form-item label="代理" prop="daili">
<el-input v-model="form.daili" placeholder="请输入代理" />
</el-form-item>
<el-form-item label="柜类型" prop="gx">
<el-input v-model="form.gx" placeholder="请输入柜类型" />
</el-form-item>
<el-form-item label="柜类型详情" prop="gxs">
<el-input v-model="form.gxs" placeholder="请输入柜类型详情" />
</el-form-item>
<el-form-item label="装柜部分" prop="products">
<el-input v-model="form.products" placeholder="请输入装柜部分" />
</el-form-item>
<el-form-item label="" prop="wenti">
<el-input v-model="form.wenti" placeholder="请输入" />
</el-form-item>
<el-form-item label="0未提交;1审核中;2通过;3驳回" prop="pass">
<el-input v-model="form.pass" placeholder="请输入0未提交;1审核中;2通过;3驳回" />
</el-form-item>
<el-form-item label="封柜时间" prop="fengtime">
<el-date-picker clearable v-model="form.fengtime" type="date" value-format="yyyy-MM-dd" placeholder="选择封柜时间" />
</el-form-item>
<el-form-item label="出仓时间" prop="chutime">
<el-date-picker clearable v-model="form.chutime" type="date" value-format="yyyy-MM-dd" placeholder="选择出仓时间" />
</el-form-item>
<el-form-item label="到港时间" prop="daotime">
<el-date-picker clearable v-model="form.daotime" type="date" value-format="yyyy-MM-dd" placeholder="选择到港时间" />
</el-form-item>
<el-form-item label="清关时间" prop="qgtime">
<el-date-picker clearable v-model="form.qgtime" type="date" value-format="yyyy-MM-dd" placeholder="选择清关时间" />
</el-form-item>
<el-form-item label="0未锁定,1已锁定" prop="isSock">
<el-input v-model="form.isSock" placeholder="请输入0未锁定,1已锁定" />
</el-form-item>
<el-form-item label="运输id" prop="transportId">
<el-input v-model="form.transportId" placeholder="请输入运输id" />
</el-form-item>
<el-form-item label="管理员id" prop="adminId">
<el-input v-model="form.adminId" placeholder="请输入管理员id" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { createBox, updateBox, deleteBox, getBox, getBoxPage, exportBoxExcel } from "@/api/ecw/box";
export default {
name: "Box",
components: {
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 出货管理列表
list: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
dateRangeYzDate: [],
dateRangeFengtime: [],
dateRangeChutime: [],
dateRangeDaotime: [],
dateRangeQgtime: [],
dateRangeCreateTime: [],
// 查询参数
queryParams: {
pageNo: 1,
pageSize: 10,
number: null,
numbers: null,
type: null,
statics: null,
qiyun: null,
qiyuns: null,
mudi: null,
mudis: null,
chuandong: null,
daili: null,
gx: null,
gxs: null,
products: null,
wenti: null,
pass: null,
isSock: null,
transportId: null,
adminId: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
// 处理查询参数
let params = {...this.queryParams};
this.addBeginAndEndTime(params, this.dateRangeYzDate, 'yzDate');
this.addBeginAndEndTime(params, this.dateRangeFengtime, 'fengtime');
this.addBeginAndEndTime(params, this.dateRangeChutime, 'chutime');
this.addBeginAndEndTime(params, this.dateRangeDaotime, 'daotime');
this.addBeginAndEndTime(params, this.dateRangeQgtime, 'qgtime');
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行查询
getBoxPage(params).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
number: undefined,
numbers: undefined,
type: undefined,
statics: undefined,
qiyun: undefined,
qiyuns: undefined,
mudi: undefined,
mudis: undefined,
yzDate: undefined,
chuandong: undefined,
daili: undefined,
gx: undefined,
gxs: undefined,
products: undefined,
wenti: undefined,
pass: undefined,
fengtime: undefined,
chutime: undefined,
daotime: undefined,
qgtime: undefined,
isSock: undefined,
transportId: undefined,
adminId: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.dateRangeYzDate = [];
this.dateRangeFengtime = [];
this.dateRangeChutime = [];
this.dateRangeDaotime = [];
this.dateRangeQgtime = [];
this.dateRangeCreateTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加出货管理";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getBox(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改出货管理";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
// 修改的提交
if (this.form.id != null) {
updateBox(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
// 添加的提交
createBox(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除出货管理编号为"' + id + '"的数据项?').then(function() {
return deleteBox(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// 处理查询参数
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.addBeginAndEndTime(params, this.dateRangeYzDate, 'yzDate');
this.addBeginAndEndTime(params, this.dateRangeFengtime, 'fengtime');
this.addBeginAndEndTime(params, this.dateRangeChutime, 'chutime');
this.addBeginAndEndTime(params, this.dateRangeDaotime, 'daotime');
this.addBeginAndEndTime(params, this.dateRangeQgtime, 'qgtime');
this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
// 执行导出
this.$modal.confirm('是否确认导出所有出货管理数据项?').then(() => {
this.exportLoading = true;
return exportBoxExcel(params);
}).then(response => {
this.$download.excel(response, '${table.classComment}.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment