feat(wms/report): 新增修复报告页面和功能
feat(ems/assisted): 添加公辅消耗记录和类型管理功能 fix(eqp): 修改公辅消耗记录接口返回类型为Long refactor(wms/report): 优化合并模板查询逻辑和统计信息展示 style(wms/report): 调整时间范围选择器组件逻辑 docs(wms/report): 更新配置文件中产线类型配置 feat(wms/report): 新增异常报告页面和功能
This commit is contained in:
@@ -71,8 +71,8 @@ public class EqpAuxiliaryConsumeController extends BaseController {
|
|||||||
@Log(title = "公辅消耗记录", businessType = BusinessType.INSERT)
|
@Log(title = "公辅消耗记录", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody EqpAuxiliaryConsumeBo bo) {
|
public R<Long> add(@Validated(AddGroup.class) @RequestBody EqpAuxiliaryConsumeBo bo) {
|
||||||
return toAjax(iEqpAuxiliaryConsumeService.insertByBo(bo));
|
return R.ok(iEqpAuxiliaryConsumeService.insertByBo(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import javax.validation.constraints.*;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公辅消耗记录业务对象 eqp_auxiliary_consume
|
* 公辅消耗记录业务对象 eqp_auxiliary_consume
|
||||||
@@ -28,6 +29,8 @@ public class EqpAuxiliaryConsumeBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 记录日期
|
* 记录日期
|
||||||
*/
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date recordDate;
|
private Date recordDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public interface IEqpAuxiliaryConsumeService {
|
|||||||
/**
|
/**
|
||||||
* 新增公辅消耗记录
|
* 新增公辅消耗记录
|
||||||
*/
|
*/
|
||||||
Boolean insertByBo(EqpAuxiliaryConsumeBo bo);
|
Long insertByBo(EqpAuxiliaryConsumeBo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改公辅消耗记录
|
* 修改公辅消耗记录
|
||||||
|
|||||||
@@ -70,14 +70,14 @@ public class EqpAuxiliaryConsumeServiceImpl implements IEqpAuxiliaryConsumeServi
|
|||||||
* 新增公辅消耗记录
|
* 新增公辅消耗记录
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(EqpAuxiliaryConsumeBo bo) {
|
public Long insertByBo(EqpAuxiliaryConsumeBo bo) {
|
||||||
EqpAuxiliaryConsume add = BeanUtil.toBean(bo, EqpAuxiliaryConsume.class);
|
EqpAuxiliaryConsume add = BeanUtil.toBean(bo, EqpAuxiliaryConsume.class);
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
if (flag) {
|
if (flag) {
|
||||||
bo.setConsumeId(add.getConsumeId());
|
bo.setConsumeId(add.getConsumeId());
|
||||||
}
|
}
|
||||||
return flag;
|
return add.getConsumeId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
44
klp-ui/src/api/eqp/auxiliaryConsume.js
Normal file
44
klp-ui/src/api/eqp/auxiliaryConsume.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询公辅消耗记录列表
|
||||||
|
export function listAuxiliaryConsume(query) {
|
||||||
|
return request({
|
||||||
|
url: '/eqp/auxiliaryConsume/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询公辅消耗记录详细
|
||||||
|
export function getAuxiliaryConsume(consumeId) {
|
||||||
|
return request({
|
||||||
|
url: '/eqp/auxiliaryConsume/' + consumeId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增公辅消耗记录
|
||||||
|
export function addAuxiliaryConsume(data) {
|
||||||
|
return request({
|
||||||
|
url: '/eqp/auxiliaryConsume',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改公辅消耗记录
|
||||||
|
export function updateAuxiliaryConsume(data) {
|
||||||
|
return request({
|
||||||
|
url: '/eqp/auxiliaryConsume',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除公辅消耗记录
|
||||||
|
export function delAuxiliaryConsume(consumeId) {
|
||||||
|
return request({
|
||||||
|
url: '/eqp/auxiliaryConsume/' + consumeId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
44
klp-ui/src/api/eqp/auxiliaryType.js
Normal file
44
klp-ui/src/api/eqp/auxiliaryType.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询公辅类型列表
|
||||||
|
export function listAuxiliaryType(query) {
|
||||||
|
return request({
|
||||||
|
url: '/eqp/auxiliaryType/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询公辅类型详细
|
||||||
|
export function getAuxiliaryType(typeId) {
|
||||||
|
return request({
|
||||||
|
url: '/eqp/auxiliaryType/' + typeId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增公辅类型
|
||||||
|
export function addAuxiliaryType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/eqp/auxiliaryType',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改公辅类型
|
||||||
|
export function updateAuxiliaryType(data) {
|
||||||
|
return request({
|
||||||
|
url: '/eqp/auxiliaryType',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除公辅类型
|
||||||
|
export function delAuxiliaryType(typeId) {
|
||||||
|
return request({
|
||||||
|
url: '/eqp/auxiliaryType/' + typeId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
298
klp-ui/src/views/ems/assisted/record.vue
Normal file
298
klp-ui/src/views/ems/assisted/record.vue
Normal file
@@ -0,0 +1,298 @@
|
|||||||
|
<template>
|
||||||
|
<div class="assisted-table-container">
|
||||||
|
<div class="left-panel">
|
||||||
|
<el-menu
|
||||||
|
:default-active="currentLine"
|
||||||
|
class="line-menu"
|
||||||
|
@select="handleLineSelect"
|
||||||
|
>
|
||||||
|
<el-menu-item index="">全部</el-menu-item>
|
||||||
|
<el-menu-item
|
||||||
|
v-for="item in dict.type.sys_lines"
|
||||||
|
:key="item.value"
|
||||||
|
:index="item.value"
|
||||||
|
>
|
||||||
|
{{ item.label }}
|
||||||
|
</el-menu-item>
|
||||||
|
</el-menu>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="right-panel" v-loading="rightLoading">
|
||||||
|
<div v-if="!currentLine" class="empty-state">
|
||||||
|
<el-empty description="请选择产线" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else-if="!auxiliaryTypes.length" class="empty-state">
|
||||||
|
<el-empty description="该产线下暂无公辅类型" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else>
|
||||||
|
<div style="margin-bottom: 16px; display: flex; align-items: center; flex-wrap: wrap; gap: 10px;">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="selectedMonth"
|
||||||
|
type="month"
|
||||||
|
placeholder="选择月份"
|
||||||
|
format="yyyy-MM"
|
||||||
|
value-format="yyyy-MM"
|
||||||
|
@change="handleMonthChange"
|
||||||
|
style="width: 150px;"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-button icon="el-icon-refresh" @click="handleRefresh">刷新</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="margin-bottom: 16px; padding: 10px; background: #f5f7fa; border-radius: 4px;">
|
||||||
|
<el-checkbox v-model="configOptions.showSumRow">显示求和行</el-checkbox>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table :data="tableData" style="width: 100%" border :show-summary="configOptions.showSumRow" :summary-method="getSummaries">
|
||||||
|
<el-table-column prop="date" label="日期" width="120" />
|
||||||
|
<el-table-column v-for="type in auxiliaryTypes" :key="type.typeId" :prop="'type_' + type.typeId" :label="type.typeName">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<input v-model="scope.row['type_' + type.typeId].consume" class="nob"
|
||||||
|
@change="(e) => handleCellChange(scope.row, type.typeId)" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listAuxiliaryType } from "@/api/eqp/auxiliaryType";
|
||||||
|
import { listAuxiliaryConsume, updateAuxiliaryConsume, addAuxiliaryConsume } from "@/api/eqp/auxiliaryConsume";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AuxiliaryRecord",
|
||||||
|
dicts: ['sys_lines'],
|
||||||
|
data() {
|
||||||
|
const currentMonth = dayjs().format("YYYY-MM");
|
||||||
|
|
||||||
|
return {
|
||||||
|
auxiliaryTypes: [],
|
||||||
|
currentLine: "",
|
||||||
|
tableData: [],
|
||||||
|
rightLoading: false,
|
||||||
|
selectedMonth: currentMonth,
|
||||||
|
originalData: [],
|
||||||
|
configOptions: {
|
||||||
|
showSumRow: false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async handleRefresh() {
|
||||||
|
if (this.currentLine) {
|
||||||
|
this.rightLoading = true;
|
||||||
|
await this.loadAllData();
|
||||||
|
this.rightLoading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async handleLineSelect(index) {
|
||||||
|
this.currentLine = index;
|
||||||
|
this.rightLoading = true;
|
||||||
|
await this.loadAllData();
|
||||||
|
this.rightLoading = false;
|
||||||
|
},
|
||||||
|
|
||||||
|
async handleMonthChange() {
|
||||||
|
if (this.currentLine) {
|
||||||
|
this.rightLoading = true;
|
||||||
|
await this.loadAllData();
|
||||||
|
this.rightLoading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async loadAllData() {
|
||||||
|
await this.loadAuxiliaryTypes();
|
||||||
|
await this.loadAuxiliaryConsumes();
|
||||||
|
},
|
||||||
|
|
||||||
|
async loadAuxiliaryTypes() {
|
||||||
|
const params = { pageSize: 999 };
|
||||||
|
if (this.currentLine) {
|
||||||
|
params.lineName = this.currentLine;
|
||||||
|
}
|
||||||
|
const res = await listAuxiliaryType(params);
|
||||||
|
this.auxiliaryTypes = res.rows || [];
|
||||||
|
},
|
||||||
|
|
||||||
|
async loadAuxiliaryConsumes() {
|
||||||
|
const startDate = dayjs(this.selectedMonth).startOf('month').format('YYYY-MM-DD') + ' 00:00:00';
|
||||||
|
const endDate = dayjs(this.selectedMonth).endOf('month').format('YYYY-MM-DD') + ' 23:59:59';
|
||||||
|
|
||||||
|
const res = await listAuxiliaryConsume({
|
||||||
|
recordStartDate: startDate,
|
||||||
|
recordEndDate: endDate
|
||||||
|
});
|
||||||
|
this.originalData = res.rows || [];
|
||||||
|
this.processTableData(res.rows || []);
|
||||||
|
},
|
||||||
|
|
||||||
|
processTableData(records) {
|
||||||
|
const dateMap = new Map();
|
||||||
|
|
||||||
|
records.forEach(record => {
|
||||||
|
const dateStr = dayjs(record.recordDate).format('YYYY-MM-DD');
|
||||||
|
if (!dateMap.has(dateStr)) {
|
||||||
|
dateMap.set(dateStr, {
|
||||||
|
date: dateStr
|
||||||
|
});
|
||||||
|
}
|
||||||
|
dateMap.get(dateStr)['type_' + record.typeId] = {
|
||||||
|
consumeId: record.consumeId,
|
||||||
|
consume: record.consume,
|
||||||
|
remark: record.remark
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
const monthDates = this.generateMonthDates(this.selectedMonth);
|
||||||
|
|
||||||
|
this.tableData = monthDates.map(date => {
|
||||||
|
const row = {
|
||||||
|
date: date
|
||||||
|
};
|
||||||
|
|
||||||
|
this.auxiliaryTypes.forEach(type => {
|
||||||
|
if (dateMap.has(date) && dateMap.get(date)['type_' + type.typeId]) {
|
||||||
|
row['type_' + type.typeId] = dateMap.get(date)['type_' + type.typeId];
|
||||||
|
} else {
|
||||||
|
row['type_' + type.typeId] = {
|
||||||
|
consumeId: null,
|
||||||
|
consume: 0,
|
||||||
|
remark: ''
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return row;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.tableData.sort((a, b) => {
|
||||||
|
return new Date(a.date) - new Date(b.date);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
generateMonthDates(month) {
|
||||||
|
const dates = [];
|
||||||
|
const start = dayjs(month).startOf('month');
|
||||||
|
const end = dayjs(month).endOf('month');
|
||||||
|
|
||||||
|
let current = start;
|
||||||
|
while (current.isBefore(end) || current.isSame(end, 'day')) {
|
||||||
|
dates.push(current.format('YYYY-MM-DD'));
|
||||||
|
current = current.add(1, 'day');
|
||||||
|
}
|
||||||
|
|
||||||
|
return dates;
|
||||||
|
},
|
||||||
|
|
||||||
|
async handleCellChange(row, typeId) {
|
||||||
|
const cellData = row['type_' + typeId];
|
||||||
|
const record = {
|
||||||
|
consumeId: cellData.consumeId,
|
||||||
|
typeId: typeId,
|
||||||
|
consume: cellData.consume,
|
||||||
|
recordDate: row.date,
|
||||||
|
remark: cellData.remark
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (cellData.consumeId) {
|
||||||
|
await updateAuxiliaryConsume(record);
|
||||||
|
} else {
|
||||||
|
const { data: newRecordId } = await addAuxiliaryConsume(record);
|
||||||
|
cellData.consumeId = newRecordId;
|
||||||
|
this.originalData.push({
|
||||||
|
...record,
|
||||||
|
consumeId: newRecordId
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.$message.success('保存成功');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('保存失败:', error);
|
||||||
|
this.$message.error('保存失败');
|
||||||
|
this.loadAuxiliaryConsumes();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getSummaries(param) {
|
||||||
|
const { columns, data } = param;
|
||||||
|
const sums = [];
|
||||||
|
|
||||||
|
if (!this.configOptions.showSumRow) {
|
||||||
|
return sums;
|
||||||
|
}
|
||||||
|
|
||||||
|
columns.forEach((column, index) => {
|
||||||
|
if (index === 0) {
|
||||||
|
sums[index] = '合计';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const prop = column.property;
|
||||||
|
if (prop && prop.startsWith('type_')) {
|
||||||
|
const values = data.map(item => Number(item[prop]?.consume) || 0);
|
||||||
|
const sum = values.reduce((prev, curr) => prev + curr, 0);
|
||||||
|
sums[index] = sum.toFixed(2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sums[index] = '';
|
||||||
|
});
|
||||||
|
|
||||||
|
return sums;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.assisted-table-container {
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-panel {
|
||||||
|
width: 200px;
|
||||||
|
border-right: 1px solid #e6e6e6;
|
||||||
|
padding: 16px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line-menu {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-panel {
|
||||||
|
flex: 1;
|
||||||
|
padding: 16px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.empty-state {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nob {
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
line-height: 23px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nob:focus {
|
||||||
|
border: 1px dotted black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
386
klp-ui/src/views/ems/assisted/type.vue
Normal file
386
klp-ui/src/views/ems/assisted/type.vue
Normal file
@@ -0,0 +1,386 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div class="main-layout">
|
||||||
|
<div class="left-menu">
|
||||||
|
<el-menu
|
||||||
|
:default-active="currentLine"
|
||||||
|
class="line-menu"
|
||||||
|
@select="handleLineSelect"
|
||||||
|
>
|
||||||
|
<el-menu-item index="">全部</el-menu-item>
|
||||||
|
<el-menu-item
|
||||||
|
v-for="item in dict.type.sys_lines"
|
||||||
|
:key="item.value"
|
||||||
|
:index="item.value"
|
||||||
|
>
|
||||||
|
{{ item.label }}
|
||||||
|
</el-menu-item>
|
||||||
|
</el-menu>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="right-content">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
||||||
|
<el-form-item label="公辅类型名称" prop="typeName">
|
||||||
|
<el-input v-model="queryParams.typeName" placeholder="请输入公辅类型名称" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||||||
|
@click="handleUpdate">修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
||||||
|
@click="handleDelete">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<div v-loading="loading" class="card-list">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="8" v-for="item in auxiliaryTypeList" :key="item.typeId">
|
||||||
|
<el-card :class="['auxiliary-card', { 'selected': ids.includes(item.typeId) }]" shadow="hover" @click.native="handleCardClick(item)">
|
||||||
|
<div class="card-header">
|
||||||
|
<span class="card-title">{{ item.typeName }}</span>
|
||||||
|
<el-tag size="mini" type="info">{{ item.lineName }}</el-tag>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="card-info">
|
||||||
|
<span class="info-label">备注:</span>
|
||||||
|
<span class="info-value">{{ item.remark || '-' }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="card-footer">
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="handleUpdate(item)">修改</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="handleDelete(item)">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-empty v-if="auxiliaryTypeList.length === 0 && !loading" description="暂无数据" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="公辅类型名称" prop="typeName">
|
||||||
|
<el-input v-model="form.typeName" placeholder="请输入公辅类型名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产线名称" prop="lineName">
|
||||||
|
<el-select v-model="form.lineName" placeholder="请选择产线名称">
|
||||||
|
<el-option v-for="item in dict.type.sys_lines" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listAuxiliaryType, getAuxiliaryType, delAuxiliaryType, addAuxiliaryType, updateAuxiliaryType } from "@/api/eqp/auxiliaryType";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AuxiliaryType",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 按钮loading
|
||||||
|
buttonLoading: false,
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 公辅类型表格数据
|
||||||
|
auxiliaryTypeList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 当前选中的产线
|
||||||
|
currentLine: "",
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
typeName: undefined,
|
||||||
|
lineName: undefined,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
typeId: [
|
||||||
|
{ required: true, message: "公辅类型ID不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
typeName: [
|
||||||
|
{ required: true, message: "公辅类型名称不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
lineName: [
|
||||||
|
{ required: true, message: "产线名称不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
remark: [
|
||||||
|
{ required: false, message: "备注不能为空", trigger: "blur" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
dicts: ['sys_lines'],
|
||||||
|
methods: {
|
||||||
|
/** 产线选择 */
|
||||||
|
handleLineSelect(index) {
|
||||||
|
this.currentLine = index;
|
||||||
|
this.queryParams.lineName = index || undefined;
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 卡片点击 */
|
||||||
|
handleCardClick(row) {
|
||||||
|
// 切换选中状态
|
||||||
|
const index = this.ids.indexOf(row.typeId);
|
||||||
|
if (index > -1) {
|
||||||
|
this.ids.splice(index, 1);
|
||||||
|
} else {
|
||||||
|
this.ids = [row.typeId];
|
||||||
|
}
|
||||||
|
this.single = this.ids.length !== 1;
|
||||||
|
this.multiple = !this.ids.length;
|
||||||
|
},
|
||||||
|
/** 查询公辅类型列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listAuxiliaryType(this.queryParams).then(response => {
|
||||||
|
this.auxiliaryTypeList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
typeId: undefined,
|
||||||
|
typeName: undefined,
|
||||||
|
lineName: undefined,
|
||||||
|
createBy: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
delFlag: undefined,
|
||||||
|
remark: undefined
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.typeId)
|
||||||
|
this.single = selection.length !== 1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加公辅类型";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.loading = true;
|
||||||
|
this.reset();
|
||||||
|
const typeId = row.typeId || this.ids
|
||||||
|
getAuxiliaryType(typeId).then(response => {
|
||||||
|
this.loading = false;
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改公辅类型";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.buttonLoading = true;
|
||||||
|
if (this.form.typeId != null) {
|
||||||
|
updateAuxiliaryType(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addAuxiliaryType(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const typeIds = row.typeId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除公辅类型编号为"' + typeIds + '"的数据项?').then(() => {
|
||||||
|
this.loading = true;
|
||||||
|
return delAuxiliaryType(typeIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('eqp/auxiliaryType/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `auxiliaryType_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.main-layout {
|
||||||
|
display: flex;
|
||||||
|
height: calc(100vh - 84px);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-menu {
|
||||||
|
width: 200px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-title {
|
||||||
|
padding: 16px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
border-bottom: 1px solid #e6e6e6;
|
||||||
|
background: #f5f7fa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line-menu {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right-content {
|
||||||
|
flex: 1;
|
||||||
|
padding: 0 16px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-list {
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auxiliary-card {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auxiliary-card:hover {
|
||||||
|
transform: translateY(-4px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.auxiliary-card.selected {
|
||||||
|
border: 1px solid #409eff;
|
||||||
|
background: #b5d9fc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-title {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-body {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-info {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-info:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-label {
|
||||||
|
color: #909399;
|
||||||
|
min-width: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-value {
|
||||||
|
color: #606266;
|
||||||
|
flex: 1;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding-top: 12px;
|
||||||
|
border-top: 1px solid #f0f0f0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
374
klp-ui/src/views/wms/report/abnormal.vue
Normal file
374
klp-ui/src/views/wms/report/abnormal.vue
Normal file
@@ -0,0 +1,374 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container" v-loading="loading">
|
||||||
|
<el-row>
|
||||||
|
<el-form label-width="80px" inline>
|
||||||
|
<el-form-item label="时间">
|
||||||
|
<time-range-picker v-model="timeRangeParams" start-key="startTime" end-key="endTime"
|
||||||
|
:default-start-time="queryParams.startTime" :default-end-time="queryParams.endTime"
|
||||||
|
@quick-select="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产线" prop="lineId">
|
||||||
|
<el-select style="width: 200px;" v-model="actionTypes" placeholder="请选择产线" clearable @change="handleQuery">
|
||||||
|
<el-option label="全部" value="" />
|
||||||
|
<el-option v-for="line in lineOptions" :key="line.value" :label="line.label" :value="line.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<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">
|
||||||
|
<muti-select style="width: 200px;" v-model="queryParams.itemMaterial" :options="dict.type.coil_material"
|
||||||
|
placeholder="请选择材质" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="厂家" prop="itemManufacturer">
|
||||||
|
<muti-select style="width: 200px;" v-model="queryParams.itemManufacturer"
|
||||||
|
:options="dict.type.coil_manufacturer" placeholder="请选择厂家" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="getList">查询</el-button>
|
||||||
|
<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-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-descriptions title="统计信息" :column="3" border>
|
||||||
|
<el-descriptions-item label="产出数量">{{ summary.outCount }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="产出总重">{{ summary.outTotalWeight }}t</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="产出均重">{{ summary.outAvgWeight }}t</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item label="消耗数量">{{ summary.lossCount }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="消耗总重">{{ summary.lossTotalWeight }}t</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="消耗均重">{{ summary.lossAvgWeight }}t</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item label="数量差值">{{ summary.countDiff }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="总重差值">{{ summary.weightDiff }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="均重差值">{{ summary.avgWeightDiff }}t</el-descriptions-item>
|
||||||
|
<!-- <el-descriptions-item label="合计均重">{{ summary.totalAvgWeight }}t</el-descriptions-item> -->
|
||||||
|
|
||||||
|
<!-- 成品率 -->
|
||||||
|
<el-descriptions-item label="成品率">{{ summary.passRate }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="损耗率">{{ summary.lossRate }}</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>
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||||
|
<el-radio-group v-model="activeColumnConfig">
|
||||||
|
<!-- <el-radio-button label="coil-report-loss">投入明细配置</el-radio-button> -->
|
||||||
|
<el-radio-button label="coil-report-output">产出明细配置</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listCoilWithIds } from "@/api/wms/coil";
|
||||||
|
import {
|
||||||
|
listPendingAction,
|
||||||
|
} from '@/api/wms/pendingAction';
|
||||||
|
import MemoInput from "@/components/MemoInput";
|
||||||
|
import MutiSelect from "@/components/MutiSelect";
|
||||||
|
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||||
|
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||||
|
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 TimeRangePicker from "@/views/wms/report/components/timeRangePicker.vue";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'MergeTemplate',
|
||||||
|
components: {
|
||||||
|
MemoInput,
|
||||||
|
MutiSelect,
|
||||||
|
ProductInfo,
|
||||||
|
RawMaterialInfo,
|
||||||
|
CoilNo,
|
||||||
|
CoilTable,
|
||||||
|
ColumnsSetting,
|
||||||
|
TimeRangePicker
|
||||||
|
},
|
||||||
|
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||||
|
data() {
|
||||||
|
// 工具函数:个位数补零
|
||||||
|
const addZero = (num) => num.toString().padStart(2, '0')
|
||||||
|
|
||||||
|
// 获取当前日期(默认选中当天)
|
||||||
|
const now = new Date()
|
||||||
|
const currentDate = `${now.getFullYear()}-${addZero(now.getMonth() + 1)}`
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成指定日期/月份的时间范围字符串
|
||||||
|
* @param {string} dateStr - 支持格式:yyyy-MM(月份) 或 yyyy-MM-dd(具体日期)
|
||||||
|
* @returns {object} 包含start(开始时间)和end(结束时间)的对象
|
||||||
|
*/
|
||||||
|
const getDayTimeRange = (dateStr) => {
|
||||||
|
// 先校验输入格式是否合法
|
||||||
|
const monthPattern = /^\d{4}-\d{2}$/; // yyyy-MM 正则
|
||||||
|
const dayPattern = /^\d{4}-\d{2}-\d{2}$/; // yyyy-MM-dd 正则
|
||||||
|
|
||||||
|
if (!monthPattern.test(dateStr) && !dayPattern.test(dateStr)) {
|
||||||
|
throw new Error('输入格式错误,请传入 yyyy-MM 或 yyyy-MM-dd 格式的字符串');
|
||||||
|
}
|
||||||
|
|
||||||
|
let startDate, endDate;
|
||||||
|
|
||||||
|
if (monthPattern.test(dateStr)) {
|
||||||
|
// 处理 yyyy-MM 格式:获取本月第一天和最后一天
|
||||||
|
const [year, month] = dateStr.split('-').map(Number);
|
||||||
|
// 月份是0基的(0=1月,1=2月...),所以要减1
|
||||||
|
// 第一天: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 {
|
||||||
|
// 处理 yyyy-MM-dd 格式:直接使用传入的日期
|
||||||
|
startDate = dateStr;
|
||||||
|
endDate = dateStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 拼接时间部分
|
||||||
|
return {
|
||||||
|
start: `${startDate} 00:00:00`,
|
||||||
|
end: `${endDate} 23:59:59`
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const { start, end } = getDayTimeRange(currentDate)
|
||||||
|
return {
|
||||||
|
lossList: [],
|
||||||
|
outList: [],
|
||||||
|
activeTab: 'loss',
|
||||||
|
activeColumnConfig: 'coil-report-loss',
|
||||||
|
settingVisible: false,
|
||||||
|
loading: false,
|
||||||
|
timeRangeParams: {
|
||||||
|
startTime: start,
|
||||||
|
endTime: end
|
||||||
|
},
|
||||||
|
queryParams: {
|
||||||
|
startTime: start,
|
||||||
|
endTime: end,
|
||||||
|
lineId: '',
|
||||||
|
enterCoilNo: '',
|
||||||
|
currentCoilNo: '',
|
||||||
|
warehouseId: '',
|
||||||
|
itemName: '',
|
||||||
|
itemSpecification: '',
|
||||||
|
itemMaterial: '',
|
||||||
|
itemManufacturer: '',
|
||||||
|
pageSize: 9999,
|
||||||
|
pageNum: 1,
|
||||||
|
},
|
||||||
|
lossColumns: [],
|
||||||
|
outputColumns: [],
|
||||||
|
actionTypes: '',
|
||||||
|
lineOptions: [
|
||||||
|
{ label: '酸轧线', value: '11,120,201,520' },
|
||||||
|
{ label: '镀锌线', value: '202,501,521' },
|
||||||
|
{ label: '双机架', value: '205,504,524' },
|
||||||
|
{ label: '镀铬线', value: '206,505,525' },
|
||||||
|
{ label: '拉矫线', value: '204,503,523' },
|
||||||
|
{ label: '脱脂线', value: '203,502,522' },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
summary() {
|
||||||
|
return calcSummary(this.outList, this.lossList)
|
||||||
|
},
|
||||||
|
mSummary() {
|
||||||
|
return calcMSummary(this.outList, this.lossList)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
timeRangeParams: {
|
||||||
|
handler(newVal) {
|
||||||
|
this.queryParams.startTime = newVal.startTime
|
||||||
|
this.queryParams.endTime = newVal.endTime
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.handleQuery()
|
||||||
|
this.loadColumns()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleQuery() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
async getList() {
|
||||||
|
this.loading = true;
|
||||||
|
const actions = await listPendingAction({ ...this.queryParams, actionTypes: this.actionTypes, actionStatus: 2 });
|
||||||
|
|
||||||
|
const outIds = actions.rows.map(item => item.processedCoilIds).join(',');
|
||||||
|
|
||||||
|
if (!outIds) {
|
||||||
|
this.outList = []
|
||||||
|
this.loading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const outRes = await listCoilWithIds({ ...this.queryParams, coilIds: outIds || '', startTime: '', endTime: '', minAbnormalCount: 1 });
|
||||||
|
this.outList = outRes.rows.map(item => {
|
||||||
|
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||||
|
const [thickness, width] = item.specification?.split('*') || []
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
computedThickness: parseFloat(thickness),
|
||||||
|
computedWidth: parseFloat(width),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const lossIds = this.outList.map(item => item.parentCoilId).join(',');
|
||||||
|
if (!lossIds) {
|
||||||
|
this.lossList = []
|
||||||
|
this.loading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const lossRes = await listCoilWithIds({ ...this.queryParams, coilIds: lossIds || '', startTime: '', endTime: '' });
|
||||||
|
this.lossList = lossRes.rows.map(item => {
|
||||||
|
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||||
|
const [thickness, width] = item.specification?.split('*') || []
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
computedThickness: parseFloat(thickness),
|
||||||
|
computedWidth: parseFloat(width),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// if (!lossIds) {
|
||||||
|
// this.lossList = []
|
||||||
|
// } else {
|
||||||
|
// const lossRes = await listCoilWithIds({ ...this.queryParams, coilIds: lossIds || '', startTime: '', endTime: '' });
|
||||||
|
|
||||||
|
// this.lossList = lossRes.rows.map(item => {
|
||||||
|
// // 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||||
|
// const [thickness, width] = item.specification?.split('*') || []
|
||||||
|
// return {
|
||||||
|
// ...item,
|
||||||
|
// computedThickness: parseFloat(thickness),
|
||||||
|
// computedWidth: parseFloat(width),
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
this.loading = false;
|
||||||
|
|
||||||
|
// this.loading = true;
|
||||||
|
// const res1 = await listPendingAction({ ...this.queryParams, actionTypes: '201,202,203,204,205,206', actionStatus: 2 });
|
||||||
|
|
||||||
|
// const res = res1.rows;
|
||||||
|
// // 获取两层数据
|
||||||
|
// const lossIds = res.map(item => item.coilId);
|
||||||
|
// // 使用new Set去重
|
||||||
|
// const outIds = [...new Set(res.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, coilIds: lossIds.join(',') || '', startTime: '', endTime: '' }),
|
||||||
|
// listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '', startTime: '', endTime: '' }),
|
||||||
|
// ]);
|
||||||
|
// 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),
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// this.loading = false;
|
||||||
|
},
|
||||||
|
// 导出
|
||||||
|
exportData() {
|
||||||
|
if (this.outList.length === 0) {
|
||||||
|
this.$message.warning('暂无数据可导出')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.download('wms/materialCoil/export', {
|
||||||
|
coilIds: this.outList.map(item => item.coilId).join(',')
|
||||||
|
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
exportLossData() {
|
||||||
|
if (this.lossList.length === 0) {
|
||||||
|
this.$message.warning('暂无数据可导出')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.download('wms/materialCoil/export', {
|
||||||
|
coilIds: this.lossList.map(item => item.coilId).join(',')
|
||||||
|
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
// 加载列设置
|
||||||
|
loadColumns() {
|
||||||
|
// this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
|
||||||
|
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
@@ -103,10 +103,12 @@ export default {
|
|||||||
},
|
},
|
||||||
handleTimeChange() {
|
handleTimeChange() {
|
||||||
this.$emit('input', {
|
this.$emit('input', {
|
||||||
|
...this.value,
|
||||||
[this.startKey]: this.startTime,
|
[this.startKey]: this.startTime,
|
||||||
[this.endKey]: this.endTime
|
[this.endKey]: this.endTime
|
||||||
})
|
})
|
||||||
this.$emit('change', {
|
this.$emit('change', {
|
||||||
|
...this.value,
|
||||||
[this.startKey]: this.startTime,
|
[this.startKey]: this.startTime,
|
||||||
[this.endKey]: this.endTime
|
[this.endKey]: this.endTime
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export const dugeConfig = {
|
export const dugeConfig = {
|
||||||
actionTypes: [505, 120],
|
actionTypes: [505],
|
||||||
actionQueryParams: {
|
actionQueryParams: {
|
||||||
createBys: 'dugekuguan'
|
createBys: 'dugekuguan'
|
||||||
},
|
},
|
||||||
@@ -17,7 +17,7 @@ export const dugeConfig = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const lajiaoConfig = {
|
export const lajiaoConfig = {
|
||||||
actionTypes: [503, 120],
|
actionTypes: [503],
|
||||||
actionQueryParams: {
|
actionQueryParams: {
|
||||||
updateBys: 'lajiaokuguan'
|
updateBys: 'lajiaokuguan'
|
||||||
},
|
},
|
||||||
@@ -35,7 +35,7 @@ export const lajiaoConfig = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const shuangConfig = {
|
export const shuangConfig = {
|
||||||
actionTypes: [504, 120],
|
actionTypes: [504],
|
||||||
actionQueryParams: {
|
actionQueryParams: {
|
||||||
createBys: 'shuangkuguan'
|
createBys: 'shuangkuguan'
|
||||||
},
|
},
|
||||||
@@ -53,7 +53,7 @@ export const shuangConfig = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const tuozhiConfig = {
|
export const tuozhiConfig = {
|
||||||
actionTypes: [502, 120],
|
actionTypes: [502],
|
||||||
actionQueryParams: {
|
actionQueryParams: {
|
||||||
createBys: 'tuozhikuguan'
|
createBys: 'tuozhikuguan'
|
||||||
},
|
},
|
||||||
@@ -93,7 +93,7 @@ export const suanzhaConfig = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const zincConfig = {
|
export const zincConfig = {
|
||||||
actionTypes: [501, 120],
|
actionTypes: [501],
|
||||||
actionQueryParams: {
|
actionQueryParams: {
|
||||||
createBys: 'duxinkuguan'
|
createBys: 'duxinkuguan'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-descriptions title="统计信息" :column="3" border>
|
<el-descriptions title="统计信息" :column="3" border>
|
||||||
<el-descriptions-item label="产出数量">{{ summary.outCount }}</el-descriptions-item>
|
<el-descriptions-item label="产出数量">{{ summary.outCount }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="产出总重">{{ summary.outTotalWeight }}t</el-descriptions-item>
|
<el-descriptions-item label="产出总重">{{ summary.outTotalWeight }}t</el-descriptions-item>
|
||||||
<el-descriptions-item label="产出均重">{{ summary.outAvgWeight }}t</el-descriptions-item>
|
<el-descriptions-item label="产出均重">{{ summary.outAvgWeight }}t</el-descriptions-item>
|
||||||
@@ -52,20 +52,21 @@
|
|||||||
<el-descriptions-item label="消耗总重">{{ summary.lossTotalWeight }}t</el-descriptions-item>
|
<el-descriptions-item label="消耗总重">{{ summary.lossTotalWeight }}t</el-descriptions-item>
|
||||||
<el-descriptions-item label="消耗均重">{{ summary.lossAvgWeight }}t</el-descriptions-item>
|
<el-descriptions-item label="消耗均重">{{ summary.lossAvgWeight }}t</el-descriptions-item>
|
||||||
|
|
||||||
<el-descriptions-item label="合计数量">{{ summary.totalCount }}</el-descriptions-item>
|
<el-descriptions-item label="数量差值">{{ summary.countDiff }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="合计总重">{{ summary.totalWeight }}t</el-descriptions-item>
|
<el-descriptions-item label="总重差值">{{ summary.weightDiff }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="合计均重">{{ summary.totalAvgWeight }}t</el-descriptions-item>
|
<el-descriptions-item label="均重差值">{{ summary.avgWeightDiff }}t</el-descriptions-item>
|
||||||
|
<!-- <el-descriptions-item label="合计均重">{{ summary.totalAvgWeight }}t</el-descriptions-item> -->
|
||||||
|
|
||||||
<!-- 成品率 -->
|
<!-- 成品率 -->
|
||||||
<el-descriptions-item label="成品率">{{ summary.passRate }}</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.lossRate }}</el-descriptions-item>
|
||||||
<!-- 异常率 -->
|
<!-- 异常率 -->
|
||||||
<el-descriptions-item label="异常率">{{ summary.abRate }}</el-descriptions-item>
|
<el-descriptions-item label="异常率">{{ summary.abRate }}</el-descriptions-item>
|
||||||
<!-- 正品率 -->
|
<!-- 正品率 -->
|
||||||
<el-descriptions-item label="正品率">{{ summary.passRate2 }}</el-descriptions-item>
|
<el-descriptions-item label="正品率">{{ summary.passRate2 }}</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
|
|
||||||
<!-- 已处理M统计信息 -->
|
<!-- 已处理M统计信息 -->
|
||||||
<!-- <el-descriptions title="已处理M统计信息" :column="3" border>
|
<!-- <el-descriptions title="已处理M统计信息" :column="3" border>
|
||||||
<el-descriptions-item label="产出数量">{{ mSummary.outCount }}</el-descriptions-item>
|
<el-descriptions-item label="产出数量">{{ mSummary.outCount }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="产出总重">{{ mSummary.outTotalWeight }}t</el-descriptions-item>
|
<el-descriptions-item label="产出总重">{{ mSummary.outTotalWeight }}t</el-descriptions-item>
|
||||||
@@ -75,10 +76,9 @@
|
|||||||
<el-descriptions-item label="消耗总重">{{ mSummary.lossTotalWeight }}t</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.lossAvgWeight }}t</el-descriptions-item>
|
||||||
|
|
||||||
<el-descriptions-item label="合计数量">{{ mSummary.totalCount }}</el-descriptions-item>
|
<el-descriptions-item label="数量差值">{{ mSummary.countDiff }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="合计总重">{{ mSummary.totalWeight }}t</el-descriptions-item>
|
<el-descriptions-item label="总重差值">{{ mSummary.weightDiff }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="合计均重">{{ mSummary.totalAvgWeight }}t</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.passRate }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="损耗率">{{ mSummary.lossRate }}</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.abRate }}</el-descriptions-item>
|
||||||
@@ -227,15 +227,9 @@ export default {
|
|||||||
},
|
},
|
||||||
async getList() {
|
async getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const res1 = await listPendingAction({ ...this.queryParams, actionType: 201, actionStatus: 2 });
|
const res1 = await listPendingAction({ ...this.queryParams, actionTypes: '201,202,203,204,205,206', actionStatus: 2 });
|
||||||
const res2 = await listPendingAction({ ...this.queryParams, actionType: 202, actionStatus: 2 });
|
|
||||||
|
|
||||||
const res3 = await listPendingAction({ ...this.queryParams, actionType: 203, actionStatus: 2 });
|
const res = res1.rows;
|
||||||
const res4 = await listPendingAction({ ...this.queryParams, actionType: 204, actionStatus: 2 });
|
|
||||||
const res5 = await listPendingAction({ ...this.queryParams, actionType: 205, actionStatus: 2 });
|
|
||||||
const res6 = await listPendingAction({ ...this.queryParams, actionType: 206, actionStatus: 2 });
|
|
||||||
|
|
||||||
const res = res1.rows.concat(res2.rows, res3.rows, res4.rows, res5.rows, res6.rows);
|
|
||||||
// 获取两层数据
|
// 获取两层数据
|
||||||
const lossIds = res.map(item => item.coilId);
|
const lossIds = res.map(item => item.coilId);
|
||||||
// 使用new Set去重
|
// 使用new Set去重
|
||||||
|
|||||||
14
klp-ui/src/views/wms/report/repair/acid.vue
Normal file
14
klp-ui/src/views/wms/report/repair/acid.vue
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<merge-template :actionType="520"></merge-template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import mergeTemplate from "@/views/wms/report/template/merge.vue";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
mergeTemplate,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
14
klp-ui/src/views/wms/report/repair/duge.vue
Normal file
14
klp-ui/src/views/wms/report/repair/duge.vue
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<merge-template :actionType="525"></merge-template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import mergeTemplate from "@/views/wms/report/template/merge.vue";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
mergeTemplate,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
300
klp-ui/src/views/wms/report/repair/index.vue
Normal file
300
klp-ui/src/views/wms/report/repair/index.vue
Normal file
@@ -0,0 +1,300 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container" v-loading="loading">
|
||||||
|
<el-row>
|
||||||
|
<el-form label-width="80px" inline>
|
||||||
|
<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-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>
|
||||||
|
<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">
|
||||||
|
<muti-select style="width: 200px;" v-model="queryParams.itemMaterial" :options="dict.type.coil_material"
|
||||||
|
placeholder="请选择材质" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="厂家" prop="itemManufacturer">
|
||||||
|
<muti-select style="width: 200px;" v-model="queryParams.itemManufacturer"
|
||||||
|
:options="dict.type.coil_manufacturer" placeholder="请选择厂家" clearable @keyup.enter.native="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="getList">查询</el-button>
|
||||||
|
<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-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-descriptions title="统计信息" :column="3" border>
|
||||||
|
<el-descriptions-item label="产出数量">{{ summary.outCount }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="产出总重">{{ summary.outTotalWeight }}t</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="产出均重">{{ summary.outAvgWeight }}t</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item label="消耗数量">{{ summary.lossCount }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="消耗总重">{{ summary.lossTotalWeight }}t</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="消耗均重">{{ summary.lossAvgWeight }}t</el-descriptions-item>
|
||||||
|
|
||||||
|
<el-descriptions-item label="合计数量">{{ summary.totalCount }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="合计总重">{{ summary.totalWeight }}t</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="合计均重">{{ summary.totalAvgWeight }}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>
|
||||||
|
<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.totalCount }}</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="合计总重">{{ mSummary.totalWeight }}t</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="合计均重">{{ mSummary.totalAvgWeight }}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="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>
|
||||||
|
|
||||||
|
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||||
|
<el-radio-group v-model="activeColumnConfig">
|
||||||
|
<el-radio-button label="coil-report-loss">投入明细配置</el-radio-button>
|
||||||
|
<el-radio-button label="coil-report-output">产出明细配置</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listCoilWithIds } from "@/api/wms/coil";
|
||||||
|
import {
|
||||||
|
listPendingAction,
|
||||||
|
} from '@/api/wms/pendingAction';
|
||||||
|
import MemoInput from "@/components/MemoInput";
|
||||||
|
import MutiSelect from "@/components/MutiSelect";
|
||||||
|
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||||
|
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||||
|
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";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'MergeTemplate',
|
||||||
|
props: {
|
||||||
|
actionType: {
|
||||||
|
type: Number,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
MemoInput,
|
||||||
|
MutiSelect,
|
||||||
|
ProductInfo,
|
||||||
|
RawMaterialInfo,
|
||||||
|
CoilNo,
|
||||||
|
CoilTable,
|
||||||
|
ColumnsSetting
|
||||||
|
},
|
||||||
|
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||||
|
data() {
|
||||||
|
// 工具函数:个位数补零
|
||||||
|
const addZero = (num) => num.toString().padStart(2, '0')
|
||||||
|
|
||||||
|
// 获取当前日期(默认选中当天)
|
||||||
|
const now = new Date()
|
||||||
|
const currentDate = `${now.getFullYear()}-${addZero(now.getMonth() + 1)}`
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成指定日期/月份的时间范围字符串
|
||||||
|
* @param {string} dateStr - 支持格式:yyyy-MM(月份) 或 yyyy-MM-dd(具体日期)
|
||||||
|
* @returns {object} 包含start(开始时间)和end(结束时间)的对象
|
||||||
|
*/
|
||||||
|
const getDayTimeRange = (dateStr) => {
|
||||||
|
// 先校验输入格式是否合法
|
||||||
|
const monthPattern = /^\d{4}-\d{2}$/; // yyyy-MM 正则
|
||||||
|
const dayPattern = /^\d{4}-\d{2}-\d{2}$/; // yyyy-MM-dd 正则
|
||||||
|
|
||||||
|
if (!monthPattern.test(dateStr) && !dayPattern.test(dateStr)) {
|
||||||
|
throw new Error('输入格式错误,请传入 yyyy-MM 或 yyyy-MM-dd 格式的字符串');
|
||||||
|
}
|
||||||
|
|
||||||
|
let startDate, endDate;
|
||||||
|
|
||||||
|
if (monthPattern.test(dateStr)) {
|
||||||
|
// 处理 yyyy-MM 格式:获取本月第一天和最后一天
|
||||||
|
const [year, month] = dateStr.split('-').map(Number);
|
||||||
|
// 月份是0基的(0=1月,1=2月...),所以要减1
|
||||||
|
// 第一天: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 {
|
||||||
|
// 处理 yyyy-MM-dd 格式:直接使用传入的日期
|
||||||
|
startDate = dateStr;
|
||||||
|
endDate = dateStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 拼接时间部分
|
||||||
|
return {
|
||||||
|
start: `${startDate} 00:00:00`,
|
||||||
|
end: `${endDate} 23:59:59`
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const { start, end } = getDayTimeRange(currentDate)
|
||||||
|
return {
|
||||||
|
lossList: [],
|
||||||
|
outList: [],
|
||||||
|
activeTab: 'loss',
|
||||||
|
activeColumnConfig: 'coil-report-loss',
|
||||||
|
settingVisible: false,
|
||||||
|
loading: false,
|
||||||
|
queryParams: {
|
||||||
|
startTime: start,
|
||||||
|
endTime: end,
|
||||||
|
enterCoilNo: '',
|
||||||
|
currentCoilNo: '',
|
||||||
|
warehouseId: '',
|
||||||
|
itemName: '',
|
||||||
|
itemSpecification: '',
|
||||||
|
itemMaterial: '',
|
||||||
|
itemManufacturer: '',
|
||||||
|
pageSize: 9999,
|
||||||
|
pageNum: 1,
|
||||||
|
},
|
||||||
|
lossColumns: [],
|
||||||
|
outputColumns: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
summary() {
|
||||||
|
return calcSummary(this.outList, this.lossList)
|
||||||
|
},
|
||||||
|
// mSummary() {
|
||||||
|
// return calcMSummary(this.outList, this.lossList)
|
||||||
|
// },
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.handleQuery()
|
||||||
|
this.loadColumns()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleQuery() {
|
||||||
|
this.getList()
|
||||||
|
},
|
||||||
|
async getList() {
|
||||||
|
this.loading = true;
|
||||||
|
const res1 = await listPendingAction({ ...this.queryParams, actionTypes: '520,521,522,523,524,525', actionStatus: 2 });
|
||||||
|
|
||||||
|
const res = res1.rows;
|
||||||
|
// 获取两层数据
|
||||||
|
const lossIds = res.map(item => item.coilId);
|
||||||
|
// const actions = res.map(item => item.actionId);
|
||||||
|
// 使用new Set去重
|
||||||
|
const outIds = [...new Set(res.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, coilIds: lossIds.join(',') || '', startTime: '', endTime: '' }),
|
||||||
|
listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '', startTime: '', endTime: '' }),
|
||||||
|
]);
|
||||||
|
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),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.loading = false;
|
||||||
|
},
|
||||||
|
// 导出
|
||||||
|
exportData() {
|
||||||
|
if (this.outList.length === 0) {
|
||||||
|
this.$message.warning('暂无数据可导出')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.download('wms/materialCoil/export', {
|
||||||
|
coilIds: this.outList.map(item => item.coilId).join(',')
|
||||||
|
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
exportLossData() {
|
||||||
|
if (this.lossList.length === 0) {
|
||||||
|
this.$message.warning('暂无数据可导出')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.download('wms/materialCoil/export', {
|
||||||
|
coilIds: this.lossList.map(item => item.coilId).join(',')
|
||||||
|
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
// 加载列设置
|
||||||
|
loadColumns() {
|
||||||
|
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
|
||||||
|
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style></style>
|
||||||
14
klp-ui/src/views/wms/report/repair/lajiao.vue
Normal file
14
klp-ui/src/views/wms/report/repair/lajiao.vue
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<merge-template :actionType="523"></merge-template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import mergeTemplate from "@/views/wms/report/template/merge.vue";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
mergeTemplate,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
14
klp-ui/src/views/wms/report/repair/shuang.vue
Normal file
14
klp-ui/src/views/wms/report/repair/shuang.vue
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<merge-template :actionType="524"></merge-template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import mergeTemplate from "@/views/wms/report/template/merge.vue";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
mergeTemplate,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
14
klp-ui/src/views/wms/report/repair/tuozhi.vue
Normal file
14
klp-ui/src/views/wms/report/repair/tuozhi.vue
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<merge-template :actionType="522"></merge-template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import mergeTemplate from "@/views/wms/report/template/merge.vue";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
mergeTemplate,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Reference in New Issue
Block a user