feat(wms): 新增报表导出文件管理功能
新增报表导出文件管理模块,包含后端接口和前端页面 在各类报表页面添加保存报表功能 优化CoilSelector和CoilCard组件显示 调整分页大小和表格高度 统一各产线报表配置 修复文件预览组件高度问题
This commit is contained in:
44
klp-ui/src/api/wms/exportFile.js
Normal file
44
klp-ui/src/api/wms/exportFile.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询报导出文件列表
|
||||
export function listExportFile(query) {
|
||||
return request({
|
||||
url: '/wms/exportFile/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询报导出文件详细
|
||||
export function getExportFile(id) {
|
||||
return request({
|
||||
url: '/wms/exportFile/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增报导出文件
|
||||
export function addExportFile(data) {
|
||||
return request({
|
||||
url: '/wms/exportFile',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改报导出文件
|
||||
export function updateExportFile(data) {
|
||||
return request({
|
||||
url: '/wms/exportFile',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除报导出文件
|
||||
export function delExportFile(id) {
|
||||
return request({
|
||||
url: '/wms/exportFile/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@@ -267,7 +267,7 @@ export default {
|
||||
selectedCoil: null,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 50,
|
||||
currentCoilNo: null,
|
||||
grade: null,
|
||||
itemSpecification: null,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="xlsx-preview">
|
||||
<div class="xlsx-preview" :style="{ height: height }">
|
||||
<vue-office-excel :src="src" @render-error="handleExcelError" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -18,6 +18,11 @@ export default {
|
||||
type: String,
|
||||
required: true,
|
||||
description: "Excel文件的URL或路径"
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: "70vh",
|
||||
description: "预览区域高度"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -32,7 +37,6 @@ export default {
|
||||
<style scoped>
|
||||
.xlsx-preview {
|
||||
width: 100%;
|
||||
height: 70vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
@@ -7,7 +7,7 @@
|
||||
<el-popover placement="top" width="280" trigger="hover" popper-class="material-params-popover">
|
||||
<div class="material-params-content">
|
||||
<div class="params-title">
|
||||
{{ coil.coilName || '—' }}
|
||||
{{ coil.itemName || '—' }}
|
||||
</div>
|
||||
<div class="params-list">
|
||||
<div class="param-coil">
|
||||
|
||||
60
klp-ui/src/views/crm/components/DeliveryTable.vue
Normal file
60
klp-ui/src/views/crm/components/DeliveryTable.vue
Normal file
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="coil-stats" style="margin-bottom: 10px; padding: 10px; background-color: #f5f7fa; border-radius: 4px;">
|
||||
<span style="margin-right: 20px;"><strong>已发货:{{ deliveryCountFinished }}</strong></span>
|
||||
<span><strong>总单据数:{{ deliveryCountTotal }}</strong></span>
|
||||
</div>
|
||||
<el-table border :data="data" highlight-current-row>
|
||||
<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="consigneeUnit" />
|
||||
<el-table-column label="发货单位" align="center" prop="senderUnit" />
|
||||
<el-table-column label="订单编号" align="center" prop="orderNo">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.orderId">{{ scope.row.orderCode }}</span>
|
||||
<span v-else>{{ scope.row.principalPhone }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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" width="60" />
|
||||
<el-table-column label="状态" align="center" prop="status" width="80">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.status === 1">已发货</div>
|
||||
<div v-else-if="scope.row.status === 0">未发货</div>
|
||||
<div v-else-if="scope.row.status === 2">已打印</div>
|
||||
<div v-else>未打印</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" width="100" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "DeliveryWaybill",
|
||||
props: {
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
/** 计算已发货数量 */
|
||||
deliveryCountFinished() {
|
||||
return this.data.filter(row => row.status === 1 || row.status === 2).length;
|
||||
},
|
||||
/** 计算总数量 */
|
||||
deliveryCountTotal() {
|
||||
return this.data.length;
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,60 +1,61 @@
|
||||
<template>
|
||||
<div class="contract-tabs">
|
||||
<div v-if="contractId" class="tabs-content">
|
||||
<el-tabs v-model="activeTab" type="card" tab-position="top" v-loading="tabLoading">
|
||||
<el-tab-pane label="下发订单" name="second">
|
||||
<OrderPage v-if="activeTab === 'second'" :contractId="contractId" :customerId="customerId" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="财务状态" name="third">
|
||||
<KLPTable v-loading="loading" :data="financeList">
|
||||
<el-table-column label="收款日期" align="center" prop="dueDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.dueDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收款金额" align="center" prop="amount" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</KLPTable>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="订单异议" name="fourth">
|
||||
<el-table v-loading="loading" :data="objectionList">
|
||||
<el-table-column label="编号" align="center" prop="objectionCode" />
|
||||
<el-table-column label="状态" align="center" prop="objectionStatus">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.objectionStatus === 0" type="danger">待处理</el-tag>
|
||||
<el-tag v-else-if="scope.row.objectionStatus === 1" type="success">已处理</el-tag>
|
||||
<el-tag v-else-if="scope.row.objectionStatus === 2" type="info">已关闭</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="处理人" align="center" prop="handleUser" />
|
||||
<el-table-column label="处理时间" align="center" prop="handleTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.handleTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发货配卷" name="fifth">
|
||||
<CoilTable :data="coilList" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="合同附件" name="sixth">
|
||||
<div class="attachment-section">
|
||||
<div class="attachment-item">
|
||||
<h4>商务附件</h4>
|
||||
<FileList :oss-ids="contractAttachment" />
|
||||
</div>
|
||||
<div class="attachment-item">
|
||||
<h4>技术附件</h4>
|
||||
<FileList :oss-ids="technicalAgreement" />
|
||||
</div>
|
||||
<div class="attachment-item">
|
||||
<h4>排产函</h4>
|
||||
<FileList :oss-ids="otherAttachment" />
|
||||
</div>
|
||||
<div class="custom-tabbar" v-loading="tabLoading">
|
||||
<div
|
||||
v-for="tab in tabs"
|
||||
:key="tab.name"
|
||||
class="tab-item"
|
||||
:class="{ active: activeTab === tab.name }"
|
||||
@click="activeTab = tab.name"
|
||||
>
|
||||
{{ tab.label }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
<OrderPage v-if="activeTab === 'second'" :contractId="contractId" :customerId="customerId" />
|
||||
<KLPTable v-else-if="activeTab === 'third'" v-loading="loading" :data="financeList">
|
||||
<el-table-column label="收款日期" align="center" prop="dueDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.dueDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收款金额" align="center" prop="amount" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</KLPTable>
|
||||
<el-table v-else-if="activeTab === 'fourth'" v-loading="loading" :data="objectionList">
|
||||
<el-table-column label="编号" align="center" prop="objectionCode" />
|
||||
<el-table-column label="状态" align="center" prop="objectionStatus">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.objectionStatus === 0" type="danger">待处理</el-tag>
|
||||
<el-tag v-else-if="scope.row.objectionStatus === 1" type="success">已处理</el-tag>
|
||||
<el-tag v-else-if="scope.row.objectionStatus === 2" type="info">已关闭</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="处理人" align="center" prop="handleUser" />
|
||||
<el-table-column label="处理时间" align="center" prop="handleTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.handleTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
</el-table>
|
||||
<CoilTable v-else-if="activeTab === 'fifth'" :data="coilList" />
|
||||
<div v-else-if="activeTab === 'sixth'" class="attachment-section">
|
||||
<div class="attachment-item">
|
||||
<h4>商务附件</h4>
|
||||
<FileList :oss-ids="contractAttachment" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="attachment-item">
|
||||
<h4>技术附件</h4>
|
||||
<FileList :oss-ids="technicalAgreement" />
|
||||
</div>
|
||||
<div class="attachment-item">
|
||||
<h4>排产函</h4>
|
||||
<FileList :oss-ids="otherAttachment" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="no-selection" style="display: flex; align-items: center; justify-content: center; height: 100%;">
|
||||
<el-empty description="请先选择合同" />
|
||||
@@ -120,7 +121,15 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
// 活动tab
|
||||
activeTab: "second"
|
||||
activeTab: "second",
|
||||
// 标签页配置
|
||||
tabs: [
|
||||
{ label: "下发订单", name: "second" },
|
||||
{ label: "财务状态", name: "third" },
|
||||
{ label: "订单异议", name: "fourth" },
|
||||
{ label: "发货配卷", name: "fifth" },
|
||||
{ label: "合同附件", name: "sixth" }
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -152,6 +161,52 @@ export default {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.tabs-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.custom-tabbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
background-color: #f5f7fa;
|
||||
padding: 4px;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 16px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
padding: 8px 16px;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
transition: all 0.3s ease;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tab-item:hover {
|
||||
color: #409eff;
|
||||
background-color: rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
|
||||
.tab-item.active {
|
||||
color: #409eff;
|
||||
background-color: #fff;
|
||||
border: 1px solid #dcdfe6;
|
||||
font-weight: 500;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.attachment-section {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
@@ -90,6 +90,12 @@
|
||||
<CoilTable :data="coilList" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发货单据" name="delivery">
|
||||
<div class="order-record" v-if="activeTab === 'delivery'">
|
||||
<!-- 发货单内容 -->
|
||||
<DeliveryTable :data="deliveryWaybillList" />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="操作记录" name="record" v-hasPermi="['crm:order:record']">
|
||||
<div class="order-record" v-if="activeTab === 'record'">
|
||||
<!-- 操作记录内容 -->
|
||||
@@ -152,6 +158,8 @@
|
||||
import KLPList from '@/components/KLPUI/KLPList/index.vue'
|
||||
import { listOrder, delOrder, listOrderPackaging } from "@/api/crm/order";
|
||||
import { listCustomer } from "@/api/crm/customer";
|
||||
import { listDeliveryWaybill } from "@/api/wms/deliveryWaybill";
|
||||
|
||||
import { ORDER_STATUS, ORDER_TYPE } from '../js/enum'
|
||||
import { ORDER_ACTIONS, actions } from '../js/actions'
|
||||
import OrderDetail from '../components/OrderDetail.vue';
|
||||
@@ -162,6 +170,7 @@ import OrderRecord from '../components/OrderRecord.vue';
|
||||
import FileList from '@/components/FileList';
|
||||
import { listContract } from "@/api/crm/contract";
|
||||
import CoilTable from "../components/CoilTable.vue";
|
||||
import DeliveryTable from "../components/DeliveryTable.vue";
|
||||
|
||||
export default {
|
||||
name: 'OrderPage',
|
||||
@@ -173,7 +182,8 @@ export default {
|
||||
ReceiveTable,
|
||||
OrderRecord,
|
||||
FileList,
|
||||
CoilTable
|
||||
CoilTable,
|
||||
DeliveryTable
|
||||
},
|
||||
dicts: ['customer_level', 'customer_industry', 'wip_pack_saleman'],
|
||||
props: {
|
||||
@@ -217,6 +227,7 @@ export default {
|
||||
customerList: [],
|
||||
contractList: [],
|
||||
coilList: [],
|
||||
deliveryWaybillList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -240,6 +251,12 @@ export default {
|
||||
this.contractList = response.rows || [];
|
||||
});
|
||||
},
|
||||
/** 查询发货单列表 */
|
||||
getDeliveryWaybillList() {
|
||||
listDeliveryWaybill({ pageNum: 1, pageSize: 1000, orderId: this.currentOrder.orderId }).then(response => {
|
||||
this.deliveryWaybillList = response.rows || [];
|
||||
});
|
||||
},
|
||||
/** 查询发货配卷列表 */
|
||||
getCoilList() {
|
||||
listOrderPackaging(this.currentOrder.orderId).then(response => {
|
||||
@@ -265,6 +282,7 @@ export default {
|
||||
}
|
||||
this.activeTab = 'detail';
|
||||
this.getCoilList()
|
||||
this.getDeliveryWaybillList()
|
||||
console.log('点击订单:', order)
|
||||
},
|
||||
/** 查询正式订单主列表 */
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
|
||||
<KLPTable v-loading="loading" :data="materialCoilList" @selection-change="handleSelectionChange" :floatLayer="true"
|
||||
:floatLayerConfig="floatLayerConfig" @row-click="handleRowClick"
|
||||
:height="showAbnormal ? 'calc(100vh - 400px)' : ''">
|
||||
:height="showAbnormal ? 'calc(100vh - 400px)' : 'calc(100vh - 300px)'">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
@@ -690,7 +690,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 50,
|
||||
enterCoilNo: undefined,
|
||||
currentCoilNo: undefined,
|
||||
supplierCoilNo: undefined,
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
<el-button type="primary" @click="saveReport">保存报表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -75,6 +76,7 @@ import MutiSelect from "@/components/MutiSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -147,7 +149,10 @@ export default {
|
||||
totalWeight: totalWeight.toFixed(2),
|
||||
avgWeight,
|
||||
}
|
||||
}
|
||||
},
|
||||
coilIds() {
|
||||
return this.list.map(item => item.coilId).join(',')
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
@@ -178,11 +183,30 @@ export default {
|
||||
// 导出
|
||||
exportData() {
|
||||
this.download('wms/materialCoil/exportDelivery', {
|
||||
coilIds: this.list.map(item => item.coilId).join(','),
|
||||
coilIds: this.coilIds,
|
||||
// 传了status为1则会使用发货时间作为筛选条件查询,且导出后的excel会包含发货时间和发货人
|
||||
status: 1
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
saveReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.coilIds, {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '发货报表',
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
<LossTemplate
|
||||
:actionTypes="actionTypes"
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
></LossTemplate>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LossTemplate from '@/views/wms/report/template/loss.vue'
|
||||
import { dugeConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'LossReport',
|
||||
@@ -15,10 +19,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [505, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'dugekuguan'
|
||||
},
|
||||
...dugeConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
<OutTemplate
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OutTemplate from "@/views/wms/report/template/out.vue";
|
||||
import { dugeConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'ZhaTemplate',
|
||||
@@ -15,16 +17,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
baseQueryParams: {
|
||||
createBy: 'dugekuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{value: '1988151132361519105', label: '镀铬成品库'},
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
...dugeConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
379
klp-ui/src/views/wms/report/export/index.vue
Normal file
379
klp-ui/src/views/wms/report/export/index.vue
Normal file
@@ -0,0 +1,379 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<drag-resize-panel direction="horizontal" :initialSize="400" :minSize="200" :maxSize="600">
|
||||
<!-- 左侧文件列表 -->
|
||||
<template slot="panelA">
|
||||
<div class="left-panel">
|
||||
<el-input v-model="queryParams.reportTitle" placeholder="请输入报表标题" clearable @change="handleQuery"
|
||||
size="small" />
|
||||
<!-- 自定义列表样式 -->
|
||||
<div class="custom-list" v-loading="loading" style="height: calc(100% - 140px); overflow-y: auto;">
|
||||
<div v-for="item in exportFileList" :key="item.id" class="list-item" @click="handleRowClick(item)"
|
||||
:class="{ 'active': form.id === item.id }">
|
||||
<div class="item-header">
|
||||
<div class="item-title">{{ item.reportTitle }}</div>
|
||||
<div class="item-actions">
|
||||
<el-button size="mini" type="text" @click.stop="handleDelete(item)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-meta">
|
||||
<span class="meta-value" v-if="item.reportType">#{{ item.reportType }}</span>
|
||||
<span class="meta-value" v-if="item.productionLine">#{{ item.productionLine }}</span>
|
||||
<span class="meta-value">{{ parseTime(item.createTime, '{y}.{m}.{d}') }}</span>
|
||||
<span class="meta-value">{{ item.createBy }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="exportFileList.length === 0" class="empty-list">
|
||||
<el-empty description="暂无报表文件" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" style="margin-top: 10px;" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- 右侧编辑和预览 -->
|
||||
<template slot="panelB">
|
||||
<div class="right-panel" v-if="form.id" v-loading="rightLoading">
|
||||
<div class="panel-header">
|
||||
<el-input v-model="form.reportTitle" @change="handleSimpleUpdate" size="small" placeholder="请输入报表标题" />
|
||||
<el-button type="primary" icon="el-icon-download" @click="handleExport">下载</el-button>
|
||||
</div>
|
||||
|
||||
<!-- Excel预览 -->
|
||||
<div v-if="form.attachment" class="preview-section">
|
||||
<xlsx-preview :src="form.attachment" height="calc(100vh - 180px)" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-empty v-else description="点击左侧选择报表文件查看" v-loading="rightLoading" />
|
||||
</template>
|
||||
</drag-resize-panel>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listExportFile, getExportFile, delExportFile, addExportFile, updateExportFile } from "@/api/wms/exportFile";
|
||||
import XlsxPreview from "@/components/FilePreview/preview/xlsx/index.vue";
|
||||
import DragResizePanel from "@/components/DragResizePanel/index.vue";
|
||||
|
||||
export default {
|
||||
name: "ExportFile",
|
||||
components: {
|
||||
XlsxPreview,
|
||||
DragResizePanel
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
buttonLoading: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 报导出文件表格数据
|
||||
exportFileList: [],
|
||||
// 标题
|
||||
title: "编辑报表文件",
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
reportTitle: undefined,
|
||||
reportName: undefined,
|
||||
reportParams: undefined,
|
||||
productionLine: undefined,
|
||||
attachment: undefined,
|
||||
reportType: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
id: undefined,
|
||||
reportTitle: undefined,
|
||||
reportName: undefined,
|
||||
reportParams: undefined,
|
||||
productionLine: undefined,
|
||||
attachment: undefined,
|
||||
reportType: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
remark: undefined,
|
||||
delFlag: undefined
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
reportTitle: [
|
||||
{ required: true, message: "报表标题不能为空", trigger: "blur" }
|
||||
],
|
||||
reportName: [
|
||||
{ required: true, message: "报表名称不能为空", trigger: "blur" }
|
||||
],
|
||||
reportParams: [
|
||||
{ required: true, message: "报表查询参数不能为空", trigger: "blur" }
|
||||
],
|
||||
productionLine: [
|
||||
{ required: true, message: "相关产线不能为空", trigger: "blur" }
|
||||
],
|
||||
attachment: [
|
||||
{ required: true, message: "附件不能为空", trigger: "blur" }
|
||||
],
|
||||
reportType: [
|
||||
{ required: true, message: "报表类型不能为空", trigger: "change" }
|
||||
],
|
||||
},
|
||||
rightLoading: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询报导出文件列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listExportFile(this.queryParams).then(response => {
|
||||
this.exportFileList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
reportTitle: undefined,
|
||||
reportName: undefined,
|
||||
reportParams: undefined,
|
||||
productionLine: undefined,
|
||||
attachment: undefined,
|
||||
reportType: undefined,
|
||||
createBy: undefined,
|
||||
createTime: undefined,
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
remark: undefined,
|
||||
delFlag: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 行点击事件 */
|
||||
handleRowClick(row) {
|
||||
this.rightLoading = true;
|
||||
// this.loading = true;
|
||||
getExportFile(row.id).then(response => {
|
||||
this.rightLoading = false;
|
||||
this.form = response.data;
|
||||
this.title = "修改报表文件";
|
||||
});
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.title = "添加报表文件";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
getExportFile(row.id).then(response => {
|
||||
this.loading = false;
|
||||
this.form = response.data;
|
||||
this.title = "修改报表文件";
|
||||
});
|
||||
},
|
||||
/** 简单更新按钮操作 */
|
||||
handleSimpleUpdate() {
|
||||
// this.submitForm();
|
||||
updateExportFile(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.id != null) {
|
||||
updateExportFile(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
addExportFile(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id;
|
||||
this.$modal.confirm('是否确认删除报导出文件编号为"' + ids + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delExportFile(ids);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.reset();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.$download.oss(this.form.ossId)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-container {
|
||||
height: calc(100vh - 84px);
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.left-panel {
|
||||
height: 100%;
|
||||
padding: 15px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.right-panel {
|
||||
height: 100%;
|
||||
padding: 15px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.panel-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.panel-header h3 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
/* 自定义列表样式 */
|
||||
.custom-list {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
padding: 15px;
|
||||
margin-bottom: 10px;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #e4e7ed;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.list-item:hover {
|
||||
border-color: #409eff;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.list-item.active {
|
||||
border-color: #409eff;
|
||||
background-color: #ecf5ff;
|
||||
}
|
||||
|
||||
.item-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.item-title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
flex: 1;
|
||||
margin-right: 10px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.item-actions {
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.item-meta {
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.meta-label {
|
||||
font-weight: 500;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.meta-value {
|
||||
color: #909399;
|
||||
border-radius: 4px;
|
||||
padding: 2px 5px;
|
||||
background-color: #f5f7fa;
|
||||
}
|
||||
|
||||
.empty-list {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 200px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.preview-section {
|
||||
margin-top: 30px;
|
||||
background: #f5f7fa;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.preview-section h4 {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
color: #303133;
|
||||
}
|
||||
</style>
|
||||
@@ -13,6 +13,7 @@ export const dugeConfig = {
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
productionLine: '镀铬线',
|
||||
}
|
||||
|
||||
export const lajiaoConfig = {
|
||||
@@ -30,6 +31,7 @@ export const lajiaoConfig = {
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
productionLine: '拉矫线',
|
||||
}
|
||||
|
||||
export const shuangConfig = {
|
||||
@@ -47,6 +49,7 @@ export const shuangConfig = {
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
productionLine: '双机架线',
|
||||
}
|
||||
|
||||
export const tuozhiConfig = {
|
||||
@@ -64,6 +67,7 @@ export const tuozhiConfig = {
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
productionLine: '脱脂线',
|
||||
}
|
||||
|
||||
export const suanzhaConfig = {
|
||||
@@ -84,6 +88,7 @@ export const suanzhaConfig = {
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
productionLine: '酸轧线',
|
||||
}
|
||||
|
||||
export const zincConfig = {
|
||||
@@ -102,6 +107,7 @@ export const zincConfig = {
|
||||
{ value: '2019583429955104769', label: '废品库' },
|
||||
{ value: '2019583137616310273', label: '退货库' },
|
||||
],
|
||||
productionLine: '镀锌线',
|
||||
}
|
||||
|
||||
export const splitConfig = {
|
||||
@@ -117,6 +123,7 @@ export const splitConfig = {
|
||||
{ value: '1988150800092950529', label: '退火分条成品' },
|
||||
{ value: '1988150380649967617', label: '镀锌分条成品' },
|
||||
{ value: '1988151027466170370', label: '拉矫分条成品' },
|
||||
]
|
||||
],
|
||||
productionLine: '分条线',
|
||||
}
|
||||
|
||||
|
||||
54
klp-ui/src/views/wms/report/js/reportFile.js
Normal file
54
klp-ui/src/views/wms/report/js/reportFile.js
Normal file
@@ -0,0 +1,54 @@
|
||||
import { uploadFile } from "@/api/system/oss";
|
||||
import { exportCoilWithAll } from "@/api/wms/coil";
|
||||
import { addExportFile } from "@/api/wms/exportFile";
|
||||
|
||||
export async function saveReportFile(coilIds, { reportParams, productionLine, reportType }) {
|
||||
// 使用exportCoilWithAll接口传入coilIds获取二进制文件数据
|
||||
if (!coilIds) {
|
||||
throw new Error('无数据,无法保存')
|
||||
}
|
||||
const response = await exportCoilWithAll({ coilIds })
|
||||
// 构建报告标题
|
||||
function addZero(num) {
|
||||
return num < 10 ? '0' + num : num
|
||||
}
|
||||
|
||||
const now = new Date()
|
||||
const year = now.getFullYear()
|
||||
const month = addZero(now.getMonth() + 1)
|
||||
const day = addZero(now.getDate())
|
||||
console.log(productionLine)
|
||||
const reportTitle = `${year}-${month}-${day}_${reportType}_${productionLine || '全厂'}`
|
||||
// reportName 后再增加时间戳,避免重复
|
||||
const reportName = `${reportTitle}_${new Date().getTime()}`
|
||||
|
||||
const file = new Blob([response], { type: 'application/vnd.ms-excel' })
|
||||
const fileName = reportTitle + '.xlsx'
|
||||
// 通过new File构建出excel文件
|
||||
const excelFile = new File([file], fileName, { type: 'application/vnd.ms-excel' })
|
||||
// 上传文件到minio
|
||||
const uploadResponse = await uploadFile(excelFile)
|
||||
// 构建请求体创建文件保存记录
|
||||
const reportExportFile = {
|
||||
reportName,
|
||||
reportTitle,
|
||||
reportParams: JSON.stringify(reportParams, null, 2),
|
||||
productionLine,
|
||||
reportType,
|
||||
attachment: uploadResponse.data.url,
|
||||
ossId: uploadResponse.data.ossId,
|
||||
}
|
||||
// 调用addExportFile接口创建文件保存记录
|
||||
const res = await addExportFile(reportExportFile)
|
||||
return true;
|
||||
}
|
||||
|
||||
function createReportTitle(reportType, productionLine) {
|
||||
// 获取一个yyyy-MM-dd格式的北京时间字符串
|
||||
const now = new Date()
|
||||
const year = now.getFullYear()
|
||||
const month = addZero(now.getMonth() + 1)
|
||||
const day = addZero(now.getDate())
|
||||
console.log(year, month, day)
|
||||
return `${year}-${month}-${day}_${reportType}_${productionLine || '全场'}`
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
<LossTemplate
|
||||
:actionTypes="actionTypes"
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
></LossTemplate>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LossTemplate from '@/views/wms/report/template/loss.vue'
|
||||
import { lajiaoConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'LossReport',
|
||||
@@ -15,10 +19,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [503, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'lajiaokuguan'
|
||||
},
|
||||
...lajiaoConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
<OutTemplate
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OutTemplate from "@/views/wms/report/template/out.vue";
|
||||
import { lajiaoConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'ZhaTemplate',
|
||||
@@ -15,16 +17,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
baseQueryParams: {
|
||||
createBy: 'lajiaokuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{value: '1988150915591499777', label: '拉矫成品库'},
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
...lajiaoConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
<el-button type="primary" @click="saveReport">保存报表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -86,6 +87,8 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -158,6 +161,9 @@ export default {
|
||||
totalWeight: totalWeight.toFixed(2),
|
||||
avgWeight,
|
||||
}
|
||||
},
|
||||
coilIds() {
|
||||
return this.list.map(item => item.coilId).join(',')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -202,14 +208,14 @@ export default {
|
||||
coilIds: coilIds,
|
||||
}).then(res => {
|
||||
this.list = res.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
}
|
||||
})
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
}
|
||||
})
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
@@ -217,9 +223,28 @@ export default {
|
||||
// 导出
|
||||
exportData() {
|
||||
this.download('wms/materialCoil/export', {
|
||||
coilIds: this.list.map(item => item.coilId).join(',')
|
||||
coilIds: this.coilIds,
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
saveReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.coilIds, {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '收货报表',
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
<LossTemplate
|
||||
:actionTypes="actionTypes"
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
></LossTemplate>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LossTemplate from '@/views/wms/report/template/loss.vue'
|
||||
import { shuangConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'LossReport',
|
||||
@@ -15,10 +19,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [504, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'shuangkuguan'
|
||||
},
|
||||
...shuangConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
<OutTemplate
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OutTemplate from "@/views/wms/report/template/out.vue";
|
||||
import { shuangConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'ZhaTemplate',
|
||||
@@ -15,16 +17,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
baseQueryParams: {
|
||||
createBy: 'shuangkuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{value: '1992873437713080322', label: '双机架成品库'},
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
...shuangConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
<LossTemplate
|
||||
:actionTypes="actionTypes"
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
></LossTemplate>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<OutTemplate
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
<el-button type="primary" @click="saveOutputReport">保存产出报表</el-button>
|
||||
<el-button type="primary" @click="saveLossReport">保存消耗报表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -133,6 +135,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/calc";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
export default {
|
||||
name: 'ComprehensiveTemplate',
|
||||
@@ -162,7 +165,11 @@ export default {
|
||||
warehouseOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
productionLine: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
@@ -393,6 +400,48 @@ export default {
|
||||
coilIds: this.lossList.map(item => item.coilId).join(',')
|
||||
}, `materialCoil_${this.queryParams.startDate}_${this.queryParams.endDate}_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 保存产出报表
|
||||
saveOutputReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.list.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '产出报表,综合报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 保存消耗报表
|
||||
saveLossReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.lossList.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '消耗报表,综合报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
<el-button type="primary" @click="saveOutputReport">保存产出报表</el-button>
|
||||
<el-button type="primary" @click="saveLossReport">保存消耗报表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -127,6 +129,8 @@ import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
|
||||
export default {
|
||||
name: 'DayTemplate',
|
||||
@@ -156,7 +160,11 @@ export default {
|
||||
warehouseOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
productionLine: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_itemname'],
|
||||
data() {
|
||||
@@ -234,7 +242,7 @@ export default {
|
||||
},
|
||||
mSummary() {
|
||||
return calcMSummary(this.list, this.lossList)
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
@@ -289,6 +297,48 @@ export default {
|
||||
actionIds: this.actionIds
|
||||
}, `materialCoil_${this.queryParams.date}_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 保存产出报表
|
||||
saveOutputReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.list.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '产出报表,日报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 保存消耗报表
|
||||
saveLossReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.lossList.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '消耗报表,日报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.handleQuery()
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
<!-- <el-button type="primary" @click="saveOutputReport">保存产出报表</el-button> -->
|
||||
<el-button type="primary" @click="saveLossReport">保存消耗报表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -80,6 +82,7 @@ import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import { fetchLossList } from "@/views/wms/report/js/fetch";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
|
||||
export default {
|
||||
@@ -103,6 +106,10 @@ export default {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
productionLine: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
@@ -131,6 +138,7 @@ export default {
|
||||
activeColumnConfig: 'coil-report-loss',
|
||||
settingVisible: false,
|
||||
list: [],
|
||||
lossList: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
@@ -199,6 +207,27 @@ export default {
|
||||
actionIds: this.actionIds
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 保存消耗报表
|
||||
saveLossReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.lossList.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '消耗报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
<el-button type="primary" @click="saveOutputReport">保存产出报表</el-button>
|
||||
<el-button type="primary" @click="saveLossReport">保存消耗报表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -122,6 +124,7 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
import { calcSummary, calcMSummary } from "@/views/wms/report/js/calc";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
export default {
|
||||
name: 'MergeTemplate',
|
||||
@@ -129,7 +132,11 @@ export default {
|
||||
actionType: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
productionLine: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
components: {
|
||||
MemoInput,
|
||||
@@ -209,7 +216,7 @@ export default {
|
||||
pageNum: 1,
|
||||
},
|
||||
lossColumns: [],
|
||||
outColumns: []
|
||||
outputColumns: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -288,6 +295,48 @@ export default {
|
||||
coilIds: this.lossList.map(item => item.coilId).join(',')
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 保存产出报表
|
||||
saveOutputReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.outList.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '产出报表,合卷报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 保存消耗报表
|
||||
saveLossReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.lossList.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '消耗报表,合卷报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 加载列设置
|
||||
loadColumns() {
|
||||
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
<el-button type="primary" @click="saveOutputReport">保存产出报表</el-button>
|
||||
<el-button type="primary" @click="saveLossReport">保存消耗报表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -131,6 +133,7 @@ import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
export default {
|
||||
name: 'MonthTemplate',
|
||||
@@ -160,7 +163,11 @@ export default {
|
||||
warehouseOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
productionLine: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
@@ -310,6 +317,48 @@ export default {
|
||||
actionIds: this.actionIds
|
||||
}, `materialCoil_${this.queryParams.date}_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 保存产出报表
|
||||
saveOutputReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.list.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '产出报表,月报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 保存消耗报表
|
||||
saveLossReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.lossList.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '消耗报表,月报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
fetchData() {
|
||||
this.loading = true
|
||||
Promise.all([
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
<el-button type="primary" @click="saveOutputReport">保存产出报表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -77,6 +78,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import { fetchOutputList } from "@/views/wms/report/js/fetch";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
|
||||
export default {
|
||||
@@ -99,7 +101,11 @@ export default {
|
||||
warehouseOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
productionLine: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
@@ -204,6 +210,27 @@ export default {
|
||||
coilIds: this.list.map(item => item.coilId).join(',')
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 保存产出报表
|
||||
saveOutputReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.list.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '产出报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.handleQuery()
|
||||
|
||||
@@ -50,6 +50,8 @@
|
||||
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
<el-button type="primary" @click="saveOutputReport">保存产出报表</el-button>
|
||||
<el-button type="primary" @click="saveLossReport">保存消耗报表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -144,6 +146,7 @@ import { calcSummary, calcAbSummary, calcTeamSummary, calcMSummary } from "@/vie
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
export default {
|
||||
name: 'TeamTemplate',
|
||||
@@ -173,7 +176,11 @@ export default {
|
||||
warehouseOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
productionLine: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
@@ -311,6 +318,48 @@ export default {
|
||||
// coilIds: this.lossList.map(item => item.coilId).join(',')
|
||||
actionIds: this.actionIds
|
||||
}, `materialCoil_${this.queryParams.date}_${new Date().getTime()}.xlsx`);
|
||||
},
|
||||
// 保存产出报表
|
||||
saveOutputReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.list.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '产出报表,班报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 保存消耗报表
|
||||
saveLossReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.lossList.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '消耗报表,班报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
<el-button type="primary" @click="saveOutputReport">保存产出报表</el-button>
|
||||
<el-button type="primary" @click="saveLossReport">保存消耗报表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -130,6 +132,7 @@ import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
export default {
|
||||
name: 'YearTemplate',
|
||||
@@ -159,7 +162,11 @@ export default {
|
||||
warehouseOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
productionLine: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
@@ -303,6 +310,48 @@ export default {
|
||||
actionIds: this.actionIds
|
||||
}, `materialCoil_${this.queryParams.date}_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 保存产出报表
|
||||
saveOutputReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.list.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '产出报表,年报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 保存消耗报表
|
||||
saveLossReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.lossList.map(item => item.coilId).join(','), {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '消耗报表,年报表',
|
||||
productionLine: this.productionLine,
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.handleQuery()
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
<LossTemplate
|
||||
:actionTypes="actionTypes"
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
></LossTemplate>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LossTemplate from '@/views/wms/report/template/loss.vue'
|
||||
import { tuozhiConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'LossReport',
|
||||
@@ -15,10 +19,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [502, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'tuozhikuguan'
|
||||
},
|
||||
...tuozhiConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<OutTemplate
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
<LossTemplate
|
||||
:actionTypes="actionTypes"
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
></LossTemplate>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LossTemplate from '@/views/wms/report/template/loss.vue'
|
||||
import { suanzhaConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'LossReport',
|
||||
@@ -15,10 +19,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [11, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'suanzhakuguan'
|
||||
},
|
||||
...suanzhaConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
<OutTemplate
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OutTemplate from "@/views/wms/report/template/out.vue";
|
||||
import { suanzhaConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'ZhaTemplate',
|
||||
@@ -15,19 +17,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
baseQueryParams: {
|
||||
createBy: 'suanzhakuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{ label: '酸连轧成品库', value: '1988150099140866050' },
|
||||
{ label: '镀锌原料库', value: '1988150263284953089' },
|
||||
{ label: '脱脂原料库', value: '1988150545175736322' },
|
||||
{ label: '酸连轧纵剪分条原料库', value: '1988150150521090049' },
|
||||
{ label: '技术部', value: '2019583656787259393' },
|
||||
{ label: '小钢卷库', value: '2019583325311414274' },
|
||||
{ label: '废品库', value: '2019583429955104769' },
|
||||
{ label: '退货库', value: '2019583137616310273' },
|
||||
],
|
||||
...suanzhaConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
<LossTemplate
|
||||
:actionTypes="actionTypes"
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
></LossTemplate>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import LossTemplate from '@/views/wms/report/template/loss.vue'
|
||||
import { zincConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'LossReport',
|
||||
@@ -15,10 +19,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
actionTypes: [501, 120],
|
||||
actionQueryParams: {
|
||||
createBy: 'duxinkuguan'
|
||||
},
|
||||
...zincConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
<OutTemplate
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OutTemplate from "@/views/wms/report/template/out.vue";
|
||||
import { zincConfig } from '@/views/wms/report/js/config.js'
|
||||
|
||||
export default {
|
||||
name: 'ZhaTemplate',
|
||||
@@ -15,17 +17,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
baseQueryParams: {
|
||||
createBy: 'duxinkuguan',
|
||||
},
|
||||
warehouseOptions: [
|
||||
{ value: '1988150323162836993', label: '镀锌成品库' },
|
||||
{ value: '1988150487185289217', label: '镀锌纵剪分条原料库' },
|
||||
{ value: '2019583656787259393', label: '技术部' },
|
||||
{ value: '2019583325311414274', label: '小钢卷库' },
|
||||
{ value: '2019583429955104769', label: '废品库' },
|
||||
{ value: '2019583137616310273', label: '退货库' },
|
||||
],
|
||||
...zincConfig,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
:actionQueryParams="actionQueryParams"
|
||||
:baseQueryParams="baseQueryParams"
|
||||
:warehouseOptions="warehouseOptions"
|
||||
:productionLine="productionLine"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.klp.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.domain.vo.ReportExportFileVo;
|
||||
import com.klp.domain.bo.ReportExportFileBo;
|
||||
import com.klp.service.IReportExportFileService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 报导出文件
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-11
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/wms/exportFile")
|
||||
public class ReportExportFileController extends BaseController {
|
||||
|
||||
private final IReportExportFileService iReportExportFileService;
|
||||
|
||||
/**
|
||||
* 查询报导出文件列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ReportExportFileVo> list(ReportExportFileBo bo, PageQuery pageQuery) {
|
||||
return iReportExportFileService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出报导出文件列表
|
||||
*/
|
||||
@Log(title = "报导出文件", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ReportExportFileBo bo, HttpServletResponse response) {
|
||||
List<ReportExportFileVo> list = iReportExportFileService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "报导出文件", ReportExportFileVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取报导出文件详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public R<ReportExportFileVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(iReportExportFileService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报导出文件
|
||||
*/
|
||||
@Log(title = "报导出文件", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ReportExportFileBo bo) {
|
||||
return toAjax(iReportExportFileService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报导出文件
|
||||
*/
|
||||
@Log(title = "报导出文件", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ReportExportFileBo bo) {
|
||||
return toAjax(iReportExportFileService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除报导出文件
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@Log(title = "报导出文件", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iReportExportFileService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
65
klp-wms/src/main/java/com/klp/domain/ReportExportFile.java
Normal file
65
klp-wms/src/main/java/com/klp/domain/ReportExportFile.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package com.klp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
||||
/**
|
||||
* 报导出文件对象 report_export_file
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-11
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("report_export_file")
|
||||
public class ReportExportFile extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 报表标题
|
||||
*/
|
||||
private String reportTitle;
|
||||
/**
|
||||
* 报表名称(唯一)
|
||||
*/
|
||||
private String reportName;
|
||||
/**
|
||||
* 报表查询参数(JSON格式)
|
||||
*/
|
||||
private String reportParams;
|
||||
/**
|
||||
* 相关产线
|
||||
*/
|
||||
private String productionLine;
|
||||
/**
|
||||
* 附件(文件存储路径/URL)
|
||||
*/
|
||||
private String attachment;
|
||||
/**
|
||||
* 附件ID
|
||||
*/
|
||||
private String ossId;
|
||||
/**
|
||||
* 报表类型(如:Excel/PDF/Word)
|
||||
*/
|
||||
private String reportType;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除标志 0-未删除 1-已删除
|
||||
*/
|
||||
@TableLogic
|
||||
private Long delFlag;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.klp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
|
||||
/**
|
||||
* 报导出文件业务对象 report_export_file
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-11
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ReportExportFileBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 报表标题
|
||||
*/
|
||||
@NotBlank(message = "报表标题不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String reportTitle;
|
||||
|
||||
/**
|
||||
* 报表名称(唯一)
|
||||
*/
|
||||
@NotBlank(message = "报表名称(唯一)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String reportName;
|
||||
|
||||
/**
|
||||
* 报表查询参数(JSON格式)
|
||||
*/
|
||||
private String reportParams;
|
||||
|
||||
private String productionLine;
|
||||
|
||||
/**
|
||||
* 附件ID
|
||||
*/
|
||||
@NotBlank(message = "附件ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String ossId;
|
||||
|
||||
/**
|
||||
* 附件(文件存储路径/URL)
|
||||
*/
|
||||
@NotBlank(message = "附件不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String attachment;
|
||||
|
||||
/**
|
||||
* 报表类型(如:日报表/月报表/年报表)
|
||||
*/
|
||||
@NotBlank(message = "报表类型不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String reportType;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.klp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 报导出文件视图对象 report_export_file
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-11
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ReportExportFileVo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 报表标题
|
||||
*/
|
||||
@ExcelProperty(value = "报表标题")
|
||||
private String reportTitle;
|
||||
|
||||
/**
|
||||
* 报表名称(唯一)
|
||||
*/
|
||||
@ExcelProperty(value = "报表名称(唯一)")
|
||||
private String reportName;
|
||||
|
||||
/**
|
||||
* 报表查询参数(JSON格式)
|
||||
*/
|
||||
@ExcelProperty(value = "报表查询参数(JSON格式)")
|
||||
private String reportParams;
|
||||
|
||||
/**
|
||||
* 相关产线
|
||||
*/
|
||||
@ExcelProperty(value = "相关产线")
|
||||
private String productionLine;
|
||||
|
||||
/**
|
||||
* 附件ID
|
||||
*/
|
||||
private String ossId;
|
||||
|
||||
/**
|
||||
* 附件(文件存储路径/URL)
|
||||
*/
|
||||
@ExcelProperty(value = "附件(文件存储路径/URL)")
|
||||
private String attachment;
|
||||
|
||||
/**
|
||||
* 报表类型(如:Excel/PDF/Word)
|
||||
*/
|
||||
@ExcelProperty(value = "报表类型(如:Excel/PDF/Word)")
|
||||
private String reportType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.klp.mapper;
|
||||
|
||||
import com.klp.domain.ReportExportFile;
|
||||
import com.klp.domain.vo.ReportExportFileVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 报导出文件Mapper接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-11
|
||||
*/
|
||||
public interface ReportExportFileMapper extends BaseMapperPlus<ReportExportFileMapper, ReportExportFile, ReportExportFileVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.klp.service;
|
||||
|
||||
import com.klp.domain.ReportExportFile;
|
||||
import com.klp.domain.vo.ReportExportFileVo;
|
||||
import com.klp.domain.bo.ReportExportFileBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报导出文件Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-11
|
||||
*/
|
||||
public interface IReportExportFileService {
|
||||
|
||||
/**
|
||||
* 查询报导出文件
|
||||
*/
|
||||
ReportExportFileVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询报导出文件列表
|
||||
*/
|
||||
TableDataInfo<ReportExportFileVo> queryPageList(ReportExportFileBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询报导出文件列表
|
||||
*/
|
||||
List<ReportExportFileVo> queryList(ReportExportFileBo bo);
|
||||
|
||||
/**
|
||||
* 新增报导出文件
|
||||
*/
|
||||
Boolean insertByBo(ReportExportFileBo bo);
|
||||
|
||||
/**
|
||||
* 修改报导出文件
|
||||
*/
|
||||
Boolean updateByBo(ReportExportFileBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除报导出文件信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.klp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.domain.bo.ReportExportFileBo;
|
||||
import com.klp.domain.vo.ReportExportFileVo;
|
||||
import com.klp.domain.ReportExportFile;
|
||||
import com.klp.mapper.ReportExportFileMapper;
|
||||
import com.klp.service.IReportExportFileService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 报导出文件Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-11
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ReportExportFileServiceImpl implements IReportExportFileService {
|
||||
|
||||
private final ReportExportFileMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询报导出文件
|
||||
*/
|
||||
@Override
|
||||
public ReportExportFileVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报导出文件列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ReportExportFileVo> queryPageList(ReportExportFileBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ReportExportFile> lqw = buildQueryWrapper(bo);
|
||||
Page<ReportExportFileVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询报导出文件列表
|
||||
*/
|
||||
@Override
|
||||
public List<ReportExportFileVo> queryList(ReportExportFileBo bo) {
|
||||
LambdaQueryWrapper<ReportExportFile> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ReportExportFile> buildQueryWrapper(ReportExportFileBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ReportExportFile> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getReportTitle()), ReportExportFile::getReportTitle, bo.getReportTitle());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getReportName()), ReportExportFile::getReportName, bo.getReportName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getReportParams()), ReportExportFile::getReportParams, bo.getReportParams());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProductionLine()), ReportExportFile::getProductionLine, bo.getProductionLine());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAttachment()), ReportExportFile::getAttachment, bo.getAttachment());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getReportType()), ReportExportFile::getReportType, bo.getReportType());
|
||||
lqw.orderByDesc(ReportExportFile::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增报导出文件
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ReportExportFileBo bo) {
|
||||
ReportExportFile add = BeanUtil.toBean(bo, ReportExportFile.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改报导出文件
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ReportExportFileBo bo) {
|
||||
ReportExportFile update = BeanUtil.toBean(bo, ReportExportFile.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ReportExportFile entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除报导出文件
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.klp.mapper.ReportExportFileMapper">
|
||||
|
||||
<resultMap type="com.klp.domain.ReportExportFile" id="ReportExportFileResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="reportTitle" column="report_title"/>
|
||||
<result property="reportName" column="report_name"/>
|
||||
<result property="reportParams" column="report_params"/>
|
||||
<result property="productionLine" column="production_line"/>
|
||||
<result property="attachment" column="attachment"/>
|
||||
<result property="ossId" column="oss_id"/>
|
||||
<result property="reportType" column="report_type"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user