作者 xudada

Merge remote-tracking branch 'origin/master'

... ... @@ -12,3 +12,5 @@ export const delCustomer = params => { return axios.get(`${baseServiceURL2}/cust
export const ediCustomer = params => { return http.post(`${baseServiceURL2}/customer/ediCustomer`, params); };
//客户配置列表
export const selectCustomers = params => { return axios.get(`${baseServiceURL2}/customer/selectCustomers`, { params: params }); };
// 查询客户配置所有列表
export const selectAll = params => {return axios.get(`${baseServiceURL2}/customer/selectAll`, {params: params});};
\ No newline at end of file
... ...
... ... @@ -7,11 +7,12 @@ let baseServiceURL2 = 'wlpt-cbed-system'
//订单列表
export const selectLists = params => { return axios.get(`${baseServiceURL2}/ExportOrderDeclaration/selectLists`, { params: params }); };
// export const selectLists = params => { return axios.get(`${baseServiceURL2}/ExportOrderDeclaration/selectLists`, { params: params }); };
export const selectLists = params => { return axios.get(`${baseServiceURL2}/ExportOrder/selectList`, { params: params }); };
//订单申报
export const sendOrder = params => { return http.post(`${baseServiceURL2}/ExportOrderDeclaration/sendOrder`, params); };
//上传EXCEL
export const importExcel = params => { return http.postExcelData(`${baseServiceURL2}/import/importExcel`, params); };
// export const importExcel = params => { return http.postExcelData(`${baseServiceURL2}/import/importExcel`, params); };
//订单批量申报
export const batchOrder = params => { return http.post(`${baseServiceURL2}/ExportOrderDeclaration/batchOrder`, params); };
//订单批量导入申报
... ... @@ -30,3 +31,13 @@ export const zfeldBatchDeclare = params => { return http.post(`${baseServiceURL2
export const zfeldImportDeclare = params => { return http.postExcelData(`${baseServiceURL2}/ExportWaybillDeclaration/eldImportDeclare`, params); };
//根据提运单统计信息
export const billNoStatistics = params => { return axios.get(`${baseServiceURL2}/ExportListDeclaration/billNoStatistics`, { params: params }); };
// 根据guid删除订单信息
export const deleteOrderByGuid = params => {return axios.get(`${baseServiceURL2}/ExportOrder/deleteByGuid`, {params: params}); };
//根据主单号批量删除订单信息
export const batchDelExt2 = params => {return axios.get(`${baseServiceURL2}/ExportOrder/batchDelExt2`, {params: params});}
// 根据guid列表批量删除订单信息
export const batchDelOrderByBeans = params =>{return http.post(`${baseServiceURL2}/ExportOrder/deleteByBeans`,params); };
// 导入订单文件到minio
export const importExcelToMinio = params => { return http.postExcelData(`${baseServiceURL2}/import/importExcelToMinio`, params); };
// 查询导入文件列表
export const selectFilePage = params =>{return axios.get(`${baseServiceURL2}/import/selectFilePage`, { params: params }); }
\ No newline at end of file
... ...
... ... @@ -206,6 +206,7 @@ import satellite from "./views/deploy/satellite";
import ExortOrder from './views/exportorder/Exportorder.vue'
import CustomerConfig from './views/exportorder/CustomerConfig.vue'
import ManagerWaybill from "./views/exportorder/ManagerWaybill.vue";
import ImportOrder from './views/exportorder/ImportOrder';
/*制单管理*/
import ZhiDan from './views/zhidan/zhidan.vue'
... ... @@ -251,7 +252,8 @@ let routes = [
children: [
{path: '/ExortOrder', component: ExortOrder, name: '出口订单'},
{path: '/CustomerConfig', component: CustomerConfig, name: '客户配置'},
{path: '/ManagerWaybill', component: ManagerWaybill, name: '主单管理'}
{path: '/ManagerWaybill', component: ManagerWaybill, name: '主单管理'},
{path: '/import', component: ImportOrder, name: '订单预录入'}
]
},
{
... ...
... ... @@ -6,6 +6,9 @@
<el-input size="medium" v-model="queryInfo.ext1" class="" placeholder="客户编码"></el-input>
</el-form-item>
<el-form-item label="">
<el-input size="medium" v-model="queryInfo.ext2" class="" placeholder="主单号"></el-input>
</el-form-item>
<el-form-item label="">
<el-input size="medium" v-model="queryInfo.orderno" placeholder="订单号"></el-input>
</el-form-item>
<el-form-item label="">
... ... @@ -58,7 +61,7 @@
<el-form-item>
<el-button size="medium" @click="getList" style="background: none">查询</el-button>
</el-form-item>
<el-form-item>
<!-- <el-form-item>
<el-upload
class="upload-demo"
action=""
... ... @@ -67,7 +70,13 @@
:show-file-list="false">
<el-button size="medium" type="primary">导入订单</el-button>
</el-upload>
</el-form-item>-->
<el-form-item>
<el-button size="medium" @click="batchDelOrderByBeans" type="danger">批量删除</el-button>
</el-form-item>
<el-form-item>
<el-button size="medium" @click="batchDelExt2" type="danger">主单号批量删除</el-button>
</el-form-item>
</el-form>
</div>
<div style="margin-bottom: 20px">
... ... @@ -148,6 +157,7 @@
row-key="id"
stripe
>
<el-table-column type="index" label="序号" width="50" align="center"/>
<el-table-column prop="itemno" label="企业商品货号" />
<el-table-column prop="itemname" label="企业商品名称" />
<el-table-column prop="itemdescribe" label="企业商品描述" />
... ... @@ -163,6 +173,7 @@
</el-table-column>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="ext1" label="客户编号" width="180"></el-table-column>
<el-table-column prop="ext2" label="主单号" width="180"></el-table-column>
<el-table-column prop="orderno" label="订单编号" width="180"></el-table-column>
<el-table-column prop="ordertype" label="订单类型" width="120">
<template slot-scope="scope">
... ... @@ -205,11 +216,12 @@
<el-table-column
fixed="right"
label="操作"
width="180"
width="200"
show-overflow-tooltip>
<template slot-scope="scope">
<el-button type="text" size="small" @click="sendorder(scope.row)">订单申报</el-button>
<el-button type="text" size="small" @click="sendDeclare(scope.row)">清单申报</el-button>
<el-button type="text" size="small" @click="deleteOrderByGuid(scope.row)">订单删除</el-button>
</template>
</el-table-column>
</el-table>
... ... @@ -228,8 +240,9 @@
</template>
<script>
import {sendOrder,selectLists,batchOrder,batchOrderImport,importExcel,eldhBatchDeclare,eldhImportDeclare,
eldBatchDeclare,eldImportDeclare,zfeldBatchDeclare,zfeldImportDeclare} from '../../api/consigner/exportOrder'
import {sendOrder,selectLists,batchOrder,batchOrderImport,eldhBatchDeclare,eldhImportDeclare,
eldBatchDeclare,eldImportDeclare,zfeldBatchDeclare,zfeldImportDeclare,deleteOrderByGuid,
batchDelOrderByBeans,batchDelExt2} from '../../api/consigner/exportOrder'
export default {
data() {
return {
... ... @@ -272,6 +285,7 @@
orderno:'',
ordertype:'',
ext1:'',
ext2:'',
starttime:'',
endtime:'',
pageNum:1,
... ... @@ -314,6 +328,7 @@
this.getList();
},
methods: {
//运单批量导入申报
zfbatchOrderImport({ file, onSuccess, onError }){
// 生成 FormData 对象
... ... @@ -501,7 +516,7 @@
return true; // 允许上传
},
uploadFile({ file, onSuccess, onError }){
/*uploadFile({ file, onSuccess, onError }){
// 生成 FormData 对象
const formData = new FormData();
formData.append('file', file);
... ... @@ -518,7 +533,7 @@
this.$message.error(error.toString())
onError(error); // 调用 onError 回调通知上传失败
})
},
},*/
//订单申报
sendorder(row){
sendOrder(row).then((response)=>{
... ... @@ -532,6 +547,86 @@
this.$message.error(error.toString())
})
},
// 订单删除
deleteOrderByGuid(row){
this.$confirm('此操作将永久删除该订单, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const guid = row.guid;
deleteOrderByGuid({guid}).then((response) => {
const res = response.data;
const code = res.code;
const msg = res.msg;
if (code !== '200'){
return this.$message.error(msg);
}
this.$message.success(`订单删除成功`);
this.getList();
}).catch(error => {
this.$message.error(error.toString())
})
}).catch(() => {
});
},
// 根据主单号删除数据
batchDelExt2(){
if (this.selectedRows.length !== 1){
this.$message.error("此功能仅支持勾选一条数据");
return;
}
this.$confirm('此操作将永久批量删除所选主单号订单, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const ext2 = this.selectedRows[0].ext2;
batchDelExt2({ext2}).then((response) => {
const res = response.data;
const code = res.code;
const msg = res.msg;
if (code !== '200'){
this.$message.error(msg);
return;
}
this.$message.success("批量删除成功");
this.getList();
}).catch(error=>{
this.$message.error(error.toString())
})
}).catch(() => {
})
},
// 订单批量删除
batchDelOrderByBeans(){
if (this.selectedRows.length===0){
this.$message.error('请勾选需要删除的订单信息!');
return;
}
this.$confirm('此操作将永久删除所选订单, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
batchDelOrderByBeans(this.selectedRows).then((response) => {
const res = response.data;
const code = res.code;
const msg = res.msg;
const data = res.data;
if (code !== '200'){
const errMsg = `${msg}${data}`;
this.$message.error(errMsg);
return;
}
this.$message.success("订单批量删除成功");
this.getList();
}).catch(error => {
this.$message.error(error.toString());
})
})
},
//订单列表查询
getList(){
if(this.value2 !== null && this.value2 !== ""){
... ...
<template>
<div>
<div>
<el-form :inline="true" :model="queryInfo" class="demo-form-inline">
<el-form-item label="">
<el-select size="medium" v-model="queryInfo.clientCode" placeholder="客户编码" clearable>
<el-option
v-for="item in customerList"
:key="item.clientCode"
:label="item.clientName"
:value="item.clientCode"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="">
<el-select size="medium" v-model="queryInfo.fileStatus" placeholder="文件状态" clearable>
<el-option
v-for="item in fileStatus"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="">
<el-input size="medium" v-model="queryInfo.fileName" placeholder="文件名称"></el-input>
</el-form-item>
<el-form-item>
<div class="block">
<el-date-picker
style="background: none"
size="medium"
v-model="value2"
type="daterange"
align="right"
unlink-panels
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions">
</el-date-picker>
</div>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="getList">查询</el-button>
</el-form-item>
</el-form>
</div>
<div>
<el-row :gutter="20">
<el-col :span="3">
<el-button size="medium" @click="downloadOrderTemplate">模板下载</el-button>
</el-col>
<el-col :span="3">
<el-upload
class="upload-demo"
action=""
:before-upload="beforeUpload"
:http-request="orderImport"
:show-file-list="false">
<el-button size="medium" type="primary">导入订单</el-button>
</el-upload>
</el-col>
</el-row>
</div>
<el-row :gutter="20" style="height: 20px;"></el-row>
<div>
<el-table
:data="tableData"
style="width: 100%"
row-key="uuid"
border
stripe
>
<el-table-column prop="clientName" label="客户名称" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="clientCode" label="客户编码" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="fileStatus" label="文件状态" width="180" show-overflow-tooltip>
<template slot-scope="scope">
<span v-if="scope.row.fileStatus === 1">入库中</span>
<span v-else-if="scope.row.fileStatus === 2">入库异常</span>
<span v-else-if="scope.row.fileStatus === 5">入库成功</span>
</template>
</el-table-column>
<el-table-column prop="fileName" label="文件名称" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="handleRes" label="处理结果" width="180" show-overflow-tooltip></el-table-column>
<el-table-column prop="createTime" label="创建时间" width="180" show-overflow-tooltip></el-table-column>
</el-table>
</div>
<div class="block">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryInfo.pageNum"
:page-sizes="[20, 30, 40, 100]"
:page-size="queryInfo.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="total">
</el-pagination>
</div>
</div>
</template>
<script>
import {selectAll} from '../../api/consigner/customerconfig'
import {importExcelToMinio, selectFilePage} from '../../api/consigner/exportOrder'
export default {
data() {
return {
// 查询条件
queryInfo: {
clientCode: '',
fileStatus: '',
fileName: '',
startTime: '',
endTime: '',
pageNum: 1,
pageSize: 20
},
// 列表数据
tableData: [],
total: 0,
// 文件状态码
fileStatus: [
{
label: '入库中',
value: '1'
},
{
label: '入库异常',
value: '2'
},
{
label: '入库成功',
value: '5'
}
],
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
// 存储从后端获取的客户数据
customerList: [],
value2:[],
}
},
mounted() {
this.getCustomerList();
this.getList();
},
methods: {
// 查询上传文件信息列表
getList(){
if (this.value2 !== null && this.value2 !== ''){
this.queryInfo.startTime = this.value2[0];
this.queryInfo.endTime = this.value2[1];
}
selectFilePage(this.queryInfo).then((response) => {
const res = response.data;
const code = res.code;
const data = res.data;
if (code !== '200'){
return this.$message.error("获取文件列表失败");
}
this.tableData = data.list;
this.total = data.total;
this.$message.success("获取文件列表成功");
this.queryInfo.startTime = '';
this.queryInfo.endTime = '';
}).catch(error => {
this.$message.error(error.toString());
})
},
// 获取客户配置列表选项
getCustomerList(){
selectAll().then((response) =>{
const res = response.data;
const code = res.code;
if (code !== '200'){
return this.$message.error("客户信息获取失败");
}
this.customerList = res.data;
}
).catch(error => {
this.$message.error(error.toString())
})
},
//导入订单excel
beforeUpload(file) {
// 检查文件类型
const isExcel = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.type === 'application/vnd.ms-excel';
const fileMaxSize = 10 * 1024 * 1024;
if (!isExcel) {
this.$message.error('上传文件只能是 Excel 格式!');
return false; // 取消文件上传
}
// 检查文件大小
const isLtMaxSize = file.size / 1024 / 1024 < fileMaxSize;
if (!isLtMaxSize) {
this.$message.error(`上传文件大小不能超过 ${fileMaxSize / (1024 * 1024)} MB!`);
return false; // 取消文件上传
}
return true; // 允许上传
},
// 下载订单模板文件
downloadOrderTemplate(){
const fileUrl = '../../static/出口订单导入模板.xlsx';
// 创建隐藏的<a>元素
const link = document.createElement('a');
link.href = fileUrl;
link.download = '出口订单导入模板.xlsx'; // 设置下载的文件名
// 将<a>元素添加到DOM中
document.body.appendChild(link);
// 触发点击事件
link.click();
// 移除<a>元素
document.body.removeChild(link);
},
// 导入订单文件到minio
orderImport({file, onSuccess, onError}){
const formData = new FormData();
formData.append('file', file);
importExcelToMinio(formData).then((response) => {
const res = response.data;
const code = res.code;
const msg = res.msg;
if (code !== '200'){
return this.$message.error(msg);
}
this.$message.success(msg);
this.getList();
onSuccess(res);
}).catch(error => {
this.$message.error(error.toString());
onError(error);
})
},
//分页
handleSizeChange(val) {
this.queryInfo.pageSize=val;
this.getList();
},
//分页
handleCurrentChange(val) {
this.queryInfo.pageNum=val;
this.getList();
},
}
}
</script>
... ...
不能预览此文件类型