Merge remote-tracking branch 'origin/0.8.X' into 0.8.X

This commit is contained in:
2026-05-27 17:13:02 +08:00
22 changed files with 803 additions and 431 deletions

View File

@@ -1,26 +1,28 @@
<template>
<ComprehensiveTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import ComprehensiveTemplate from '@/views/wms/report/template/comprehensive.vue'
import { dugeConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'ComprehensiveReport',
components: {
ComprehensiveTemplate,
ActionTemplate,
},
data() {
return {
...dugeConfig,
actionType: 505,
reportType: 'all',
productionLine: '镀铬线',
warehouseOptions: [
{ value: '1988151132361519105', label: '镀铬成品库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,26 +1,33 @@
<template>
<DayTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
<ActionTemplate
:actionType="actionType"
:reportType="reportType"
:productionLine="productionLine"
:warehouseOptions="warehouseOptions"
/>
</template>
<script>
import DayTemplate from '@/views/wms/report/template/day.vue'
import { dugeConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'LossReport',
name: 'DayReport',
components: {
DayTemplate,
ActionTemplate,
},
data() {
return {
...dugeConfig,
actionType: 505,
reportType: 'day',
productionLine: '镀铬线',
warehouseOptions: [
{ value: '1988151132361519105', label: '镀铬成品库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,26 +1,28 @@
<template>
<LossTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
></LossTemplate>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import LossTemplate from '@/views/wms/report/template/loss.vue'
import { dugeConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'LossReport',
components: {
LossTemplate,
},
data() {
return {
...dugeConfig,
}
export default {
name: 'DayReport',
components: {
ActionTemplate,
},
data() {
return {
actionType: 505,
reportType: 'loss',
productionLine: '镀铬线',
warehouseOptions: [
{ value: '1988151132361519105', label: '镀铬成品库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
</script>
}
</script>

View File

@@ -1,26 +1,28 @@
<template>
<MonthTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import MonthTemplate from '@/views/wms/report/template/month.vue'
import { dugeConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'MonthReport',
components: {
MonthTemplate,
ActionTemplate,
},
data() {
return {
...dugeConfig,
actionType: 505,
reportType: 'month',
productionLine: '镀铬线',
warehouseOptions: [
{ value: '1988151132361519105', label: '镀铬成品库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,24 +1,28 @@
<template>
<OutTemplate
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import OutTemplate from "@/views/wms/report/template/out.vue";
import { dugeConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'ZhaTemplate',
name: 'DayReport',
components: {
OutTemplate,
ActionTemplate,
},
data() {
return {
...dugeConfig,
actionType: 505,
reportType: 'out',
productionLine: '镀铬线',
warehouseOptions: [
{ value: '1988151132361519105', label: '镀铬成品库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,26 +1,28 @@
<template>
<TeamTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import TeamTemplate from '@/views/wms/report/template/team.vue'
import { dugeConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'TeamReport',
name: 'DayReport',
components: {
TeamTemplate,
ActionTemplate,
},
data() {
return {
...dugeConfig,
actionType: 505,
reportType: 'team',
productionLine: '镀铬线',
warehouseOptions: [
{ value: '1988151132361519105', label: '镀铬成品库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,26 +1,28 @@
<template>
<YearTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import YearTemplate from '@/views/wms/report/template/year.vue'
import { dugeConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'YearReport',
components: {
YearTemplate,
ActionTemplate,
},
data() {
return {
...dugeConfig,
actionType: 505,
reportType: 'year',
productionLine: '镀铬线',
warehouseOptions: [
{ value: '1988151132361519105', label: '镀铬成品库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,26 +1,29 @@
<template>
<ComprehensiveTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import ComprehensiveTemplate from '@/views/wms/report/template/comprehensive.vue'
import { shuangConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'ShuangComprehensiveReport',
name: 'ComprehensiveReport',
components: {
ComprehensiveTemplate,
ActionTemplate,
},
data() {
return {
...shuangConfig,
actionType: 504,
reportType: 'all',
productionLine: '双机架线',
warehouseOptions: [
{ value: '1992873437713080322', label: '双机架成品库' },
{ value: '1988151076996706306', label: '镀铬原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,26 +1,34 @@
<template>
<DayTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
<ActionTemplate
:actionType="actionType"
:reportType="reportType"
:productionLine="productionLine"
:warehouseOptions="warehouseOptions"
/>
</template>
<script>
import DayTemplate from '@/views/wms/report/template/day.vue'
import { shuangConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'LossReport',
name: 'DayReport',
components: {
DayTemplate,
ActionTemplate,
},
data() {
return {
...shuangConfig,
actionType: 504,
reportType: 'day',
productionLine: '双机架线',
warehouseOptions: [
{ value: '1992873437713080322', label: '双机架成品库' },
{ value: '1988151076996706306', label: '镀铬原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,26 +1,29 @@
<template>
<LossTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
></LossTemplate>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import LossTemplate from '@/views/wms/report/template/loss.vue'
import { shuangConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'LossReport',
components: {
LossTemplate,
},
data() {
return {
...shuangConfig,
}
export default {
name: 'DayReport',
components: {
ActionTemplate,
},
data() {
return {
actionType: 504,
reportType: 'loss',
productionLine: '双机架线',
warehouseOptions: [
{ value: '1992873437713080322', label: '双机架成品库' },
{ value: '1988151076996706306', label: '镀铬原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
</script>
}
</script>

View File

@@ -1,26 +1,29 @@
<template>
<MonthTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import MonthTemplate from '@/views/wms/report/template/month.vue'
import { shuangConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'MonthReport',
components: {
MonthTemplate,
ActionTemplate,
},
data() {
return {
...shuangConfig,
actionType: 504,
reportType: 'month',
productionLine: '双机架线',
warehouseOptions: [
{ value: '1992873437713080322', label: '双机架成品库' },
{ value: '1988151076996706306', label: '镀铬原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,24 +1,29 @@
<template>
<OutTemplate
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import OutTemplate from "@/views/wms/report/template/out.vue";
import { shuangConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'ZhaTemplate',
name: 'DayReport',
components: {
OutTemplate,
ActionTemplate,
},
data() {
return {
...shuangConfig,
actionType: 504,
reportType: 'out',
productionLine: '双机架线',
warehouseOptions: [
{ value: '1992873437713080322', label: '双机架成品库' },
{ value: '1988151076996706306', label: '镀铬原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,26 +1,29 @@
<template>
<TeamTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import TeamTemplate from '@/views/wms/report/template/team.vue'
import { shuangConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'TeamReport',
name: 'DayReport',
components: {
TeamTemplate,
ActionTemplate,
},
data() {
return {
...shuangConfig,
actionType: 504,
reportType: 'team',
productionLine: '双机架线',
warehouseOptions: [
{ value: '1992873437713080322', label: '双机架成品库' },
{ value: '1988151076996706306', label: '镀铬原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,26 +1,29 @@
<template>
<YearTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import YearTemplate from '@/views/wms/report/template/year.vue'
import { shuangConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'YearReport',
components: {
YearTemplate,
ActionTemplate,
},
data() {
return {
...shuangConfig,
actionType: 504,
reportType: 'year',
productionLine: '双机架线',
warehouseOptions: [
{ value: '1992873437713080322', label: '双机架成品库' },
{ value: '1988151076996706306', label: '镀铬原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,8 +1,33 @@
<template>
<div class="app-container" v-loading="loading">
<el-row>
<!-- all 类型视图选择器 -->
<div v-if="reportType === 'all'" style="margin-bottom: 10px;">
<el-radio-group v-model="viewType" @change="handleViewTypeChange">
<el-radio-button label="day">日视图</el-radio-button>
<el-radio-button label="month">月视图</el-radio-button>
<el-radio-button label="year">年视图</el-radio-button>
<el-radio-button label="custom">自定义</el-radio-button>
</el-radio-group>
<el-date-picker v-if="viewType === 'day'" style="width: 200px; margin-left: 10px;" v-model="dayDate" type="date"
value-format="yyyy-MM-dd" placeholder="选择日期" @change="handleDayDateChange" />
<el-date-picker v-if="viewType === 'month'" style="width: 200px; margin-left: 10px;" v-model="monthDate"
type="month" value-format="yyyy-MM" placeholder="选择月份" @change="handleMonthDateChange" />
<el-date-picker v-if="viewType === 'year'" style="width: 200px; margin-left: 10px;" v-model="yearDate" type="year"
value-format="yyyy" placeholder="选择年份" @change="handleYearDateChange" />
<span v-if="viewType === 'custom'" style="margin-left: 10px;">
<el-date-picker style="width: 200px;" v-model="queryParams.startTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择开始日期"></el-date-picker>
<el-date-picker style="width: 200px;" v-model="queryParams.endTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结束日期"></el-date-picker>
</span>
</div>
<el-row v-else>
<el-form label-width="80px" inline>
<!-- 根据 reportType 显示不同的日期选择器 -->
<template v-if="['out', 'loss'].includes(reportType)">
<el-form-item label="时间范围" prop="timeRange">
<time-range-picker v-model="queryParams" start-key="startTime" end-key="endTime"
@@ -37,54 +62,79 @@
</el-select>
</el-form-item>
</template>
<template v-else>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker style="width: 200px;" v-model="queryParams.startTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择开始日期"></el-date-picker>
</el-form>
</el-row>
<el-row>
<el-form label-width="80px" inline>
<template v-if="reportType !== 'all'">
<el-form-item label="入场钢卷号" prop="enterCoilNo">
<el-input style="width: 200px; display: inline-block;" v-model="queryParams.enterCoilNo"
placeholder="请输入入场钢卷号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker style="width: 200px;" v-model="queryParams.endTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择结束日期"></el-date-picker>
<el-form-item label="当前钢卷号" prop="currentCoilNo">
<el-input style="width: 200px;" v-model="queryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="产品名称" prop="itemName">
<el-input style="width: 200px;" v-model="queryParams.itemName" placeholder="请输入产品名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="规格" prop="itemSpecification">
<memo-input style="width: 200px;" v-model="queryParams.itemSpecification" storageKey="coilSpec"
placeholder="请选择规格" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="材质" prop="itemMaterial">
<dict-select style="width: 200px;" v-model="queryParams.itemMaterial" dict-type="coil_material"
placeholder="请选择材质" clearable @keyup.enter.native="handleQuery" multiple />
</el-form-item>
<el-form-item label="厂家" prop="itemManufacturer">
<dict-select style="width: 200px;" v-model="queryParams.itemManufacturer" dict-type="coil_manufacturer"
placeholder="请选择厂家" clearable @keyup.enter.native="handleQuery" multiple />
</el-form-item>
<el-form-item label="品质" prop="qualityStatusCsv">
<muti-select v-model="queryParams.qualityStatusCsv" :options="dict.type.coil_quality_status"
placeholder="请选择品质" clearable />
</el-form-item>
<el-form-item label="逻辑库位" prop="warehouseId">
<warehouse-select v-model="queryParams.warehouseId" placeholder="请选择仓库/库区/库位"
style="width: 100%; display: inline-block; width: 200px;" clearable />
</el-form-item>
</template>
<template v-else>
<el-form-item label="入场钢卷号" prop="enterCoilNo">
<el-input style="width: 200px; display: inline-block;" v-model="queryParams.enterCoilNo"
placeholder="请输入入场钢卷号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="当前钢卷号" prop="currentCoilNo">
<el-input style="width: 200px;" v-model="queryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="逻辑库位" prop="warehouseIds">
<el-select v-model="warehouseIds" collapse-tags multiple placeholder="请选择逻辑库位" style="width: 200px;">
<el-option v-for="item in warehouseOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="产品名称" prop="itemName">
<el-input style="width: 200px;" v-model="queryParams.itemName" placeholder="请输入产品名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="规格" prop="itemSpecification">
<memo-input style="width: 200px;" v-model="queryParams.itemSpecification" storageKey="coilSpec"
placeholder="请选择规格" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="材质" prop="itemMaterial">
<dict-select style="width: 200px;" v-model="queryParams.itemMaterial" dictType="coil_material"
placeholder="请选择材质" clearable multiple />
</el-form-item>
<el-form-item label="厂家" prop="itemManufacturer">
<dict-select style="width: 200px;" v-model="queryParams.itemManufacturer" dictType="coil_manufacturer"
placeholder="请选择厂家" clearable multiple />
</el-form-item>
<el-form-item label="品质" prop="qualityStatusCsv">
<muti-select v-model="queryParams.qualityStatusCsv" :options="dict.type.coil_quality_status"
placeholder="请选择品质" clearable />
</el-form-item>
</template>
<el-form-item label="入场钢卷号" prop="enterCoilNo">
<el-input style="width: 200px; display: inline-block;" v-model="queryParams.enterCoilNo"
placeholder="请输入入场钢卷号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="当前钢卷号" prop="currentCoilNo">
<el-input style="width: 200px;" v-model="queryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="产品名称" prop="itemName">
<el-input style="width: 200px;" v-model="queryParams.itemName" placeholder="请输入产品名称" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="规格" prop="itemSpecification">
<memo-input style="width: 200px;" v-model="queryParams.itemSpecification" storageKey="coilSpec"
placeholder="请选择规格" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="材质" prop="itemMaterial">
<dict-select style="width: 200px;" v-model="queryParams.itemMaterial" dict-type="coil_material"
placeholder="请选择材质" clearable @keyup.enter.native="handleQuery" multiple />
</el-form-item>
<el-form-item label="厂家" prop="itemManufacturer">
<dict-select style="width: 200px;" v-model="queryParams.itemManufacturer" dict-type="coil_manufacturer"
placeholder="请选择厂家" clearable @keyup.enter.native="handleQuery" multiple />
</el-form-item>
<el-form-item label="品质" prop="qualityStatusCsv">
<muti-select v-model="queryParams.qualityStatusCsv" :options="dict.type.coil_quality_status"
placeholder="请选择品质" clearable />
</el-form-item>
<!-- <el-form-item v-if="['team', 'day', 'month', 'year', 'all'].includes(reportType)" label="逻辑库位"
prop="warehouseIds">
<el-select v-model="warehouseIds" collapse-tags multiple placeholder="请选择逻辑库位" style="width: 200px;">
<el-option v-for="item in warehouseOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item> -->
<el-form-item label="逻辑库位" prop="warehouseId">
<warehouse-select v-model="queryParams.warehouseId" placeholder="请选择仓库/库区/库位"
style="width: 100%; display: inline-block; width: 200px;" clearable />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">查询</el-button>
<el-button v-if="['out', 'team', 'day', 'month', 'year', 'all'].includes(reportType)" type="primary"
@@ -114,7 +164,68 @@
<el-descriptions-item label="均重">{{ lossSummary.avgWeight }}t</el-descriptions-item>
</el-descriptions>
<!-- team, day, month, year, all 类型的统计信息 -->
<!-- all 类型的统计信息comprehensive 风格 -->
<template v-else-if="reportType === 'all'">
<el-descriptions title="统计信息" :column="3" border>
<el-descriptions-item label="产出数量">{{ summary.outCount }}<span v-if="viewType === 'day' && yesterdaySummary.outCount" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.outCount }})</span></el-descriptions-item>
<el-descriptions-item label="产出总重">{{ summary.outTotalWeight }}t<span v-if="viewType === 'day' && yesterdaySummary.outTotalWeight" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.outTotalWeight }}t)</span></el-descriptions-item>
<el-descriptions-item label="产出均重">{{ summary.outAvgWeight }}t<span v-if="viewType === 'day' && yesterdaySummary.outAvgWeight" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.outAvgWeight }}t)</span></el-descriptions-item>
<el-descriptions-item label="消耗数量">{{ summary.lossCount }}<span v-if="viewType === 'day' && yesterdaySummary.lossCount" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.lossCount }})</span></el-descriptions-item>
<el-descriptions-item label="消耗总重">{{ summary.lossTotalWeight }}t<span v-if="viewType === 'day' && yesterdaySummary.lossTotalWeight" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.lossTotalWeight }}t)</span></el-descriptions-item>
<el-descriptions-item label="消耗均重">{{ summary.lossAvgWeight }}t<span v-if="viewType === 'day' && yesterdaySummary.lossAvgWeight" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.lossAvgWeight }}t)</span></el-descriptions-item>
<el-descriptions-item label="数量差值">{{ summary.countDiff }}<span v-if="viewType === 'day' && yesterdaySummary.countDiff" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.countDiff }})</span></el-descriptions-item>
<el-descriptions-item label="总重差值">{{ summary.weightDiff }}<span v-if="viewType === 'day' && yesterdaySummary.weightDiff" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.weightDiff }})</span></el-descriptions-item>
<el-descriptions-item label="均重差值">{{ summary.avgWeightDiff }}t<span v-if="viewType === 'day' && yesterdaySummary.avgWeightDiff" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.avgWeightDiff }}t)</span></el-descriptions-item>
<el-descriptions-item label="成品率">{{ summary.passRate }}<span v-if="viewType === 'day' && yesterdaySummary.passRate" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.passRate }})</span></el-descriptions-item>
<el-descriptions-item label="损耗率">{{ summary.lossRate }}<span v-if="viewType === 'day' && yesterdaySummary.lossRate" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.lossRate }})</span></el-descriptions-item>
<el-descriptions-item label="异常率">{{ summary.abRate }}<span v-if="viewType === 'day' && yesterdaySummary.abRate" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.abRate }})</span></el-descriptions-item>
<el-descriptions-item label="正品率">{{ summary.passRate2 }}<span v-if="viewType === 'day' && yesterdaySummary.passRate2" style="margin-left: 10px; font-size: 12px; color: #999;">(昨日: {{ yesterdaySummary.passRate2 }})</span></el-descriptions-item>
</el-descriptions>
<el-descriptions title="已处理M统计信息" :column="3" border>
<el-descriptions-item label="产出数量">{{ mSummary.outCount }}</el-descriptions-item>
<el-descriptions-item label="产出总重">{{ mSummary.outTotalWeight }}t</el-descriptions-item>
<el-descriptions-item label="产出均重">{{ mSummary.outAvgWeight }}t</el-descriptions-item>
<el-descriptions-item label="消耗数量">{{ mSummary.lossCount }}</el-descriptions-item>
<el-descriptions-item label="消耗总重">{{ mSummary.lossTotalWeight }}t</el-descriptions-item>
<el-descriptions-item label="消耗均重">{{ mSummary.lossAvgWeight }}t</el-descriptions-item>
<el-descriptions-item label="数量差值">{{ mSummary.countDiff }}</el-descriptions-item>
<el-descriptions-item label="总重差值">{{ mSummary.weightDiff }}</el-descriptions-item>
<el-descriptions-item label="均重差值">{{ mSummary.avgWeightDiff }}t</el-descriptions-item>
<el-descriptions-item label="成品率">{{ mSummary.passRate }}</el-descriptions-item>
<el-descriptions-item label="损耗率">{{ mSummary.lossRate }}</el-descriptions-item>
<el-descriptions-item label="异常率">{{ mSummary.abRate }}</el-descriptions-item>
<el-descriptions-item label="正品率">{{ mSummary.passRate2 }}</el-descriptions-item>
</el-descriptions>
<el-descriptions title="异常统计" :column="4" border>
<el-descriptions-item v-for="item in abSummary" :key="item.label" :label="item.label">{{ item.value
}}</el-descriptions-item>
</el-descriptions>
<!-- 月视图日数据折线图 -->
<div v-if="viewType === 'month'" style="margin-top: 20px; height: 400px;">
<el-card>
<template slot="header">
<div class="clearfix">
<span>日数据趋势</span>
</div>
</template>
<div ref="monthChart" style="width: 100%; height: 350px;"></div>
</el-card>
</div>
<!-- 分条信息统计 -->
<split-summary v-if="productionLine == '分条线'" :origin-outputlist="outList" :origin-loss-list="lossList"
:common-coil-ids="commonCoilIds"></split-summary>
</template>
<!-- team, day, month, year 类型的统计信息 -->
<template v-else>
<el-descriptions title="统计信息" :column="3" border>
<el-descriptions-item label="产出数量">{{ summary.outCount }}</el-descriptions-item>
@@ -129,16 +240,12 @@
<el-descriptions-item label="总重差值">{{ summary.weightDiff }}</el-descriptions-item>
<el-descriptions-item label="均重差值">{{ summary.avgWeightDiff }}t</el-descriptions-item>
<!-- 成品率 -->
<el-descriptions-item label="成品率">{{ summary.passRate }}</el-descriptions-item>
<el-descriptions-item label="损耗率">{{ summary.lossRate }}</el-descriptions-item>
<!-- 异常率 -->
<el-descriptions-item label="异常率">{{ summary.abRate }}</el-descriptions-item>
<!-- 正品率 -->
<el-descriptions-item label="正品率">{{ summary.passRate2 }}</el-descriptions-item>
</el-descriptions>
<!-- 已处理M统计信息 -->
<el-descriptions title="已处理M统计信息" :column="3" border>
<el-descriptions-item label="产出数量">{{ mSummary.outCount }}</el-descriptions-item>
<el-descriptions-item label="产出总重">{{ mSummary.outTotalWeight }}t</el-descriptions-item>
@@ -151,22 +258,17 @@
<el-descriptions-item label="数量差值">{{ mSummary.countDiff }}</el-descriptions-item>
<el-descriptions-item label="总重差值">{{ mSummary.weightDiff }}</el-descriptions-item>
<el-descriptions-item label="均重差值">{{ mSummary.avgWeightDiff }}t</el-descriptions-item>
<!-- 成品率 -->
<el-descriptions-item label="成品率">{{ mSummary.passRate }}</el-descriptions-item>
<el-descriptions-item label="损耗率">{{ mSummary.lossRate }}</el-descriptions-item>
<!-- 异常率 -->
<el-descriptions-item label="异常率">{{ mSummary.abRate }}</el-descriptions-item>
<!-- 正品率 -->
<el-descriptions-item label="正品率">{{ mSummary.passRate2 }}</el-descriptions-item>
</el-descriptions>
<!-- 异常统计team 类型显示 -->
<el-descriptions v-if="reportType === 'team'" title="异常统计" :column="4" border>
<el-descriptions-item v-for="item in abSummary" :key="item.label" :label="item.label">{{ item.value
}}</el-descriptions-item>
</el-descriptions>
<!-- 班组统计信息team 类型显示 -->
<template v-if="reportType === 'team'">
<el-descriptions title="班组统计信息" :column="3" border>
</el-descriptions>
@@ -179,16 +281,31 @@
</template>
<!-- 明细信息和标签页 -->
<el-descriptions title="明细信息" :column="3" border>
</el-descriptions>
<el-tabs v-if="reportType !== 'out' && reportType !== 'loss'" v-model="activeTab">
<el-tab-pane label="投入钢卷" name="loss">
<coil-table :data="lossList" :columns="lossColumns" :loading="loading" height="calc(100vh - 360px)" />
</el-tab-pane>
<el-tab-pane label="产出钢卷" name="output">
<coil-table :data="outList" :columns="outputColumns" :loading="loading" height="calc(100vh - 360px)" />
</el-tab-pane>
</el-tabs>
<!-- all 类型产出在前投入在后 -->
<template v-if="reportType === 'all'">
<el-descriptions title="明细信息" :column="3" border>
</el-descriptions>
<el-tabs v-model="activeTab">
<el-tab-pane label="产出钢卷" name="output">
<coil-table :columns="outputColumns" :data="outList" :highlight-config="{ rows: commonCoilIds }"></coil-table>
</el-tab-pane>
<el-tab-pane label="投入钢卷" name="loss">
<coil-table :columns="lossColumns" :data="lossList" :highlight-config="{ rows: commonCoilIds }"></coil-table>
</el-tab-pane>
</el-tabs>
</template>
<template v-else-if="reportType !== 'out' && reportType !== 'loss'">
<el-descriptions title="明细信息" :column="3" border>
</el-descriptions>
<el-tabs v-model="activeTab">
<el-tab-pane label="投入钢卷" name="loss">
<coil-table :data="lossList" :columns="lossColumns" :loading="loading" height="calc(100vh - 360px)" />
</el-tab-pane>
<el-tab-pane label="产出钢卷" name="output">
<coil-table :data="outList" :columns="outputColumns" :loading="loading" height="calc(100vh - 360px)" />
</el-tab-pane>
</el-tabs>
</template>
<!-- out 类型只显示产出钢卷 -->
<coil-table v-else-if="reportType === 'out'" :columns="outputColumns" :data="outList"></coil-table>
<!-- loss 类型只显示投入钢卷 -->
@@ -208,6 +325,7 @@
import { listCoilWithIds } from "@/api/wms/coil";
import {
listLightPendingAction,
listPendingAction,
} from '@/api/wms/pendingAction';
import MemoInput from "@/components/MemoInput";
import MutiSelect from "@/components/MutiSelect";
@@ -219,8 +337,10 @@ import { calcSummary, calcAbSummary, calcTeamSummary, calcMSummary } from "@/vie
import CoilTable from "@/views/wms/report/components/coilTable";
import ColumnsSetting from "@/views/wms/report/components/setting/columns";
import TimeRangePicker from "@/views/wms/report/components/timeRangePicker.vue";
import SplitSummary from "@/views/wms/report/components/summary/splitSummary.vue";
import { saveReportFile } from "@/views/wms/report/js/reportFile";
import * as echarts from 'echarts';
export default {
name: 'MergeTemplate',
@@ -251,20 +371,18 @@ export default {
WarehouseSelect,
CoilTable,
ColumnsSetting,
TimeRangePicker
TimeRangePicker,
SplitSummary,
},
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer', 'coil_quality_status'],
data() {
// 工具函数:个位数补零
const addZero = (num) => num.toString().padStart(2, '0')
// 获取当前日期
const now = new Date()
const currentYear = `${now.getFullYear()}`
const currentMonth = `${now.getFullYear()}-${addZero(now.getMonth() + 1)}`
const currentDay = `${now.getFullYear()}-${addZero(now.getMonth() + 1)}-${addZero(now.getDate())}`
// 获取昨天的日期(用于 out 和 loss 类型的默认时间)
const yesterday = new Date(now)
yesterday.setDate(yesterday.getDate() - 1)
const yesYear = yesterday.getFullYear()
@@ -273,40 +391,28 @@ export default {
const defaultStartTime = `${yesYear}-${yesMonth}-${yesDay} 07:00:00`
const defaultEndTime = `${now.getFullYear()}-${addZero(now.getMonth() + 1)}-${addZero(now.getDate())} 07:00:00`
/**
* 生成指定日期/月份/年份的时间范围字符串
* @param {string} dateStr - 支持格式yyyy年份、yyyy-MM月份或 yyyy-MM-dd具体日期
* @returns {object} 包含start开始时间和end结束时间的对象
*/
const getDayTimeRange = (dateStr) => {
// 先校验输入格式是否合法
const yearPattern = /^\d{4}$/; // yyyy 正则
const monthPattern = /^\d{4}-\d{2}$/; // yyyy-MM 正则
const dayPattern = /^\d{4}-\d{2}-\d{2}$/; // yyyy-MM-dd 正则
const yearPattern = /^\d{4}$/;
const monthPattern = /^\d{4}-\d{2}$/;
const dayPattern = /^\d{4}-\d{2}-\d{2}$/;
let startDate, endDate;
if (yearPattern.test(dateStr)) {
// 处理 yyyy 格式:获取本年第一天和最后一天
startDate = `${dateStr}-01-01`;
endDate = `${dateStr}-12-31`;
} else if (monthPattern.test(dateStr)) {
// 处理 yyyy-MM 格式:获取本月第一天和最后一天
const [year, month] = dateStr.split('-').map(Number);
// 第一天yyyy-MM-01
startDate = `${dateStr}-01`;
// 最后一天:通过 new Date(year, month, 0) 计算month是原始月份比如2代表2月传2则取3月0日=2月最后一天
const lastDayOfMonth = new Date(year, month, 0).getDate();
endDate = `${dateStr}-${lastDayOfMonth.toString().padStart(2, '0')}`;
} else if (dayPattern.test(dateStr)) {
// 处理 yyyy-MM-dd 格式:直接使用传入的日期
startDate = dateStr;
endDate = dateStr;
} else {
throw new Error('输入格式错误,请传入 yyyy、yyyy-MM 或 yyyy-MM-dd 格式的字符串');
}
// 拼接时间部分
return {
start: `${startDate} 00:00:00`,
end: `${endDate} 23:59:59`
@@ -328,11 +434,13 @@ export default {
defaultStartTime,
defaultEndTime,
getDayTimeRange,
// all 类型专用
viewType: 'custom',
yesterdaySummary: {},
monthChart: null,
queryParams: {
startTime: start,
endTime: end,
// byCreateTimeStart: start,
// byCreateTimeEnd: end,
enterCoilNo: '',
currentCoilNo: '',
warehouseId: '',
@@ -382,7 +490,6 @@ export default {
};
});
},
// out 类型的统计
outSummary() {
const totalCount = this.outList.length;
const totalWeight = this.outList.reduce((acc, cur) => acc + parseFloat(cur.netWeight), 0);
@@ -393,7 +500,6 @@ export default {
avgWeight,
};
},
// loss 类型的统计
lossSummary() {
const totalCount = this.lossList.length;
const totalWeight = this.lossList.reduce((acc, cur) => acc + parseFloat(cur.netWeight), 0);
@@ -403,7 +509,21 @@ export default {
totalWeight: totalWeight.toFixed(2),
avgWeight,
};
}
},
commonCoilIds() {
if (this.productionLine !== '分条线') {
return []
}
const outputCoilIds = new Set(this.outList.map(item => item.coilId))
const lossCoilIds = new Set(this.lossList.map(item => item.coilId))
const commonIds = []
outputCoilIds.forEach(id => {
if (lossCoilIds.has(id)) {
commonIds.push(id)
}
})
return commonIds
},
},
watch: {
warehouseOptions: {
@@ -421,17 +541,20 @@ export default {
this.loadColumns()
},
methods: {
// 根据 reportType 初始化日期
initDateByReportType() {
if (this.reportType === 'out' || this.reportType === 'loss') {
// out 和 loss 类型使用默认时间
this.queryParams.startTime = this.defaultStartTime;
this.queryParams.endTime = this.defaultEndTime;
} else if (this.reportType === 'team') {
// team 类型初始化 byCreateTimeStart 和 byCreateTimeEnd
const { start, end } = this.getDayTimeRange(this.dayDate);
this.queryParams.byCreateTimeStart = start;
this.queryParams.byCreateTimeEnd = end;
} else if (this.reportType === 'all') {
// all 类型默认使用当前月份作为自定义时间范围
this.viewType = 'custom';
const { start, end } = this.getDayTimeRange(this.monthDate);
this.queryParams.startTime = start;
this.queryParams.endTime = end;
} else {
let dateStr;
if (this.reportType === 'year') {
@@ -440,16 +563,12 @@ export default {
dateStr = this.monthDate;
} else if (this.reportType === 'day') {
dateStr = this.dayDate;
} else {
// all 类型,默认使用当前月份
dateStr = this.monthDate;
}
const { start, end } = this.getDayTimeRange(dateStr);
this.queryParams.startTime = start;
this.queryParams.endTime = end;
}
},
// 日期变更处理
handleDateChange() {
let dateStr;
if (this.reportType === 'year') {
@@ -466,26 +585,108 @@ export default {
this.handleQuery();
}
},
// all 类型:视图类型切换
handleViewTypeChange() {
switch (this.viewType) {
case 'day': {
const today = new Date();
const year = today.getFullYear();
const month = String(today.getMonth() + 1).padStart(2, '0');
const day = String(today.getDate()).padStart(2, '0');
this.dayDate = `${year}-${month}-${day}`;
this.handleDayDateChange();
break;
}
case 'month':
this.handleMonthDateChange();
break;
case 'year':
this.handleYearDateChange();
break;
case 'custom':
break;
}
},
// all 类型:日视图日期变更
handleDayDateChange() {
if (this.dayDate) {
const { start, end } = this.getDayTimeRange(this.dayDate);
this.queryParams.startTime = start;
this.queryParams.endTime = end;
this.handleQuery();
}
},
// all 类型:月视图日期变更
handleMonthDateChange() {
if (this.monthDate) {
const { start, end } = this.getDayTimeRange(this.monthDate);
this.queryParams.startTime = start;
this.queryParams.endTime = end;
this.handleQuery();
}
},
// all 类型:年视图日期变更
handleYearDateChange() {
if (this.yearDate) {
this.queryParams.startTime = `${this.yearDate}-01-01 00:00:00`;
this.queryParams.endTime = `${this.yearDate}-12-31 23:59:59`;
this.handleQuery();
}
},
handleQuery() {
this.getList()
},
async getList() {
this.loading = true;
// 所有报表类型都使用原始的 listLightPendingAction 方式获取数据
if (this.reportType === 'all') {
// all 类型使用 comprehensive 方式查询
const res = await listLightPendingAction({ ...this.queryParams, actionTypes: this.actionType, actionStatus: 2 });
const lossIds = res.data.filter(item => item.coilId).map(item => item.coilId);
const lossActionIds = res.data.filter(item => item.actionId).map(item => item.actionId);
this.actionIds = lossActionIds.join(',')
const outIds = [...new Set(res.data.filter(item => item.processedCoilIds).map(item => item.processedCoilIds))];
if (lossIds.length === 0 || outIds.length === 0) {
this.$message({ message: '查询结果为空', type: 'warning' })
this.loading = false;
return
}
const [lossRes, outRes] = await Promise.all([
listCoilWithIds({ ...this.queryParams, actionIds: lossActionIds.join(',') || '', startTime: '', endTime: '', selectType: 'raw_material' }),
listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '', startTime: '', endTime: '', selectType: 'product' }),
]);
this.lossList = lossRes.rows.map(item => {
const [thickness, width] = item.specification?.split('*') || []
return { ...item, computedThickness: parseFloat(thickness), computedWidth: parseFloat(width) }
});
this.outList = outRes.rows.map(item => {
const [thickness, width] = item.specification?.split('*') || []
return { ...item, computedThickness: parseFloat(thickness), computedWidth: parseFloat(width) }
});
if (this.viewType === 'day') {
this.getYesterdayData()
}
if (this.viewType === 'month') {
this.$nextTick(() => {
this.initMonthChart()
})
}
this.loading = false;
return
}
const res = await listLightPendingAction({ ...this.queryParams, actionTypes: this.actionType, actionStatus: 2 });
// 获取两层数据
const lossIds = res.data.filter(item => item.coilId).map(item => item.coilId);
const lossActionIds = res.data.filter(item => item.actionId).map(item => item.actionId);
this.actionIds = lossActionIds.join(',')
// 使用new Set去重
const outIds = [...new Set(res.data.filter(item => item.processedCoilIds).map(item => item.processedCoilIds))];
if (lossIds.length === 0 || outIds.length === 0) {
this.$message({
message: '查询结果为空',
type: 'warning'
})
this.$message({ message: '查询结果为空', type: 'warning' })
this.loading = false;
return
}
@@ -495,60 +696,170 @@ export default {
listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '', startTime: '', endTime: '', selectType: 'product' }),
]);
// 根据 reportType 决定填充哪些数据
if (this.reportType === 'out') {
// 产出报表模式:只填充产出数据
this.outList = outRes.rows.map(item => {
const [thickness, width] = item.specification?.split('*') || []
return {
...item,
computedThickness: parseFloat(thickness),
computedWidth: parseFloat(width),
}
return { ...item, computedThickness: parseFloat(thickness), computedWidth: parseFloat(width) }
});
this.lossList = []; // 清空消耗数据
this.lossList = [];
} else if (this.reportType === 'loss') {
// 消耗报表模式:只填充消耗数据
this.lossList = lossRes.rows.map(item => {
const [thickness, width] = item.specification?.split('*') || []
return {
...item,
computedThickness: parseFloat(thickness),
computedWidth: parseFloat(width),
}
return { ...item, computedThickness: parseFloat(thickness), computedWidth: parseFloat(width) }
});
this.outList = []; // 清空产出数据
this.outList = [];
} else {
// team/day/month/year/all 类型:填充两者数据
this.lossList = lossRes.rows.map(item => {
const [thickness, width] = item.specification?.split('*') || []
return {
...item,
computedThickness: parseFloat(thickness),
computedWidth: parseFloat(width),
}
return { ...item, computedThickness: parseFloat(thickness), computedWidth: parseFloat(width) }
});
this.outList = outRes.rows.map(item => {
const [thickness, width] = item.specification?.split('*') || []
return {
...item,
computedThickness: parseFloat(thickness),
computedWidth: parseFloat(width),
}
return { ...item, computedThickness: parseFloat(thickness), computedWidth: parseFloat(width) }
});
}
this.loading = false;
},
// 导出
// all 类型:获取昨日数据
getYesterdayData() {
const yesterday = new Date(this.dayDate)
yesterday.setDate(yesterday.getDate() - 1)
const year = yesterday.getFullYear()
const month = String(yesterday.getMonth() + 1).padStart(2, '0')
const day = String(yesterday.getDate()).padStart(2, '0')
const yesterdayDate = `${year}-${month}-${day}`
const { start, end } = this.getDayTimeRange(yesterdayDate)
Promise.all([
listCoilWithIds({
selectType: 'raw_material',
itemType: 'raw_material',
warehouseIds: this.warehouseIds.join(','),
...this.queryParams,
startTime: start,
endTime: end,
pageSize: 99999,
pageNum: 1,
}),
listCoilWithIds({
selectType: 'product',
itemType: 'product',
warehouseIds: this.warehouseIds.join(','),
...this.queryParams,
startTime: start,
endTime: end,
pageSize: 99999,
pageNum: 1,
}),
]).then((resList) => {
const list = resList.flatMap(res => res.rows)
const yesterdayList = list.sort(
(a, b) => new Date(b.createTime) - new Date(a.createTime)
).map(item => {
if (!item.selectType) {
item.selectType = item.itemType === 'product' ? 'product' : 'raw_material'
}
return item
})
listPendingAction({
actionStatus: 2,
actionType: this.actionType,
pageSize: 99999,
pageNum: 1,
startTime: start,
endTime: end,
}).then((lossRes) => {
const lossActions = lossRes.rows
const lossCoilIds = lossActions.map(item => item.coilId).join(',')
if (lossCoilIds) {
listCoilWithIds({
...this.queryParams,
startTime: undefined,
endTime: undefined,
coilIds: lossCoilIds,
pageSize: 99999,
pageNum: 1,
}).then(res => {
const yesterdayLossList = res.rows
this.yesterdaySummary = calcSummary(yesterdayList, yesterdayLossList)
})
} else {
this.yesterdaySummary = calcSummary(yesterdayList, [])
}
})
})
},
// all 类型:初始化月视图折线图
initMonthChart() {
if (!this.$refs.monthChart) return
if (this.monthChart) {
this.monthChart.dispose()
}
this.monthChart = echarts.init(this.$refs.monthChart)
const dailyData = {}
this.outList.forEach(item => {
const date = item.createTime.split(' ')[0]
if (!dailyData[date]) {
dailyData[date] = { outCount: 0, outTotalWeight: 0, lossCount: 0, lossTotalWeight: 0 }
}
dailyData[date].outCount++
dailyData[date].outTotalWeight += parseFloat(item.netWeight) || 0
})
this.lossList.forEach(item => {
const date = item.actionCompleteTime?.split(' ')[0]
if (!dailyData[date]) {
dailyData[date] = { outCount: 0, outTotalWeight: 0, lossCount: 0, lossTotalWeight: 0 }
}
dailyData[date].lossCount++
dailyData[date].lossTotalWeight += parseFloat(item.netWeight) || 0
})
const dates = Object.keys(dailyData).sort()
const outCountData = dates.map(date => dailyData[date].outCount)
const outTotalWeightData = dates.map(date => dailyData[date].outTotalWeight.toFixed(2))
const lossCountData = dates.map(date => dailyData[date].lossCount)
const lossTotalWeightData = dates.map(date => dailyData[date].lossTotalWeight.toFixed(2))
const option = {
tooltip: {
trigger: 'axis',
axisPointer: { type: 'cross', label: { backgroundColor: '#6a7985' } }
},
legend: { data: ['产出数量', '产出总重', '消耗数量', '消耗总重'] },
grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
xAxis: [{ type: 'category', boundaryGap: false, data: dates }],
yAxis: [
{ type: 'value', name: '数量', position: 'left' },
{ type: 'value', name: '重量(t)', position: 'right' }
],
series: [
{ name: '产出数量', type: 'line', data: outCountData, yAxisIndex: 0 },
{ name: '产出总重', type: 'line', data: outTotalWeightData, yAxisIndex: 1 },
{ name: '消耗数量', type: 'line', data: lossCountData, yAxisIndex: 0 },
{ name: '消耗总重', type: 'line', data: lossTotalWeightData, yAxisIndex: 1 }
]
}
this.monthChart.setOption(option)
window.addEventListener('resize', () => {
this.monthChart.resize()
})
},
exportData() {
if (this.outList.length === 0) {
this.$message.warning('暂无数据可导出')
return
}
// 根据 reportType 调整文件名
let fileName = `materialCoil_${new Date().getTime()}.xlsx`;
if (['day', 'month', 'year'].includes(this.reportType)) {
if (['day', 'month', 'year', 'all'].includes(this.reportType)) {
fileName = `materialCoil_${this.queryParams.date || ''}_${new Date().getTime()}.xlsx`;
}
this.download('wms/materialCoil/export', {
@@ -560,20 +871,16 @@ export default {
this.$message.warning('暂无数据可导出')
return
}
// 根据 reportType 调整文件名
let fileName = `materialCoil_${new Date().getTime()}.xlsx`;
if (['day', 'month', 'year'].includes(this.reportType)) {
if (['day', 'month', 'year', 'all'].includes(this.reportType)) {
fileName = `materialCoil_${this.queryParams.date || ''}_${new Date().getTime()}.xlsx`;
}
this.download('wms/materialCoil/export', {
actionIds: this.actionIds
}, fileName)
},
// 保存产出报表
saveOutputReport() {
this.loading = true
// 根据 reportType 调整报表类型
let reportTypeStr = '产出报表';
if (this.reportType === 'day') {
reportTypeStr = '产出报表,日报表';
@@ -583,29 +890,23 @@ export default {
reportTypeStr = '产出报表,年报表';
} else if (this.reportType === 'team') {
reportTypeStr = '产出报表,班报表';
} else if (this.reportType === 'all') {
reportTypeStr = '产出报表,综合报表';
}
saveReportFile(this.outList.map(item => item.coilId).join(','), {
reportParams: this.queryParams,
reportType: reportTypeStr,
productionLine: this.productionLine,
}).then(res => {
this.$message({
message: '保存成功',
type: 'success',
})
this.$message({ message: '保存成功', type: 'success' })
}).catch(err => {
this.$message({
message: '保存失败',
type: 'error',
})
this.$message({ message: '保存失败', type: 'error' })
}).finally(() => {
this.loading = false
})
},
// 保存消耗报表
saveLossReport() {
this.loading = true
// 根据 reportType 调整报表类型
let reportTypeStr = '消耗报表';
if (this.reportType === 'day') {
reportTypeStr = '消耗报表,日报表';
@@ -615,26 +916,21 @@ export default {
reportTypeStr = '消耗报表,年报表';
} else if (this.reportType === 'team') {
reportTypeStr = '消耗报表,班报表';
} else if (this.reportType === 'all') {
reportTypeStr = '消耗报表,综合报表';
}
saveReportFile(this.lossList.map(item => item.coilId).join(','), {
reportParams: this.queryParams,
reportType: reportTypeStr,
productionLine: this.productionLine,
}).then(res => {
this.$message({
message: '保存成功',
type: 'success',
})
this.$message({ message: '保存成功', type: 'success' })
}).catch(err => {
this.$message({
message: '保存失败',
type: 'error',
})
this.$message({ message: '保存失败', type: 'error' })
}).finally(() => {
this.loading = false
})
},
// 加载列设置
loadColumns() {
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
@@ -643,4 +939,4 @@ export default {
}
</script>
<style></style>
<style></style>

View File

@@ -1,26 +1,29 @@
<template>
<ComprehensiveTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import ComprehensiveTemplate from '@/views/wms/report/template/comprehensive.vue'
import { tuozhiConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'ComprehensiveReport',
components: {
ComprehensiveTemplate,
ActionTemplate,
},
data() {
return {
...tuozhiConfig,
actionType: 502,
reportType: 'all',
productionLine: '脱脂线',
warehouseOptions: [
{ value: '1988150586938421250', label: '脱脂成品库' },
{ value: '1988150648993148929', label: '罩式退火原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,27 +1,34 @@
<template>
<DayTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
<ActionTemplate
:actionType="actionType"
:reportType="reportType"
:productionLine="productionLine"
:warehouseOptions="warehouseOptions"
/>
</template>
<script>
import DayTemplate from '@/views/wms/report/template/day.vue'
import { tuozhiConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'LossReport',
name: 'DayReport',
components: {
DayTemplate,
ActionTemplate,
},
data() {
return {
...tuozhiConfig,
actionType: 502,
reportType: 'day',
productionLine: '脱脂线',
warehouseOptions: [
{ value: '1988150586938421250', label: '脱脂成品库' },
{ value: '1988150648993148929', label: '罩式退火原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,26 +1,29 @@
<template>
<LossTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
></LossTemplate>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import LossTemplate from '@/views/wms/report/template/loss.vue'
import { tuozhiConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'LossReport',
components: {
LossTemplate,
},
data() {
return {
...tuozhiConfig,
}
export default {
name: 'DayReport',
components: {
ActionTemplate,
},
data() {
return {
actionType: 502,
reportType: 'loss',
productionLine: '脱脂线',
warehouseOptions: [
{ value: '1988150586938421250', label: '脱脂成品库' },
{ value: '1988150648993148929', label: '罩式退火原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
</script>
}
</script>

View File

@@ -1,26 +1,29 @@
<template>
<MonthTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import MonthTemplate from '@/views/wms/report/template/month.vue'
import { tuozhiConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'MonthReport',
components: {
MonthTemplate,
ActionTemplate,
},
data() {
return {
...tuozhiConfig,
actionType: 502,
reportType: 'month',
productionLine: '脱脂线',
warehouseOptions: [
{ value: '1988150586938421250', label: '脱脂成品库' },
{ value: '1988150648993148929', label: '罩式退火原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,24 +1,29 @@
<template>
<OutTemplate
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import OutTemplate from "@/views/wms/report/template/out.vue";
import { tuozhiConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'ZhaTemplate',
name: 'DayReport',
components: {
OutTemplate,
ActionTemplate,
},
data() {
return {
...tuozhiConfig,
actionType: 502,
reportType: 'out',
productionLine: '脱脂线',
warehouseOptions: [
{ value: '1988150586938421250', label: '脱脂成品库' },
{ value: '1988150648993148929', label: '罩式退火原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,26 +1,29 @@
<template>
<TeamTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import TeamTemplate from '@/views/wms/report/template/team.vue'
import { tuozhiConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'TeamReport',
name: 'DayReport',
components: {
TeamTemplate,
ActionTemplate,
},
data() {
return {
...tuozhiConfig,
actionType: 502,
reportType: 'team',
productionLine: '脱脂线',
warehouseOptions: [
{ value: '1988150586938421250', label: '脱脂成品库' },
{ value: '1988150648993148929', label: '罩式退火原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>

View File

@@ -1,26 +1,29 @@
<template>
<YearTemplate
:actionTypes="actionTypes"
:actionQueryParams="actionQueryParams"
:baseQueryParams="baseQueryParams"
:warehouseOptions="warehouseOptions"
:productionLine="productionLine"
/>
<ActionTemplate :actionType="actionType" :reportType="reportType" :productionLine="productionLine" :warehouseOptions="warehouseOptions" />
</template>
<script>
import YearTemplate from '@/views/wms/report/template/year.vue'
import { tuozhiConfig } from '@/views/wms/report/js/config.js'
import ActionTemplate from '@/views/wms/report/template/action.vue'
export default {
name: 'YearReport',
components: {
YearTemplate,
ActionTemplate,
},
data() {
return {
...tuozhiConfig,
actionType: 502,
reportType: 'year',
productionLine: '脱脂线',
warehouseOptions: [
{ value: '1988150586938421250', label: '脱脂成品库' },
{ value: '1988150648993148929', label: '罩式退火原料库' },
{ label: '技术部', value: '2019583656787259393' },
{ label: '小钢卷库', value: '2019583325311414274' },
{ label: '废品库', value: '2019583429955104769' },
{ label: '退货库', value: '2019583137616310273' },
],
}
}
}
</script>
</script>