修改盘点正常的列表

This commit is contained in:
zx
2026-02-28 09:35:39 +08:00
parent 2897bc3f51
commit 079818aa0f
4 changed files with 195 additions and 33 deletions

View File

@@ -17,7 +17,14 @@ export function getScan(query) {
params: query
})
}
// 统计
export function getTotalStatistics(data) {
return request({
url: '/MatchScan/statistics',
method: 'post',
data: data
})
}
// 开始匹配
export function getMatch(data) {
return request({
@@ -44,6 +51,15 @@ export function getScanResult(query) {
params: query
})
}
// 获取盘点结果 - 最新再用
export function inventoryList(data) {
return request({
url: '/MatchScan/inventoryList',
method: 'post',
data: data
})
}
// 获取图表
export function getChart(data) {

View File

@@ -69,14 +69,47 @@
<el-text v-show="status == 1">当前为未扫描到但数据库里有的数据</el-text>
<el-text v-show="status == 2">当前为已扫描到但数据库里没有的数据</el-text>
</div>
<el-table :data="matchData" border empty-text="暂无数据" v-if="status == 0 || status == 1">
<el-table-column prop="rkPcode" label="存放位置" />
<el-table-column prop="realQty" label="数量" />
<el-table-column prop="count" label="操作" class-name="small-padding fixed-width">
<el-table :data="matchData" border empty-text="暂无数据" show-overflow-tooltip show-summary
:summary-method="getSummaries" v-if="status == 0 || status == 1">
<el-table-column label="序号" align="center" type="index" width="70" />
<el-table-column label="单据号" align="center" prop="billNo" width="180" />
<el-table-column label="库存类型" align="center" prop="operationTypeName" width="150" />
<el-table-column label="订单编号" align="center" prop="sapNo" width="150" />
<el-table-column label="项目号" align="center" prop="xmNo" width="150" />
<el-table-column label="项目描述" align="center" prop="xmMs" width="150" />
<el-table-column label="物料号" align="center" prop="wlNo" width="100" />
<el-table-column label="物料描述" align="center" prop="wlMs" width="150" />
<el-table-column label="供应商名称" align="center" prop="gysMc" width="150" />
<el-table-column label="合同单价" align="center" prop="htDj" />
<el-table-column label="总计" align="center" prop="totalAmount" />
<el-table-column label="单位" align="center" prop="dw" />
<el-table-column label="实际入库数量" align="center" prop="realQty" width="120" />
<el-table-column label="库位码" align="center" prop="pcode" width="120" />
<el-table-column label="托盘码" align="center" prop="trayCode" />
<el-table-column label="身份码" align="center" prop="entityId" width="150" />
<el-table-column label="物资类型" align="center" prop="wlTypeName" />
<el-table-column label="场景" align="center" prop="sceneName" width="150" />
<el-table-column label="所属大库" align="center" prop="parentWarehouseName" width="150" />
<el-table-column label="所属小库" align="center" prop="warehouseName" width="150" />
<el-table-column label="入库类型" align="center" prop="operationTypeName" width="150" />
<el-table-column label="入库时间" align="center" prop="operationTime" width="150" />
<el-table-column label="还料时间" align="center" prop="returnTime" width="150">
<template #default="scope">
<span>{{ parseTime(scope.row.returnTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="库龄" align="center" prop="stockAge" />
<el-table-column label="备注" align="center" prop="remark" width="150" />
<el-table-column label="一次封样号" align="center" prop="fycde1" width="150" />
<el-table-column label="二次封样号" align="center" prop="fycde2" width="150" />
<!-- <el-table-column prop="count" label="操作" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="View" @click="handleView(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<el-table :data="matchData" border empty-text="暂无数据" v-if="status == 2">
@@ -106,7 +139,7 @@
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button @click="taskView=false">关闭</el-button>
<el-button @click="taskView = false">关闭</el-button>
</span>
</template>
</el-dialog>
@@ -115,7 +148,7 @@
<script setup name="AutoInventory">
import { ElLoading } from 'element-plus';
import { getTaskCount, getScan, getMatch, getChart, stopScan, getScanResult, getStockList } from "@/api/Inventory/autoInventory"
import { getTaskCount, getScan, getMatch, getChart, stopScan, getTotalStatistics, getStockList, inventoryList } from "@/api/Inventory/autoInventory"
import { ref, reactive, onMounted, onBeforeUnmount, markRaw } from "vue";
import avatar from "@/assets/images/avatar.jpg"
import { useRoute } from 'vue-router';
@@ -282,7 +315,7 @@ const getMatchData = () => {
})
})
})
}
// 匹配结果
const getResultList = () => {
@@ -290,9 +323,15 @@ const getResultList = () => {
pageNum: queryParams.value.pageNum,
pageSize: queryParams.value.pageSize,
status: status.value,
taskId: taskId.value
warehouseCode: deviceObj.value.warehouseCode,
sceneId: deviceObj.value.sceneId,
}
getScanResult(obj).then(res => {
if (status.value != 0) {
matchData.value = null
matchTotal.value = 0
return;
}
inventoryList(obj).then(res => {
matchData.value = res.rows
matchTotal.value = res.total
})
@@ -390,13 +429,47 @@ if (deviceInfo) {
});
connectWebSocket(); // 组件加载时连接 WebSocket
}
// 获取总计
const totalMoney = ref(null)
const pcodeCount = ref(null)
const sumQty = ref(null)
function getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 1) { // 第一列不进行合计操作,通常是序列号或选择框等非数值列。
sums[index] = '总计'; // 这里可以设置为其他文字或空字符串。
return;
} else if (index === 2) { // 第二列是金额列,进行求和操作。
sums[index] = '总金额:' + totalMoney.value;
} else if (index === 3) {
sums[index] = '共存于:' + pcodeCount.value + '个库位'
} else if (index === 4) {
sums[index] = '总数:' + sumQty.value
}
})
return sums
}
function getSumInfo() {
//统计信息
console.log(deviceObj.value,'deviceObj');
let rkInfo = JSON.parse(JSON.stringify({
warehouseCode: deviceObj.value.warehouseCode,
sceneId: deviceObj.value.sceneId,
}))
getTotalStatistics(rkInfo).then(response => {
totalMoney.value = response.data.totalAmount
pcodeCount.value = response.data.locationCount
sumQty.value = response.data.totalQuantity
});
}
getSumInfo()
// 使用 Websocket 发送消息
const send = () => {
let obj = {
deviceId: deviceObj.value.deviceId,
ip: deviceObj.value.ipAddress,
port: deviceObj.value.port
port: deviceObj.value.port
}
loadingInstance.close();
isSend.value = true

View File

@@ -407,8 +407,8 @@ function handleInventory(row) {
}
/** 查看结果操作 */
function handleHistory(row) {
router.push({ path: "/Inventory/task/inventoryResult" , query: {"taskId": row.id} })
function handleHistory(row) {
router.push({ path: "/Inventory/task/inventoryResult" , query: {"taskId": row.id,'warehouseCode':row.warehouseCode,"sceneId":row.sceneId} })
}
/** 导出按钮操作 */

View File

@@ -18,16 +18,49 @@
<el-tabs v-model="activeTabs" type="border-card" @tab-change="handleQueryInfo">
<el-tab-pane v-for="item in statusList" :label="item.label" :name="item.value">
<el-table :data="dialogData" border empty-text="暂无数据" v-if="dialogParams.status == 0 || dialogParams.status == 1">
<el-table-column prop="rkPcode" label="存放位置" />
<el-table-column prop="realQty" label="数量" />
<el-table-column prop="count" label="操作" class-name="small-padding fixed-width">
<el-table :data="dialogData" border empty-text="暂无数据" show-overflow-tooltip show-summary
:summary-method="getSummaries" v-if="dialogParams.status == 0 || dialogParams.status == 1">
<el-table-column label="序号" align="center" type="index" width="70" />
<el-table-column label="单据号" align="center" prop="billNo" width="180" />
<el-table-column label="库存类型" align="center" prop="operationTypeName" width="150" />
<el-table-column label="订单编号" align="center" prop="sapNo" width="150" />
<el-table-column label="项目号" align="center" prop="xmNo" width="150" />
<el-table-column label="项目描述" align="center" prop="xmMs" width="150" />
<el-table-column label="物料号" align="center" prop="wlNo" width="100" />
<el-table-column label="物料描述" align="center" prop="wlMs" width="150" />
<el-table-column label="供应商名称" align="center" prop="gysMc" width="150" />
<el-table-column label="合同单价" align="center" prop="htDj" />
<el-table-column label="总计" align="center" prop="totalAmount" />
<el-table-column label="单位" align="center" prop="dw" />
<el-table-column label="实际入库数量" align="center" prop="realQty" width="120" />
<el-table-column label="库位码" align="center" prop="pcode" width="120" />
<el-table-column label="托盘码" align="center" prop="trayCode" />
<el-table-column label="身份码" align="center" prop="entityId" width="150" />
<el-table-column label="物资类型" align="center" prop="wlTypeName" />
<el-table-column label="场景" align="center" prop="sceneName" width="150" />
<el-table-column label="所属大库" align="center" prop="parentWarehouseName" width="150" />
<el-table-column label="所属小库" align="center" prop="warehouseName" width="150" />
<el-table-column label="入库类型" align="center" prop="operationTypeName" width="150" />
<el-table-column label="入库时间" align="center" prop="operationTime" width="150" />
<el-table-column label="还料时间" align="center" prop="returnTime" width="150">
<template #default="scope">
<span>{{ parseTime(scope.row.returnTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="库龄" align="center" prop="stockAge" />
<el-table-column label="备注" align="center" prop="remark" width="150" />
<el-table-column label="一次封样号" align="center" prop="fycde1" width="150" />
<el-table-column label="二次封样号" align="center" prop="fycde2" width="150" />
<!-- <el-table-column prop="count" label="操作" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="View" @click="handleView(scope.row)">查看</el-button>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<el-table :data="dialogData" border empty-text="暂无数据" v-if="dialogParams.status == 2">
<el-table-column prop="rkPcode" label="存放位置" />
</el-table>
@@ -64,7 +97,7 @@
</template>
<script setup name="InventoryResult">
import { getScanResult, getStockList } from "@/api/Inventory/autoInventory";
import { getStockList, getTotalStatistics, inventoryList } from "@/api/Inventory/autoInventory";
import { onMounted, ref } from "vue";
import { useRoute } from 'vue-router';
@@ -91,13 +124,19 @@ const dialogParams = ref({
status: 0,
pageNum: 1,
pageSize: 10,
taskId: ""
warehouseCode: '',
sceneId: '',
})
const dialogData = ref([])
const dialogTotal = ref(0)
const getHistoryInfo = () => {
getScanResult(dialogParams.value).then(res => {
if(dialogParams.value.status!=0){
dialogData.value =null
dialogTotal.value = 0
return;
}
inventoryList(dialogParams.value).then(res => {
dialogData.value = res.rows
dialogTotal.value = res.total
})
@@ -122,25 +161,59 @@ const chageDialogPage = (e) => {
const taskView = ref(false)
const viewData = ref([])
const handleView = (row) => {
// let obj = {
// pageNum: 1,
// pageSize: 100,
// pcode: row.rkPcode
// }
getStockList(row.rkPcode).then(res => {
console.log(res)
viewData.value = res.data
taskView.value = true
})
}
const totalMoney = ref(null)
const pcodeCount = ref(null)
const sumQty = ref(null)
function getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 1) { // 第一列不进行合计操作,通常是序列号或选择框等非数值列。
sums[index] = '总计'; // 这里可以设置为其他文字或空字符串。
return;
} else if (index === 2) { // 第二列是金额列,进行求和操作。
sums[index] = '总金额:' + totalMoney.value;
} else if (index === 3) {
sums[index] = '共存于:' + pcodeCount.value + '个库位'
} else if (index === 4) {
sums[index] = '总数:' + sumQty.value
}
})
return sums
}
const route = useRoute()
onMounted(() => {
dialogParams.value.taskId = route.query.taskId
// dialogParams.value.taskId = route.query.taskId
dialogParams.value.warehouseCode = route.query.warehouseCode
dialogParams.value.sceneId = route.query.sceneId
dialogParams.value.pageNum = 1
dialogParams.value.pageSize = 10
getHistoryInfo()
})
// 获取总计
function getSumInfo() {
//统计信息
let rkInfo = JSON.parse(JSON.stringify({
warehouseCode:route.query.warehouseCode,
sceneId:route.query.sceneId,
}))
delete rkInfo.pageNum
delete rkInfo.pageSize
getTotalStatistics(rkInfo).then(response => {
totalMoney.value = response.data.totalAmount
pcodeCount.value = response.data.locationCount
sumQty.value = response.data.totalQuantity
});
}
getSumInfo()
</script>
<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>