feat(wms): 新增报表导出文件管理功能
新增报表导出文件管理模块,包含后端接口和前端页面 在各类报表页面添加保存报表功能 优化CoilSelector和CoilCard组件显示 调整分页大小和表格高度 统一各产线报表配置 修复文件预览组件高度问题
This commit is contained in:
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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user