diff --git a/klp-ui/src/views/wms/coil/do/correntAll.vue b/klp-ui/src/views/wms/coil/do/correntAll.vue
index 90ec48b5..3e074631 100644
--- a/klp-ui/src/views/wms/coil/do/correntAll.vue
+++ b/klp-ui/src/views/wms/coil/do/correntAll.vue
@@ -181,13 +181,11 @@
回滚
+ style="position: absolute; bottom: 10px; right: 10px;" type="success" icon="el-icon-refresh" size="mini"
+ @click="handleRestoreMaterial(item)" :loading="item.cancelling" class="action-btn">回滚
强制入库
+ style="position: absolute; bottom: 10px; right: 10px;" type="success" icon="el-icon-refresh" size="mini"
+ @click="handleForceInMaterial(item)" :loading="item.cancelling" class="action-btn">强制入库
@@ -215,7 +214,8 @@
-
+
@@ -249,7 +249,8 @@
-
+
@@ -286,12 +287,14 @@
-
-
+
+
-
+
{
this.userList = response.rows || []
})
},
-
+
// 处理材料类型变化
handleMaterialTypeChange(value) {
// 清空物品选择
@@ -633,7 +637,7 @@ export default {
this.form.itemType = 'raw_material';
}
},
-
+
/** 预览标签 */
handlePreviewLabel(row) {
this.labelRender.visible = true;
@@ -644,7 +648,7 @@ export default {
updateTime: row.updateTime?.split(' ')[0] || '',
};
},
-
+
/** 追溯按钮操作 */
handleTrace(row) {
this.traceOpen = true;
@@ -662,21 +666,14 @@ export default {
this.traceLoading = false;
});
},
-
- /** 查看操作记录 */
- handleViewActions(row) {
- this.currentCoilId = row.coilId;
- this.actionDialogVisible = true;
- this.actionQueryParams.pageNum = 1;
- this.getActionList();
- },
-
+
/** 查询操作记录 */
getActionList() {
this.actionLoading = true;
const payload = {
+ ...this.materialQueryParams,
...this.actionQueryParams,
- coilId: this.currentCoilId,
+ coilIds: this.coilIds,
includeDeleted: this.rubbish ? 2 : 0
};
listPendingAction(payload).then(response => {
@@ -687,13 +684,13 @@ export default {
this.actionLoading = false;
});
},
-
+
/** 操作记录搜索 */
handleActionQuery() {
this.actionQueryParams.pageNum = 1;
this.getActionList();
},
-
+
/** 重置操作记录搜索 */
resetActionQuery() {
this.resetForm('actionQueryForm');
@@ -701,7 +698,7 @@ export default {
this.actionQueryParams.actionStatus = null;
this.handleActionQuery();
},
-
+
// ========== 物料列表相关方法 ==========
/** 查询物料列表 */
getMaterialCoil() {
@@ -721,10 +718,10 @@ export default {
this.materialCoilList = response.rows || []
this.materialTotal = response.total || 0
this.materialLoading = false
-
+
// 如果有钢卷数据,自动获取第一个钢卷的操作记录
if (this.materialCoilList.length > 0) {
- this.currentCoilId = this.materialCoilList[0].coilId;
+ this.coilIds = this.materialCoilList.map(item => item.coilId).join(',');
this.getActionList();
} else {
// 清空操作记录
@@ -735,7 +732,7 @@ export default {
this.materialLoading = false
})
},
-
+
/** 物料搜索 */
handleMaterialQuery() {
// 检查是否至少填写了一个钢卷号
@@ -743,18 +740,18 @@ export default {
this.$message.warning('请至少填写一个钢卷号进行搜索');
return;
}
-
+
this.materialQueryParams.pageNum = 1;
this.searched = true;
this.getMaterialCoil();
// 同时获取操作记录
- if (this.materialCoilList.length > 0) {
- this.currentCoilId = this.materialCoilList[0].coilId;
- this.getActionList();
- }
+ // if (this.materialCoilList.length > 0) {
+ // this.currentCoilId = this.materialCoilList[0].coilId;
+ // this.getActionList();
+ // }
},
-
+
/** 重置物料搜索 */
resetMaterialQuery() {
this.resetForm('materialQueryForm');
@@ -764,7 +761,7 @@ export default {
this.materialCoilList = [];
this.actionList = [];
},
-
+
/** 回滚操作 */
handleRestoreMaterial(row) {
this.$modal.confirm('是否要将改钢卷还原到上次加工的状态(会删除该钢卷并将上一步的历史钢卷还原)').then(_ => {
@@ -782,7 +779,7 @@ export default {
})
})
},
-
+
/** 强制入库操作 */
handleForceInMaterial(row) {
this.$modal.confirm('是否要强制入库改钢卷?').then(_ => {
@@ -803,7 +800,7 @@ export default {
})
})
},
-
+
/** 修正按钮操作 */
handleCorrectMaterial(row) {
this.form = {
@@ -812,12 +809,12 @@ export default {
this.title = "钢卷信息修正";
this.correctVisible = true
},
-
+
/** 取消按钮 */
cancel() {
this.correctVisible = false
},
-
+
/** 提交按钮 */
submitForm() {
this.$refs['form'].validate(valid => {
@@ -836,7 +833,7 @@ export default {
});
})
},
-
+
// ========== 操作记录相关方法 ==========
/** 处理操作状态变化 */
handleStatusChange(row) {
@@ -845,28 +842,28 @@ export default {
this.getActionList();
});
},
-
+
/** 完成时间改变时触发 */
handleProcessTimeChange(row) {
updatePendingAction(row).then(response => {
this.$message.success('更新成功');
});
},
-
+
/** 多选框选中数据 */
handleSelectionChange(selection) {
this.ids = selection.map(item => item.actionId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
-
+
/** 新增操作 */
handleAddAction() {
this.resetActionForm();
this.actionOpen = true;
this.actionTitle = '添加操作记录';
},
-
+
/** 修改操作 */
handleUpdateAction(row) {
this.resetActionForm();
@@ -877,7 +874,7 @@ export default {
this.actionTitle = '修改操作记录';
});
},
-
+
/** 删除操作 */
handleDeleteAction(row) {
const actionIds = row.actionId || this.ids;
@@ -892,7 +889,7 @@ export default {
this.$message.success('删除成功');
}).catch(() => { });
},
-
+
/** 还原操作 */
handleRestoreAction(row) {
const actionId = row.actionId;
@@ -907,24 +904,24 @@ export default {
});
});
},
-
+
/** 刷新操作记录 */
handleRefreshAction() {
this.getActionList();
this.$message.success('刷新成功');
},
-
+
/** 显示钢卷选择器 */
showCoilSelector() {
this.coilSelectorVisible = true;
},
-
+
/** 钢卷选择回调 */
handleCoilSelect(coil) {
this.actionForm.coilId = coil.coilId;
this.actionForm.currentCoilNo = coil.currentCoilNo;
},
-
+
/** 提交操作表单 */
submitActionForm() {
this.$refs['actionForm'].validate(valid => {
@@ -948,13 +945,13 @@ export default {
}
});
},
-
+
/** 取消操作表单 */
cancelAction() {
this.actionOpen = false;
this.resetActionForm();
},
-
+
/** 重置操作表单 */
resetActionForm() {
this.actionForm = {
@@ -971,7 +968,7 @@ export default {
this.$refs['actionForm'].resetFields();
}
},
-
+
/** 获取边框样式 */
getBorderStyle(row) {
// 已发货
@@ -992,7 +989,7 @@ export default {
}
return { border: '1.5px solid #e4e7ed' }
},
-
+
/** 获取钢卷类型标签 */
getTypeLabel(row) {
if (row.status == 1) {
@@ -1009,7 +1006,7 @@ export default {
}
return '未知'
},
-
+
/** 根据操作类型获取图标 */
getActionIcon(actionType) {
const value = parseInt(actionType);
@@ -1043,19 +1040,19 @@ export default {
border-radius: 4px;
padding: 20px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
-
+
.page-title {
margin: 0 0 16px 0;
font-size: 18px;
font-weight: 600;
color: #303133;
}
-
+
.search-form {
display: flex;
align-items: center;
gap: 12px;
-
+
.search-tip {
font-size: 12px;
color: #909399;
@@ -1071,14 +1068,14 @@ export default {
padding: 80px 20px;
text-align: center;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
-
+
i {
font-size: 48px;
margin-bottom: 16px;
display: block;
color: #c0c4cc;
}
-
+
p {
margin: 0;
font-size: 16px;
@@ -1165,7 +1162,7 @@ export default {
overflow-y: auto;
display: flex;
flex-direction: column;
-
+
&::-webkit-scrollbar {
width: 6px;
}
@@ -1183,12 +1180,12 @@ export default {
background: #a8a8a8;
}
}
-
+
::v-deep .el-table {
flex: 1;
min-height: 200px;
}
-
+
::v-deep .el-table__body-wrapper {
overflow-y: auto;
}
diff --git a/klp-ui/src/views/wms/report/snap/index.vue b/klp-ui/src/views/wms/report/snap/index.vue
index e69de29b..bc91791c 100644
--- a/klp-ui/src/views/wms/report/snap/index.vue
+++ b/klp-ui/src/views/wms/report/snap/index.vue
@@ -0,0 +1,324 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+ 新增
+
+
+ 删除
+
+
+ 导出
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.reportDate, '{y}-{m}-{d}') }}
+
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/klp-ui/src/views/wms/report/template/loss.vue b/klp-ui/src/views/wms/report/template/loss.vue
index 951368a9..8d4cc76a 100644
--- a/klp-ui/src/views/wms/report/template/loss.vue
+++ b/klp-ui/src/views/wms/report/template/loss.vue
@@ -38,12 +38,6 @@
-
查询
导出
@@ -85,6 +79,8 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
+import { fetchLossList } from "@/views/wms/report/js/fetch";
+
export default {
name: 'LossTemplate',
@@ -186,44 +182,11 @@ export default {
},
async getList() {
this.loading = true
- const resultList = await Promise.all(this.actionTypes.map(actionType => {
- return listPendingAction({
- actionStatus: 2,
- warehouseId: this.queryParams.planId,
- actionType,
- pageSize: 9999,
- pageNum: 1,
- startTime: this.queryParams.byCreateTimeStart,
- endTime: this.queryParams.byCreateTimeEnd,
- ...this.actionQueryParams,
- })
- }))
- const actions = resultList.flatMap(item => item.rows)
- const actionIds = actions.map(item => item.actionId).join(',')
- if (!actionIds) {
- this.$message({
- message: '暂无数据',
- type: 'warning',
- })
- this.list = []
- this.loading = false
- return
- }
- listCoilWithIds({
+ fetchLossList(this.actionTypes, {
...this.queryParams,
- byCreateTimeStart: undefined,
- byCreateTimeEnd: undefined,
- actionIds: actionIds,
+ ...this.actionQueryParams,
}).then(res => {
- this.list = res.rows.map(item => {
- // 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
- const [thickness, width] = item.specification?.split('*') || [undefined, undefined]
- return {
- ...item,
- computedThickness: parseFloat(thickness),
- computedWidth: parseFloat(width),
- }
- })
+ this.list = res
this.loading = false
})
},
diff --git a/klp-ui/src/views/wms/report/template/month.vue b/klp-ui/src/views/wms/report/template/month.vue
index f3eca940..cf20abd8 100644
--- a/klp-ui/src/views/wms/report/template/month.vue
+++ b/klp-ui/src/views/wms/report/template/month.vue
@@ -92,7 +92,7 @@
{{ item.value
- }}
+ }}
@@ -130,6 +130,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/calc";
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
+import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
export default {
name: 'MonthTemplate',
@@ -389,9 +390,18 @@ export default {
fetchData() {
this.loading = true
Promise.all([
- this.getList(),
- this.getLossList()
- ]).then(() => {
+ fetchLossList(this.actionTypes, {
+ ...this.queryParams,
+ ...this.actionQueryParams
+ }),
+ fetchOutputList({
+ ...this.queryParams,
+ ...this.baseQueryParams,
+ warehouseIds: this.warehouseIds.join(','),
+ }),
+ ]).then(([lossList, outputList]) => {
+ this.lossList = lossList
+ this.list = outputList
this.loading = false
})
},
diff --git a/klp-ui/src/views/wms/report/template/out.vue b/klp-ui/src/views/wms/report/template/out.vue
index ee09d18e..abc8b795 100644
--- a/klp-ui/src/views/wms/report/template/out.vue
+++ b/klp-ui/src/views/wms/report/template/out.vue
@@ -40,7 +40,7 @@
:options="dict.type.coil_manufacturer" placeholder="请选择厂家" clearable @keyup.enter.native="handleQuery" />
- 查询
+ 查询
导出
列设置
@@ -76,6 +76,8 @@ import MutiSelect from "@/components/MutiSelect";
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
+import { fetchOutputList } from "@/views/wms/report/js/fetch";
+
export default {
name: 'OutTemplate',
@@ -160,7 +162,7 @@ export default {
handler(newVal, oldVal) {
if (newVal !== oldVal) {
this.warehouseIds = newVal.map(item => item.value)
- this.getList()
+ this.handleQuery()
}
},
immediate: true,
@@ -186,40 +188,13 @@ export default {
},
// 统一查询入口
handleQuery() {
- this.getList()
- },
- getList() {
this.loading = true
- Promise.all([
- listCoilWithIds({
- selectType: 'raw_material',
- itemType: 'raw_material',
- warehouseIds: this.warehouseIds.join(','),
- ...this.queryParams,
- ...this.baseQueryParams,
- }),
- listCoilWithIds({
- selectType: 'product',
- itemType: 'product',
- warehouseIds: this.warehouseIds.join(','),
- ...this.queryParams,
- ...this.baseQueryParams,
- }),
- ]).then((resList) => {
- console.log(resList)
- const list = resList.flatMap(res => res.rows)
- // 按照createTime 降序排序
- this.list = list.sort(
- (a, b) => new Date(b.createTime) - new Date(a.createTime)
- ).map(item => {
- // 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
- const [thickness, width] = item.specification.split('*')
- return {
- ...item,
- computedThickness: parseFloat(thickness),
- computedWidth: parseFloat(width),
- }
- })
+ fetchOutputList({
+ ...this.queryParams,
+ ...this.baseQueryParams,
+ warehouseIds: this.warehouseIds.join(','),
+ }).then((resList) => {
+ this.list = resList
this.loading = false
})
},
@@ -231,7 +206,7 @@ export default {
},
},
mounted() {
- this.getList()
+ this.handleQuery()
this.loadColumns()
}
}
diff --git a/klp-ui/src/views/wms/report/template/team.vue b/klp-ui/src/views/wms/report/template/team.vue
index de538426..8e1f7577 100644
--- a/klp-ui/src/views/wms/report/template/team.vue
+++ b/klp-ui/src/views/wms/report/template/team.vue
@@ -135,6 +135,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import { calcSummary, calcAbSummary, calcTeamSummary, calcMSummary } from "@/views/wms/report/js/calc";
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
+import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
export default {
name: 'TeamTemplate',
@@ -263,94 +264,24 @@ export default {
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
},
+ // 统一查询入口(兼容回车和按钮点击)
handleQuery() {
- this.getList();
- // this.getLossList();
- },
- getList() {
- this.loading = true;
+ this.loading = true
Promise.all([
- listCoilWithIds({
- selectType: 'raw_material',
- itemType: 'raw_material',
- warehouseIds: this.warehouseIds.join(','),
+ fetchLossList(this.actionTypes, {
...this.queryParams,
- ...this.baseQueryParams
+ ...this.actionQueryParams
}),
- listCoilWithIds({
- selectType: 'product',
- itemType: 'product',
+ fetchOutputList({
+ ...this.queryParams,
+ ...this.baseQueryParams,
warehouseIds: this.warehouseIds.join(','),
- ...this.queryParams,
- ...this.baseQueryParams
- })
- ]).then(resList => {
- const list = resList.flatMap(res => res.rows);
- this.list = list.sort((a, b) => new Date(b.createTime) - new Date(a.createTime)).map(item => {
- // 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
- const [thickness, width] = item.specification.split('*')
- return {
- ...item,
- computedThickness: parseFloat(thickness),
- computedWidth: parseFloat(width),
- }
- });
- // this.loading = false;
- this.getLossList()
- // this.loading = false;
- }).catch(err => {
- console.error('查询失败:', err);
- this.loading = false;
- });
- },
- async getLossList() {
- this.loading = true;
- try {
- const resultList = await Promise.all(this.actionTypes.map(actionType => {
- return listPendingAction({
- actionStatus: 2,
- warehouseId: this.queryParams.planId,
- actionType,
- pageSize: 9999,
- pageNum: 1,
- startTime: this.queryParams.byCreateTimeStart,
- endTime: this.queryParams.byCreateTimeEnd,
- ...this.actionQueryParams
- });
- }));
- const actions = resultList.flatMap(item => item.rows);
- const coilIds = actions.map(item => item.coilId).join(',');
-
- if (!coilIds) {
- this.$message({
- message: '暂无数据',
- type: 'warning'
- });
- this.lossList = [];
- this.loading = false;
- return;
- }
-
- const res = await listCoilWithIds({
- ...this.queryParams,
- byCreateTimeStart: undefined,
- byCreateTimeEnd: undefined,
- coilIds: coilIds
- });
- this.lossList = res.rows.map(item => {
- // 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
- const [thickness, width] = item.specification.split('*')
- return {
- ...item,
- computedThickness: parseFloat(thickness),
- computedWidth: parseFloat(width),
- }
- });
- this.loading = false;
- } catch (err) {
- console.error('查询失败:', err);
- this.loading = false;
- }
+ }),
+ ]).then(([lossList, outputList]) => {
+ this.lossList = lossList
+ this.list = outputList
+ this.loading = false
+ })
},
exportData() {
if (this.list.length === 0) {
@@ -372,8 +303,7 @@ export default {
}
},
mounted() {
- this.getList();
- // this.getLossList();
+ this.handleQuery()
this.loadColumns();
}
};
diff --git a/klp-ui/src/views/wms/report/template/year.vue b/klp-ui/src/views/wms/report/template/year.vue
index f3e7d40c..ac57f3b1 100644
--- a/klp-ui/src/views/wms/report/template/year.vue
+++ b/klp-ui/src/views/wms/report/template/year.vue
@@ -130,6 +130,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/calc";
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
+import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
export default {
name: 'YearTemplate',
@@ -264,84 +265,20 @@ export default {
},
// 统一查询入口(兼容回车和按钮点击)
handleQuery() {
- this.getList()
- // this.getLossList()
- },
- // 核心查询逻辑
- getList() {
this.loading = true
Promise.all([
- listCoilWithIds({
- selectType: 'raw_material',
- itemType: 'raw_material',
- warehouseIds: this.warehouseIds.join(','),
+ fetchLossList(this.actionTypes, {
+ ...this.queryParams,
+ ...this.actionQueryParams
+ }),
+ fetchOutputList({
...this.queryParams,
...this.baseQueryParams,
- }),
- listCoilWithIds({
- selectType: 'product',
- itemType: 'product',
warehouseIds: this.warehouseIds.join(','),
- ...this.queryParams,
- ...this.baseQueryParams,
}),
- ]).then((resList) => {
- const list = resList.flatMap(res => res.rows)
- // 按照createTime 降序排序
- this.list = list.sort(
- (a, b) => new Date(b.createTime) - new Date(a.createTime)
- ).map(item => {
- // 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
- const [thickness, width] = item.specification?.split('*') || [0, 0]
- return {
- ...item,
- computedThickness: parseFloat(thickness),
- computedWidth: parseFloat(width),
- }
- })
- this.getLossList()
- })
- },
- async getLossList() {
- this.loading = true
- const resultList = await Promise.all(this.actionTypes.map(actionType => {
- return listPendingAction({
- actionStatus: 2,
- warehouseId: this.queryParams.planId,
- actionType,
- pageSize: 99999,
- pageNum: 1,
- startTime: this.queryParams.byCreateTimeStart,
- endTime: this.queryParams.byCreateTimeEnd,
- ...this.actionQueryParams,
- })
- }))
- const actions = resultList.flatMap(item => item.rows)
- const coilIds = actions.map(item => item.coilId).join(',')
- if (!coilIds) {
- this.$message({
- message: '暂无数据',
- type: 'warning',
- })
- this.lossList = []
- this.loading = false
- return
- }
- listCoilWithIds({
- ...this.queryParams,
- byCreateTimeStart: undefined,
- byCreateTimeEnd: undefined,
- coilIds: coilIds,
- }).then(res => {
- this.lossList = res.rows.map(item => {
- // 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
- const [thickness, width] = item.specification?.split('*') || [0, 0]
- return {
- ...item,
- computedThickness: parseFloat(thickness),
- computedWidth: parseFloat(width),
- }
- })
+ ]).then(([lossList, outputList]) => {
+ this.lossList = lossList
+ this.list = outputList
this.loading = false
})
},
@@ -366,8 +303,7 @@ export default {
},
},
mounted() {
- this.getList()
- // this.getLossList()
+ this.handleQuery()
this.loadColumns()
}
}