2026-01-09 19:06:21 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="app-container" v-loading="loading">
|
|
|
|
|
|
<el-row>
|
2026-01-09 20:12:22 +08:00
|
|
|
|
<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="endTime">
|
|
|
|
|
|
<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-input style="width: 200px;" v-model="queryParams.currentCoilNo" placeholder="请输入当前钢卷号" clearable
|
|
|
|
|
|
@keyup.enter.native="handleQuery" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="逻辑库位" prop="endTime">
|
|
|
|
|
|
<warehouse-select v-model="queryParams.warehouseId" placeholder="请选择仓库/库区/库位"
|
|
|
|
|
|
style="width: 100%; display: inline-block; width: 200px;" clearable />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="产品名称" prop="endTime">
|
|
|
|
|
|
<el-input style="width: 200px;" v-model="queryParams.itemName" placeholder="请输入产品名称" clearable
|
|
|
|
|
|
@keyup.enter.native="handleQuery" />
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item label="规格" prop="endTime">
|
|
|
|
|
|
<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="endTime">
|
|
|
|
|
|
<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="endTime">
|
|
|
|
|
|
<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 prop="endTime">
|
|
|
|
|
|
<el-button type="primary" @click="getList">查询</el-button>
|
|
|
|
|
|
<el-button type="primary" @click="exportData">导出</el-button>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
2026-01-09 19:06:21 +08:00
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
<el-descriptions title="统计信息" :column="3" border>
|
|
|
|
|
|
<el-descriptions-item label="总钢卷数量">{{ summary.totalCount }}</el-descriptions-item>
|
2026-01-09 19:37:18 +08:00
|
|
|
|
<el-descriptions-item label="总重">{{ summary.totalWeight }}t</el-descriptions-item>
|
2026-01-09 19:06:21 +08:00
|
|
|
|
<el-descriptions-item label="均重">{{ summary.avgWeight }}t</el-descriptions-item>
|
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
|
|
|
|
|
|
<el-descriptions title="明细信息" :column="3" border>
|
|
|
|
|
|
</el-descriptions>
|
|
|
|
|
|
<el-table :data="list" border height="calc(100vh - 320px)">
|
|
|
|
|
|
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
|
|
|
|
|
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
|
|
|
|
|
<el-table-column label="产品类型" align="center" width="250">
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
|
|
|
|
|
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column label="长度 (米)" align="center" prop="length" />
|
|
|
|
|
|
<el-table-column label="更新人" align="center" prop="updateByName" />
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import { listMaterialCoil } from "@/api/wms/coil";
|
|
|
|
|
|
import {
|
|
|
|
|
|
listPendingAction,
|
|
|
|
|
|
} from '@/api/wms/pendingAction';
|
|
|
|
|
|
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
|
|
|
|
|
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
|
|
|
|
|
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
2026-01-09 20:12:22 +08:00
|
|
|
|
import MemoInput from "@/components/MemoInput";
|
|
|
|
|
|
import MutiSelect from "@/components/MutiSelect";
|
|
|
|
|
|
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
|
|
|
|
|
|
2026-01-09 19:06:21 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
components: {
|
|
|
|
|
|
ProductInfo,
|
|
|
|
|
|
RawMaterialInfo,
|
|
|
|
|
|
CoilNo,
|
2026-01-09 20:12:22 +08:00
|
|
|
|
MemoInput,
|
|
|
|
|
|
MutiSelect,
|
|
|
|
|
|
WarehouseSelect,
|
2026-01-09 19:06:21 +08:00
|
|
|
|
},
|
2026-01-09 20:12:22 +08:00
|
|
|
|
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
2026-01-09 19:06:21 +08:00
|
|
|
|
data() {
|
2026-01-10 08:25:00 +08:00
|
|
|
|
// 工具函数:个位数补零,保证格式统一(比如 9 → 09,5 → 05)
|
|
|
|
|
|
const addZero = (num) => num.toString().padStart(2, '0')
|
|
|
|
|
|
|
2026-01-09 19:06:21 +08:00
|
|
|
|
const now = new Date()
|
2026-01-10 08:25:00 +08:00
|
|
|
|
// 基于【本地北京时间】获取年月日
|
|
|
|
|
|
const year = now.getFullYear()
|
|
|
|
|
|
const month = addZero(now.getMonth() + 1) // 月份+1 补零
|
|
|
|
|
|
const day = addZero(now.getDate())
|
|
|
|
|
|
|
|
|
|
|
|
// ✅ 正确的 北京时间 今日开始/结束时间
|
|
|
|
|
|
const startTime = `${year}-${month}-${day} 00:00:00`
|
|
|
|
|
|
const endTime = `${year}-${month}-${day} 23:59:59`
|
2026-01-09 19:06:21 +08:00
|
|
|
|
return {
|
|
|
|
|
|
list: [],
|
|
|
|
|
|
queryParams: {
|
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
|
pageSize: 9999,
|
2026-01-10 08:25:00 +08:00
|
|
|
|
// status: 1,
|
2026-01-09 19:06:21 +08:00
|
|
|
|
startTime: startTime,
|
|
|
|
|
|
endTime: endTime,
|
2026-01-09 20:12:22 +08:00
|
|
|
|
selectType: 'product',
|
|
|
|
|
|
enterCoilNo: '',
|
|
|
|
|
|
currentCoilNo: '',
|
|
|
|
|
|
warehouseId: '',
|
|
|
|
|
|
productName: '',
|
|
|
|
|
|
itemSpecification: '',
|
|
|
|
|
|
itemMaterial: '',
|
|
|
|
|
|
itemManufacturer: '',
|
2026-01-09 19:06:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
|
|
|
summary() {
|
|
|
|
|
|
// 总钢卷数量、总重、均重
|
|
|
|
|
|
const totalCount = this.list.length
|
|
|
|
|
|
const totalWeight = this.list.reduce((acc, cur) => acc + parseFloat(cur.netWeight), 0)
|
|
|
|
|
|
const avgWeight = totalCount > 0 ? (totalWeight / totalCount).toFixed(2) : 0
|
|
|
|
|
|
return {
|
|
|
|
|
|
totalCount,
|
2026-01-09 19:37:18 +08:00
|
|
|
|
totalWeight: totalWeight.toFixed(2),
|
2026-01-09 19:06:21 +08:00
|
|
|
|
avgWeight,
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
getList() {
|
|
|
|
|
|
this.loading = true
|
2026-01-09 19:37:18 +08:00
|
|
|
|
Promise.all([
|
|
|
|
|
|
// 酸连轧成品库
|
|
|
|
|
|
listMaterialCoil({
|
2026-01-09 20:12:22 +08:00
|
|
|
|
...this.queryParams,
|
2026-01-09 19:37:18 +08:00
|
|
|
|
startTime: this.queryParams.startTime,
|
|
|
|
|
|
endTime: this.queryParams.endTime,
|
|
|
|
|
|
pageSize: 9999,
|
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
|
dataType: 1,
|
|
|
|
|
|
createBy: 'suanzhakuguan',
|
|
|
|
|
|
warehouseId: '1988150099140866050'
|
|
|
|
|
|
}),
|
|
|
|
|
|
// 镀锌原料库
|
|
|
|
|
|
listMaterialCoil({
|
2026-01-09 20:12:22 +08:00
|
|
|
|
...this.queryParams,
|
2026-01-09 19:37:18 +08:00
|
|
|
|
startTime: this.queryParams.startTime,
|
|
|
|
|
|
endTime: this.queryParams.endTime,
|
|
|
|
|
|
pageSize: 9999,
|
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
|
dataType: 1,
|
|
|
|
|
|
createBy: 'suanzhakuguan',
|
|
|
|
|
|
warehouseId: '1988150263284953089'
|
|
|
|
|
|
}),
|
|
|
|
|
|
// 脱脂原料库
|
2026-01-09 19:06:21 +08:00
|
|
|
|
listMaterialCoil({
|
2026-01-09 20:12:22 +08:00
|
|
|
|
...this.queryParams,
|
2026-01-09 19:37:18 +08:00
|
|
|
|
startTime: this.queryParams.startTime,
|
|
|
|
|
|
endTime: this.queryParams.endTime,
|
|
|
|
|
|
pageSize: 9999,
|
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
|
dataType: 1,
|
|
|
|
|
|
createBy: 'suanzhakuguan',
|
|
|
|
|
|
warehouseId: '1988150545175736322'
|
|
|
|
|
|
}),
|
|
|
|
|
|
]).then(([res1, res2, res3]) => {
|
|
|
|
|
|
console.log(res1, res2, res3)
|
|
|
|
|
|
this.list = [...res1.rows, ...res2.rows, ...res3.rows]
|
|
|
|
|
|
this.loading = false
|
2026-01-09 19:06:21 +08:00
|
|
|
|
})
|
2026-01-09 19:37:18 +08:00
|
|
|
|
// listPendingAction({
|
|
|
|
|
|
// // actionStatus: 2,
|
|
|
|
|
|
// actionType: 11,
|
|
|
|
|
|
// pageSize: 999,
|
|
|
|
|
|
// pageNum: 1,
|
|
|
|
|
|
// startTime: this.queryParams.startTime,
|
|
|
|
|
|
// endTime: this.queryParams.endTime,
|
|
|
|
|
|
// }).then(res => {
|
|
|
|
|
|
// const actions = res.rows
|
|
|
|
|
|
// const coilIds = actions.map(item => item.coilId).join(',')
|
|
|
|
|
|
// console.log(coilIds)
|
|
|
|
|
|
// if (!coilIds) {
|
|
|
|
|
|
// this.$message({
|
|
|
|
|
|
// message: '暂无数据',
|
|
|
|
|
|
// type: 'warning',
|
|
|
|
|
|
// })
|
|
|
|
|
|
// this.loading = false
|
|
|
|
|
|
// return
|
|
|
|
|
|
// }
|
|
|
|
|
|
// listMaterialCoil({
|
|
|
|
|
|
// coilIds: coilIds,
|
|
|
|
|
|
// }).then(res => {
|
|
|
|
|
|
// this.list = res.rows
|
|
|
|
|
|
// this.loading = false
|
|
|
|
|
|
// })
|
|
|
|
|
|
// })
|
2026-01-09 19:06:21 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 导出
|
|
|
|
|
|
exportData() {
|
|
|
|
|
|
this.download('wms/materialCoil/export', {
|
|
|
|
|
|
coilIds: this.list.map(item => item.coilId).join(',')
|
|
|
|
|
|
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
|
|
|
this.getList()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped></style>
|